22 m_runInEventLoop(ps.getUntrackedParameter<bool>(
"runInEventLoop",
false)),
23 m_runInEndLumi(ps.getUntrackedParameter<bool>(
"runInEndLumi",
false)),
24 m_runInEndRun(ps.getUntrackedParameter<bool>(
"runInEndRun",
false)),
25 m_runInEndJob(ps.getUntrackedParameter<bool>(
"runInEndJob",
false)),
26 verbose_(ps.getUntrackedParameter<bool> (
"verbose",
false)),
29 m_nrEvJob(0), m_nrEvRun(0),
30 preGps_(0ULL), preOrb_(0ULL)
38 edm::LogInfo(
"L1TGT") <<
"\n Unable to get DQMStore service.";
71 edm::LogInfo(
"L1TGT") <<
"\n Unable to get DQMStore service.";
106 edm::LogInfo(
"L1TGT") <<
"L1TGT: analyze...." << std::endl;
113 long long int orbitTcs = -1;
114 int orbitEvmFdl = -1;
126 if (!gtEvmReadoutRecord.
isValid()) {
128 <<
"can't find L1GlobalTriggerEvmReadoutRecord";
133 const L1GtfeWord& gtfeEvmWord = gtEvmReadoutRecord->gtfeWord();
134 const L1GtfeExtWord& gtfeEvmExtWord = gtEvmReadoutRecord->gtfeWord();
136 gtfeEvmBx = gtfeEvmWord.
bxNr();
141 const L1TcsWord& tcsWord = gtEvmReadoutRecord->tcsWord();
143 tcsBx = tcsWord.
bxNr();
156 static_cast<double>(tcsWord.
eventNr()) / static_cast<double>(tcsWord.
partTrigNr()));
162 boost::uint16_t momentum = gtfeEvmExtWord.
beamMomentum();
176 edm::LogInfo(
"L1TGT") <<
" check mode = " << beam <<
" momentum " << momentum
177 <<
" int2 " << intensity2 << std::endl;
186 Long64_t delorb = orbitTcs -
preOrb_;
187 Long64_t delgps = gps -
preGps_;
191 freq = ((Double_t)(delorb)) * 3564. / ((Double_t)(delgps));
200 edm::LogInfo(
"L1TGT") <<
" preOrb_ = " << preOrb_ <<
" orbitTcs=" << orbitTcs
201 <<
" delorb=" << delorb << std::hex <<
" preGps_="
202 << preGps_ <<
" gps=" << gps <<
std::dec
203 <<
" delgps=" << delgps <<
" freq=" << freq
217 const L1GtFdlWord& fdlWord = gtEvmReadoutRecord->gtFdlWord();
219 orbitEvmFdl = fdlWord.
orbitNr();
223 if ((orbitTcs >= 0) && (orbitEvmFdl >= 0)) {
225 int diffOrbit =
static_cast<float> (orbitTcs - orbitEvmFdl);
226 edm::LogInfo(
"L1TGT") <<
"\n orbitTcs = " << orbitTcs <<
" orbitEvmFdl = "
227 << orbitEvmFdl <<
" diffOrbit = " << diffOrbit
228 <<
" orbitEvent = " << iEvent.
orbitNumber() << std::endl;
248 }
else if (orbitEvmFdl >= 0) {
259 if ((lsTcs >= 0) && (lsEvmFdl >= 0)) {
261 int diffLs =
static_cast<float> (lsTcs - lsEvmFdl);
262 edm::LogInfo(
"L1TGT") <<
"\n lsTcs = " << lsTcs <<
" lsEvmFdl = " << lsEvmFdl
263 <<
" diffLs = " << diffLs <<
" lsEvent = "
264 << lsNumber << std::endl;
283 }
else if (lsEvmFdl >= 0) {
300 if (!gtReadoutRecord.
isValid()) {
302 <<
"can't find L1GlobalTriggerReadoutRecord";
308 int fdlBx[2] = { -1, -1 };
309 int psbBx[2][7] = { { -1, -1, -1, -1, -1, -1, -1 }, { -1, -1, -1, -1, -1,
314 const L1GtfeWord& gtfeWord = gtReadoutRecord->gtfeWord();
315 gtfeBx = gtfeWord.
bxNr();
325 if (gmtReadoutCollection.
isValid()) {
326 gmtBx = gmtReadoutCollection->getRecord().getBxNr();
332 const L1GtFdlWord& fdlWord = gtReadoutRecord->gtFdlWord();
333 fdlBx[0] = fdlWord.
bxNr();
337 const DecisionWord& gtDecisionWord = gtReadoutRecord->decisionWord();
339 gtReadoutRecord->technicalTriggerWord();
342 DecisionWord::const_iterator GTdbitItr;
344 for (GTdbitItr = gtDecisionWord.begin(); GTdbitItr
345 != gtDecisionWord.end(); GTdbitItr++) {
350 DecisionWord::const_iterator GTdbitItr1;
351 for (GTdbitItr1 = gtDecisionWord.begin(); GTdbitItr1
352 != gtDecisionWord.end(); GTdbitItr1++) {
358 TechnicalTriggerWord::const_iterator GTtbitItr1;
359 for (GTtbitItr1 = gtTTWord.begin(); GTtbitItr1
360 != gtTTWord.end(); GTtbitItr1++) {
370 TechnicalTriggerWord::const_iterator GTtbitItr;
372 for (GTtbitItr = gtTTWord.begin(); GTtbitItr != gtTTWord.end(); GTtbitItr++) {
377 TechnicalTriggerWord::const_iterator GTtbitItr1;
378 for (GTtbitItr1 = gtTTWord.begin(); GTtbitItr1
379 != gtTTWord.end(); GTtbitItr1++) {
395 static_cast<float> (pfIndexAlgoTrig));
402 std::pair<int, int> pairLsPfi = std::make_pair(lsNumber,
419 int psbID[7] = { 0xbb09, 0xbb0d, 0xbb0e, 0xbb0f, 0xbb13, 0xbb14, 0xbb15 };
420 for (
int i = 0;
i < 7;
i++) {
421 if (
isActive(gtfeActiveBoards, ibit)) {
422 L1GtPsbWord psbWord = gtReadoutRecord->gtPsbWord(psbID[
i]);
423 psbBx[0][
i] = psbWord.
bxNr();
434 for (
int i = 0;
i < 2;
i++) {
438 for (
int j = 0;
j < 7;
j++) {
439 for (
int i = 0;
i < 2;
i++) {
440 if (psbBx[
i][
j] > -1)
485 const int TotalNrBinsLs = 1000;
486 const double totalNrBinsLs =
static_cast<double>(TotalNrBinsLs);
495 "GT algorithm trigger bit correlation",
496 128, -0.5, 127.5, 128, -0.5, 127.5);
501 "GT technical trigger bits",
506 "GT technical trigger bit correlation",
507 64, -0.5, 63.5, 64, -0.5, 63.5);
512 "GT algorithm - technical trigger bit correlation",
513 128, -0.5, 127.5, 64, -0.5, 63.5);
518 "GT algorithm trigger bit rate per LS",
519 TotalNrBinsLs, 0., totalNrBinsLs, 128, -0.5, 127.5);
524 "GT technical trigger bit rate per LS",
525 TotalNrBinsLs, 0., totalNrBinsLs, 64, -0.5, 63.5);
539 "GT event number (from last resync)",
544 "GT event number (from last resync) vs LS",
545 TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e15,
"s");
550 "GT trigger number (from start run)",
555 "GT trigger number (from start run) vs LS",
556 TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e15,
"s");
561 "GT event/trigger number ratio vs LS",
562 TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 2.,
"s");
567 "GT orbit number vs LS",
568 TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e15,
"s");
573 "GT setup version vs LS",
574 TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e10,
"i");
582 "delta Bx of GT modules wrt GTFE",
583 20, 0., 20., 100, -4000., 4000.,
"i");
607 "BST master status over LS",
608 TotalNrBinsLs, 0., totalNrBinsLs, 6, -1., 5.);
615 "BST turn count over LS",
616 TotalNrBinsLs, 0., totalNrBinsLs, 250, 0., 4.3e9);
621 "BST LHC fill number % 1000", 1000, 0., 1000.);
625 "BST beam mode over LS",
626 TotalNrBinsLs, 0., totalNrBinsLs, 25, 1., 26.);
653 TotalNrBinsLs, 0., totalNrBinsLs, 100, 0., 7200.);
662 "Clock frequency measured by GPS", 1000, -2., 200.);
666 "Clock frequency measured by GPS",
667 TotalNrBinsLs, 0., totalNrBinsLs, 100, 39.95, 40.2);
673 TotalNrBinsLs, 0., totalNrBinsLs, 1000, 0., 5000.);
679 TotalNrBinsLs, 0., totalNrBinsLs, 1000, 0., 5000.);
686 "Index of L1 prescale factor set",
687 TotalNrBinsLs, 0., totalNrBinsLs, 25, 0., 25.);
692 "Number of prescale factor indices used per LS", 10, 0., 10.);
703 "Orbit number difference (TCS - EVM_FDL)",
711 "LS number difference (TCS - EVM_FDL)",
721 "Orbit number difference (TCS - EVM_FDL)",
722 TotalNrBinsLs, 0., totalNrBinsLs,
730 "LS number difference (TCS - EVM_FDL)",
731 TotalNrBinsLs, 0., totalNrBinsLs,
748 if (word & (1 << bit))
757 edm::LogInfo(
"L1TGT") <<
"\n Prescale factor indices used in a LS "
764 <<
" pfIndex = " << (*cIt).second << std::endl;
775 int previousLsNumber = -1;
776 int previousPfsIndex = -1;
784 int pfsIndicesPerLs = 1;
786 if ((*cIt).first == previousLsNumber) {
788 if ((*cIt).second != previousPfsIndex) {
790 previousPfsIndex = (*cIt).second;
796 if (previousLsNumber != -1) {
801 previousLsNumber = (*cIt).first;
802 previousPfsIndex = (*cIt).second;
MonitorElement * m_monL1PrescaleFactorSet
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * gpsfreqwide
const cms_uint16_t bxNr() const
get/set bunch cross number of the actual bx
const cms_uint64_t orbitNr() const
get/set orbit number since start of run
DQMStore * m_dbe
internal members
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void rmdir(const std::string &fullpath)
MonitorElement * m_monLsNrDiffTcsFdlEvmLs
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< std::pair< int, int > >::const_iterator CItVecPair
const cms_uint64_t gpsTime() const
LHC-BOB-ES-0001 (EDMS 638899)
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)
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
MonitorElement * BST_intensityBeam2
const cms_uint16_t bxNr() const
get/set bunch cross number as counted in the TCS chip
void bookHistograms()
book all histograms for the module
MonitorElement * event_number
std::vector< bool > DecisionWord
typedefs
static const int MaxLsNrDiffTcsFdlEvm
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmSource_
input tag for L1 GT EVM readout record
MonitorElement * orbit_lumi
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
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 beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
const cms_uint16_t activeBoards() const
get/set boards contributing to EVM respectively DAQ record
MonitorElement * m_monLsNrDiffTcsFdlEvm
const cms_uint16_t bxNr() const
get/set bunch cross number as counted in the GTFE board
bool dirExists(const std::string &path) const
true if directory exists
const cms_uint32_t totalIntensityBeam2() const
const cms_uint32_t totalIntensityBeam1() const
MonitorElement * algo_bits
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
virtual void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
end section
const cms_uint32_t lhcFillNumber() const
MonitorElement * tt_bits_corr
virtual void endRun(const edm::Run &, const edm::EventSetup &)
bool isActive(int word, int bit)
MonitorElement * gpsfreqlum
int m_nrEvJob
number of events processed
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtSource_L1GT_
input parameters
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
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * BST_beamMomentum
MonitorElement * BST_lhcFillNumber
volatile std::atomic< bool > shutdown_flag false
MonitorElement * setupversion_lumi
virtual void analyze(const edm::Event &, const edm::EventSetup &)
const cms_uint32_t turnCountNumber() const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
MonitorElement * BST_turnCountNumber
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
MonitorElement * event_lumi
const cms_uint16_t beamMode() 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
void setCurrentFolder(const std::string &fullpath)
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_