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
EcalTBEventHeader::endBurstTime_sec_
int endBurstTime_sec_
Definition: EcalTBEventHeader.h:220
EcalTBEventHeader::setNominalCrystalInBeam
void setNominalCrystalInBeam(const DetId &crystalInBeam)
Definition: EcalTBEventHeader.h:183
EcalTBEventHeader::setS6ADC
void setS6ADC(const int &S6ADC)
Definition: EcalTBEventHeader.h:201
EcalTBEventHeader::syncError_
bool syncError_
Definition: EcalTBEventHeader.h:254
EBDetId::ic
int ic() const
get ECAL/crystal number inside SM
Definition: EBDetId.cc:41
EcalTBEventHeader::endBurstTime_msec_
int endBurstTime_msec_
Definition: EcalTBEventHeader.h:221
EcalTBEventHeader::setNextCrystalInBeam
void setNextCrystalInBeam(const DetId &crystalInBeam)
Definition: EcalTBEventHeader.h:185
EcalTBEventHeader::numberOfMagnetMeasurements_
int numberOfMagnetMeasurements_
Magnet currents.
Definition: EcalTBEventHeader.h:228
EBDetId
Definition: EBDetId.h:17
EcalTBEventHeader::phiTableIndex
unsigned int phiTableIndex() const
Returns the phi table index.
Definition: EcalTBEventHeader.h:86
LumiMonitor_cff.scalers
scalers
Definition: LumiMonitor_cff.py:11
EcalTBEventHeader::EcalTBEventHeader
EcalTBEventHeader()
Definition: EcalTBEventHeader.h:16
EBDetId.h
EcalTBEventHeader::laserTypeName
LaserType laserTypeName() const
Definition: EcalTBEventHeader.h:118
EcalTBEventHeader::magnetsMeasurement
Definition: EcalTBEventHeader.h:20
EcalTBEventHeader::magnetsMeasurement_t
struct EcalTBEventHeader::magnetsMeasurement magnetsMeasurement_t
EcalTBEventHeader::triggerMask_
int triggerMask_
The trigger mask.
Definition: EcalTBEventHeader.h:225
EcalTBEventHeader::setBegBurstLV1A
void setBegBurstLV1A(const int &begBurstLV1A)
Definition: EcalTBEventHeader.h:175
EcalTBEventHeader
Definition: EcalTBEventHeader.h:14
EcalTBEventHeader::begBurstLV1A
int begBurstLV1A() const
Returns the begin burst time (msec)
Definition: EcalTBEventHeader.h:58
EcalTBEventHeader::setEventNumber
void setEventNumber(const int &eventNumber)
Definition: EcalTBEventHeader.h:157
operator<<
std::ostream & operator<<(std::ostream &, const EcalTBEventHeader &)
Definition: EcalTBEventHeader.cc:75
EcalTBEventHeader::setLightIntensity
void setLightIntensity(const int &lightIntensity)
Definition: EcalTBEventHeader.h:197
EcalTBEventHeader::syncError
bool syncError() const
is there any sync error
Definition: EcalTBEventHeader.h:92
EcalTBEventHeader::laserType
int laserType() const
return the event laser type
Definition: EcalTBEventHeader.h:114
DetId
Definition: DetId.h:17
EcalTBEventHeader::magnetMeasurements
const std::vector< magnetsMeasurement_t > & magnetMeasurements() const
Definition: EcalTBEventHeader.h:145
EcalTBEventHeader::S6ADC
int S6ADC() const
returns S6 ADC value
Definition: EcalTBEventHeader.h:141
EcalTBEventHeader::date
int date() const
Returns the date in Unix time.
Definition: EcalTBEventHeader.h:75
EcalTBEventHeader::smInBeam_
short smInBeam_
Definition: EcalTBEventHeader.h:262
EcalTBEventHeader::S6ADC_
int S6ADC_
ADC lecture of the S6 counter.
Definition: EcalTBEventHeader.h:260
EcalTBEventHeader::runNumber
int runNumber() const
Definition: EcalTBEventHeader.h:37
EcalTBEventHeader::LBlue
Definition: EcalTBEventHeader.h:106
EcalTBEventHeader::tableIsMovingAtBegSpill
bool tableIsMovingAtBegSpill() const
Tell if the table is Moving At the begin of the spill (available in runs only after 1st August 06)
Definition: EcalTBEventHeader.h:90
EcalTBEventHeader::LaserType
LaserType
Definition: EcalTBEventHeader.h:105
EcalTBEventHeader::crystalInBeam_
DetId crystalInBeam_
Information from the table Supervisor.
Definition: EcalTBEventHeader.h:243
EcalTBEventHeader::magnetsMeasurement::magnet7VMeas_uvolt
int magnet7VMeas_uvolt
Definition: EcalTBEventHeader.h:27
EcalTBEventHeader::eventNumber
int eventNumber() const
Returns the event number.
Definition: EcalTBEventHeader.h:35
EcalTBEventHeader::begBurstTimeSec
int begBurstTimeSec() const
Returns the begin burst time (sec)
Definition: EcalTBEventHeader.h:46
EcalTBEventHeader::thetaTableIndex_
unsigned int thetaTableIndex_
Theta table index (X)
Definition: EcalTBEventHeader.h:246
EcalTBEventHeader::magnetsMeasurement::magnet6ISet_ampere
int magnet6ISet_ampere
Definition: EcalTBEventHeader.h:22
EcalTBEventHeader::setScalers
void setScalers(const std::vector< int > &scalers)
Definition: EcalTBEventHeader.h:210
EcalTBEventHeader::setBegBurstTimeMsec
void setBegBurstTimeMsec(const int &begBurstTimeMsec)
Definition: EcalTBEventHeader.h:169
EcalTBEventHeader::setPhiTableIndex
void setPhiTableIndex(const unsigned int &phiTableIndex)
Definition: EcalTBEventHeader.h:189
EcalTBEventHeader::endBurstTimeMsec
int endBurstTimeMsec() const
Returns the end burst time (msec)
Definition: EcalTBEventHeader.h:55
EcalTBEventHeader::setTriggerMask
void setTriggerMask(const int &triggerMask)
Definition: EcalTBEventHeader.h:165
EcalTBEventHeader::~EcalTBEventHeader
~EcalTBEventHeader()
Definition: EcalTBEventHeader.h:18
EcalTBEventHeader::magnetsMeasurement::magnet7IMeas_uampere
int magnet7IMeas_uampere
Definition: EcalTBEventHeader.h:28
EcalTBEventHeader::setMagnetMeasurements
void setMagnetMeasurements(const std::vector< magnetsMeasurement_t > &magnetMeasurements)
Definition: EcalTBEventHeader.h:206
EcalTBEventHeader::magnetsMeasurement::magnet6IRead_ampere
int magnet6IRead_ampere
Definition: EcalTBEventHeader.h:21
EcalTBEventHeader::magnetsMeasurement::magnet6VMeas_uvolt
int magnet6VMeas_uvolt
Definition: EcalTBEventHeader.h:30
EcalTBEventHeader::magnetsMeasurement::magnet6IMeas_uampere
int magnet6IMeas_uampere
Definition: EcalTBEventHeader.h:31
EcalTBEventHeader::begBurstTimeMsec
int begBurstTimeMsec() const
Returns the begin burst time (msec)
Definition: EcalTBEventHeader.h:49
EcalTBEventHeader::nominalCrystalInBeam_
DetId nominalCrystalInBeam_
The nominal crystal which should be hit by the beam.
Definition: EcalTBEventHeader.h:244
EcalTBEventHeader::setNumberOfMagnetMeasurements
void setNumberOfMagnetMeasurements(const int &numberOfMagnetMeasurements)
Definition: EcalTBEventHeader.h:203
EcalTBEventHeader::setLaserType
void setLaserType(const int &laserType)
Definition: EcalTBEventHeader.h:199
EcalTBEventHeader::magnetsMeasurement::magnet7ISet_ampere
int magnet7ISet_ampere
Definition: EcalTBEventHeader.h:25
EcalTBEventHeader::smInBeam
short smInBeam() const
Returns the burst number.
Definition: EcalTBEventHeader.h:43
EcalTBEventHeader::burstNumber
short burstNumber() const
Returns the burst number.
Definition: EcalTBEventHeader.h:40
EcalTBEventHeader::triggerMask
int triggerMask() const
Returns the trigger mask.
Definition: EcalTBEventHeader.h:72
EcalTBEventHeader::nextCrystalInBeam
int nextCrystalInBeam() const
Definition: EcalTBEventHeader.h:82
EcalTBEventHeader::tableIsMoving
bool tableIsMoving() const
Tell if the table is Moving.
Definition: EcalTBEventHeader.h:88
EcalTBEventHeader::tableIsMoving_
bool tableIsMoving_
Definition: EcalTBEventHeader.h:249
EcalTBEventHeader::begBurstTime_sec_
int begBurstTime_sec_
Information from the ecalSupervisor.
Definition: EcalTBEventHeader.h:218
EcalTBEventHeader::tableIsMovingAtBegSpill_
bool tableIsMovingAtBegSpill_
Definition: EcalTBEventHeader.h:251
EcalTBEventHeader::magnetsMeasurement::magnet7IRead_ampere
int magnet7IRead_ampere
Definition: EcalTBEventHeader.h:24
EcalTBEventHeader::magnetMeasurements_
std::vector< magnetsMeasurement_t > magnetMeasurements_
Definition: EcalTBEventHeader.h:229
EcalTBEventHeader::setEndBurstTimeSec
void setEndBurstTimeSec(const int &endBurstTimeSec)
Definition: EcalTBEventHeader.h:171
EcalTBEventHeader::runNumber_
int runNumber_
The number of the run.
Definition: EcalTBEventHeader.h:214
EcalTBEventHeader::eventNumber_
int eventNumber_
The numner of the event.
Definition: EcalTBEventHeader.h:213
EcalTBEventHeader::setRunNumber
void setRunNumber(const int &runNumber)
Definition: EcalTBEventHeader.h:159
EcalTBEventHeader::setTableIsMovingAtBegSpill
void setTableIsMovingAtBegSpill(const bool &tableIsMoving)
Definition: EcalTBEventHeader.h:193
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalTBEventHeader::endBurstLV1A_
int endBurstLV1A_
Definition: EcalTBEventHeader.h:223
EcalTBEventHeader::setCrystalInBeam
void setCrystalInBeam(const DetId &crystalInBeam)
Definition: EcalTBEventHeader.h:181
EcalTBEventHeader::setTableIsMoving
void setTableIsMoving(const bool &tableIsMoving)
Definition: EcalTBEventHeader.h:191
EcalTBEventHeader::dbEventType
int dbEventType() const
Returns the event type as in the H4ROOTDB.
Definition: EcalTBEventHeader.cc:53
EcalTBEventHeader::LInfrared
709 nm
Definition: EcalTBEventHeader.h:109
EcalTBEventHeader::scaler
int scaler(int scalerId) const
Definition: EcalTBEventHeader.h:147
EcalTBEventHeader::begBurstLV1A_
int begBurstLV1A_
Definition: EcalTBEventHeader.h:222
EcalTBEventHeader::setBurstNumber
void setBurstNumber(const short &burstNumber)
Definition: EcalTBEventHeader.h:163
EcalTBEventHeader::laserType_
int laserType_
The laser type –see enum LaserType.
Definition: EcalTBEventHeader.h:258
EcalTBEventHeader::endBurstLV1A
int endBurstLV1A() const
Returns the end burst time (sec)
Definition: EcalTBEventHeader.h:61
EcalTBEventHeader::lightIntensity_
int lightIntensity_
The light intensity.
Definition: EcalTBEventHeader.h:257
EcalTBEventHeader::begBurstTime_msec_
int begBurstTime_msec_
Definition: EcalTBEventHeader.h:219
EcalTBEventHeader::phiTableIndex_
unsigned int phiTableIndex_
Phi table index (Y)
Definition: EcalTBEventHeader.h:247
EcalTBEventHeader::setThetaTableIndex
void setThetaTableIndex(const unsigned int &thetaTableIndex)
Definition: EcalTBEventHeader.h:187
EcalTBEventHeader::setEndBurstLV1A
void setEndBurstLV1A(const int &endBurstLV1A)
Definition: EcalTBEventHeader.h:177
EcalTBEventHeader::setDate
void setDate(const int &date)
Definition: EcalTBEventHeader.h:179
EcalTBEventHeader::setSyncError
void setSyncError(const bool &syncError)
Definition: EcalTBEventHeader.h:195
EcalTBEventHeader::nextCrystalInBeam_
DetId nextCrystalInBeam_
The nominal next crystal which should be hit by the beam.
Definition: EcalTBEventHeader.h:245
EcalTBEventHeader::date_
int date_
The date when the run was taken.
Definition: EcalTBEventHeader.h:240
EcalTBEventHeader::crystalInBeam
int crystalInBeam() const
Returns the crystal which is being hit by the beam (in the internal SM numbering scheme)
Definition: EcalTBEventHeader.h:80
EcalTBEventHeader::eventType
std::string eventType() const
Definition: EcalTBEventHeader.cc:7
EcalTBEventHeader::lightIntensity
int lightIntensity() const
return the laser intensity
Definition: EcalTBEventHeader.h:112
EcalTBEventHeader::setSmInBeam
void setSmInBeam(const int &smInBeam)
Definition: EcalTBEventHeader.h:161
EcalTBEventHeader::setBegBurstTimeSec
void setBegBurstTimeSec(const int &begBurstTimeSec)
Definition: EcalTBEventHeader.h:167
EcalTBEventHeader::LGreen
440 nm
Definition: EcalTBEventHeader.h:107
EcalTBEventHeader::setEndBurstTimeMsec
void setEndBurstTimeMsec(const int &endBurstTimeMsec)
Definition: EcalTBEventHeader.h:173
EcalTBEventHeader::burstNumber_
short burstNumber_
The number of the burst.
Definition: EcalTBEventHeader.h:215
EcalTBEventHeader::numberOfMagnetMeasurements
int numberOfMagnetMeasurements() const
Definition: EcalTBEventHeader.h:143
EcalTBEventHeader::LRed
495 nm
Definition: EcalTBEventHeader.h:108
EcalTBEventHeader::endBurstTimeSec
int endBurstTimeSec() const
Returns the end burst time (sec)
Definition: EcalTBEventHeader.h:52
EcalTBEventHeader::nominalCrystalInBeam
int nominalCrystalInBeam() const
Definition: EcalTBEventHeader.h:81
EcalTBEventHeader::thetaTableIndex
unsigned int thetaTableIndex() const
Returns the theta table index.
Definition: EcalTBEventHeader.h:84
EcalTBEventHeader::scalers_
std::vector< int > scalers_
Definition: EcalTBEventHeader.h:265