23 gtSource_(ps.getParameter<edm::InputTag> (
"gtSource")),
24 gtEvmSource_(ps.getParameter<edm::InputTag> (
"gtEvmSource")),
25 verbose_(ps.getUntrackedParameter<bool> (
"verbose",
false)),
28 m_nrEvJob(0), m_nrEvRun(0),
29 preGps_(0ULL), preOrb_(0ULL),
39 edm::LogInfo(
"L1TGT") <<
"\n Unable to get DQMStore service.";
72 edm::LogInfo(
"L1TGT") <<
"\n Unable to get DQMStore service.";
107 edm::LogInfo(
"L1TGT") <<
"L1TGT: analyze...." << std::endl;
114 long long int orbitTcs = -1;
115 int orbitEvmFdl = -1;
127 if (!gtEvmReadoutRecord.
isValid()) {
129 <<
"can't find L1GlobalTriggerEvmReadoutRecord with label "
135 const L1GtfeWord& gtfeEvmWord = gtEvmReadoutRecord->gtfeWord();
136 const L1GtfeExtWord& gtfeEvmExtWord = gtEvmReadoutRecord->gtfeWord();
138 gtfeEvmBx = gtfeEvmWord.
bxNr();
143 const L1TcsWord& tcsWord = gtEvmReadoutRecord->tcsWord();
145 tcsBx = tcsWord.
bxNr();
163 boost::uint16_t beam = gtfeEvmExtWord.
beamMode();
164 boost::uint16_t momentum = gtfeEvmExtWord.
beamMomentum();
178 edm::LogInfo(
"L1TGT") <<
" check mode = " << beam <<
" momentum " << momentum
179 <<
" int2 " << intensity2 << std::endl;
188 Long64_t delorb = orbitTcs -
preOrb_;
189 Long64_t delgps = gps -
preGps_;
193 freq = ((Double_t)(delorb)) * 3564. / ((Double_t)(delgps));
202 edm::LogInfo(
"L1TGT") <<
" preOrb_ = " << preOrb_ <<
" orbitTcs=" << orbitTcs
203 <<
" delorb=" << delorb << std::hex <<
" preGps_="
204 << preGps_ <<
" gps=" << gps << std::dec
205 <<
" delgps=" << delgps <<
" freq=" << freq
219 const L1GtFdlWord& fdlWord = gtEvmReadoutRecord->gtFdlWord();
221 orbitEvmFdl = fdlWord.
orbitNr();
225 if ((orbitTcs >= 0) && (orbitEvmFdl >= 0)) {
227 int diffOrbit =
static_cast<float> (orbitTcs - orbitEvmFdl);
228 edm::LogInfo(
"L1TGT") <<
"\n orbitTcs = " << orbitTcs <<
" orbitEvmFdl = "
229 << orbitEvmFdl <<
" diffOrbit = " << diffOrbit
230 <<
" orbitEvent = " << iEvent.
orbitNumber() << std::endl;
250 }
else if (orbitEvmFdl >= 0) {
261 if ((lsTcs >= 0) && (lsEvmFdl >= 0)) {
263 int diffLs =
static_cast<float> (lsTcs - lsEvmFdl);
264 edm::LogInfo(
"L1TGT") <<
"\n lsTcs = " << lsTcs <<
" lsEvmFdl = " << lsEvmFdl
265 <<
" diffLs = " << diffLs <<
" lsEvent = "
266 << lsNumber << std::endl;
285 }
else if (lsEvmFdl >= 0) {
302 if (!gtReadoutRecord.
isValid()) {
304 <<
"can't find L1GlobalTriggerReadoutRecord with label "
311 int fdlBx[2] = { -1, -1 };
312 int psbBx[2][7] = { { -1, -1, -1, -1, -1, -1, -1 }, { -1, -1, -1, -1, -1,
317 const L1GtfeWord& gtfeWord = gtReadoutRecord->gtfeWord();
318 gtfeBx = gtfeWord.
bxNr();
328 if (gmtReadoutCollection.
isValid()) {
329 gmtBx = gmtReadoutCollection->getRecord().getBxNr();
335 const L1GtFdlWord& fdlWord = gtReadoutRecord->gtFdlWord();
336 fdlBx[0] = fdlWord.
bxNr();
340 const DecisionWord& gtDecisionWord = gtReadoutRecord->decisionWord();
342 gtReadoutRecord->technicalTriggerWord();
345 DecisionWord::const_iterator GTdbitItr;
347 for (GTdbitItr = gtDecisionWord.begin(); GTdbitItr
348 != gtDecisionWord.end(); GTdbitItr++) {
353 DecisionWord::const_iterator GTdbitItr1;
354 for (GTdbitItr1 = gtDecisionWord.begin(); GTdbitItr1
355 != gtDecisionWord.end(); GTdbitItr1++) {
361 TechnicalTriggerWord::const_iterator GTtbitItr1;
362 for (GTtbitItr1 = gtTTWord.begin(); GTtbitItr1
363 != gtTTWord.end(); GTtbitItr1++) {
373 TechnicalTriggerWord::const_iterator GTtbitItr;
375 for (GTtbitItr = gtTTWord.begin(); GTtbitItr != gtTTWord.end(); GTtbitItr++) {
380 TechnicalTriggerWord::const_iterator GTtbitItr1;
381 for (GTtbitItr1 = gtTTWord.begin(); GTtbitItr1
382 != gtTTWord.end(); GTtbitItr1++) {
398 static_cast<float> (pfIndexAlgoTrig));
405 std::pair<int, int> pairLsPfi = std::make_pair(lsNumber,
424 int psbID[7] = { 0xbb09, 0xbb0d, 0xbb0e, 0xbb0f, 0xbb13, 0xbb14, 0xbb15 };
425 for (
int i = 0;
i < 7;
i++) {
426 if (
isActive(gtfeActiveBoards, ibit)) {
427 L1GtPsbWord psbWord = gtReadoutRecord->gtPsbWord(psbID[
i]);
428 psbBx[0][
i] = psbWord.
bxNr();
439 for (
int i = 0;
i < 2;
i++) {
443 for (
int j = 0;
j < 7;
j++) {
444 for (
int i = 0;
i < 2;
i++) {
445 if (psbBx[
i][
j] > -1)
460 <<
"\n endLuminosityBlock:: Prescale factor indices used in a LS "
466 <<
" pfIndex = " << (*cIt).second << std::endl;
478 <<
"\n endRun:: Prescale factor indices used in a LS "
484 <<
" pfIndex = " << (*cIt).second << std::endl;
507 const int TotalNrBinsLs = 1000;
508 const double totalNrBinsLs =
static_cast<double>(TotalNrBinsLs);
517 "GT algo bit correlation",
518 128, -0.5, 127.5, 128, -0.5, 127.5);
523 "GT technical trigger bits",
528 "GT tech. trig. bit correlation",
529 64, -0.5, 63.5, 64, -0.5, 63.5);
534 "GT algo tech. trig. bit correlation",
535 128, -0.5, 127.5, 64, -0.5, 63.5);
540 "GT algo bit rate per lumi segment",
541 TotalNrBinsLs, 0., totalNrBinsLs, 128, -0.5, 127.5);
546 "GT tech. trig. bit rate per lumi segment",
547 TotalNrBinsLs, 0., totalNrBinsLs, 64, -0.5, 63.5);
561 "GT Event number (from last resync)",
566 "GT Event number (from last resync) vs lumi section",
567 TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e15,
"s");
572 "GT Trigger number (from start run)",
577 "GT Trigger number (from start run) vs lumi section",
578 TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e15,
"s");
583 "GT Event/Trigger number ratio vs lumi section",
584 TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 2.,
"s");
589 "GT orbit number vs lumi section",
590 TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e15,
"s");
595 "GT setup version vs lumi section",
596 TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e10,
"i");
604 "delta Bx of GT modules wrt. GTFE",
605 20, 0., 20., 100, -4000., 4000.,
"i");
629 "BST master status over lumi segment",
630 TotalNrBinsLs, 0., totalNrBinsLs, 6, -1., 5.);
637 "BST turn count over lumi segment",
638 TotalNrBinsLs, 0., totalNrBinsLs, 250, 0., 4.3e9);
643 "BST LHC fill number % 1000", 1000, 0., 1000.);
647 "BST beam mode over lumi segment",
648 TotalNrBinsLs, 0., totalNrBinsLs, 25, 1., 26.);
675 TotalNrBinsLs, 0., totalNrBinsLs, 100, 0., 7200.);
684 "clock frequency measured by GPS", 1000, -2., 200.);
688 "clock frequency measured by GPS",
689 TotalNrBinsLs, 0., totalNrBinsLs, 100, 39.95, 40.2);
695 TotalNrBinsLs, 0., totalNrBinsLs, 100, 0., 100.);
701 TotalNrBinsLs, 0., totalNrBinsLs, 100, 0., 100.);
708 "Index of L1 prescale factor set",
709 TotalNrBinsLs, 0., totalNrBinsLs, 25, 0., 25.);
714 "Number of prescale factor indices used per LS", 10, 0., 10.);
725 "Orbit number difference (TCS - EVM_FDL)",
733 "LS number difference (TCS - EVM_FDL)",
743 "Orbit number difference (TCS - EVM_FDL)",
744 TotalNrBinsLs, 0., totalNrBinsLs,
752 "LS number difference (TCS - EVM_FDL)",
753 TotalNrBinsLs, 0., totalNrBinsLs,
770 if (word & (1 << bit))
MonitorElement * m_monL1PrescaleFactorSet
Master< F > master(const F &f)
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
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
edm::InputTag gtSource_
input parameters
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
edm::InputTag gtEvmSource_
input tag for L1 GT EVM readout record
std::vector< bool > DecisionWord
typedefs
static const int MaxLsNrDiffTcsFdlEvm
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 &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
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
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)
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)