22 m_runInEventLoop(ps.getUntrackedParameter<
bool>(
"runInEventLoop",
false)),
23 m_runInEndLumi(ps.getUntrackedParameter<
bool>(
"runInEndLumi",
false)),
24 verbose_(ps.getUntrackedParameter<
bool>(
"verbose",
false)),
41 const int TotalNrBinsLs = 1000;
42 const double totalNrBinsLs =
static_cast<double>(TotalNrBinsLs);
46 algo_bits = ibooker.
book1D(
"algo_bits",
"GT algorithm trigger bits", 128, -0.5, 127.5);
50 ibooker.
book2D(
"algo_bits_corr",
"GT algorithm trigger bit correlation", 128, -0.5, 127.5, 128, -0.5, 127.5);
54 tt_bits = ibooker.
book1D(
"tt_bits",
"GT technical trigger bits", 64, -0.5, 63.5);
57 tt_bits_corr = ibooker.
book2D(
"tt_bits_corr",
"GT technical trigger bit correlation", 64, -0.5, 63.5, 64, -0.5, 63.5);
62 "algo_tt_bits_corr",
"GT algorithm - technical trigger bit correlation", 128, -0.5, 127.5, 64, -0.5, 63.5);
67 "algo_bits_lumi",
"GT algorithm trigger bit rate per LS", TotalNrBinsLs, 0., totalNrBinsLs, 128, -0.5, 127.5);
72 "tt_bits_lumi",
"GT technical trigger bit rate per LS", TotalNrBinsLs, 0., totalNrBinsLs, 64, -0.5, 63.5);
85 event_number = ibooker.
book1D(
"event_number",
"GT event number (from last resync)", 100, 0., 50000.);
89 "event_lumi",
"GT event number (from last resync) vs LS", TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e15,
"s");
93 trigger_number = ibooker.
book1D(
"trigger_number",
"GT trigger number (from start run)", 100, 0., 50000.);
97 "GT trigger number (from start run) vs LS",
109 "evnum_trignum_lumi",
"GT event/trigger number ratio vs LS", TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 2.,
"s");
114 "orbit_lumi",
"GT orbit number vs LS", TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e15,
"s");
119 "setupversion_lumi",
"GT setup version vs LS", TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e10,
"i");
123 gtfe_bx = ibooker.
book1D(
"gtfe_bx",
"GTFE Bx number", 3600, 0., 3600.);
127 ibooker.
bookProfile(
"dbx_module",
"delta Bx of GT modules wrt GTFE", 20, 0., 20., 100, -4000., 4000.,
"i");
151 ibooker.
book2D(
"BST_MasterStatus",
"BST master status over LS", TotalNrBinsLs, 0., totalNrBinsLs, 6, -1., 5.);
158 ibooker.
book2D(
"BST_turnCountNumber",
"BST turn count over LS", TotalNrBinsLs, 0., totalNrBinsLs, 250, 0., 4.3e9);
165 BST_beamMode = ibooker.
book2D(
"BST_beamMode",
"BST beam mode over LS", TotalNrBinsLs, 0., totalNrBinsLs, 25, 1., 26.);
191 ibooker.
book2D(
"BST_beamMomentum",
"BST beam momentum", TotalNrBinsLs, 0., totalNrBinsLs, 100, 0., 7200.);
195 gpsfreq = ibooker.
book1D(
"gpsfreq",
"Clock frequency measured by GPS", 1000, 39.95, 40.2);
198 gpsfreqwide = ibooker.
book1D(
"gpsfreqwide",
"Clock frequency measured by GPS", 1000, -2., 200.);
202 "gpsfreqlum",
"Clock frequency measured by GPS", TotalNrBinsLs, 0., totalNrBinsLs, 100, 39.95, 40.2);
207 ibooker.
book2D(
"BST_intensityBeam1",
"Intensity beam 1", TotalNrBinsLs, 0., totalNrBinsLs, 1000, 0., 5000.);
212 ibooker.
book2D(
"BST_intensityBeam2",
"Intensity beam 2", TotalNrBinsLs, 0., totalNrBinsLs, 1000, 0., 5000.);
219 "L1PrescaleFactorSet",
"Index of L1 prescale factor set", TotalNrBinsLs, 0., totalNrBinsLs, 25, 0., 25.);
223 ibooker.
book1D(
"L1PfIndicesPerLs",
"Number of prescale factor indices used per LS", 10, 0., 10.);
233 "Orbit number difference (TCS - EVM_FDL)",
240 "LS number difference (TCS - EVM_FDL)",
249 "Orbit number difference (TCS - EVM_FDL)",
260 "LS number difference (TCS - EVM_FDL)",
283 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);
284 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);
285 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);
286 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);
287 h_L1TechBX = ibooker.
book2D(
"h_L1TechBX",
"L1 Tech Trigger BX", 64, -0.5, 63.5, 5, -2.5, 2.5);
290 int itrig = (
algo->second).algoBitNumber();
298 }
else if (itrig < 64) {
303 }
else if (itrig < 96) {
308 }
else if (itrig < 128) {
317 for (
CItAlgo techTrig =
menu->gtTechnicalTriggerMap().begin(); techTrig !=
menu->gtTechnicalTriggerMap().end();
319 int itrig = (techTrig->second).algoBitNumber();
335 edm::LogInfo(
"L1TGT") <<
"L1TGT: analyze...." << std::endl;
342 long long int orbitTcs = -1;
343 int orbitEvmFdl = -1;
349 const int lsNumber =
iEvent.luminosityBlock();
355 if (!gtEvmReadoutRecord.
isValid()) {
356 edm::LogInfo(
"L1TGT") <<
"can't find L1GlobalTriggerEvmReadoutRecord";
363 gtfeEvmBx = gtfeEvmWord.
bxNr();
371 tcsBx = tcsWord.
bxNr();
384 static_cast<double>(tcsWord.
eventNr()) / static_cast<double>(tcsWord.
partTrigNr()));
404 edm::LogInfo(
"L1TGT") <<
" check mode = " <<
beam <<
" momentum " << momentum <<
" int2 " << intensity2
409 uint64_t gpshi = (gpsr >> 32) & 0xffffffff;
411 uint64_t gps = gpshi * 1000000 + gpslo;
414 Long64_t delorb = orbitTcs -
preOrb_;
415 Long64_t delgps = gps -
preGps_;
419 freq = ((Double_t)(delorb)) * 3564. / ((Double_t)(delgps));
428 edm::LogInfo(
"L1TGT") <<
" preOrb_ = " <<
preOrb_ <<
" orbitTcs=" << orbitTcs <<
" delorb=" << delorb
430 <<
" delgps=" << delgps <<
" freq=" << freq << std::endl;
443 orbitEvmFdl = fdlWord.
orbitNr();
447 if ((orbitTcs >= 0) && (orbitEvmFdl >= 0)) {
448 int diffOrbit =
static_cast<float>(orbitTcs - orbitEvmFdl);
449 edm::LogInfo(
"L1TGT") <<
"\n orbitTcs = " << orbitTcs <<
" orbitEvmFdl = " << orbitEvmFdl
450 <<
" diffOrbit = " << diffOrbit <<
" orbitEvent = " <<
iEvent.orbitNumber() << std::endl;
467 }
else if (orbitEvmFdl >= 0) {
478 if ((lsTcs >= 0) && (lsEvmFdl >= 0)) {
479 int diffLs =
static_cast<float>(lsTcs - lsEvmFdl);
480 edm::LogInfo(
"L1TGT") <<
"\n lsTcs = " << lsTcs <<
" lsEvmFdl = " << lsEvmFdl <<
" diffLs = " << diffLs
481 <<
" lsEvent = " << lsNumber << std::endl;
498 }
else if (lsEvmFdl >= 0) {
519 if (!gtReadoutRecord.
isValid()) {
520 edm::LogInfo(
"L1TGT") <<
"can't find L1GlobalTriggerReadoutRecord";
524 if (gtReadoutRecord.
isValid()) {
525 unsigned int NmaxL1AlgoBit = gtReadoutRecord->
decisionWord().size();
531 const std::vector<L1GtFdlWord>& m_gtFdlWord(gtReadoutRecord->
gtFdlVector());
532 int numberBxInEvent = m_gtFdlWord.size();
533 int minBxInEvent = (numberBxInEvent + 1) / 2 - numberBxInEvent;
535 for (
unsigned int iBit = 0; iBit < NmaxL1AlgoBit; ++iBit) {
536 bool accept = dWord[iBit];
547 for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin(); itBx != m_gtFdlWord.end(); ++itBx) {
549 bool accept = dWordBX[iBit];
564 for (
unsigned int iBit = 0; iBit < NmaxL1TechBit; ++iBit) {
565 bool accept = technicalTriggerWordBeforeMask[iBit];
575 for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin(); itBx != m_gtFdlWord.end(); ++itBx) {
576 const DecisionWord dWordBX = (*itBx).gtTechnicalTriggerWord();
577 bool accept = dWordBX[iBit];
587 int fdlBx[2] = {-1, -1};
588 int psbBx[2][7] = {{-1, -1, -1, -1, -1, -1, -1}, {-1, -1, -1, -1, -1, -1, -1}};
593 gtfeBx = gtfeWord.
bxNr();
603 if (gmtReadoutCollection.
isValid()) {
611 fdlBx[0] = fdlWord.
bxNr();
619 DecisionWord::const_iterator GTdbitItr;
621 for (GTdbitItr = gtDecisionWord.begin(); GTdbitItr != gtDecisionWord.end(); GTdbitItr++) {
626 DecisionWord::const_iterator GTdbitItr1;
627 for (GTdbitItr1 = gtDecisionWord.begin(); GTdbitItr1 != gtDecisionWord.end(); GTdbitItr1++) {
633 TechnicalTriggerWord::const_iterator GTtbitItr1;
634 for (GTtbitItr1 = gtTTWord.begin(); GTtbitItr1 != gtTTWord.end(); GTtbitItr1++) {
644 TechnicalTriggerWord::const_iterator GTtbitItr;
646 for (GTtbitItr = gtTTWord.begin(); GTtbitItr != gtTTWord.end(); GTtbitItr++) {
651 TechnicalTriggerWord::const_iterator GTtbitItr1;
652 for (GTtbitItr1 = gtTTWord.begin(); GTtbitItr1 != gtTTWord.end(); GTtbitItr1++) {
673 std::pair<int, int> pairLsPfi = std::make_pair(lsNumber, pfIndexAlgoTrig);
685 int psbID[7] = {0xbb09, 0xbb0d, 0xbb0e, 0xbb0f, 0xbb13, 0xbb14, 0xbb15};
686 for (
int i = 0;
i < 7;
i++) {
687 if (
isActive(gtfeActiveBoards, ibit)) {
689 psbBx[0][
i] = psbWord.
bxNr();
700 for (
int i = 0;
i < 2;
i++) {
704 for (
int j = 0;
j < 7;
j++) {
705 for (
int i = 0;
i < 2;
i++) {
706 if (psbBx[
i][
j] > -1)
730 edm::LogInfo(
"L1TGT") <<
"\n Prescale factor indices used in a LS " << std::endl;
733 edm::LogVerbatim(
"L1TGT") <<
" lsNumber = " << (*cIt).first <<
" pfIndex = " << (*cIt).second << std::endl;
744 int previousLsNumber = -1;
745 int previousPfsIndex = -1;
750 int pfsIndicesPerLs = 1;
752 if ((*cIt).first == previousLsNumber) {
753 if ((*cIt).second != previousPfsIndex) {
754 previousPfsIndex = (*cIt).second;
760 if (previousLsNumber != -1) {
765 previousLsNumber = (*cIt).first;
766 previousPfsIndex = (*cIt).second;
MonitorElement * m_monL1PrescaleFactorSet
const cms_uint32_t orbitNr() const
get/set orbit number
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
Log< level::Info, true > LogVerbatim
MonitorElement * h_L1AlgoBX1
MonitorElement * gpsfreqwide
const cms_uint16_t gtPrescaleFactorIndexAlgo() const
const cms_uint16_t beamMode() const
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
std::map< std::string, bool > l1TriggerDecision
const cms_uint64_t orbitNr() const
get/set orbit number since start of run
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * m_monLsNrDiffTcsFdlEvmLs
const L1GtFdlWord gtFdlWord(int bxInEvent) const
get / set FDL word (record) in the GT readout record
std::vector< std::pair< int, int > >::const_iterator CItVecPair
const cms_uint32_t setupVersion() const
get/set setup version
void analyze(const edm::Event &, const edm::EventSetup &) override
const L1GtfeExtWord gtfeWord() const
get / set GTFE word (record) in the GT readout record
std::string to_string(const V &value)
const cms_uint16_t luminositySegmentNr() const
get/set luminosity segment number
const DecisionWord & decisionWord(int bxInEventValue) const
const L1GtfeWord gtfeWord() const
get / set GTFE word (record) in the GT readout record
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 L1GtFdlWord gtFdlWord(int bxInEventValue) const
get / set FDL word (record) in the GT readout record
const cms_uint16_t localBxNr() const
get/set local bunch cross number of the actual bx
MonitorElement * BST_beamMode
MonitorElement * BST_MasterStatus
const cms_uint16_t bxNr() const
get/set bunch cross number as counted in the TCS chip
const cms_uint16_t bxNr() const
get/set bunch cross number of the actual bx
T getUntrackedParameter(std::string const &, T const &) const
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
MonitorElement * BST_intensityBeam2
MonitorElement * h_L1TechBX
const cms_uint16_t bstMasterStatus() const
MonitorElement * event_number
Container::value_type value_type
const std::vector< L1GtFdlWord > gtFdlVector() const
get the vector of L1GtFdlWord
const cms_uint32_t eventNr() const
get/set event number since last L1 reset generated in TCS chip
const cms_uint32_t turnCountNumber() const
MonitorElement * h_L1AlgoBX3
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
const cms_uint32_t lhcFillNumber() const
std::vector< bool > DecisionWord
typedefs
static const int MaxLsNrDiffTcsFdlEvm
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)
int getBxNr() const
get counters
const TechnicalTriggerWord & technicalTriggerWord(int bxInEventValue) const
std::string m_histFolder
histogram folder for L1 GT plots
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)
MonitorElement * m_monLsNrDiffTcsFdlEvm
std::string algoBitToName[128]
const cms_uint16_t lumiSegmentNr() const
get/set luminosity segment number of the actual bx
MonitorElement * algo_bits
Log< level::Info, false > LogInfo
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
MonitorElement * event_type
MonitorElement * m_monOrbitNrDiffTcsFdlEvmLs
MonitorElement * dbx_module
const cms_uint64_t gpsTime() const
LHC-BOB-ES-0001 (EDMS 638899)
unsigned long long uint64_t
const cms_uint16_t bxNr() const
get/set bunch cross number as counted in the GTFE board
const L1GtPsbWord gtPsbWord(cms_uint16_t boardIdValue, int bxInEventValue) const
get / set PSB word (record) in the GT readout record
MonitorElement * tt_bits_corr
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
bool isActive(int word, int bit)
book all histograms for the module
const cms_uint16_t beamMomentum() const
const cms_uint16_t bxNr() const
get/set BxNr - bunch cross number of the actual bx
MonitorElement * gpsfreqlum
int m_nrEvJob
number of events processed
const cms_uint32_t partTrigNr() const
get/set total number of L1A sent since start of the run to this DAQ partition
const L1TcsWord tcsWord() const
get / set TCS word (record) in the GT readout record
const cms_uint16_t localBxNr() const
get/set local bunch cross number of the actual bx
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtSource_L1GT_
input parameters
MonitorElement * h_L1AlgoBX2
void countPfsIndicesPerLs()
MonitorElement * m_monL1PfIndicesPerLs
std::map< std::string, bool >::iterator trig_iter
MonitorElement * trigger_number
std::vector< std::pair< int, int > > m_pairLsNumberPfIndex
L1MuGMTReadoutRecord const & getRecord(int bx=0) const
const cms_uint32_t totalIntensityBeam2() const
MonitorElement * BST_beamMomentum
MonitorElement * BST_lhcFillNumber
MonitorElement * setupversion_lumi
const cms_uint16_t activeBoards() const
get/set boards contributing to EVM respectively DAQ record
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * BST_turnCountNumber
std::map< std::string, bool > l1TechTriggerDecision
MonitorElement * event_lumi
MonitorElement * tt_bits_lumi
MonitorElement * trigger_lumi
MonitorElement * evnum_trignum_lumi
const cms_uint32_t totalIntensityBeam1() const
const cms_uint16_t triggerType() const
get/set trigger type, identical with event type in CMS header
MonitorElement * algo_tt_bits_corr
std::string techBitToName[64]
edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > l1gtTrigmenuToken_
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)