REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestRawDAQMetadata.h
1 /*************************************************************************
2  * This file is part of the REST software framework. *
3  * *
4  * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
5  * For more information see http://gifna.unizar.es/trex *
6  * *
7  * REST is free software: you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation, either version 3 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * REST is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have a copy of the GNU General Public License along with *
18  * REST in $REST_PATH/LICENSE. *
19  * If not, see http://www.gnu.org/licenses/. *
20  * For the list of contributors see $REST_PATH/CREDITS. *
21  *************************************************************************/
22 
23 #ifndef RestCore_TRestRawDAQMetadata
24 #define RestCore_TRestRawDAQMetadata
25 
26 #include <iostream>
27 
28 #include "TRestMetadata.h"
29 #include "TString.h"
30 
33  private:
34  void InitFromConfigFile() override;
35 
36  void Initialize() override;
37 
38  protected:
39  TString fOutBinFileName;
40  TString fElectronicsType;
41  std::vector<TString> fPedBuffer; // Pedestal script
42  std::vector<TString> fRunBuffer; // Run script
43  TString fNamePedScript; // Name of the run script e.g. /home/user/scripts/run
44  TString fNameRunScript; // Name of the pedestal script e.g.
45  // /home/user/scripts/ped
46  UInt_t fGain; // Value of the gain in the script you have to convert it to fC
47  UInt_t fShappingTime; // Value of the shapping time in the script you have to
48  // convert it to nS
49 
50  public:
51  void PrintMetadata() override;
52  void PrintRunScript();
53  void PrintPedScript();
54 
55  // Constructor
57  TRestRawDAQMetadata(const char* configFilename);
58  // Destructor
59  virtual ~TRestRawDAQMetadata();
60 
61  void SetScriptsBuffer();
62  void SetParFromPedBuffer(); // Set gain and shaping time from a given buffer
63  void SetOutBinFileName(TString fName) { fOutBinFileName = fName; }
64 
65  inline UInt_t GetGain() const { return fGain; }
66  inline UInt_t GetShappingTime() const { return fShappingTime; }
67  UInt_t GetValFromString(TString var, TString line);
68 
69  ClassDefOverride(TRestRawDAQMetadata, 1); // REST run class
70 };
71 #endif
A base class for any REST metadata class.
Definition: TRestMetadata.h:74
A metadata class to store DAQ information.
void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
void PrintMetadata() override
Implemented it in the derived metadata class to print out specific metadata information.
void Initialize() override
Making default settings.