MarlinTPC  1.2.0
GenericADCElectronicsParameters.h
1 #ifndef GenericADCElectronicsParameters_h
2 #define GenericADCElectronicsParameters_h 1
3 
4 //C++
5 #include <iostream>
6 #include <string>
7 #include <utility>
8 
9 //LCIO
10 #include "lcio.h"
11 #include "UTIL/LCFixedObject.h"
12 
13  // DAQ channel number and readout module ID here called channelID and readoutGroup
14 #define GenericADCElectronicsParametersNINTVals 5
15  // GenericADCElectronicsParameters Value and GenericADCElectronicsParameters Width
16 #define GenericADCElectronicsParametersNFLOATVals 1
17 #define GenericADCElectronicsParametersNDOUBLEVals 0
18 
19 namespace tpcconddata
20 {
21 
22  class GenericADCElectronicsParameters;
23 
24  typedef GenericADCElectronicsParameters LCGenericADCElectronicsParameters;
25 
37  class GenericADCElectronicsParameters : public UTIL::LCFixedObject<GenericADCElectronicsParametersNINTVals,GenericADCElectronicsParametersNFLOATVals,GenericADCElectronicsParametersNDOUBLEVals>
38  {
39 
40  public:
41 
44  GenericADCElectronicsParameters(int readoutGroupID, int polarity, int maxADCvalue, float frequency, bool isPedestalSubtracted, bool isZeroSupressed);
45 
48  GenericADCElectronicsParameters(EVENT::LCObject* obj):UTIL::LCFixedObject<GenericADCElectronicsParametersNINTVals,
49  GenericADCElectronicsParametersNFLOATVals,
50  GenericADCElectronicsParametersNDOUBLEVals>(obj) { }
51 
54 
55  // the class interface:
56 
57  // set the module number
58  void setReadoutGroup(int readoutGroupID);
59  // set the polarity value, should be -1 or +1
60  void setPolarity(int polarity);
61  // set the precision value of the electronics (maximum possible ADC value)
62  void setMaxADCValue(int maxADCValue);
63  // set the read out frequency of the read-out electronics (in MHz)
64  void setFrequency(float frequency);
65  // set to true, if readout electronics is automatically subtracting pedestals
66  void setPedestalSubtracted(bool onoff);
67  // set to true, if readout electronics does zero suppression
68  void setZeroSupressed(bool onoff);
69 
70 
71  // get the module number
72  int getReadoutGroup() const;
73  // get the polarity value, should be -1 or +1
74  int getPolarity() const;
75  // get the precision value of the electronics (maximum possible ADC value)
76  int getMaxADCValue() const;
77  // get the read out frequency of the read-out electronics (in MHz)
78  float getFrequency() const;
79  // returns true, if readout electronics is automatically subtracting pedestals
80  bool isPedestalSubtracted() const;
81  // returns true, if readout electronics does zero suppression
82  bool isZeroSupressed() const;
83 
84  static std::string getRevision();
85  static std::string getDefaultColName();
86 
87  void print( std::ostream& os = std::cout ) const;
88 
89  // -------- need to implement abstract methods from LCGenericObject
90  const std::string getTypeName() const
91  {
92  return std::string("GenericADCElectronicsParameters");
93  }
94  const std::string getDataDescription() const
95  {
96  return std::string("i:ReadoutGroup,Polarity,MaxADCValue,f:Frequency(MHz)");
97  }
98 
99  #ifdef USE_LCCD
100  // add some helper functions for using the native LCCD conditions map
101  typedef int key_type;
102 
103  key_type conditions_key() const;
104  #endif
105 
106  protected:
107 
108  }; // end of class
109 
110  std::ostream &operator<<(std::ostream &os, const GenericADCElectronicsParameters &p);
111 
112 } //end namespace tpcconddata
113 #endif
GenericADCElectronicsParameters(int readoutGroupID, int polarity, int maxADCvalue, float frequency, bool isPedestalSubtracted, bool isZeroSupressed)
Convenient constructor setting all values.
Definition: GenericADCElectronicsParameters.cc:20
virtual ~GenericADCElectronicsParameters()
Important for memory handling.
Definition: GenericADCElectronicsParameters.cc:30
Class that combines information on parameters and settings if the read-out electronics for storage...
Definition: GenericADCElectronicsParameters.h:37
GenericADCElectronicsParameters(EVENT::LCObject *obj)
'Copy constructor' needed to interpret LCCollection read from file/database.
Definition: GenericADCElectronicsParameters.h:48