MarlinTPC  1.2.0
Pedestal.h
1 #ifndef Pedestal_h
2 #define Pedestal_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 #define PedestalNINTVals 2 // DAQ channel number and readout module ID here called channelID and readoutGroup
14 #define PedestalNFLOATVals 2 // Pedestal Value and Pedestal Width
15 #define PedestalNDOUBLEVals 0
16 
17 namespace tpcconddata
18 {
19 
20  class Pedestal;
21 
22  typedef Pedestal LCPedestal;
23 
32  class Pedestal : public UTIL::LCFixedObject<PedestalNINTVals,PedestalNFLOATVals,PedestalNDOUBLEVals>
33  {
34 
35  public:
36 
39  Pedestal(int channelID, int readoutGroup, float pedestalValue, float pedestalWidth);
40 
43  Pedestal(std::pair<int,int> hardwareID, float pedestalValue, float pedestalWidth);
44 
47  Pedestal(int channelID, int readoutGroup);
48 
51  Pedestal(std::pair<int,int> hardwareID);
52 
55  Pedestal(EVENT::LCObject* obj):UTIL::LCFixedObject<PedestalNINTVals,
56  PedestalNFLOATVals,
57  PedestalNDOUBLEVals>(obj) { }
58 
60  virtual ~Pedestal();
61 
62 
63  // the class interface:
67  std::pair<int,int> getHardwareID() const;
68 
69  float getPedestalValue() const;
70  float getPedestalWidth() const;
71 
72  void setPedestalValue(float pedestalValue);
73  void setPedestalWidth(float pedestalWidth);
74 
75  static std::string getRevision();
76  static std::string getDefaultColName();
77 
78  void print( std::ostream& os = std::cout ) const;
79 
80  // -------- need to implement abstract methods from LCGenericObject
81  const std::string getTypeName() const
82  {
83  return std::string("Pedestal");
84  }
85  const std::string getDataDescription() const
86  {
87  return std::string("i:ChannelID,ModuleID,f:PedestalValue,PedestalWidth");
88  }
89 
90  #ifdef USE_LCCD
91  // add some helper functions for using the native LCCD conditions map
92  typedef std::pair<int, int> key_type;
93 
94  key_type conditions_key() const;
95  #endif
96 
97 
98  protected:
99 
100  void setHardwareID(int channelID, int readoutGroup);
101 
102  };// end of class
103 
104  std::ostream &operator<<(std::ostream &os, const Pedestal &p);
105 
106 } //end namespace tpcconddata
107 #endif
Class that combines information on pedestals for storage.
Definition: Pedestal.h:32
virtual ~Pedestal()
Important for memory handling.
Definition: Pedestal.cc:53
Pedestal(EVENT::LCObject *obj)
'Copy constructor' needed to interpret LCCollection read from file/database.
Definition: Pedestal.h:55
std::pair< int, int > getHardwareID() const
Returns a pair of integers of which the first element ist the channel ID and the second element the r...
Definition: Pedestal.cc:56
Pedestal(int channelID, int readoutGroup, float pedestalValue, float pedestalWidth)
Convenient constructor using to integers for channel / readout group.
Definition: Pedestal.cc:21