TPCCondData
GenericADCElectronicsParameters.cc
Go to the documentation of this file.
1 /* GenericADCElectronicsParameters.cc
2  * $Id$
3  */
4 
6 
7 namespace tpcconddata
8 {
9 
11  {
12  return std::string("$Rev: 1649 $");
13  }
14 
16  {
17  return std::string("GenericADCElectronicsParameters");
18  }
19 
20  GenericADCElectronicsParameters::GenericADCElectronicsParameters(int readoutGroupID, int polarity, int maxADCValue, float frequency,bool isPedestalSubtracted, bool isZeroSupressed)
21  {
22  setReadoutGroup(readoutGroupID);
23  setPolarity(polarity);
24  setMaxADCValue(maxADCValue);
25  setFrequency(frequency);
26  setPedestalSubtracted(isPedestalSubtracted);
27  setZeroSupressed(isZeroSupressed);
28  }
29 
31 
33  {
34  obj()->setIntVal( 0, readoutGroupID );
35  }
36 
38  {
39  obj()->setIntVal( 1, polarity );
40  }
41 
43  {
44  obj()->setIntVal( 2, maxADCValue );
45  }
46 
48  {
49  obj()->setFloatVal( 0, frequency );
50  }
51 
53  {
54  obj()->setIntVal( 3, (int)onoff);
55  }
56 
58  {
59  obj()->setIntVal( 4, (int)onoff);
60  }
61 
62 
64  {
65  return getIntVal( 0 );
66  }
67 
69  {
70  return getIntVal( 1 );
71  }
72 
74  {
75  return getIntVal( 2 );
76  }
77 
79  {
80  return getFloatVal( 0 );
81  }
82 
84  {
85  return (bool)getIntVal( 3 );
86  }
87 
89  {
90  return (bool)getIntVal( 4 );
91  }
92 
93 
94 
95 
96  void GenericADCElectronicsParameters::print( std::ostream& os ) const
97  {
98  std::streamsize PrecisionBefore = os.precision();
99  std::streamsize WidthBefore = os.width();
100  os.precision(3); os.setf(std::ios_base::fixed);
101  os << "Electronics Parameters: ReadoutGroup :"<<getReadoutGroup()<<" Polarity: " << getPolarity() << "[+/-1] Precision:" << getMaxADCValue() <<" [ADC counts] (maximum ADC value)"<< std::fixed;
102  os << " Read-out Frequency:" << getFrequency() << " [MHz]"<< std::endl;
103  os << " Pedestal subtracted:" << isPedestalSubtracted() << " Zero Suppressed:"<<isZeroSupressed()<< std::endl;
104  os.unsetf( std::ios_base::fixed );
105  os.precision( PrecisionBefore );
106  os.width( WidthBefore );
107  }
108 
109  std::ostream &operator<<(std::ostream &os, const GenericADCElectronicsParameters &p)
110  {
111  p.print(os);
112  return os;
113  }
114 
115  #ifdef USE_LCCD
116  GenericADCElectronicsParameters::key_type GenericADCElectronicsParameters::conditions_key() const {
117 
118  return getReadoutGroup();
119  }
120  #endif
121 
122 }
GenericADCElectronicsParameters(int readoutGroupID, int polarity, int maxADCvalue, float frequency, bool isPedestalSubtracted, bool isZeroSupressed)
Convenient constructor setting all values.
virtual ~GenericADCElectronicsParameters()
Important for memory handling.
Class that combines information on parameters and settings if the read-out electronics for storage...
std::ostream & operator<<(std::ostream &os, const ADCChannelMapping &acm)