File indexing completed on 2024-04-06 12:05:13
0001
0002 #ifndef DataFormats_SiStripEventSummary_SiStripEventSummary_H
0003 #define DataFormats_SiStripEventSummary_SiStripEventSummary_H
0004
0005 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
0006 #include <sstream>
0007 #include <vector>
0008
0009 class SiStripEventSummary;
0010
0011
0012 std::ostream& operator<<(std::ostream&, const SiStripEventSummary&);
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 class SiStripEventSummary {
0023 public:
0024
0025
0026
0027 SiStripEventSummary();
0028
0029
0030 ~SiStripEventSummary() { ; }
0031
0032
0033
0034
0035
0036 inline bool valid() const;
0037
0038
0039 inline uint16_t triggerFed() const;
0040
0041
0042 inline bool isSet() const;
0043
0044
0045
0046
0047 inline const sistrip::RunType& runType() const;
0048
0049
0050 inline const uint32_t& event() const;
0051
0052
0053 inline const uint32_t& bx() const;
0054
0055
0056
0057
0058 inline const sistrip::FedReadoutMode& fedReadoutMode() const;
0059
0060
0061 inline const sistrip::ApvReadoutMode& apvReadoutMode() const;
0062
0063
0064 inline const uint16_t& apveAddress() const;
0065
0066
0067 inline const uint32_t& nApvsInSync() const;
0068
0069
0070 inline const uint32_t& nApvsOutOfSync() const;
0071
0072
0073 inline const uint32_t& nApvsErrors() const;
0074
0075
0076
0077
0078 inline bool nullParams() const;
0079
0080
0081 inline const std::vector<uint32_t>& params() const;
0082
0083
0084 inline const uint32_t& binNumber() const;
0085
0086
0087 inline const uint32_t& pllCoarse() const;
0088
0089
0090 inline const uint32_t& pllFine() const;
0091
0092
0093 inline const uint32_t& latency() const;
0094
0095
0096 inline const uint32_t& calChan() const;
0097
0098
0099 inline const uint32_t& calSel() const;
0100
0101
0102 inline const uint32_t& isha() const;
0103
0104
0105 inline const uint32_t& vfs() const;
0106
0107
0108 inline const uint32_t& ttcrx() const;
0109
0110
0111 inline const uint32_t& vpsp() const;
0112
0113
0114 inline const uint32_t& vpspCcuChan() const;
0115
0116
0117 inline const uint32_t& lldGain() const;
0118
0119
0120 inline const uint32_t& lldBias() const;
0121
0122
0123 inline const uint32_t& deviceId() const;
0124
0125
0126 inline const uint32_t& processId() const;
0127
0128
0129 inline const uint32_t& processIp() const;
0130
0131
0132 inline const uint32_t& dcuId() const;
0133
0134
0135 inline const uint32_t& layerScanned() const;
0136
0137
0138
0139
0140 void commissioningInfo(const uint32_t* const buffer, const uint32_t& event);
0141
0142
0143 void commissioningInfo(const uint32_t& daq_register1, const uint32_t& daq_register2);
0144
0145
0146 inline void triggerFed(const int16_t&);
0147
0148
0149 void fedReadoutMode(const uint16_t&);
0150
0151
0152 inline void event(const uint32_t&);
0153
0154
0155 inline void bx(const uint32_t&);
0156
0157 inline void apveAddress(uint16_t& addr);
0158 inline void nApvsInSync(uint32_t& napvs_in_sync);
0159 inline void nApvsOutOfSync(uint32_t& napvs_out_of_sync);
0160 inline void nApvsErrors(uint32_t& napvs_with_errors);
0161
0162 private:
0163
0164
0165
0166 bool valid_;
0167
0168
0169 uint16_t triggerFed_;
0170
0171
0172
0173
0174 sistrip::RunType runType_;
0175
0176
0177 uint32_t event_;
0178
0179
0180 uint32_t bx_;
0181
0182
0183 uint32_t spillNumber_;
0184
0185
0186 uint32_t nDataSenders_;
0187
0188
0189
0190
0191 sistrip::FedReadoutMode fedReadoutMode_;
0192
0193
0194 sistrip::ApvReadoutMode apvReadoutMode_;
0195
0196
0197 uint16_t apveAddress_;
0198
0199
0200 uint32_t nApvsInSync_;
0201
0202
0203 uint32_t nApvsOutOfSync_;
0204
0205
0206 uint32_t nApvsErrors_;
0207
0208
0209 std::vector<uint32_t> params_;
0210 };
0211
0212
0213
0214 bool SiStripEventSummary::valid() const { return valid_; }
0215 uint16_t SiStripEventSummary::triggerFed() const { return triggerFed_; }
0216 bool SiStripEventSummary::isSet() const { return ( runType_ != sistrip::UNDEFINED_RUN_TYPE); }
0217
0218 const sistrip::RunType& SiStripEventSummary::runType() const { return runType_; }
0219 const uint32_t& SiStripEventSummary::event() const { return event_; }
0220 const uint32_t& SiStripEventSummary::bx() const { return bx_; }
0221
0222 const sistrip::FedReadoutMode& SiStripEventSummary::fedReadoutMode() const { return fedReadoutMode_; }
0223 const sistrip::ApvReadoutMode& SiStripEventSummary::apvReadoutMode() const { return apvReadoutMode_; }
0224
0225 const uint16_t& SiStripEventSummary::apveAddress() const { return apveAddress_; }
0226 const uint32_t& SiStripEventSummary::nApvsInSync() const { return nApvsInSync_; }
0227 const uint32_t& SiStripEventSummary::nApvsOutOfSync() const { return nApvsOutOfSync_; }
0228 const uint32_t& SiStripEventSummary::nApvsErrors() const { return nApvsErrors_; }
0229
0230 bool SiStripEventSummary::nullParams() const { return (!params_[0] && !params_[1] && !params_[2] && !params_[3]); }
0231 const std::vector<uint32_t>& SiStripEventSummary::params() const { return params_; }
0232 const uint32_t& SiStripEventSummary::binNumber() const { return params_[0]; }
0233 const uint32_t& SiStripEventSummary::pllCoarse() const { return params_[0]; }
0234 const uint32_t& SiStripEventSummary::pllFine() const { return params_[1]; }
0235 const uint32_t& SiStripEventSummary::latency() const { return params_[0]; }
0236 const uint32_t& SiStripEventSummary::calChan() const { return params_[1]; }
0237 const uint32_t& SiStripEventSummary::calSel() const { return params_[2]; }
0238 const uint32_t& SiStripEventSummary::isha() const { return params_[3]; }
0239 const uint32_t& SiStripEventSummary::vfs() const { return params_[4]; }
0240 const uint32_t& SiStripEventSummary::ttcrx() const { return params_[2]; }
0241 const uint32_t& SiStripEventSummary::vpsp() const { return params_[0]; }
0242 const uint32_t& SiStripEventSummary::vpspCcuChan() const { return params_[1]; }
0243 const uint32_t& SiStripEventSummary::lldGain() const { return params_[0]; }
0244 const uint32_t& SiStripEventSummary::lldBias() const { return params_[1]; }
0245 const uint32_t& SiStripEventSummary::deviceId() const { return params_[0]; }
0246 const uint32_t& SiStripEventSummary::processId() const { return params_[1]; }
0247 const uint32_t& SiStripEventSummary::processIp() const { return params_[2]; }
0248 const uint32_t& SiStripEventSummary::dcuId() const { return params_[3]; }
0249 const uint32_t& SiStripEventSummary::layerScanned() const { return params_[3]; }
0250
0251 void SiStripEventSummary::triggerFed(const int16_t& fed) { fed < 0 ? triggerFed_ = 0 : triggerFed_ = fed; }
0252 void SiStripEventSummary::event(const uint32_t& event) { event_ = event; }
0253 void SiStripEventSummary::bx(const uint32_t& bx) { bx_ = bx; }
0254
0255 void SiStripEventSummary::apveAddress(uint16_t& addr) { apveAddress_ = addr; }
0256 void SiStripEventSummary::nApvsInSync(uint32_t& napvs_in_sync) { nApvsInSync_ = napvs_in_sync; }
0257 void SiStripEventSummary::nApvsOutOfSync(uint32_t& napvs_out_of_sync) { nApvsOutOfSync_ = napvs_out_of_sync; }
0258 void SiStripEventSummary::nApvsErrors(uint32_t& napvs_with_errors) { nApvsErrors_ = napvs_with_errors; }
0259
0260 #endif