22 m_runInEventLoop(ps.getUntrackedParameter<
bool>(
"runInEventLoop",
false)),
23 m_runInEndLumi(ps.getUntrackedParameter<
bool>(
"runInEndLumi",
false)),
24 verbose_(ps.getUntrackedParameter<
bool>(
"verbose",
false)),
40 const int TotalNrBinsLs = 1000;
41 const double totalNrBinsLs =
static_cast<double>(TotalNrBinsLs);
45 algo_bits = ibooker.
book1D(
"algo_bits",
"GT algorithm trigger bits", 128, -0.5, 127.5);
49 ibooker.
book2D(
"algo_bits_corr",
"GT algorithm trigger bit correlation", 128, -0.5, 127.5, 128, -0.5, 127.5);
53 tt_bits = ibooker.
book1D(
"tt_bits",
"GT technical trigger bits", 64, -0.5, 63.5);
56 tt_bits_corr = ibooker.
book2D(
"tt_bits_corr",
"GT technical trigger bit correlation", 64, -0.5, 63.5, 64, -0.5, 63.5);
61 "algo_tt_bits_corr",
"GT algorithm - technical trigger bit correlation", 128, -0.5, 127.5, 64, -0.5, 63.5);
66 "algo_bits_lumi",
"GT algorithm trigger bit rate per LS", TotalNrBinsLs, 0., totalNrBinsLs, 128, -0.5, 127.5);
71 "tt_bits_lumi",
"GT technical trigger bit rate per LS", TotalNrBinsLs, 0., totalNrBinsLs, 64, -0.5, 63.5);
84 event_number = ibooker.
book1D(
"event_number",
"GT event number (from last resync)", 100, 0., 50000.);
88 "event_lumi",
"GT event number (from last resync) vs LS", TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e15,
"s");
92 trigger_number = ibooker.
book1D(
"trigger_number",
"GT trigger number (from start run)", 100, 0., 50000.);
96 "GT trigger number (from start run) vs LS",
108 "evnum_trignum_lumi",
"GT event/trigger number ratio vs LS", TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 2.,
"s");
113 "orbit_lumi",
"GT orbit number vs LS", TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e15,
"s");
118 "setupversion_lumi",
"GT setup version vs LS", TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e10,
"i");
122 gtfe_bx = ibooker.
book1D(
"gtfe_bx",
"GTFE Bx number", 3600, 0., 3600.);
126 ibooker.
bookProfile(
"dbx_module",
"delta Bx of GT modules wrt GTFE", 20, 0., 20., 100, -4000., 4000.,
"i");
150 ibooker.
book2D(
"BST_MasterStatus",
"BST master status over LS", TotalNrBinsLs, 0., totalNrBinsLs, 6, -1., 5.);
157 ibooker.
book2D(
"BST_turnCountNumber",
"BST turn count over LS", TotalNrBinsLs, 0., totalNrBinsLs, 250, 0., 4.3e9);
164 BST_beamMode = ibooker.
book2D(
"BST_beamMode",
"BST beam mode over LS", TotalNrBinsLs, 0., totalNrBinsLs, 25, 1., 26.);
190 ibooker.
book2D(
"BST_beamMomentum",
"BST beam momentum", TotalNrBinsLs, 0., totalNrBinsLs, 100, 0., 7200.);
194 gpsfreq = ibooker.
book1D(
"gpsfreq",
"Clock frequency measured by GPS", 1000, 39.95, 40.2);
197 gpsfreqwide = ibooker.
book1D(
"gpsfreqwide",
"Clock frequency measured by GPS", 1000, -2., 200.);
201 "gpsfreqlum",
"Clock frequency measured by GPS", TotalNrBinsLs, 0., totalNrBinsLs, 100, 39.95, 40.2);
206 ibooker.
book2D(
"BST_intensityBeam1",
"Intensity beam 1", TotalNrBinsLs, 0., totalNrBinsLs, 1000, 0., 5000.);
211 ibooker.
book2D(
"BST_intensityBeam2",
"Intensity beam 2", TotalNrBinsLs, 0., totalNrBinsLs, 1000, 0., 5000.);
218 "L1PrescaleFactorSet",
"Index of L1 prescale factor set", TotalNrBinsLs, 0., totalNrBinsLs, 25, 0., 25.);
222 ibooker.
book1D(
"L1PfIndicesPerLs",
"Number of prescale factor indices used per LS", 10, 0., 10.);
232 "Orbit number difference (TCS - EVM_FDL)",
239 "LS number difference (TCS - EVM_FDL)",
248 "Orbit number difference (TCS - EVM_FDL)",
259 "LS number difference (TCS - EVM_FDL)",
282 h_L1AlgoBX1 = ibooker.
book2D(
"h_L1AlgoBX1",
"L1 Algo Trigger BX (algo bit 0 to 31)", 32, -0.5, 31.5, 5, -2.5, 2.5);
283 h_L1AlgoBX2 = ibooker.
book2D(
"h_L1AlgoBX2",
"L1 Algo Trigger BX (algo bit 32 to 63)", 32, 31.5, 63.5, 5, -2.5, 2.5);
284 h_L1AlgoBX3 = ibooker.
book2D(
"h_L1AlgoBX3",
"L1 Algo Trigger BX (algo bit 64 to 95)", 32, 63.5, 95.5, 5, -2.5, 2.5);
285 h_L1AlgoBX4 = ibooker.
book2D(
"h_L1AlgoBX4",
"L1 Algo Trigger BX (algo bit 96 to 127)", 32, 95.5, 127.5, 5, -2.5, 2.5);
286 h_L1TechBX = ibooker.
book2D(
"h_L1TechBX",
"L1 Tech Trigger BX", 64, -0.5, 63.5, 5, -2.5, 2.5);
289 int itrig = (
algo->second).algoBitNumber();
297 }
else if (itrig < 64) {
302 }
else if (itrig < 96) {
307 }
else if (itrig < 128) {
318 int itrig = (techTrig->second).algoBitNumber();
334 edm::LogInfo(
"L1TGT") <<
"L1TGT: analyze...." << std::endl;
341 long long int orbitTcs = -1;
342 int orbitEvmFdl = -1;
354 if (!gtEvmReadoutRecord.
isValid()) {
355 edm::LogInfo(
"L1TGT") <<
"can't find L1GlobalTriggerEvmReadoutRecord";
362 gtfeEvmBx = gtfeEvmWord.
bxNr();
370 tcsBx = tcsWord.
bxNr();
383 static_cast<double>(tcsWord.
eventNr()) / static_cast<double>(tcsWord.
partTrigNr()));
403 edm::LogInfo(
"L1TGT") <<
" check mode = " << beam <<
" momentum " << momentum <<
" int2 " << intensity2
408 uint64_t gpshi = (gpsr >> 32) & 0xffffffff;
410 uint64_t gps = gpshi * 1000000 + gpslo;
413 Long64_t delorb = orbitTcs -
preOrb_;
414 Long64_t delgps = gps -
preGps_;
418 freq = ((Double_t)(delorb)) * 3564. / ((Double_t)(delgps));
427 edm::LogInfo(
"L1TGT") <<
" preOrb_ = " << preOrb_ <<
" orbitTcs=" << orbitTcs <<
" delorb=" << delorb
428 << std::hex <<
" preGps_=" << preGps_ <<
" gps=" << gps <<
std::dec 429 <<
" delgps=" << delgps <<
" freq=" << freq << std::endl;
442 orbitEvmFdl = fdlWord.
orbitNr();
446 if ((orbitTcs >= 0) && (orbitEvmFdl >= 0)) {
447 int diffOrbit =
static_cast<float>(orbitTcs - orbitEvmFdl);
448 edm::LogInfo(
"L1TGT") <<
"\n orbitTcs = " << orbitTcs <<
" orbitEvmFdl = " << orbitEvmFdl
449 <<
" diffOrbit = " << diffOrbit <<
" orbitEvent = " << iEvent.
orbitNumber() << std::endl;
466 }
else if (orbitEvmFdl >= 0) {
477 if ((lsTcs >= 0) && (lsEvmFdl >= 0)) {
478 int diffLs =
static_cast<float>(lsTcs - lsEvmFdl);
479 edm::LogInfo(
"L1TGT") <<
"\n lsTcs = " << lsTcs <<
" lsEvmFdl = " << lsEvmFdl <<
" diffLs = " << diffLs
480 <<
" lsEvent = " << lsNumber << std::endl;
497 }
else if (lsEvmFdl >= 0) {
518 if (!gtReadoutRecord.
isValid()) {
519 edm::LogInfo(
"L1TGT") <<
"can't find L1GlobalTriggerReadoutRecord";
523 if (gtReadoutRecord.
isValid()) {
524 unsigned int NmaxL1AlgoBit = gtReadoutRecord->
decisionWord().size();
530 const std::vector<L1GtFdlWord>& m_gtFdlWord(gtReadoutRecord->
gtFdlVector());
531 int numberBxInEvent = m_gtFdlWord.size();
532 int minBxInEvent = (numberBxInEvent + 1) / 2 - numberBxInEvent;
534 for (
unsigned int iBit = 0; iBit < NmaxL1AlgoBit; ++iBit) {
535 bool accept = dWord[iBit];
546 for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin(); itBx != m_gtFdlWord.end(); ++itBx) {
548 bool accept = dWordBX[iBit];
563 for (
unsigned int iBit = 0; iBit < NmaxL1TechBit; ++iBit) {
564 bool accept = technicalTriggerWordBeforeMask[iBit];
574 for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin(); itBx != m_gtFdlWord.end(); ++itBx) {
575 const DecisionWord dWordBX = (*itBx).gtTechnicalTriggerWord();
576 bool accept = dWordBX[iBit];
586 int fdlBx[2] = {-1, -1};
587 int psbBx[2][7] = {{-1, -1, -1, -1, -1, -1, -1}, {-1, -1, -1, -1, -1, -1, -1}};
592 gtfeBx = gtfeWord.
bxNr();
602 if (gmtReadoutCollection.
isValid()) {
610 fdlBx[0] = fdlWord.
bxNr();
618 DecisionWord::const_iterator GTdbitItr;
620 for (GTdbitItr = gtDecisionWord.begin(); GTdbitItr != gtDecisionWord.end(); GTdbitItr++) {
625 DecisionWord::const_iterator GTdbitItr1;
626 for (GTdbitItr1 = gtDecisionWord.begin(); GTdbitItr1 != gtDecisionWord.end(); GTdbitItr1++) {
632 TechnicalTriggerWord::const_iterator GTtbitItr1;
633 for (GTtbitItr1 = gtTTWord.begin(); GTtbitItr1 != gtTTWord.end(); GTtbitItr1++) {
643 TechnicalTriggerWord::const_iterator GTtbitItr;
645 for (GTtbitItr = gtTTWord.begin(); GTtbitItr != gtTTWord.end(); GTtbitItr++) {
650 TechnicalTriggerWord::const_iterator GTtbitItr1;
651 for (GTtbitItr1 = gtTTWord.begin(); GTtbitItr1 != gtTTWord.end(); GTtbitItr1++) {
672 std::pair<int, int> pairLsPfi = std::make_pair(lsNumber, pfIndexAlgoTrig);
684 int psbID[7] = {0xbb09, 0xbb0d, 0xbb0e, 0xbb0f, 0xbb13, 0xbb14, 0xbb15};
685 for (
int i = 0;
i < 7;
i++) {
686 if (
isActive(gtfeActiveBoards, ibit)) {
688 psbBx[0][
i] = psbWord.
bxNr();
699 for (
int i = 0;
i < 2;
i++) {
703 for (
int j = 0;
j < 7;
j++) {
704 for (
int i = 0;
i < 2;
i++) {
705 if (psbBx[
i][
j] > -1)
722 if (word & (1 << bit))
729 edm::LogInfo(
"L1TGT") <<
"\n Prescale factor indices used in a LS " << std::endl;
732 edm::LogVerbatim(
"L1TGT") <<
" lsNumber = " << (*cIt).first <<
" pfIndex = " << (*cIt).second << std::endl;
743 int previousLsNumber = -1;
744 int previousPfsIndex = -1;
750 int pfsIndicesPerLs = 1;
752 if ((*cIt).first == previousLsNumber) {
753 if ((*cIt).second != previousPfsIndex) {
755 previousPfsIndex = (*cIt).second;
760 if (previousLsNumber != -1) {
765 previousLsNumber = (*cIt).first;
766 previousPfsIndex = (*cIt).second;
MonitorElement * m_monL1PrescaleFactorSet
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * h_L1AlgoBX1
MonitorElement * gpsfreqwide
const cms_uint16_t bxNr() const
get/set bunch cross number of the actual bx
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
const TechnicalTriggerWord & technicalTriggerWord(int bxInEventValue) const
const cms_uint64_t orbitNr() const
get/set orbit number since start of run
std::map< std::string, bool > l1TriggerDecision
MonitorElement * m_monLsNrDiffTcsFdlEvmLs
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setCurrentFolder(std::string const &fullpath)
std::vector< std::pair< int, int > >::const_iterator CItVecPair
int getBxNr() const
get counters
const L1GtfeExtWord gtfeWord() const
get / set GTFE word (record) in the GT readout record
const L1TcsWord tcsWord() const
get / set TCS word (record) in the GT readout record
const std::vector< L1GtFdlWord > gtFdlVector() const
get the vector of L1GtFdlWord
const L1GtfeWord gtfeWord() const
get / set GTFE word (record) in the GT readout record
const cms_uint64_t gpsTime() const
LHC-BOB-ES-0001 (EDMS 638899)
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::LuminosityBlockNumber_t luminosityBlock() const
const cms_uint16_t luminositySegmentNr() const
get/set luminosity segment number
MonitorElement * BST_intensityBeam1
static const int MaxOrbitNrDiffTcsFdlEvm
MonitorElement * algo_bits_corr
bool verbose_
verbosity switch
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
const cms_uint16_t bstMasterStatus() const
const cms_uint32_t partTrigNr() const
get/set total number of L1A sent since start of the run to this DAQ partition
MonitorElement * BST_beamMode
MonitorElement * BST_MasterStatus
const cms_uint16_t beamMomentum() const
const cms_uint16_t bxNr() const
get/set BxNr - bunch cross number of the actual bx
virtual void Reset()
reset ME (ie. contents, errors, etc)
MonitorElement * BST_intensityBeam2
const cms_uint16_t bxNr() const
get/set bunch cross number as counted in the TCS chip
MonitorElement * h_L1TechBX
MonitorElement * event_number
Container::value_type value_type
MonitorElement * h_L1AlgoBX3
std::vector< bool > DecisionWord
typedefs
static const int MaxLsNrDiffTcsFdlEvm
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmSource_
input tag for L1 GT EVM readout record
MonitorElement * orbit_lumi
MonitorElement * h_L1AlgoBX4
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
const L1GtPsbWord gtPsbWord(cms_uint16_t boardIdValue, int bxInEventValue) const
get / set PSB word (record) in the GT readout record
std::string m_histFolder
histogram folder for L1 GT plots
const cms_uint16_t localBxNr() const
get/set local bunch cross number of the actual bx
MonitorElement * algo_bits_lumi
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
const cms_uint16_t activeBoards() const
get/set boards contributing to EVM respectively DAQ record
const DecisionWord & decisionWord(int bxInEventValue) const
MonitorElement * m_monLsNrDiffTcsFdlEvm
const cms_uint16_t bxNr() const
get/set bunch cross number as counted in the GTFE board
std::string algoBitToName[128]
const cms_uint32_t totalIntensityBeam2() const
const cms_uint32_t totalIntensityBeam1() const
MonitorElement * algo_bits
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
MonitorElement * event_type
const cms_uint16_t gtPrescaleFactorIndexAlgo() const
MonitorElement * m_monOrbitNrDiffTcsFdlEvmLs
const cms_uint16_t lumiSegmentNr() const
get/set luminosity segment number of the actual bx
MonitorElement * dbx_module
unsigned long long uint64_t
const L1GtFdlWord gtFdlWord(int bxInEventValue) const
get / set FDL word (record) in the GT readout record
const cms_uint32_t lhcFillNumber() const
MonitorElement * tt_bits_corr
bool isActive(int word, int bit)
book all histograms for the module
MonitorElement * gpsfreqlum
int m_nrEvJob
number of events processed
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtSource_L1GT_
input parameters
MonitorElement * h_L1AlgoBX2
void countPfsIndicesPerLs()
const cms_uint16_t triggerType() const
get/set trigger type, identical with event type in CMS header
MonitorElement * m_monL1PfIndicesPerLs
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
std::map< std::string, bool >::iterator trig_iter
const cms_uint32_t eventNr() const
get/set event number since last L1 reset generated in TCS chip
const cms_uint32_t setupVersion() const
get/set setup version
MonitorElement * trigger_number
std::vector< std::pair< int, int > > m_pairLsNumberPfIndex
MonitorElement * BST_beamMomentum
L1MuGMTReadoutRecord const & getRecord(int bx=0) const
MonitorElement * BST_lhcFillNumber
MonitorElement * setupversion_lumi
const cms_uint32_t turnCountNumber() const
const L1GtFdlWord gtFdlWord(int bxInEvent) const
get / set FDL word (record) in the GT readout record
MonitorElement * BST_turnCountNumber
std::map< std::string, bool > l1TechTriggerDecision
MonitorElement * event_lumi
const cms_uint16_t beamMode() const
T const * product() const
MonitorElement * tt_bits_lumi
MonitorElement * trigger_lumi
MonitorElement * evnum_trignum_lumi
const cms_uint32_t orbitNr() const
get/set orbit number
MonitorElement * algo_tt_bits_corr
std::string techBitToName[64]
const cms_uint16_t localBxNr() const
get/set local bunch cross number of the actual bx
MonitorElement * m_monOrbitNrDiffTcsFdlEvm
L1TGT(const edm::ParameterSet &ps)
edm::EDGetTokenT< L1MuGMTReadoutCollection > gtSource_L1MuGMT_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)