CMS 3D CMS Logo

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 
15 public:
17 
19 
20  typedef struct magnetsMeasurement {
23 
26 
29 
33 
35  int eventNumber() const { return eventNumber_; }
36 
37  int runNumber() const { return runNumber_; }
38 
40  short burstNumber() const { return burstNumber_; }
41 
43  short smInBeam() const { return smInBeam_; }
44 
46  int begBurstTimeSec() const { return begBurstTime_sec_; }
47 
49  int begBurstTimeMsec() const { return begBurstTime_msec_; }
50 
52  int endBurstTimeSec() const { return endBurstTime_sec_; }
53 
55  int endBurstTimeMsec() const { return endBurstTime_msec_; }
56 
58  int begBurstLV1A() const { return begBurstLV1A_; }
59 
61  int endBurstLV1A() const { return endBurstLV1A_; }
62 
63  // Return the event type: "beam", "laser", "pedestal". "error"
64  // or a number orresponding to the orginal eventype stored in
65  // the RRF.
66  std::string eventType() const;
67 
69  int dbEventType() const;
70 
72  int triggerMask() const { return triggerMask_; }
73 
75  int date() const { return date_; }
76 
78 
79  //Table supervisor information
80  int crystalInBeam() const { return EBDetId(crystalInBeam_).ic(); }
82  int nextCrystalInBeam() const { return EBDetId(nextCrystalInBeam_).ic(); }
84  unsigned int thetaTableIndex() const { return thetaTableIndex_; }
86  unsigned int phiTableIndex() const { return phiTableIndex_; }
88  bool tableIsMoving() const { return tableIsMoving_; }
92  bool syncError() const { return syncError_; }
93 
96 
104  // FIXME: add the codes used by Jean Bourotte here.
105  enum LaserType {
106  LBlue = 440,
107  LGreen = 495,
108  LRed = 709,
109  LInfrared = 800
110  };
112  int lightIntensity() const { return lightIntensity_; }
114  int laserType() const {
115  return laserType_; // returns wavelength
116  }
117 
119  LaserType laser_type;
120  switch (laserType_) {
121  case 440:
122  laser_type = LBlue;
123  break;
124  case 495:
125  laser_type = LGreen;
126  break;
127  case 709:
128  laser_type = LRed;
129  break;
130  case 800:
131  laser_type = LInfrared;
132  break;
133  default:
134  laser_type = LRed;
135  break;
136  }
137  return laser_type; // returns laserTypeName
138  }
139 
141  int S6ADC() const { return S6ADC_; }
142 
144 
145  const std::vector<magnetsMeasurement_t>& magnetMeasurements() const { return magnetMeasurements_; }
146 
147  int scaler(int scalerId) const {
148  if (scalerId < ((int)scalers_.size()))
149  return scalers_[scalerId];
150  else
151  return -1;
152  }
153 
155  //Set Methods
156 
158 
159  void setRunNumber(const int& runNumber) { runNumber_ = runNumber; }
160 
161  void setSmInBeam(const int& smInBeam) { smInBeam_ = smInBeam; }
162 
164 
166 
168 
170 
172 
174 
176 
178 
179  void setDate(const int& date) { date_ = date; }
180 
182 
184 
186 
188 
190 
192 
194 
195  void setSyncError(const bool& syncError) { syncError_ = syncError; }
196 
198 
199  void setLaserType(const int& laserType) { laserType_ = laserType; }
200 
201  void setS6ADC(const int& S6ADC) { S6ADC_ = S6ADC; }
202 
205  }
206  void setMagnetMeasurements(const std::vector<magnetsMeasurement_t>& magnetMeasurements) {
208  }
209 
210  void setScalers(const std::vector<int>& scalers) { scalers_ = scalers; }
211 
212 private:
215  short burstNumber_;
216 
224 
226 
229  std::vector<magnetsMeasurement_t> magnetMeasurements_;
230 
231  /* int nominalMagnet6ReadAmpere_; */
232  /* int nominalMagnet7ReadAmpere_; */
233  /* int nominalMagnet6SetAmpere_; */
234  /* int nominalMagnet7SetAmpere_; */
235  /* int measuredMagnet6MicroAmpere_; */
236  /* int measuredMagnet7MicroAmpere_; */
237  /* int measuredMagnet6Volt_; */
238  /* int measuredMagnet7Volt_; */
239 
240  int date_;
241 
246  unsigned int thetaTableIndex_;
247  unsigned int phiTableIndex_;
248 
250 
251  bool tableIsMovingAtBegSpill_; //indipendent but from CAMAC one saying if table is moving at the begin of the spill
252 
253  //Sync error for Camac stuff
255 
256  //FIXME for use in CMSSW(Probably unuseful when reading from new RawData Information will be stored in EcalDCCHeaderBlock)
259 
260  int S6ADC_;
261 
262  short smInBeam_;
263 
264  // array of 36 scalers
265  std::vector<int> scalers_;
266 };
267 
268 std::ostream& operator<<(std::ostream&, const EcalTBEventHeader&);
269 
270 #endif
int endBurstTimeSec() const
Returns the end burst time (sec)
int crystalInBeam() const
Returns the crystal which is being hit by the beam (in the internal SM numbering scheme) ...
std::string eventType() const
void setSmInBeam(const int &smInBeam)
void setNextCrystalInBeam(const DetId &crystalInBeam)
LaserType laserTypeName() const
int nominalCrystalInBeam() const
void setNominalCrystalInBeam(const DetId &crystalInBeam)
unsigned int thetaTableIndex() const
Returns the theta table index.
std::vector< int > scalers_
struct EcalTBEventHeader::magnetsMeasurement magnetsMeasurement_t
const std::vector< magnetsMeasurement_t > & magnetMeasurements() const
int date() const
Returns the date in Unix time.
bool tableIsMovingAtBegSpill() const
Tell if the table is Moving At the begin of the spill (available in runs only after 1st August 06) ...
void setS6ADC(const int &S6ADC)
DetId crystalInBeam_
Information from the table Supervisor.
void setBegBurstLV1A(const int &begBurstLV1A)
int begBurstLV1A() const
Returns the begin burst time (msec)
void setLightIntensity(const int &lightIntensity)
int laserType() const
return the event laser type
int numberOfMagnetMeasurements_
Magnet currents.
int S6ADC_
ADC lecture of the S6 counter.
void setEventNumber(const int &eventNumber)
int eventNumber() const
Returns the event number.
bool syncError() const
is there any sync error
int begBurstTimeSec() const
Returns the begin burst time (sec)
int triggerMask_
The trigger mask.
void setBegBurstTimeMsec(const int &begBurstTimeMsec)
std::ostream & operator<<(std::ostream &, const EcalTBEventHeader &)
void setTriggerMask(const int &triggerMask)
int ic() const
get ECAL/crystal number inside SM
Definition: EBDetId.cc:41
void setMagnetMeasurements(const std::vector< magnetsMeasurement_t > &magnetMeasurements)
std::vector< magnetsMeasurement_t > magnetMeasurements_
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)
short smInBeam() const
Returns the burst number.
short burstNumber() const
Returns the burst number.
int triggerMask() const
Returns the trigger mask.
bool tableIsMoving() const
Tell if the table is Moving.
void setBurstNumber(const short &burstNumber)
int lightIntensity_
The light intensity.
int eventNumber_
The numner of the event.
unsigned int thetaTableIndex_
Theta table index (X)
int begBurstTimeMsec() const
Returns the begin burst time (msec)
void setCrystalInBeam(const DetId &crystalInBeam)
Definition: DetId.h:17
int endBurstTimeMsec() const
Returns the end burst time (msec)
int nextCrystalInBeam() const
void setDate(const int &date)
int begBurstTime_sec_
Information from the ecalSupervisor.
void setLaserType(const int &laserType)
void setNumberOfMagnetMeasurements(const int &numberOfMagnetMeasurements)
void setTableIsMovingAtBegSpill(const bool &tableIsMoving)
int lightIntensity() const
return the laser intensity
void setThetaTableIndex(const unsigned int &thetaTableIndex)
void setEndBurstLV1A(const int &endBurstLV1A)
int dbEventType() const
Returns the event type as in the H4ROOTDB.
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.
unsigned int phiTableIndex_
Phi table index (Y)
void setTableIsMoving(const bool &tableIsMoving)
void setBegBurstTimeSec(const int &begBurstTimeSec)
int scaler(int scalerId) const
void setEndBurstTimeMsec(const int &endBurstTimeMsec)
short burstNumber_
The number of the burst.
int endBurstLV1A() const
Returns the end burst time (sec)
void setSyncError(const bool &syncError)
unsigned int phiTableIndex() const
Returns the phi table index.
int numberOfMagnetMeasurements() const