22 m_runInEventLoop(ps.getUntrackedParameter<
bool>(
"runInEventLoop",
false)),
23 m_runInEndLumi(ps.getUntrackedParameter<
bool>(
"runInEndLumi",
false)),
24 verbose_(ps.getUntrackedParameter<
bool> (
"verbose",
false)),
25 m_nrEvJob(0), m_nrEvRun(0),
26 preGps_(0ULL), preOrb_(0ULL)
46 const int TotalNrBinsLs = 1000;
47 const double totalNrBinsLs =
static_cast<double>(TotalNrBinsLs);
51 algo_bits = ibooker.
book1D(
"algo_bits",
"GT algorithm trigger bits", 128, -0.5, 127.5);
54 algo_bits_corr = ibooker.
book2D(
"algo_bits_corr",
"GT algorithm trigger bit correlation", 128, -0.5, 127.5, 128, -0.5, 127.5);
58 tt_bits = ibooker.
book1D(
"tt_bits",
"GT technical trigger bits", 64, -0.5, 63.5);
62 "GT technical trigger bit correlation",
63 64, -0.5, 63.5, 64, -0.5, 63.5);
68 "GT algorithm - technical trigger bit correlation",
69 128, -0.5, 127.5, 64, -0.5, 63.5);
74 "GT algorithm trigger bit rate per LS",
75 TotalNrBinsLs, 0., totalNrBinsLs, 128, -0.5, 127.5);
80 "GT technical trigger bit rate per LS",
81 TotalNrBinsLs, 0., totalNrBinsLs, 64, -0.5, 63.5);
95 "GT event number (from last resync)",
100 "GT event number (from last resync) vs LS",
101 TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e15,
"s");
106 "GT trigger number (from start run)",
111 "GT trigger number (from start run) vs LS",
112 TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e15,
"s");
117 "GT event/trigger number ratio vs LS",
118 TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 2.,
"s");
123 "GT orbit number vs LS",
124 TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e15,
"s");
129 "GT setup version vs LS",
130 TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e10,
"i");
134 gtfe_bx = ibooker.
book1D(
"gtfe_bx",
"GTFE Bx number", 3600, 0., 3600.);
137 dbx_module = ibooker.
bookProfile(
"dbx_module",
"delta Bx of GT modules wrt GTFE", 20, 0., 20., 100, -4000., 4000.,
"i");
160 BST_MasterStatus = ibooker.
book2D(
"BST_MasterStatus",
"BST master status over LS", TotalNrBinsLs, 0., totalNrBinsLs, 6, -1., 5.);
166 BST_turnCountNumber = ibooker.
book2D(
"BST_turnCountNumber",
"BST turn count over LS", TotalNrBinsLs, 0., totalNrBinsLs, 250, 0., 4.3e9);
173 BST_beamMode = ibooker.
book2D(
"BST_beamMode",
"BST beam mode over LS", TotalNrBinsLs, 0., totalNrBinsLs, 25, 1., 26.);
198 BST_beamMomentum = ibooker.
book2D(
"BST_beamMomentum",
"BST beam momentum", TotalNrBinsLs, 0., totalNrBinsLs, 100, 0., 7200.);
202 gpsfreq = ibooker.
book1D(
"gpsfreq",
"Clock frequency measured by GPS", 1000, 39.95, 40.2);
205 gpsfreqwide = ibooker.
book1D(
"gpsfreqwide",
"Clock frequency measured by GPS", 1000, -2., 200.);
208 gpsfreqlum = ibooker.
book2D(
"gpsfreqlum",
"Clock frequency measured by GPS", TotalNrBinsLs, 0., totalNrBinsLs, 100, 39.95, 40.2);
212 BST_intensityBeam1 = ibooker.
book2D(
"BST_intensityBeam1",
"Intensity beam 1", TotalNrBinsLs, 0., totalNrBinsLs, 1000, 0., 5000.);
216 BST_intensityBeam2 = ibooker.
book2D(
"BST_intensityBeam2",
"Intensity beam 2", TotalNrBinsLs, 0., totalNrBinsLs, 1000, 0., 5000.);
222 m_monL1PrescaleFactorSet = ibooker.
book2D(
"L1PrescaleFactorSet",
"Index of L1 prescale factor set", TotalNrBinsLs, 0., totalNrBinsLs, 25, 0., 25.);
264 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);
265 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);
266 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);
267 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);
268 h_L1TechBX = ibooker.
book2D(
"h_L1TechBX",
"L1 Tech Trigger BX", 64, -0.5, 63.5, 5, -2.5, 2.5);
271 int itrig = (
algo->second).algoBitNumber();
279 }
else if (itrig < 64) {
284 }
else if (itrig < 96) {
289 }
else if (itrig < 128) {
299 int itrig = (techTrig->second).algoBitNumber();
321 edm::LogInfo(
"L1TGT") <<
"L1TGT: analyze...." << std::endl;
328 long long int orbitTcs = -1;
329 int orbitEvmFdl = -1;
341 if (!gtEvmReadoutRecord.
isValid()) {
343 <<
"can't find L1GlobalTriggerEvmReadoutRecord";
351 gtfeEvmBx = gtfeEvmWord.
bxNr();
359 tcsBx = tcsWord.
bxNr();
372 static_cast<double>(tcsWord.
eventNr()) / static_cast<double>(tcsWord.
partTrigNr()));
377 boost::uint16_t beam = gtfeEvmExtWord.
beamMode();
378 boost::uint16_t momentum = gtfeEvmExtWord.
beamMomentum();
392 edm::LogInfo(
"L1TGT") <<
" check mode = " << beam <<
" momentum " << momentum
393 <<
" int2 " << intensity2 << std::endl;
402 Long64_t delorb = orbitTcs -
preOrb_;
403 Long64_t delgps = gps -
preGps_;
407 freq = ((Double_t)(delorb)) * 3564. / ((Double_t)(delgps));
416 edm::LogInfo(
"L1TGT") <<
" preOrb_ = " << preOrb_ <<
" orbitTcs=" << orbitTcs
417 <<
" delorb=" << delorb << std::hex <<
" preGps_=" 418 << preGps_ <<
" gps=" << gps <<
std::dec 419 <<
" delgps=" << delgps <<
" freq=" << freq
435 orbitEvmFdl = fdlWord.
orbitNr();
439 if ((orbitTcs >= 0) && (orbitEvmFdl >= 0)) {
441 int diffOrbit =
static_cast<float> (orbitTcs - orbitEvmFdl);
442 edm::LogInfo(
"L1TGT") <<
"\n orbitTcs = " << orbitTcs <<
" orbitEvmFdl = " 443 << orbitEvmFdl <<
" diffOrbit = " << diffOrbit
444 <<
" orbitEvent = " << iEvent.
orbitNumber() << std::endl;
463 }
else if (orbitEvmFdl >= 0) {
474 if ((lsTcs >= 0) && (lsEvmFdl >= 0)) {
476 int diffLs =
static_cast<float> (lsTcs - lsEvmFdl);
477 edm::LogInfo(
"L1TGT") <<
"\n lsTcs = " << lsTcs <<
" lsEvmFdl = " << lsEvmFdl
478 <<
" diffLs = " << diffLs <<
" lsEvent = " 479 << lsNumber << std::endl;
498 }
else if (lsEvmFdl >= 0) {
519 if (!gtReadoutRecord.
isValid()) {
521 <<
"can't find L1GlobalTriggerReadoutRecord";
525 if(gtReadoutRecord.
isValid()) {
527 unsigned int NmaxL1AlgoBit = gtReadoutRecord->
decisionWord().size();
533 const std::vector<L1GtFdlWord> &m_gtFdlWord(gtReadoutRecord->
gtFdlVector());
534 int numberBxInEvent=m_gtFdlWord.size();
535 int minBxInEvent = (numberBxInEvent + 1)/2 - numberBxInEvent;
537 for (
unsigned int iBit = 0; iBit < NmaxL1AlgoBit; ++iBit) {
538 bool accept = dWord[iBit];
549 for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin(); itBx != m_gtFdlWord.end(); ++itBx) {
552 bool accept = dWordBX[iBit];
567 for (
unsigned int iBit = 0; iBit < NmaxL1TechBit; ++iBit) {
568 bool accept = technicalTriggerWordBeforeMask[iBit];
579 for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin();
580 itBx != m_gtFdlWord.end(); ++itBx) {
582 const DecisionWord dWordBX = (*itBx).gtTechnicalTriggerWord();
583 bool accept = dWordBX[iBit];
592 int fdlBx[2] = { -1, -1 };
593 int psbBx[2][7] = { { -1, -1, -1, -1, -1, -1, -1 }, { -1, -1, -1, -1, -1,
599 gtfeBx = gtfeWord.
bxNr();
609 if (gmtReadoutCollection.
isValid()) {
617 fdlBx[0] = fdlWord.
bxNr();
626 DecisionWord::const_iterator GTdbitItr;
628 for (GTdbitItr = gtDecisionWord.begin(); GTdbitItr
629 != gtDecisionWord.end(); GTdbitItr++) {
634 DecisionWord::const_iterator GTdbitItr1;
635 for (GTdbitItr1 = gtDecisionWord.begin(); GTdbitItr1
636 != gtDecisionWord.end(); GTdbitItr1++) {
642 TechnicalTriggerWord::const_iterator GTtbitItr1;
643 for (GTtbitItr1 = gtTTWord.begin(); GTtbitItr1
644 != gtTTWord.end(); GTtbitItr1++) {
654 TechnicalTriggerWord::const_iterator GTtbitItr;
656 for (GTtbitItr = gtTTWord.begin(); GTtbitItr != gtTTWord.end(); GTtbitItr++) {
661 TechnicalTriggerWord::const_iterator GTtbitItr1;
662 for (GTtbitItr1 = gtTTWord.begin(); GTtbitItr1
663 != gtTTWord.end(); GTtbitItr1++) {
679 static_cast<float> (pfIndexAlgoTrig));
686 std::pair<int, int> pairLsPfi = std::make_pair(lsNumber,
703 int psbID[7] = { 0xbb09, 0xbb0d, 0xbb0e, 0xbb0f, 0xbb13, 0xbb14, 0xbb15 };
704 for (
int i = 0;
i < 7;
i++) {
705 if (
isActive(gtfeActiveBoards, ibit)) {
707 psbBx[0][
i] = psbWord.
bxNr();
718 for (
int i = 0;
i < 2;
i++) {
722 for (
int j = 0; j < 7; j++) {
723 for (
int i = 0;
i < 2;
i++) {
724 if (psbBx[
i][j] > -1)
746 if (word & (1 << bit))
755 edm::LogInfo(
"L1TGT") <<
"\n Prescale factor indices used in a LS " 762 <<
" pfIndex = " << (*cIt).second << std::endl;
773 int previousLsNumber = -1;
774 int previousPfsIndex = -1;
782 int pfsIndicesPerLs = 1;
784 if ((*cIt).first == previousLsNumber) {
786 if ((*cIt).second != previousPfsIndex) {
788 previousPfsIndex = (*cIt).second;
794 if (previousLsNumber != -1) {
799 previousLsNumber = (*cIt).first;
800 previousPfsIndex = (*cIt).second;
MonitorElement * m_monL1PrescaleFactorSet
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
Master< F > master(const F &f)
std::map< std::string, bool > l1TechTriggerDecision
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
end section
const TechnicalTriggerWord & technicalTriggerWord(int bxInEventValue) const
const cms_uint64_t orbitNr() const
get/set orbit number since start of run
MonitorElement * bookProfile(Args &&...args)
MonitorElement * m_monLsNrDiffTcsFdlEvmLs
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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
std::vector< std::pair< int, int > > m_pairLsNumberPfIndex
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)
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
std::map< std::string, bool >::iterator trig_iter
const cms_uint16_t beamMomentum() const
const cms_uint16_t bxNr() const
get/set BxNr - bunch cross number of the actual bx
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
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmSource_
input tag for L1 GT EVM readout record
MonitorElement * orbit_lumi
MonitorElement * book1D(Args &&...args)
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
void Reset()
reset ME (ie. contents, errors, etc)
const cms_uint16_t localBxNr() const
get/set local bunch cross number of the actual bx
MonitorElement * algo_bits_lumi
std::map< std::string, bool > l1TriggerDecision
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
void setCurrentFolder(const std::string &fullpath)
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
MonitorElement * book2D(Args &&...args)
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
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
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
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
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_