MarlinTPC  1.2.0
ExtendedAltroParameters.h
1 /*
2  * ExtendedAltroParameters.h
3  *
4  * Created on: Jul 13, 2012
5  * Author: caiazza
6  */
7 
8 #ifndef EXTENDEDALTROPARAMETERS_H_
9 #define EXTENDEDALTROPARAMETERS_H_
10 
11 //STD
12 #include <iostream>
13 #include <string>
14 
15 //LCIO
16 #include "lcio.h"
17 #include "UTIL/LCFixedObject.h"
18 
19 namespace tpcconddata
20 {
42 static const int EXTENDEDALTROPARSNINT = 16;
43 static const int EXTENDEDALTROPARSNFLOAT = 0;
44 static const int EXTENDEDALTROPARSNDOUBLE = 0;
45 
46 class ExtendedAltroParameters : public lcio::LCFixedObject<EXTENDEDALTROPARSNINT, EXTENDEDALTROPARSNFLOAT ,EXTENDEDALTROPARSNDOUBLE>
47 {
48 public:
53  enum GainSettings {MV12 = 0, MV15 = 1, MV19 = 2, MV27 = 3};
54 
59  enum ShapingSettings {NS30 = 7, NS60 = 3, NS90 = 1, NS120 = 0};
60 
62  {
63  bool PreampEnable;
64  GainSettings Gain;
65  ShapingSettings ShapingTime;
66  bool Shutdown;
67  int ZSThreshold;
68  int ZSGlitchFilter;
69  int PreSamples;
70  int PostSamples;
71  int PreTriggerSamples;
72  int RCUAddress;
73  int RCUFWVersion;
74  int RCUActiveFECA;
75  int RCUActiveFECB;
76  int RCUConfigRegister1;
77  int RCUConfigRegister2;
78  int RCUStatusErrors;
79 
81  PreampEnable(0),
82  Gain(GainSettings(0)),
83  ShapingTime(ShapingSettings(0)),
84  Shutdown(0),
85  ZSThreshold(0),
86  ZSGlitchFilter(0),
87  PreSamples(0),
88  PostSamples(0),
89  PreTriggerSamples(0),
90  RCUAddress(0),
91  RCUFWVersion(0),
92  RCUActiveFECA(0),
93  RCUActiveFECB(0),
94  RCUConfigRegister1(0),
95  RCUConfigRegister2(0),
96  RCUStatusErrors(0)
97  {
98 
99  }
100  };
101 
106 
112  ExtendedAltroParameters(EVENT::LCObject* obj);
113 
118 
123  void SetData(ExtendedAltroData& Data);
124 
129  ExtendedAltroData GetData() const;
130 
135  void SetPreampEnable(bool& Enable);
136  void SetGainSettings(GainSettings& Gain);
137  void SetShapingTime(ShapingSettings& ShapingTime);
138  void SetShutdown(bool& Shutdown);
139  void SetZSThreshold(int& Threshold);
140  void SetZSGlitchFilter(int &MinSamples);
141  void SetPreSamples(int& PreSamples);
142  void SetPostSamples(int& PostSamples);
143  void SetPreTriggerSamples(int& PreTriggerSamples);
144  void SetRCUAddress(int& RCUAddress);
145  void SetRCUFWVersion(int& RCUFWVersion);
146  void SetRCUActiveFECA(int& RCUActiveFECA);
147  void SetRCUActiveFECB(int& RCUActiveFECB);
148  void SetRCUConfigRegister1(int& RCUConfigRegister1);
149  void SetRCUConfigRegister2(int& RCUConfigRegister2);
150  void SetRCUStatusErrors(int& RCUStatusErrors);
151 
156  bool GetPreampEnable() const ;
157  GainSettings GetGainSettings() const ;
158  ShapingSettings GetShapingTime() const ;
159  bool GetShutdown() const ;
160  int GetZSThreshold() const ;
161  int GetZSGlitchFilter() const;
162  int GetPreSamples() const ;
163  int GetPostSamples() const ;
164  int GetPreTriggerSamples() const ;
165  int GetRCUAddress() const ;
166  int GetRCUFWVersion() const ;
167  int GetRCUActiveFECA() const ;
168  int GetRCUActiveFECB() const ;
169  int GetRCUConfigRegister1() const ;
170  int GetRCUConfigRegister2() const ;
171  int GetRCUStatusErrors() const ;
172 
177  static std::string getRevision();
178 
183  static std::string getDefaultColName();
184 
189  void print( std::ostream& os = std::cout ) const;
190 
195  const std::string getTypeName() const;
196 
201  const std::string getDataDescription() const;
202 };
203 
210 std::ostream &operator<<(std::ostream &os, const ExtendedAltroParameters &p);
211 
218 bool operator==(const ExtendedAltroParameters &first, const ExtendedAltroParameters &second);
219 bool operator!=(const ExtendedAltroParameters &first, const ExtendedAltroParameters &second);
220 }
221 
222 
223 #endif /* EXTENDEDALTROPARAMETERS_H_ */
bool operator==(const ExtendedAltroParameters &first, const ExtendedAltroParameters &second)
Comparison operator that compares 1-1 all the internal data.
Definition: ExtendedAltroParameters.cc:365
static std::string getDefaultColName()
Default name for the collection of this type.
Definition: ExtendedAltroParameters.cc:318
ShapingSettings
Enumerator to store the available settings of the Shaping Time and match them with an human readable ...
Definition: ExtendedAltroParameters.h:59
~ExtendedAltroParameters()
Destructor.
Definition: ExtendedAltroParameters.cc:29
void SetData(ExtendedAltroData &Data)
Sets all the data at the same time.
Definition: ExtendedAltroParameters.cc:35
const std::string getDataDescription() const
Defines the data description in the standard condDB format.
Definition: ExtendedAltroParameters.cc:351
Definition: ExtendedAltroParameters.h:61
void print(std::ostream &os=std::cout) const
Prints a summary of the data.
Definition: ExtendedAltroParameters.cc:324
Definition: ExtendedAltroParameters.h:46
ExtendedAltroParameters(ExtendedAltroData &Data)
Convenient constructor to set all the data using the ExtendedAltroData structure to collect the data...
Definition: ExtendedAltroParameters.cc:18
GainSettings
Enumerator to store the available settings of the gain and match them with an human readable name...
Definition: ExtendedAltroParameters.h:53
void SetPreampEnable(bool &Enable)
Single element setters.
Definition: ExtendedAltroParameters.cc:80
static const int EXTENDEDALTROPARSNINT
Class storing to the condDB additional electronics information specific to the ALTRO electronics Prea...
Definition: ExtendedAltroParameters.h:42
bool GetPreampEnable() const
Single element Getters.
Definition: ExtendedAltroParameters.cc:216
ExtendedAltroData GetData() const
Retrieves all the data in a single structure.
Definition: ExtendedAltroParameters.cc:56
static std::string getRevision()
Retrieves the version of this condition object.
Definition: ExtendedAltroParameters.cc:312
const std::string getTypeName() const
Defines the type name used for the Condition Database.
Definition: ExtendedAltroParameters.cc:345