File indexing completed on 2024-09-07 04:38:11
0001 #ifndef RECECAL_ECALTBEVENTHEADER_H
0002 #define RECECAL_ECALTBEVENTHEADER_H 1
0003
0004 #include <ostream>
0005 #include <string>
0006 #include <vector>
0007 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0008
0009
0010
0011
0012
0013
0014 class EcalTBEventHeader {
0015 public:
0016 EcalTBEventHeader() {}
0017
0018 ~EcalTBEventHeader() {}
0019
0020 typedef struct magnetsMeasurement {
0021 int magnet6IRead_ampere;
0022 int magnet6ISet_ampere;
0023
0024 int magnet7IRead_ampere;
0025 int magnet7ISet_ampere;
0026
0027 int magnet7VMeas_uvolt;
0028 int magnet7IMeas_uampere;
0029
0030 int magnet6VMeas_uvolt;
0031 int magnet6IMeas_uampere;
0032 } magnetsMeasurement_t;
0033
0034
0035 int eventNumber() const { return eventNumber_; }
0036
0037 int runNumber() const { return runNumber_; }
0038
0039
0040 short burstNumber() const { return burstNumber_; }
0041
0042
0043 short smInBeam() const { return smInBeam_; }
0044
0045
0046 int begBurstTimeSec() const { return begBurstTime_sec_; }
0047
0048
0049 int begBurstTimeMsec() const { return begBurstTime_msec_; }
0050
0051
0052 int endBurstTimeSec() const { return endBurstTime_sec_; }
0053
0054
0055 int endBurstTimeMsec() const { return endBurstTime_msec_; }
0056
0057
0058 int begBurstLV1A() const { return begBurstLV1A_; }
0059
0060
0061 int endBurstLV1A() const { return endBurstLV1A_; }
0062
0063
0064
0065
0066 std::string eventType() const;
0067
0068
0069 int dbEventType() const;
0070
0071
0072 int triggerMask() const { return triggerMask_; }
0073
0074
0075 int date() const { return date_; }
0076
0077
0078
0079
0080 int crystalInBeam() const { return EBDetId(crystalInBeam_).ic(); }
0081 int nominalCrystalInBeam() const { return EBDetId(nominalCrystalInBeam_).ic(); }
0082 int nextCrystalInBeam() const { return EBDetId(nextCrystalInBeam_).ic(); }
0083
0084 unsigned int thetaTableIndex() const { return thetaTableIndex_; }
0085
0086 unsigned int phiTableIndex() const { return phiTableIndex_; }
0087
0088 bool tableIsMoving() const { return tableIsMoving_; }
0089
0090 bool tableIsMovingAtBegSpill() const { return tableIsMovingAtBegSpill_; }
0091
0092 bool syncError() const { return syncError_; }
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105 enum LaserType {
0106 LBlue = 440,
0107 LGreen = 495,
0108 LRed = 709,
0109 LInfrared = 800
0110 };
0111
0112 int lightIntensity() const { return lightIntensity_; }
0113
0114 int laserType() const {
0115 return laserType_;
0116 }
0117
0118 LaserType laserTypeName() const {
0119 LaserType laser_type;
0120 switch (laserType_) {
0121 case 440:
0122 laser_type = LBlue;
0123 break;
0124 case 495:
0125 laser_type = LGreen;
0126 break;
0127 case 709:
0128 laser_type = LRed;
0129 break;
0130 case 800:
0131 laser_type = LInfrared;
0132 break;
0133 default:
0134 laser_type = LRed;
0135 break;
0136 }
0137 return laser_type;
0138 }
0139
0140
0141 int S6ADC() const { return S6ADC_; }
0142
0143 int numberOfMagnetMeasurements() const { return numberOfMagnetMeasurements_; }
0144
0145 const std::vector<magnetsMeasurement_t>& magnetMeasurements() const { return magnetMeasurements_; }
0146
0147 int scaler(int scalerId) const {
0148 if (scalerId < ((int)scalers_.size()))
0149 return scalers_[scalerId];
0150 else
0151 return -1;
0152 }
0153
0154
0155
0156
0157 void setEventNumber(const int& eventNumber) { eventNumber_ = eventNumber; }
0158
0159 void setRunNumber(const int& runNumber) { runNumber_ = runNumber; }
0160
0161 void setSmInBeam(const int& smInBeam) { smInBeam_ = smInBeam; }
0162
0163 void setBurstNumber(const short& burstNumber) { burstNumber_ = burstNumber; }
0164
0165 void setTriggerMask(const int& triggerMask) { triggerMask_ = triggerMask; }
0166
0167 void setBegBurstTimeSec(const int& begBurstTimeSec) { begBurstTime_sec_ = begBurstTimeSec; }
0168
0169 void setBegBurstTimeMsec(const int& begBurstTimeMsec) { begBurstTime_msec_ = begBurstTimeMsec; }
0170
0171 void setEndBurstTimeSec(const int& endBurstTimeSec) { endBurstTime_sec_ = endBurstTimeSec; }
0172
0173 void setEndBurstTimeMsec(const int& endBurstTimeMsec) { endBurstTime_msec_ = endBurstTimeMsec; }
0174
0175 void setBegBurstLV1A(const int& begBurstLV1A) { begBurstLV1A_ = begBurstLV1A; }
0176
0177 void setEndBurstLV1A(const int& endBurstLV1A) { endBurstLV1A_ = endBurstLV1A; }
0178
0179 void setDate(const int& date) { date_ = date; }
0180
0181 void setCrystalInBeam(const DetId& crystalInBeam) { crystalInBeam_ = crystalInBeam; }
0182
0183 void setNominalCrystalInBeam(const DetId& crystalInBeam) { nominalCrystalInBeam_ = crystalInBeam; }
0184
0185 void setNextCrystalInBeam(const DetId& crystalInBeam) { nextCrystalInBeam_ = crystalInBeam; }
0186
0187 void setThetaTableIndex(const unsigned int& thetaTableIndex) { thetaTableIndex_ = thetaTableIndex; }
0188
0189 void setPhiTableIndex(const unsigned int& phiTableIndex) { phiTableIndex_ = phiTableIndex; }
0190
0191 void setTableIsMoving(const bool& tableIsMoving) { tableIsMoving_ = tableIsMoving; }
0192
0193 void setTableIsMovingAtBegSpill(const bool& tableIsMoving) { tableIsMovingAtBegSpill_ = tableIsMoving; }
0194
0195 void setSyncError(const bool& syncError) { syncError_ = syncError; }
0196
0197 void setLightIntensity(const int& lightIntensity) { lightIntensity_ = lightIntensity; }
0198
0199 void setLaserType(const int& laserType) { laserType_ = laserType; }
0200
0201 void setS6ADC(const int& S6ADC) { S6ADC_ = S6ADC; }
0202
0203 void setNumberOfMagnetMeasurements(const int& numberOfMagnetMeasurements) {
0204 numberOfMagnetMeasurements_ = numberOfMagnetMeasurements;
0205 }
0206 void setMagnetMeasurements(const std::vector<magnetsMeasurement_t>& magnetMeasurements) {
0207 magnetMeasurements_ = magnetMeasurements;
0208 }
0209
0210 void setScalers(const std::vector<int>& scalers) { scalers_ = scalers; }
0211
0212 private:
0213 int eventNumber_;
0214 int runNumber_;
0215 short burstNumber_;
0216
0217
0218 int begBurstTime_sec_;
0219 int begBurstTime_msec_;
0220 int endBurstTime_sec_;
0221 int endBurstTime_msec_;
0222 int begBurstLV1A_;
0223 int endBurstLV1A_;
0224
0225 int triggerMask_;
0226
0227
0228 int numberOfMagnetMeasurements_;
0229 std::vector<magnetsMeasurement_t> magnetMeasurements_;
0230
0231
0232
0233
0234
0235
0236
0237
0238
0239
0240 int date_;
0241
0242
0243 DetId crystalInBeam_;
0244 DetId nominalCrystalInBeam_;
0245 DetId nextCrystalInBeam_;
0246 unsigned int thetaTableIndex_;
0247 unsigned int phiTableIndex_;
0248
0249 bool tableIsMoving_;
0250
0251 bool tableIsMovingAtBegSpill_;
0252
0253
0254 bool syncError_;
0255
0256
0257 int lightIntensity_;
0258 int laserType_;
0259
0260 int S6ADC_;
0261
0262 short smInBeam_;
0263
0264
0265 std::vector<int> scalers_;
0266 };
0267
0268 std::ostream& operator<<(std::ostream&, const EcalTBEventHeader&);
0269
0270 #endif