CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalTBEventHeader.h
Go to the documentation of this file.
1 #ifndef RECECAL_ECALTBEVENTHEADER_H
2 #define RECECAL_ECALTBEVENTHEADER_H 1
3 
4 #include <ostream>
5 #include <string>
6 #include <vector>
8 
17 
18  public:
19 
21 
23 
24  typedef struct magnetsMeasurement {
27 
30 
33 
37 
39  int eventNumber() const{
40  return eventNumber_;
41  }
42 
43  int runNumber() const{
44  return runNumber_;
45  }
46 
48  short burstNumber() const{
49  return burstNumber_;
50  }
51 
53  short smInBeam() const {
54  return smInBeam_;
55  }
56 
58  int begBurstTimeSec() const{
59  return begBurstTime_sec_;
60  }
61 
63  int begBurstTimeMsec() const{
64  return begBurstTime_msec_;
65  }
66 
68  int endBurstTimeSec() const{
69  return endBurstTime_sec_;
70  }
71 
73  int endBurstTimeMsec() const{
74  return endBurstTime_msec_;
75  }
76 
78  int begBurstLV1A() const{
79  return begBurstLV1A_;
80  }
81 
83  int endBurstLV1A() const{
84  return endBurstLV1A_;
85  }
86 
87 
88  // Return the event type: "beam", "laser", "pedestal". "error"
89  // or a number orresponding to the orginal eventype stored in
90  // the RRF.
91  std::string eventType() const ;
92 
94  int dbEventType() const ;
95 
97  int triggerMask() const {
98  return triggerMask_;
99  }
100 
102  int date() const {
103  return date_;
104  }
105 
107 
108  //Table supervisor information
109  int crystalInBeam() const {
110  return EBDetId(crystalInBeam_).ic();
111  }
112  int nominalCrystalInBeam() const {
113  return EBDetId(nominalCrystalInBeam_).ic();
114  }
115  int nextCrystalInBeam() const {
116  return EBDetId(nextCrystalInBeam_).ic();
117  }
119  unsigned int thetaTableIndex() const { return thetaTableIndex_; }
121  unsigned int phiTableIndex() const { return phiTableIndex_; }
123  bool tableIsMoving() const { return tableIsMoving_;}
127  bool syncError() const { return syncError_; }
128 
131 
139  // FIXME: add the codes used by Jean Bourotte here.
140  enum LaserType {
141  LBlue = 440,
142  LGreen = 495,
143  LRed = 709,
144  LInfrared = 800
145  };
147  int lightIntensity() const {
148  return lightIntensity_;
149  }
151  int laserType() const {
152  return laserType_; // returns wavelength
153  }
154 
156  LaserType laser_type;
157  switch(laserType_){
158  case 440: laser_type = LBlue; break;
159  case 495: laser_type = LGreen; break;
160  case 709: laser_type = LRed; break;
161  case 800: laser_type = LInfrared; break;
162  default: laser_type = LRed; break;
163  }
164  return laser_type; // returns laserTypeName
165  }
166 
168  int S6ADC () const {
169  return S6ADC_ ;
170  }
171 
173 
174  const std::vector<magnetsMeasurement_t>& magnetMeasurements() const { return magnetMeasurements_; }
175 
176  int scaler(int scalerId) const {
177  if (scalerId < ((int) scalers_.size() ) )
178  return scalers_[scalerId];
179  else
180  return -1;
181  }
182 
184  //Set Methods
185 
187 
189 
190  void setSmInBeam(const int& smInBeam) { smInBeam_ = smInBeam; }
191 
193 
195 
197 
199 
201 
203 
205 
207 
208  void setDate(const int& date ) { date_=date; }
209 
211 
213 
215 
217 
219 
221 
223 
224  void setSyncError(const bool& syncError ) { syncError_ = syncError; }
225 
227 
228  void setLaserType(const int& laserType) { laserType_ = laserType; }
229 
230  void setS6ADC (const int& S6ADC) { S6ADC_ = S6ADC ; }
231 
233  void setMagnetMeasurements(const std::vector<magnetsMeasurement_t>& magnetMeasurements) { magnetMeasurements_ = magnetMeasurements;}
234 
235  void setScalers (const std::vector<int> & scalers) { scalers_ = scalers; }
236 
237 
238  private:
239 
242  short burstNumber_;
243 
244 
252 
253 
255 
258  std::vector<magnetsMeasurement_t> magnetMeasurements_;
259 
260  /* int nominalMagnet6ReadAmpere_; */
261  /* int nominalMagnet7ReadAmpere_; */
262  /* int nominalMagnet6SetAmpere_; */
263  /* int nominalMagnet7SetAmpere_; */
264  /* int measuredMagnet6MicroAmpere_; */
265  /* int measuredMagnet7MicroAmpere_; */
266  /* int measuredMagnet6Volt_; */
267  /* int measuredMagnet7Volt_; */
268 
269 
270  int date_;
271 
276  unsigned int thetaTableIndex_;
277  unsigned int phiTableIndex_;
278 
280 
281  bool tableIsMovingAtBegSpill_; //indipendent but from CAMAC one saying if table is moving at the begin of the spill
282 
283  //Sync error for Camac stuff
285 
286  //FIXME for use in CMSSW(Probably unuseful when reading from new RawData Information will be stored in EcalDCCHeaderBlock)
289 
290  int S6ADC_ ;
291 
292  short smInBeam_;
293 
294  // array of 36 scalers
295  std::vector<int> scalers_;
296 
297 };
298 
299 std::ostream& operator<<(std::ostream&, const EcalTBEventHeader&);
300 
301 #endif
int lightIntensity() const
return the laser intensity
LaserType laserTypeName() const
int endBurstTimeMsec() const
Returns the end burst time (msec)
const std::vector< magnetsMeasurement_t > & magnetMeasurements() const
void setSmInBeam(const int &smInBeam)
void setNextCrystalInBeam(const DetId &crystalInBeam)
bool tableIsMoving() const
Tell if the table is Moving.
void setNominalCrystalInBeam(const DetId &crystalInBeam)
std::vector< int > scalers_
struct EcalTBEventHeader::magnetsMeasurement magnetsMeasurement_t
int endBurstTimeSec() const
Returns the end burst time (sec)
std::string eventType() const
void setS6ADC(const int &S6ADC)
int nextCrystalInBeam() const
DetId crystalInBeam_
Information from the table Supervisor.
void setBegBurstLV1A(const int &begBurstLV1A)
void setLightIntensity(const int &lightIntensity)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
short burstNumber() const
Returns the burst number.
int numberOfMagnetMeasurements_
Magnet currents.
int triggerMask() const
Returns the trigger mask.
int crystalInBeam() const
Returns the crystal which is being hit by the beam (in the internal SM numbering scheme) ...
int begBurstTimeMsec() const
Returns the begin burst time (msec)
int endBurstLV1A() const
Returns the end burst time (sec)
int S6ADC_
ADC lecture of the S6 counter.
void setEventNumber(const int &eventNumber)
int scaler(int scalerId) const
int numberOfMagnetMeasurements() const
int triggerMask_
The trigger mask.
void setBegBurstTimeMsec(const int &begBurstTimeMsec)
int runNumber() const
void setTriggerMask(const int &triggerMask)
void setMagnetMeasurements(const std::vector< magnetsMeasurement_t > &magnetMeasurements)
std::vector< magnetsMeasurement_t > magnetMeasurements_
int begBurstTimeSec() const
Returns the begin burst time (sec)
int S6ADC() const
returns S6 ADC value
void setScalers(const std::vector< int > &scalers)
void setRunNumber(const int &runNumber)
DetId nominalCrystalInBeam_
The nominal crystal which should be hit by the beam.
void setPhiTableIndex(const unsigned int &phiTableIndex)
int dbEventType() const
Returns the event type as in the H4ROOTDB.
int date() const
Returns the date in Unix time.
void setBurstNumber(const short &burstNumber)
int lightIntensity_
The light intensity.
int ic() const
get ECAL/crystal number inside SM
Definition: EBDetId.cc:94
int eventNumber_
The numner of the event.
unsigned int thetaTableIndex_
Theta table index (X)
unsigned int phiTableIndex() const
Returns the phi table index.
void setCrystalInBeam(const DetId &crystalInBeam)
Definition: DetId.h:20
void setDate(const int &date)
int begBurstTime_sec_
Information from the ecalSupervisor.
bool tableIsMovingAtBegSpill() const
Tell if the table is Moving At the begin of the spill (available in runs only after 1st August 06) ...
void setLaserType(const int &laserType)
int eventNumber() const
Returns the event number.
void setNumberOfMagnetMeasurements(const int &numberOfMagnetMeasurements)
void setTableIsMovingAtBegSpill(const bool &tableIsMoving)
int begBurstLV1A() const
Returns the begin burst time (msec)
void setThetaTableIndex(const unsigned int &thetaTableIndex)
void setEndBurstLV1A(const int &endBurstLV1A)
short smInBeam() const
Returns the burst number.
DetId nextCrystalInBeam_
The nominal next crystal which should be hit by the beam.
int date_
The date when the run was taken.
int laserType_
The laser type –see enum LaserType.
void setEndBurstTimeSec(const int &endBurstTimeSec)
int runNumber_
The number of the run.
int laserType() const
return the event laser type
unsigned int phiTableIndex_
Phi table index (Y)
unsigned int thetaTableIndex() const
Returns the theta table index.
void setTableIsMoving(const bool &tableIsMoving)
int nominalCrystalInBeam() const
void setBegBurstTimeSec(const int &begBurstTimeSec)
void setEndBurstTimeMsec(const int &endBurstTimeMsec)
short burstNumber_
The number of the burst.
void setSyncError(const bool &syncError)
bool syncError() const
is there any sync error