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 
16 
17  public:
18 
20 
22 
23  typedef struct magnetsMeasurement {
26 
29 
32 
36 
38  int eventNumber() const{
39  return eventNumber_;
40  }
41 
42  int runNumber() const{
43  return runNumber_;
44  }
45 
47  short burstNumber() const{
48  return burstNumber_;
49  }
50 
52  short smInBeam() const {
53  return smInBeam_;
54  }
55 
57  int begBurstTimeSec() const{
58  return begBurstTime_sec_;
59  }
60 
62  int begBurstTimeMsec() const{
63  return begBurstTime_msec_;
64  }
65 
67  int endBurstTimeSec() const{
68  return endBurstTime_sec_;
69  }
70 
72  int endBurstTimeMsec() const{
73  return endBurstTime_msec_;
74  }
75 
77  int begBurstLV1A() const{
78  return begBurstLV1A_;
79  }
80 
82  int endBurstLV1A() const{
83  return endBurstLV1A_;
84  }
85 
86 
87  // Return the event type: "beam", "laser", "pedestal". "error"
88  // or a number orresponding to the orginal eventype stored in
89  // the RRF.
90  std::string eventType() const ;
91 
93  int dbEventType() const ;
94 
96  int triggerMask() const {
97  return triggerMask_;
98  }
99 
101  int date() const {
102  return date_;
103  }
104 
106 
107  //Table supervisor information
108  int crystalInBeam() const {
109  return EBDetId(crystalInBeam_).ic();
110  }
111  int nominalCrystalInBeam() const {
112  return EBDetId(nominalCrystalInBeam_).ic();
113  }
114  int nextCrystalInBeam() const {
115  return EBDetId(nextCrystalInBeam_).ic();
116  }
118  unsigned int thetaTableIndex() const { return thetaTableIndex_; }
120  unsigned int phiTableIndex() const { return phiTableIndex_; }
122  bool tableIsMoving() const { return tableIsMoving_;}
126  bool syncError() const { return syncError_; }
127 
130 
138  // FIXME: add the codes used by Jean Bourotte here.
139  enum LaserType {
140  LBlue = 440,
141  LGreen = 495,
142  LRed = 709,
143  LInfrared = 800
144  };
146  int lightIntensity() const {
147  return lightIntensity_;
148  }
150  int laserType() const {
151  return laserType_; // returns wavelength
152  }
153 
155  LaserType laser_type;
156  switch(laserType_){
157  case 440: laser_type = LBlue; break;
158  case 495: laser_type = LGreen; break;
159  case 709: laser_type = LRed; break;
160  case 800: laser_type = LInfrared; break;
161  default: laser_type = LRed; break;
162  }
163  return laser_type; // returns laserTypeName
164  }
165 
167  int S6ADC () const {
168  return S6ADC_ ;
169  }
170 
172 
173  const std::vector<magnetsMeasurement_t>& magnetMeasurements() const { return magnetMeasurements_; }
174 
175  int scaler(int scalerId) const {
176  if (scalerId < ((int) scalers_.size() ) )
177  return scalers_[scalerId];
178  else
179  return -1;
180  }
181 
183  //Set Methods
184 
186 
188 
189  void setSmInBeam(const int& smInBeam) { smInBeam_ = smInBeam; }
190 
192 
194 
196 
198 
200 
202 
204 
206 
207  void setDate(const int& date ) { date_=date; }
208 
210 
212 
214 
216 
218 
220 
222 
223  void setSyncError(const bool& syncError ) { syncError_ = syncError; }
224 
226 
227  void setLaserType(const int& laserType) { laserType_ = laserType; }
228 
229  void setS6ADC (const int& S6ADC) { S6ADC_ = S6ADC ; }
230 
232  void setMagnetMeasurements(const std::vector<magnetsMeasurement_t>& magnetMeasurements) { magnetMeasurements_ = magnetMeasurements;}
233 
234  void setScalers (const std::vector<int> & scalers) { scalers_ = scalers; }
235 
236 
237  private:
238 
241  short burstNumber_;
242 
243 
251 
252 
254 
257  std::vector<magnetsMeasurement_t> magnetMeasurements_;
258 
259  /* int nominalMagnet6ReadAmpere_; */
260  /* int nominalMagnet7ReadAmpere_; */
261  /* int nominalMagnet6SetAmpere_; */
262  /* int nominalMagnet7SetAmpere_; */
263  /* int measuredMagnet6MicroAmpere_; */
264  /* int measuredMagnet7MicroAmpere_; */
265  /* int measuredMagnet6Volt_; */
266  /* int measuredMagnet7Volt_; */
267 
268 
269  int date_;
270 
275  unsigned int thetaTableIndex_;
276  unsigned int phiTableIndex_;
277 
279 
280  bool tableIsMovingAtBegSpill_; //indipendent but from CAMAC one saying if table is moving at the begin of the spill
281 
282  //Sync error for Camac stuff
284 
285  //FIXME for use in CMSSW(Probably unuseful when reading from new RawData Information will be stored in EcalDCCHeaderBlock)
288 
289  int S6ADC_ ;
290 
291  short smInBeam_;
292 
293  // array of 36 scalers
294  std::vector<int> scalers_;
295 
296 };
297 
298 std::ostream& operator<<(std::ostream&, const EcalTBEventHeader&);
299 
300 #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:46
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:18
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