MarlinTPC  1.2.0
ADCChannelMapping.h
1 #ifndef ADCChannelMapping_h
2 #define ADCChannelMapping_h 1
3 
4 //C++
5 #include "iostream"
6 #include "string"
7 
8 //LCIO
9 #include "lcio.h"
10 #include "EVENT/LCGenericObject.h"
11 #include "IMPL/LCGenericObjectImpl.h"
12 
13 namespace tpcconddata
14 {
15 
16  class ADCChannelMapping;
17 
36  class ADCChannelMapping : public EVENT::LCGenericObject
37  {
38 
39  public:
40 
44  ADCChannelMapping(int channelID, int padIndex, int type = -1, int moduleID = 0,
45  int readoutGroup = 0);
46 
49  ADCChannelMapping(EVENT::LCObject* obj) ;
50 
53  virtual ~ADCChannelMapping();
54 
55  int getChannelID() const;
56  int getPadID() const;
57  int getType() const ;
58  int getModuleID() const;
59  int getReadoutGroup() const;
60 
61  static std::string getRevision();
62  static std::string getDefaultColName();
63 
64  IMPL::LCGenericObjectImpl* obj() const { return _myObj; }
65  virtual int id() const { return _myObj->id(); }
66 
67  void print( std::ostream& os = std::cout) const;
68 
69  // -------- need to implement abstract methods from LCGenericObject
70  virtual const std::string getTypeName() const
71  {
72  return std::string("ADCChannelMapping");
73  }
74 
75  virtual const std::string getDataDescription() const
76  {
77  return std::string("i:ChannelIDs,PadID,Type,ModuleID,ReadoutGroup");
78  }
79 
80  // the other functions inherited from LCGenericObject
81  // just pass them to the implementation
82  virtual int getNInt() const { return _myObj->getNInt(); }
83  virtual int getNFloat() const { return _myObj->getNFloat(); }
84  virtual int getNDouble() const { return _myObj->getNDouble(); }
85 
86  virtual int getIntVal(int i) const { return _myObj->getIntVal(i); }
87  virtual float getFloatVal(int i) const { return _myObj->getFloatVal(i); }
88  virtual double getDoubleVal(int i) const { return _myObj->getDoubleVal(i); }
89 
90  virtual bool isFixedSize() const { return _myObj->isFixedSize(); }
91 
92  #ifdef USE_LCCD
93  // add some helper functions for using the native LCCD conditions map
94  typedef std::pair<int, int> key_type;
95 
96  key_type softwareToHardwareKey() const;
97  key_type hardwareToSoftwareKey() const;
98  #endif
99 
100  protected:
101  bool _createObj;
102  IMPL::LCGenericObjectImpl* _myObj;
103 
104  };
105 
106  std::ostream &operator<<(std::ostream &os, const ADCChannelMapping &acm);
107 }
108 #endif
ADCChannelMapping(int channelID, int padIndex, int type=-1, int moduleID=0, int readoutGroup=0)
The constructor with all the member functions given.
Definition: ADCChannelMapping.cc:21
virtual ~ADCChannelMapping()
The desctructor.
Definition: ADCChannelMapping.cc:60
class to store the mapping pad (position) to the channel ID (electronic) also the type of the used el...
Definition: ADCChannelMapping.h:36