TPCCondData
TimePixParameters.h
Go to the documentation of this file.
1 #ifndef TimePixParameters_h
2 #define TimePixParameters_h 1
3 
4 //C++
5 #include <iostream>
6 #include <string>
7 #include <utility>
8 
9 //LCIO
10 #include "lcio.h"
11 #include "EVENT/LCGenericObject.h"
12 #include "IMPL/LCGenericObjectImpl.h"
13 
14 namespace tpcconddata
15 {
16 
23  class TimePixParameters : public EVENT::LCGenericObject
24  {
25 
26  public:
27 
30  TimePixParameters(EVENT::LCObject* obj);
31 
35  TimePixParameters(int nChips=1);
36 
38  virtual ~TimePixParameters();
39 
40  // the class interface:
41 
43  void setChipID (int chipID);
45  int getChipID() const;
46 
48  void setDACs(int chipIndex, int * DACs);
49  // OK, this does not work since the getIntVal gives a copy, not a reference :-(
50  // Get the complete array of DACs
51  //const double * getDACs(int chipIndex) const;
52 
54  int getDAC(int chipIndex, int dacIndex) const;
55 
57  void setType(int type);
59  int getType() const;
60 
62  void setPolarity(int polarity);
64  int getPolarity() const;
65 
66  // get the DACs for the Timepix by name (convenience functions for not to use the index)
67  int getIKrumm(int chipIndex) const;
68  int getDisc(int chipIndex) const;
69  int getPreamp(int chipIndex) const;
70  int getBuffA(int chipIndex) const;
71  int getBuffB(int chipIndex) const;
72  int getDelayN(int chipIndex) const;
73  int getTHLFine(int chipIndex) const;
74  int getTHLCoarse(int chipIndex) const;
75  int getTHHFine(int chipIndex) const;
76  int getTHHCoarse(int chipIndex) const;
77  int getFBK(int chipIndex) const;
78  int getGnd(int chipIndex) const;
79  int getTHS(int chipIndex) const;
80  int getBiasVLDS(int chipIndex) const;
81  int getRefLVDS(int chipIndex) const;
82 
84  void setClock(double clock);
86  double getClock() const;
87 
89  void setShutterEndTime(double shutterEndTime);
91  double getShutterEndTime() const;
92 
94  int getNChips() const;
95 
96  static std::string getRevision();
97  static std::string getDefaultColName();
98 
99  void print( std::ostream& os = std::cout ) const;
100 
101  // -------- need to implement abstract methods from LCGenericObject
102  int getNInt() const;
103  int getNFloat() const;
104  int getNDouble() const;
105 
106  int getIntVal(int index) const;
107  float getFloatVal(int index) const;
108  double getDoubleVal(int index) const;
109 
110  // Objects of type TimePixParameters do not always have the same size, but
111  // the size does not change at runtime. So it is fixed size.
112  bool isFixedSize() const { return true; };
113 
114  const std::string getTypeName() const
115  {
116  return std::string("TimePixParameters");
117  }
118  const std::string getDataDescription() const
119  {
120  return std::string("i:ChipID,Type,Polarity,NChips,DACs[16NChips],d:clock(MHz),shutterEndTime(ns)");
121  }
122 
123  protected:
124  bool createObj;
125  IMPL::LCGenericObjectImpl* myObj;
126 
127  }; // end of class
128 
129  std::ostream &operator<<(std::ostream &os, const TimePixParameters &p);
130 
131 } //end namespace tpcconddata
132 #endif
const std::string getTypeName() const
int getTHLFine(int chipIndex) const
virtual ~TimePixParameters()
Important for memory handling.
int getTHHCoarse(int chipIndex) const
int getType() const
get the chip type (3=timepix)
TimePixParameters(EVENT::LCObject *obj)
Constructor needed to interpret LCCollection read from file/database.
int getTHS(int chipIndex) const
double getDoubleVal(int index) const
int getNChips() const
Get the number of chips.
int getGnd(int chipIndex) const
int getBiasVLDS(int chipIndex) const
int getFBK(int chipIndex) const
void print(std::ostream &os=std::cout) const
int getTHHFine(int chipIndex) const
int getTHLCoarse(int chipIndex) const
The TimePix parameters.
const std::string getDataDescription() const
int getBuffA(int chipIndex) const
void setPolarity(int polarity)
set the polarity
void setClock(double clock)
Set the clock (in MHz)
std::ostream & operator<<(std::ostream &os, const ADCChannelMapping &acm)
int getIKrumm(int chipIndex) const
void setType(int type)
set the chip type (3=timepix)
int getChipID() const
get the chip iID aka module number
int getDisc(int chipIndex) const
void setShutterEndTime(double shutterEndTime)
Set the shutter end time (wrt. tigger)
int getDAC(int chipIndex, int dacIndex) const
Get a specific DAC by index.
double getShutterEndTime() const
Get the shutter end time (wrt. tigger)
float getFloatVal(int index) const
double getClock() const
Get the clock (in MHz)
int getDelayN(int chipIndex) const
IMPL::LCGenericObjectImpl * myObj
static std::string getDefaultColName()
int getRefLVDS(int chipIndex) const
void setDACs(int chipIndex, int *DACs)
Set the DACs for one chip, a 16 words long integer array.
int getBuffB(int chipIndex) const
int getPolarity() const
get the polarity
void setChipID(int chipID)
set the chip iID aka module number
int getPreamp(int chipIndex) const