MarlinTPC  1.2.0
TimePixParameters.h
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
virtual ~TimePixParameters()
Important for memory handling.
Definition: TimePixParameters.cc:44
int getType() const
get the chip type (3=timepix)
Definition: TimePixParameters.cc:74
TimePixParameters(EVENT::LCObject *obj)
Constructor needed to interpret LCCollection read from file/database.
Definition: TimePixParameters.cc:30
int getNChips() const
Get the number of chips.
Definition: TimePixParameters.cc:109
The TimePix parameters.
Definition: TimePixParameters.h:23
void setPolarity(int polarity)
set the polarity
Definition: TimePixParameters.cc:77
void setClock(double clock)
Set the clock (in MHz)
Definition: TimePixParameters.cc:99
void setType(int type)
set the chip type (3=timepix)
Definition: TimePixParameters.cc:72
int getChipID() const
get the chip iID aka module number
Definition: TimePixParameters.cc:50
void setShutterEndTime(double shutterEndTime)
Set the shutter end time (wrt. tigger)
Definition: TimePixParameters.cc:104
int getDAC(int chipIndex, int dacIndex) const
Get a specific DAC by index.
Definition: TimePixParameters.cc:67
double getShutterEndTime() const
Get the shutter end time (wrt. tigger)
Definition: TimePixParameters.cc:106
double getClock() const
Get the clock (in MHz)
Definition: TimePixParameters.cc:101
void setDACs(int chipIndex, int *DACs)
Set the DACs for one chip, a 16 words long integer array.
Definition: TimePixParameters.cc:52
int getPolarity() const
get the polarity
Definition: TimePixParameters.cc:79
void setChipID(int chipID)
set the chip iID aka module number
Definition: TimePixParameters.cc:49