CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
L1TGT Class Reference

#include <L1TGT.h>

Inheritance diagram for L1TGT:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 L1TGT (const edm::ParameterSet &ps)
 
virtual ~L1TGT ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

enum  activeDAQ {
  FDL = 0, PSB9, PSB13, PSB14,
  PSB15, PSB19, PSB20, PSB21,
  GMT
}
 
enum  activeEVM { TCS, FDLEVM }
 
typedef std::vector< std::pair
< int, int > >::const_iterator 
CItVecPair
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
void bookHistograms ()
 book all histograms for the module More...
 
void countPfsIndicesPerLs ()
 
virtual void endJob ()
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 end section More...
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 
bool isActive (int word, int bit)
 

Private Attributes

MonitorElementalgo_bits
 
MonitorElementalgo_bits_corr
 
MonitorElementalgo_bits_lumi
 
MonitorElementalgo_tt_bits_corr
 
MonitorElementBST_beamMode
 
MonitorElementBST_beamMomentum
 
MonitorElementBST_intensityBeam1
 
MonitorElementBST_intensityBeam2
 
MonitorElementBST_lhcFillNumber
 
MonitorElementBST_MasterStatus
 
MonitorElementBST_turnCountNumber
 
MonitorElementdbx_module
 
MonitorElementevent_lumi
 
MonitorElementevent_number
 
MonitorElementevent_type
 
MonitorElementevnum_trignum_lumi
 
MonitorElementgpsfreq
 
MonitorElementgpsfreqlum
 
MonitorElementgpsfreqwide
 
edm::EDGetTokenT
< L1GlobalTriggerEvmReadoutRecord
gtEvmSource_
 input tag for L1 GT EVM readout record More...
 
MonitorElementgtfe_bx
 
edm::EDGetTokenT
< L1GlobalTriggerReadoutRecord
gtSource_L1GT_
 input parameters More...
 
edm::EDGetTokenT
< L1MuGMTReadoutCollection
gtSource_L1MuGMT_
 
DQMStorem_dbe
 internal members More...
 
std::string m_histFolder
 histogram folder for L1 GT plots More...
 
MonitorElementm_monL1PfIndicesPerLs
 
MonitorElementm_monL1PrescaleFactorSet
 
MonitorElementm_monLsNrDiffTcsFdlEvm
 
MonitorElementm_monLsNrDiffTcsFdlEvmLs
 
MonitorElementm_monOrbitNrDiffTcsFdlEvm
 
MonitorElementm_monOrbitNrDiffTcsFdlEvmLs
 
int m_nrEvJob
 number of events processed More...
 
int m_nrEvRun
 
std::vector< std::pair< int,
int > > 
m_pairLsNumberPfIndex
 
bool m_runInEndJob
 
bool m_runInEndLumi
 
bool m_runInEndRun
 
bool m_runInEventLoop
 switches to choose the running of various methods More...
 
MonitorElementorbit_lumi
 
boost::uint64_t preGps_
 
boost::uint64_t preOrb_
 
MonitorElementsetupversion_lumi
 
MonitorElementtrigger_lumi
 
MonitorElementtrigger_number
 
MonitorElementtt_bits
 
MonitorElementtt_bits_corr
 
MonitorElementtt_bits_lumi
 
bool verbose_
 verbosity switch More...
 

Static Private Attributes

static const int MaxLsNrDiffTcsFdlEvm = 24
 
static const int MaxOrbitNrDiffTcsFdlEvm = 24
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: DQM for L1 Global Trigger.

Author
J. Berryhill, I. Mikulec
Vasile Mihai Ghete - HEPHY Vienna

Definition at line 45 of file L1TGT.h.

Member Typedef Documentation

typedef std::vector<std::pair<int, int> >::const_iterator L1TGT::CItVecPair
private

Definition at line 194 of file L1TGT.h.

Member Enumeration Documentation

enum L1TGT::activeDAQ
private
Enumerator
FDL 
PSB9 
PSB13 
PSB14 
PSB15 
PSB19 
PSB20 
PSB21 
GMT 

Definition at line 87 of file L1TGT.h.

87  {
89  };
enum L1TGT::activeEVM
private
Enumerator
TCS 
FDLEVM 

Definition at line 93 of file L1TGT.h.

93  {
94  TCS, FDLEVM
95  };

Constructor & Destructor Documentation

L1TGT::L1TGT ( const edm::ParameterSet ps)

Definition at line 18 of file L1TGT.cc.

References edm::ParameterSet::getUntrackedParameter(), m_dbe, m_histFolder, m_pairLsNumberPfIndex, cppFunctionSkipper::operator, and AlCaHLTBitMon_QueryRunRegistry::string.

18  :
19  gtSource_L1GT_(consumes<L1GlobalTriggerReadoutRecord>(ps.getParameter<edm::InputTag> ("gtSource"))),
20  gtSource_L1MuGMT_(consumes<L1MuGMTReadoutCollection>(ps.getParameter<edm::InputTag> ("gtSource"))),
21  gtEvmSource_(consumes<L1GlobalTriggerEvmReadoutRecord>(ps.getParameter<edm::InputTag> ("gtEvmSource"))),
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)),
27  m_dbe(0),
28  //
29  m_nrEvJob(0), m_nrEvRun(0),
30  preGps_(0ULL), preOrb_(0ULL)
31 {
32 
34  "L1T/L1TGT");
35 
37  if (m_dbe == 0) {
38  edm::LogInfo("L1TGT") << "\n Unable to get DQMStore service.";
39  } else {
40 
41  m_dbe->setVerbose(0);
43 
44  }
45 
46  // reserve space for 1000 LS
47  m_pairLsNumberPfIndex.reserve(1000);
48 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool m_runInEndRun
Definition: L1TGT.h:116
int m_nrEvRun
Definition: L1TGT.h:184
boost::uint64_t preGps_
Definition: L1TGT.h:189
DQMStore * m_dbe
internal members
Definition: L1TGT.h:180
std::vector< std::pair< int, int > > m_pairLsNumberPfIndex
Definition: L1TGT.h:193
bool verbose_
verbosity switch
Definition: L1TGT.h:121
bool m_runInEventLoop
switches to choose the running of various methods
Definition: L1TGT.h:114
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmSource_
input tag for L1 GT EVM readout record
Definition: L1TGT.h:111
void setVerbose(unsigned level)
Definition: DQMStore.cc:619
std::string m_histFolder
histogram folder for L1 GT plots
Definition: L1TGT.h:187
bool m_runInEndLumi
Definition: L1TGT.h:115
int m_nrEvJob
number of events processed
Definition: L1TGT.h:183
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtSource_L1GT_
input parameters
Definition: L1TGT.h:107
boost::uint64_t preOrb_
Definition: L1TGT.h:190
bool m_runInEndJob
Definition: L1TGT.h:117
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
edm::EDGetTokenT< L1MuGMTReadoutCollection > gtSource_L1MuGMT_
Definition: L1TGT.h:108
L1TGT::~L1TGT ( )
virtual

Definition at line 50 of file L1TGT.cc.

50  {
51 
52  // empty
53 }

Member Function Documentation

void L1TGT::analyze ( const edm::Event iEvent,
const edm::EventSetup evSetup 
)
privatevirtual

get Global Trigger algo and technical trigger bit statistics

Implements edm::EDAnalyzer.

Definition at line 101 of file L1TGT.cc.

References L1GtfeWord::activeBoards(), algo_bits, algo_bits_corr, algo_bits_lumi, algo_tt_bits_corr, EcalCondDBWriter_cfi::beam, L1GtfeExtWord::beamMode(), L1GtfeExtWord::beamMomentum(), BST_beamMode, BST_beamMomentum, BST_intensityBeam1, BST_intensityBeam2, BST_lhcFillNumber, BST_MasterStatus, BST_turnCountNumber, L1GtfeExtWord::bstMasterStatus(), L1TcsWord::bxNr(), L1GtPsbWord::bxNr(), L1GtFdlWord::bxNr(), L1GtfeWord::bxNr(), dbx_module, event_lumi, event_number, event_type, L1TcsWord::eventNr(), evnum_trignum_lumi, FDL, MonitorElement::Fill(), spr::find(), edm::Event::getByToken(), GMT, gpsfreq, gpsfreqlum, gpsfreqwide, L1GtfeExtWord::gpsTime(), gtEvmSource_, gtfe_bx, L1GtFdlWord::gtPrescaleFactorIndexAlgo(), gtSource_L1GT_, gtSource_L1MuGMT_, i, isActive(), edm::HandleBase::isValid(), j, L1GtfeExtWord::lhcFillNumber(), L1GtPsbWord::localBxNr(), L1GtFdlWord::localBxNr(), edm::EventBase::luminosityBlock(), L1TcsWord::luminositySegmentNr(), L1GtFdlWord::lumiSegmentNr(), m_monL1PrescaleFactorSet, m_monLsNrDiffTcsFdlEvm, m_monLsNrDiffTcsFdlEvmLs, m_monOrbitNrDiffTcsFdlEvm, m_monOrbitNrDiffTcsFdlEvmLs, m_nrEvJob, m_pairLsNumberPfIndex, autoMagneticFieldProducer_cfi::master, MaxLsNrDiffTcsFdlEvm, MaxOrbitNrDiffTcsFdlEvm, orbit_lumi, L1TcsWord::orbitNr(), L1GtFdlWord::orbitNr(), edm::EventBase::orbitNumber(), L1TcsWord::partTrigNr(), preGps_, preOrb_, PSB9, L1GtfeWord::setupVersion(), setupversion_lumi, TCS, L1GtfeExtWord::totalIntensityBeam1(), L1GtfeExtWord::totalIntensityBeam2(), trigger_lumi, trigger_number, L1TcsWord::triggerType(), tt_bits, tt_bits_corr, tt_bits_lumi, L1GtfeExtWord::turnCountNumber(), and verbose_.

101  {
102 
103  m_nrEvJob++;
104 
105  if (verbose_) {
106  edm::LogInfo("L1TGT") << "L1TGT: analyze...." << std::endl;
107  }
108 
109  // initialize Bx, orbit number, luminosity segment number to invalid value
110  int tcsBx = -1;
111  int gtfeEvmBx = -1;
112 
113  long long int orbitTcs = -1;
114  int orbitEvmFdl = -1;
115 
116  int lsTcs = -1;
117  int lsEvmFdl = -1;
118 
119  // get once only the LS block number, to be used in many histograms
120  const int lsNumber = iEvent.luminosityBlock();
121 
122  // open EVM readout record if available
124  iEvent.getByToken(gtEvmSource_, gtEvmReadoutRecord);
125 
126  if (!gtEvmReadoutRecord.isValid()) {
127  edm::LogInfo("L1TGT")
128  << "can't find L1GlobalTriggerEvmReadoutRecord";
129  } else {
130 
131  // get all info from the EVM record if available and fill the histograms
132 
133  const L1GtfeWord& gtfeEvmWord = gtEvmReadoutRecord->gtfeWord();
134  const L1GtfeExtWord& gtfeEvmExtWord = gtEvmReadoutRecord->gtfeWord();
135 
136  gtfeEvmBx = gtfeEvmWord.bxNr();
137  int gtfeEvmActiveBoards = gtfeEvmWord.activeBoards();
138 
139  if (isActive(gtfeEvmActiveBoards, TCS)) { // if TCS present in the record
140 
141  const L1TcsWord& tcsWord = gtEvmReadoutRecord->tcsWord();
142 
143  tcsBx = tcsWord.bxNr();
144  orbitTcs = tcsWord.orbitNr();
145  lsTcs = tcsWord.luminositySegmentNr();
146 
147  event_type->Fill(tcsWord.triggerType());
148  orbit_lumi->Fill(lsNumber, orbitTcs);
149 
150  trigger_number->Fill(tcsWord.partTrigNr());
151  event_number->Fill(tcsWord.eventNr());
152 
153  trigger_lumi->Fill(lsNumber, tcsWord.partTrigNr());
154  event_lumi->Fill(lsNumber, tcsWord.eventNr());
155  evnum_trignum_lumi->Fill(lsNumber,
156  static_cast<double>(tcsWord.eventNr()) / static_cast<double>(tcsWord.partTrigNr()));
157 
158  boost::uint16_t master = gtfeEvmExtWord.bstMasterStatus();
159  boost::uint32_t turnCount = gtfeEvmExtWord.turnCountNumber();
160  boost::uint32_t lhcFill = gtfeEvmExtWord.lhcFillNumber();
161  boost::uint16_t beam = gtfeEvmExtWord.beamMode();
162  boost::uint16_t momentum = gtfeEvmExtWord.beamMomentum();
163  boost::uint32_t intensity1 = gtfeEvmExtWord.totalIntensityBeam1();
164  boost::uint32_t intensity2 = gtfeEvmExtWord.totalIntensityBeam2();
165 
166  BST_MasterStatus->Fill(lsNumber, static_cast<double>(master));
167  BST_turnCountNumber->Fill(lsNumber, static_cast<double>(turnCount));
168  BST_lhcFillNumber->Fill(static_cast<double>(lhcFill % 1000));
169  BST_beamMode->Fill(lsNumber, static_cast<double>(beam));
170 
171  BST_beamMomentum->Fill(lsNumber, static_cast<double>(momentum));
172  BST_intensityBeam1->Fill(lsNumber, static_cast<double>(intensity1));
173  BST_intensityBeam2->Fill(lsNumber, static_cast<double>(intensity2));
174 
175  if (verbose_) {
176  edm::LogInfo("L1TGT") << " check mode = " << beam << " momentum " << momentum
177  << " int2 " << intensity2 << std::endl;
178  }
179 
180  boost::uint64_t gpsr = gtfeEvmExtWord.gpsTime();
181  boost::uint64_t gpshi = (gpsr >> 32) & 0xffffffff;
182  boost::uint64_t gpslo = gpsr & 0xffffffff;
183  boost::uint64_t gps = gpshi * 1000000 + gpslo;
184  // edm::LogInfo("L1TGT") << " gpsr = " << std::hex << gpsr << " hi=" << gpshi << " lo=" << gpslo << " gps=" << gps << std::endl;
185 
186  Long64_t delorb = orbitTcs - preOrb_;
187  Long64_t delgps = gps - preGps_;
188  Double_t freq = -1.;
189 
190  if (delgps > 0) {
191  freq = ((Double_t)(delorb)) * 3564. / ((Double_t)(delgps));
192  }
193 
194  if (delorb > 0) {
195  gpsfreq->Fill(freq);
196  gpsfreqwide->Fill(freq);
197  gpsfreqlum->Fill(lsNumber, freq);
198  if (verbose_) {
199  if (freq > 200.) {
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
204  << std::endl;
205 
206  }
207  }
208  }
209 
210  preGps_ = gps;
211  preOrb_ = orbitTcs;
212 
213  }
214 
215  // get info from FDL if active
216  if (isActive(gtfeEvmActiveBoards, FDL)) {
217  const L1GtFdlWord& fdlWord = gtEvmReadoutRecord->gtFdlWord();
218 
219  orbitEvmFdl = fdlWord.orbitNr();
220  lsEvmFdl = fdlWord.lumiSegmentNr();
221  }
222 
223  if ((orbitTcs >= 0) && (orbitEvmFdl >= 0)) {
224 
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;
229 
230  if (diffOrbit >= MaxOrbitNrDiffTcsFdlEvm) {
232 
233  } else if (diffOrbit <= -MaxOrbitNrDiffTcsFdlEvm) {
235 
236  } else {
237  m_monOrbitNrDiffTcsFdlEvm->Fill(diffOrbit);
239  diffOrbit);
240 
241  }
242 
243  } else {
244 
245  if (orbitTcs >= 0) {
246  // EVM_FDL error
248  } else if (orbitEvmFdl >= 0) {
249  // TCS error
251 
252  } else {
253  // TCS and EVM_FDL error
256  }
257  }
258 
259  if ((lsTcs >= 0) && (lsEvmFdl >= 0)) {
260 
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;
265 
266  if (diffLs >= MaxLsNrDiffTcsFdlEvm) {
268 
269  } else if (diffLs <= -MaxLsNrDiffTcsFdlEvm) {
271 
272  } else {
273  m_monLsNrDiffTcsFdlEvm->Fill(diffLs);
274  m_monLsNrDiffTcsFdlEvmLs->Fill(lsNumber, diffLs);
275 
276  }
277 
278  } else {
279 
280  if (lsTcs >= 0) {
281  // EVM_FDL error
283  } else if (lsEvmFdl >= 0) {
284  // TCS error
286 
287  } else {
288  // TCS and EVM_FDL error
291  }
292  }
293 
294  }
295 
296  // open GT DAQ readout record - exit if failed
298  iEvent.getByToken(gtSource_L1GT_, gtReadoutRecord);
299 
300  if (!gtReadoutRecord.isValid()) {
301  edm::LogInfo("L1TGT")
302  << "can't find L1GlobalTriggerReadoutRecord";
303  return;
304  }
305 
306  // initialize bx's to invalid value
307  int gtfeBx = -1;
308  int fdlBx[2] = { -1, -1 };
309  int psbBx[2][7] = { { -1, -1, -1, -1, -1, -1, -1 }, { -1, -1, -1, -1, -1,
310  -1, -1 } };
311  int gmtBx = -1;
312 
313  // get info from GTFE DAQ record
314  const L1GtfeWord& gtfeWord = gtReadoutRecord->gtfeWord();
315  gtfeBx = gtfeWord.bxNr();
316  gtfe_bx->Fill(gtfeBx);
317  setupversion_lumi->Fill(lsNumber, gtfeWord.setupVersion());
318  int gtfeActiveBoards = gtfeWord.activeBoards();
319 
320  // look for GMT readout collection from the same source if GMT active
321  if (isActive(gtfeActiveBoards, GMT)) {
322  edm::Handle<L1MuGMTReadoutCollection> gmtReadoutCollection;
323  iEvent.getByToken(gtSource_L1MuGMT_, gmtReadoutCollection);
324 
325  if (gmtReadoutCollection.isValid()) {
326  gmtBx = gmtReadoutCollection->getRecord().getBxNr();
327  }
328  }
329 
330  // get info from FDL if active (including decision word)
331  if (isActive(gtfeActiveBoards, FDL)) {
332  const L1GtFdlWord& fdlWord = gtReadoutRecord->gtFdlWord();
333  fdlBx[0] = fdlWord.bxNr();
334  fdlBx[1] = fdlWord.localBxNr();
335 
337  const DecisionWord& gtDecisionWord = gtReadoutRecord->decisionWord();
338  const TechnicalTriggerWord& gtTTWord =
339  gtReadoutRecord->technicalTriggerWord();
340 
341  int dbitNumber = 0;
342  DecisionWord::const_iterator GTdbitItr;
343  algo_bits->Fill(-1.); // fill underflow to normalize
344  for (GTdbitItr = gtDecisionWord.begin(); GTdbitItr
345  != gtDecisionWord.end(); GTdbitItr++) {
346  if (*GTdbitItr) {
347  algo_bits->Fill(dbitNumber);
348  algo_bits_lumi->Fill(lsNumber, dbitNumber);
349  int dbitNumber1 = 0;
350  DecisionWord::const_iterator GTdbitItr1;
351  for (GTdbitItr1 = gtDecisionWord.begin(); GTdbitItr1
352  != gtDecisionWord.end(); GTdbitItr1++) {
353  if (*GTdbitItr1)
354  algo_bits_corr->Fill(dbitNumber, dbitNumber1);
355  dbitNumber1++;
356  }
357  int tbitNumber1 = 0;
358  TechnicalTriggerWord::const_iterator GTtbitItr1;
359  for (GTtbitItr1 = gtTTWord.begin(); GTtbitItr1
360  != gtTTWord.end(); GTtbitItr1++) {
361  if (*GTtbitItr1)
362  algo_tt_bits_corr->Fill(dbitNumber, tbitNumber1);
363  tbitNumber1++;
364  }
365  }
366  dbitNumber++;
367  }
368 
369  int tbitNumber = 0;
370  TechnicalTriggerWord::const_iterator GTtbitItr;
371  tt_bits->Fill(-1.); // fill underflow to normalize
372  for (GTtbitItr = gtTTWord.begin(); GTtbitItr != gtTTWord.end(); GTtbitItr++) {
373  if (*GTtbitItr) {
374  tt_bits->Fill(tbitNumber);
375  tt_bits_lumi->Fill(lsNumber, tbitNumber);
376  int tbitNumber1 = 0;
377  TechnicalTriggerWord::const_iterator GTtbitItr1;
378  for (GTtbitItr1 = gtTTWord.begin(); GTtbitItr1
379  != gtTTWord.end(); GTtbitItr1++) {
380  if (*GTtbitItr1)
381  tt_bits_corr->Fill(tbitNumber, tbitNumber1);
382  tbitNumber1++;
383  }
384  }
385  tbitNumber++;
386  }
387 
388 
389  // fill the index of actual prescale factor set
390  // the index for technical triggers and algorithm trigger is the same (constraint in L1 GT TS)
391  // so we read only pfIndexAlgoTrig (boost::uint16_t)
392 
393  const int pfIndexAlgoTrig = fdlWord.gtPrescaleFactorIndexAlgo();
394  m_monL1PrescaleFactorSet->Fill(lsNumber,
395  static_cast<float> (pfIndexAlgoTrig));
396 
397  //
398 
399  // check that the combination (lsNumber, pfIndex) is not already included
400  // to avoid fake entries due to different event order
401 
402  std::pair<int, int> pairLsPfi = std::make_pair(lsNumber,
403  pfIndexAlgoTrig);
404 
405  CItVecPair cIt = find(m_pairLsNumberPfIndex.begin(),
406  m_pairLsNumberPfIndex.end(), pairLsPfi);
407 
408  if (cIt == m_pairLsNumberPfIndex.end()) {
409 
410  m_pairLsNumberPfIndex.push_back(pairLsPfi);
411 
412  }
413 
414  }
415 
416  // get info from active PSB's
417  int ibit = PSB9; // first psb
418  // for now hardcode psb id's - TODO - get them from Vasile's board maps...
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();
424  psbBx[1][i] = psbWord.localBxNr();
425  }
426  ibit++;
427  }
428 
429  //fill the dbx histo
430  if (gtfeEvmBx > -1)
431  dbx_module->Fill(0., gtfeEvmBx - gtfeBx);
432  if (tcsBx > -1)
433  dbx_module->Fill(1., tcsBx - gtfeBx);
434  for (int i = 0; i < 2; i++) {
435  if (fdlBx[i] > -1)
436  dbx_module->Fill(2. + i, fdlBx[i] - gtfeBx);
437  }
438  for (int j = 0; j < 7; j++) {
439  for (int i = 0; i < 2; i++) {
440  if (psbBx[i][j] > -1)
441  dbx_module->Fill(4. + i + 2 * j, psbBx[i][j] - gtfeBx);
442  }
443  }
444  if (gmtBx > -1)
445  dbx_module->Fill(18., gmtBx - gtfeBx);
446 
447 }
MonitorElement * m_monL1PrescaleFactorSet
Definition: L1TGT.h:156
MonitorElement * gpsfreqwide
Definition: L1TGT.h:153
const cms_uint16_t bxNr() const
get/set bunch cross number of the actual bx
Definition: L1GtPsbWord.h:108
int i
Definition: DBlmapReader.cc:9
boost::uint64_t preGps_
Definition: L1TGT.h:189
const cms_uint64_t orbitNr() const
get/set orbit number since start of run
Definition: L1TcsWord.h:266
MonitorElement * m_monLsNrDiffTcsFdlEvmLs
Definition: L1TGT.h:172
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
std::vector< std::pair< int, int > >::const_iterator CItVecPair
Definition: L1TGT.h:194
const cms_uint64_t gpsTime() const
LHC-BOB-ES-0001 (EDMS 638899)
std::vector< std::pair< int, int > > m_pairLsNumberPfIndex
Definition: L1TGT.h:193
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
const cms_uint16_t luminositySegmentNr() const
get/set luminosity segment number
Definition: L1TcsWord.h:166
MonitorElement * BST_intensityBeam1
Definition: L1TGT.h:150
static const int MaxOrbitNrDiffTcsFdlEvm
Definition: L1TGT.h:168
MonitorElement * algo_bits_corr
Definition: L1TGT.h:126
MonitorElement * tt_bits
Definition: L1TGT.h:127
bool verbose_
verbosity switch
Definition: L1TGT.h:121
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
const cms_uint16_t bstMasterStatus() const
MonitorElement * gtfe_bx
Definition: L1TGT.h:142
const cms_uint32_t partTrigNr() const
get/set total number of L1A sent since start of the run to this DAQ partition
Definition: L1TcsWord.h:226
MonitorElement * BST_beamMode
Definition: L1TGT.h:148
void Fill(long long x)
MonitorElement * BST_MasterStatus
Definition: L1TGT.h:145
const cms_uint16_t beamMomentum() const
const cms_uint16_t bxNr() const
get/set BxNr - bunch cross number of the actual bx
Definition: L1GtFdlWord.h:110
MonitorElement * BST_intensityBeam2
Definition: L1TGT.h:151
const cms_uint16_t bxNr() const
get/set bunch cross number as counted in the TCS chip
Definition: L1TcsWord.h:87
MonitorElement * event_number
Definition: L1TGT.h:134
std::vector< bool > DecisionWord
typedefs
static const int MaxLsNrDiffTcsFdlEvm
Definition: L1TGT.h:169
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmSource_
input tag for L1 GT EVM readout record
Definition: L1TGT.h:111
MonitorElement * orbit_lumi
Definition: L1TGT.h:139
int j
Definition: DBlmapReader.cc:9
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
int orbitNumber() const
Definition: EventBase.h:63
const cms_uint16_t localBxNr() const
get/set local bunch cross number of the actual bx
Definition: L1GtPsbWord.h:178
bool isValid() const
Definition: HandleBase.h:76
MonitorElement * algo_bits_lumi
Definition: L1TGT.h:130
const cms_uint16_t activeBoards() const
get/set boards contributing to EVM respectively DAQ record
Definition: L1GtfeWord.h:163
MonitorElement * m_monLsNrDiffTcsFdlEvm
Definition: L1TGT.h:160
MonitorElement * gpsfreq
Definition: L1TGT.h:152
const cms_uint16_t bxNr() const
get/set bunch cross number as counted in the GTFE board
Definition: L1GtfeWord.h:122
const cms_uint32_t totalIntensityBeam2() const
const cms_uint32_t totalIntensityBeam1() const
MonitorElement * algo_bits
Definition: L1TGT.h:125
MonitorElement * event_type
Definition: L1TGT.h:132
const cms_uint16_t gtPrescaleFactorIndexAlgo() const
Definition: L1GtFdlWord.h:267
MonitorElement * m_monOrbitNrDiffTcsFdlEvmLs
Definition: L1TGT.h:171
const cms_uint16_t lumiSegmentNr() const
get/set luminosity segment number of the actual bx
Definition: L1GtFdlWord.h:352
MonitorElement * dbx_module
Definition: L1TGT.h:143
unsigned long long uint64_t
Definition: Time.h:15
const cms_uint32_t lhcFillNumber() const
MonitorElement * tt_bits_corr
Definition: L1TGT.h:128
bool isActive(int word, int bit)
Definition: L1TGT.cc:747
MonitorElement * gpsfreqlum
Definition: L1TGT.h:154
int m_nrEvJob
number of events processed
Definition: L1TGT.h:183
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtSource_L1GT_
input parameters
Definition: L1TGT.h:107
const cms_uint16_t triggerType() const
get/set trigger type, identical with event type in CMS header
Definition: L1TcsWord.h:127
const cms_uint32_t eventNr() const
get/set event number since last L1 reset generated in TCS chip
Definition: L1TcsWord.h:246
const cms_uint32_t setupVersion() const
get/set setup version
Definition: L1GtfeWord.h:140
MonitorElement * trigger_number
Definition: L1TGT.h:136
MonitorElement * BST_beamMomentum
Definition: L1TGT.h:149
MonitorElement * BST_lhcFillNumber
Definition: L1TGT.h:147
MonitorElement * setupversion_lumi
Definition: L1TGT.h:140
const cms_uint32_t turnCountNumber() const
MonitorElement * BST_turnCountNumber
Definition: L1TGT.h:146
boost::uint64_t preOrb_
Definition: L1TGT.h:190
MonitorElement * event_lumi
Definition: L1TGT.h:135
const cms_uint16_t beamMode() const
MonitorElement * tt_bits_lumi
Definition: L1TGT.h:131
MonitorElement * trigger_lumi
Definition: L1TGT.h:137
MonitorElement * evnum_trignum_lumi
Definition: L1TGT.h:138
const cms_uint32_t orbitNr() const
get/set orbit number
Definition: L1GtFdlWord.h:332
MonitorElement * algo_tt_bits_corr
Definition: L1TGT.h:129
const cms_uint16_t localBxNr() const
get/set local bunch cross number of the actual bx
Definition: L1GtFdlWord.h:372
MonitorElement * m_monOrbitNrDiffTcsFdlEvm
Definition: L1TGT.h:159
edm::EDGetTokenT< L1MuGMTReadoutCollection > gtSource_L1MuGMT_
Definition: L1TGT.h:108
void L1TGT::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 55 of file L1TGT.cc.

References m_nrEvJob, preGps_, and preOrb_.

55  {
56 
57  m_nrEvJob = 0;
58 
59  preGps_ = 0ULL;
60  preOrb_ = 0ULL;
61 
62 }
boost::uint64_t preGps_
Definition: L1TGT.h:189
int m_nrEvJob
number of events processed
Definition: L1TGT.h:183
boost::uint64_t preOrb_
Definition: L1TGT.h:190
void L1TGT::beginLuminosityBlock ( const edm::LuminosityBlock iLumi,
const edm::EventSetup evSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 92 of file L1TGT.cc.

93  {
94 
95  //
96 
97 }
void L1TGT::beginRun ( const edm::Run iRun,
const edm::EventSetup evSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 64 of file L1TGT.cc.

References bookHistograms(), DQMStore::dirExists(), m_dbe, m_histFolder, m_nrEvRun, m_pairLsNumberPfIndex, cppFunctionSkipper::operator, DQMStore::rmdir(), and DQMStore::setCurrentFolder().

64  {
65 
66  m_nrEvRun = 0;
67 
69 
70  if (m_dbe == 0) {
71  edm::LogInfo("L1TGT") << "\n Unable to get DQMStore service.";
72  } else {
73 
74  // clean up directory
78  }
79 
81 
82  }
83 
84  // book histograms
86 
87  // clear bookkeeping for prescale factor change
88  m_pairLsNumberPfIndex.clear();
89 
90 }
int m_nrEvRun
Definition: L1TGT.h:184
DQMStore * m_dbe
internal members
Definition: L1TGT.h:180
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:3051
std::vector< std::pair< int, int > > m_pairLsNumberPfIndex
Definition: L1TGT.h:193
void bookHistograms()
book all histograms for the module
Definition: L1TGT.cc:483
std::string m_histFolder
histogram folder for L1 GT plots
Definition: L1TGT.h:187
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:720
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
void L1TGT::bookHistograms ( )
private

book all histograms for the module

Definition at line 483 of file L1TGT.cc.

References algo_bits, algo_bits_corr, algo_bits_lumi, algo_tt_bits_corr, DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookProfile(), BST_beamMode, BST_beamMomentum, BST_intensityBeam1, BST_intensityBeam2, BST_lhcFillNumber, BST_MasterStatus, BST_turnCountNumber, dbx_module, event_lumi, event_number, event_type, evnum_trignum_lumi, gpsfreq, gpsfreqlum, gpsfreqwide, gtfe_bx, m_dbe, m_histFolder, m_monL1PfIndicesPerLs, m_monL1PrescaleFactorSet, m_monLsNrDiffTcsFdlEvm, m_monLsNrDiffTcsFdlEvmLs, m_monOrbitNrDiffTcsFdlEvm, m_monOrbitNrDiffTcsFdlEvmLs, MaxLsNrDiffTcsFdlEvm, MaxOrbitNrDiffTcsFdlEvm, orbit_lumi, MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), setupversion_lumi, trigger_lumi, trigger_number, tt_bits, tt_bits_corr, and tt_bits_lumi.

Referenced by beginRun().

483  {
484 
485  const int TotalNrBinsLs = 1000;
486  const double totalNrBinsLs = static_cast<double>(TotalNrBinsLs);
487 
488  if (m_dbe) {
490 
491  algo_bits = m_dbe->book1D("algo_bits", "GT algorithm trigger bits", 128, -0.5, 127.5);
492  algo_bits->setAxisTitle("Algorithm trigger bits", 1);
493 
494  algo_bits_corr = m_dbe->book2D("algo_bits_corr",
495  "GT algorithm trigger bit correlation",
496  128, -0.5, 127.5, 128, -0.5, 127.5);
497  algo_bits_corr->setAxisTitle("Algorithm trigger bits", 1);
498  algo_bits_corr->setAxisTitle("Algorithm trigger bits", 2);
499 
500  tt_bits = m_dbe->book1D("tt_bits",
501  "GT technical trigger bits",
502  64, -0.5, 63.5);
503  tt_bits->setAxisTitle("Technical trigger bits", 1);
504 
505  tt_bits_corr = m_dbe->book2D("tt_bits_corr",
506  "GT technical trigger bit correlation",
507  64, -0.5, 63.5, 64, -0.5, 63.5);
508  tt_bits_corr->setAxisTitle("Technical trigger bits", 1);
509  tt_bits_corr->setAxisTitle("Technical trigger bits", 2);
510 
511  algo_tt_bits_corr = m_dbe->book2D("algo_tt_bits_corr",
512  "GT algorithm - technical trigger bit correlation",
513  128, -0.5, 127.5, 64, -0.5, 63.5);
514  algo_tt_bits_corr->setAxisTitle("Algorithm trigger bits", 1);
515  algo_tt_bits_corr->setAxisTitle("Technical trigger bits", 2);
516 
517  algo_bits_lumi = m_dbe->book2D("algo_bits_lumi",
518  "GT algorithm trigger bit rate per LS",
519  TotalNrBinsLs, 0., totalNrBinsLs, 128, -0.5, 127.5);
520  algo_bits_lumi->setAxisTitle("Luminosity segment", 1);
521  algo_bits_lumi->setAxisTitle("Algorithm trigger bits", 2);
522 
523  tt_bits_lumi = m_dbe->book2D("tt_bits_lumi",
524  "GT technical trigger bit rate per LS",
525  TotalNrBinsLs, 0., totalNrBinsLs, 64, -0.5, 63.5);
526  tt_bits_lumi->setAxisTitle("Luminosity segment", 1);
527  tt_bits_lumi->setAxisTitle("Technical trigger bits", 2);
528 
529  event_type = m_dbe->book1D("event_type", "GT event type", 10, -0.5, 9.5);
530  event_type->setAxisTitle("Event type", 1);
531  event_type->setBinLabel(2, "Physics", 1);
532  event_type->setBinLabel(3, "Calibration", 1);
533  event_type->setBinLabel(4, "Random", 1);
534  event_type->setBinLabel(6, "Traced", 1);
535  event_type->setBinLabel(7, "Test", 1);
536  event_type->setBinLabel(8, "Error", 1);
537 
538  event_number = m_dbe->book1D("event_number",
539  "GT event number (from last resync)",
540  100, 0., 50000.);
541  event_number->setAxisTitle("Event number", 1);
542 
543  event_lumi = m_dbe->bookProfile("event_lumi",
544  "GT event number (from last resync) vs LS",
545  TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e15, "s");
546  event_lumi->setAxisTitle("Luminosity segment", 1);
547  event_lumi->setAxisTitle("Event number", 2);
548 
549  trigger_number = m_dbe->book1D("trigger_number",
550  "GT trigger number (from start run)",
551  100, 0., 50000.);
552  trigger_number->setAxisTitle("Trigger number", 1);
553 
554  trigger_lumi = m_dbe->bookProfile("trigger_lumi",
555  "GT trigger number (from start run) vs LS",
556  TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e15, "s");
557  trigger_lumi->setAxisTitle("Luminosity segment", 1);
558  trigger_lumi->setAxisTitle("Trigger number", 2);
559 
560  evnum_trignum_lumi = m_dbe->bookProfile("evnum_trignum_lumi",
561  "GT event/trigger number ratio vs LS",
562  TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 2., "s");
563  evnum_trignum_lumi->setAxisTitle("Luminosity segment", 1);
564  evnum_trignum_lumi->setAxisTitle("Event/trigger number ratio", 2);
565 
566  orbit_lumi = m_dbe->bookProfile("orbit_lumi",
567  "GT orbit number vs LS",
568  TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e15, "s");
569  orbit_lumi->setAxisTitle("Luminosity segment", 1);
570  orbit_lumi->setAxisTitle("Orbit number", 2);
571 
572  setupversion_lumi = m_dbe->bookProfile("setupversion_lumi",
573  "GT setup version vs LS",
574  TotalNrBinsLs, 0., totalNrBinsLs, 100, -0.1, 1.e10, "i");
575  setupversion_lumi->setAxisTitle("Luminosity segment", 1);
576  setupversion_lumi->setAxisTitle("Setup version", 2);
577 
578  gtfe_bx = m_dbe->book1D("gtfe_bx", "GTFE Bx number", 3600, 0., 3600.);
579  gtfe_bx->setAxisTitle("GTFE BX number", 1);
580 
581  dbx_module = m_dbe->bookProfile("dbx_module",
582  "delta Bx of GT modules wrt GTFE",
583  20, 0., 20., 100, -4000., 4000., "i");
584  dbx_module->setAxisTitle("GT crate module", 1);
585  dbx_module->setAxisTitle("Module Bx - GTFE Bx", 2);
586  dbx_module->setBinLabel(1, "GTFEevm", 1);
587  dbx_module->setBinLabel(2, "TCS", 1);
588  dbx_module->setBinLabel(3, "FDL", 1);
589  dbx_module->setBinLabel(4, "FDLloc", 1);
590  dbx_module->setBinLabel(5, "PSB9", 1);
591  dbx_module->setBinLabel(6, "PSB9loc", 1);
592  dbx_module->setBinLabel(7, "PSB13", 1);
593  dbx_module->setBinLabel(8, "PSB13loc", 1);
594  dbx_module->setBinLabel(9, "PSB14", 1);
595  dbx_module->setBinLabel(10, "PSB14loc", 1);
596  dbx_module->setBinLabel(11, "PSB15", 1);
597  dbx_module->setBinLabel(12, "PSB15loc", 1);
598  dbx_module->setBinLabel(13, "PSB19", 1);
599  dbx_module->setBinLabel(14, "PSB19loc", 1);
600  dbx_module->setBinLabel(15, "PSB20", 1);
601  dbx_module->setBinLabel(16, "PSB20loc", 1);
602  dbx_module->setBinLabel(17, "PSB21", 1);
603  dbx_module->setBinLabel(18, "PSB21loc", 1);
604  dbx_module->setBinLabel(19, "GMT", 1);
605 
606  BST_MasterStatus = m_dbe->book2D("BST_MasterStatus",
607  "BST master status over LS",
608  TotalNrBinsLs, 0., totalNrBinsLs, 6, -1., 5.);
609  BST_MasterStatus->setAxisTitle("Luminosity segment", 1);
610  BST_MasterStatus->setAxisTitle("BST master status", 2);
611  BST_MasterStatus->setBinLabel(2, "Master Beam 1", 2);
612  BST_MasterStatus->setBinLabel(3, "Master Beam 2", 2);
613 
614  BST_turnCountNumber = m_dbe->book2D("BST_turnCountNumber",
615  "BST turn count over LS",
616  TotalNrBinsLs, 0., totalNrBinsLs, 250, 0., 4.3e9);
617  BST_turnCountNumber->setAxisTitle("Luminosity segment", 1);
618  BST_turnCountNumber->setAxisTitle("BST turn count number", 2);
619 
620  BST_lhcFillNumber = m_dbe->book1D("BST_lhcFillNumber",
621  "BST LHC fill number % 1000", 1000, 0., 1000.);
622  BST_lhcFillNumber->setAxisTitle("BST LHC fill number modulo 1000");
623 
624  BST_beamMode = m_dbe->book2D("BST_beamMode",
625  "BST beam mode over LS",
626  TotalNrBinsLs, 0., totalNrBinsLs, 25, 1., 26.);
627  BST_beamMode->setAxisTitle("Luminosity segment", 1);
628  BST_beamMode->setAxisTitle("Mode", 2);
629  BST_beamMode->setBinLabel(1, "No mode", 2);
630  BST_beamMode->setBinLabel(2, "Setup", 2);
631  BST_beamMode->setBinLabel(3, "Inj pilot", 2);
632  BST_beamMode->setBinLabel(4, "Inj intr", 2);
633  BST_beamMode->setBinLabel(5, "Inj nomn", 2);
634  BST_beamMode->setBinLabel(6, "Pre ramp", 2);
635  BST_beamMode->setBinLabel(7, "Ramp", 2);
636  BST_beamMode->setBinLabel(8, "Flat top", 2);
637  BST_beamMode->setBinLabel(9, "Squeeze", 2);
638  BST_beamMode->setBinLabel(10, "Adjust", 2);
639  BST_beamMode->setBinLabel(11, "Stable", 2);
640  BST_beamMode->setBinLabel(12, "Unstable", 2);
641  BST_beamMode->setBinLabel(13, "Beam dump", 2);
642  BST_beamMode->setBinLabel(14, "Ramp down", 2);
643  BST_beamMode->setBinLabel(15, "Recovery", 2);
644  BST_beamMode->setBinLabel(16, "Inj dump", 2);
645  BST_beamMode->setBinLabel(17, "Circ dump", 2);
646  BST_beamMode->setBinLabel(18, "Abort", 2);
647  BST_beamMode->setBinLabel(19, "Cycling", 2);
648  BST_beamMode->setBinLabel(20, "Warn beam dump", 2);
649  BST_beamMode->setBinLabel(21, "No beam", 2);
650 
651  BST_beamMomentum = m_dbe->book2D("BST_beamMomentum",
652  "BST beam momentum",
653  TotalNrBinsLs, 0., totalNrBinsLs, 100, 0., 7200.);
654  BST_beamMomentum->setAxisTitle("Luminosity segment", 1);
655  BST_beamMomentum->setAxisTitle("Beam momentum", 2);
656 
657  gpsfreq = m_dbe->book1D("gpsfreq", "Clock frequency measured by GPS",
658  1000, 39.95, 40.2);
659  gpsfreq->setAxisTitle("CMS clock frequency (MHz)");
660 
661  gpsfreqwide = m_dbe->book1D("gpsfreqwide",
662  "Clock frequency measured by GPS", 1000, -2., 200.);
663  gpsfreqwide->setAxisTitle("CMS clock frequency (MHz)");
664 
665  gpsfreqlum = m_dbe->book2D("gpsfreqlum",
666  "Clock frequency measured by GPS",
667  TotalNrBinsLs, 0., totalNrBinsLs, 100, 39.95, 40.2);
668  gpsfreqlum->setAxisTitle("Luminosity segment", 1);
669  gpsfreqlum->setAxisTitle("CMS clock frequency (MHz)", 2);
670 
671  BST_intensityBeam1 = m_dbe->book2D("BST_intensityBeam1",
672  "Intensity beam 1",
673  TotalNrBinsLs, 0., totalNrBinsLs, 1000, 0., 5000.);
674  BST_intensityBeam1->setAxisTitle("Luminosity segment", 1);
675  BST_intensityBeam1->setAxisTitle("Beam intensity", 2);
676 
677  BST_intensityBeam2 = m_dbe->book2D("BST_intensityBeam2",
678  "Intensity beam 2",
679  TotalNrBinsLs, 0., totalNrBinsLs, 1000, 0., 5000.);
680  BST_intensityBeam2->setAxisTitle("Luminosity segment", 1);
681  BST_intensityBeam2->setAxisTitle("Beam intensity", 2);
682 
683  // prescale factor index monitoring
684 
685  m_monL1PrescaleFactorSet = m_dbe->book2D("L1PrescaleFactorSet",
686  "Index of L1 prescale factor set",
687  TotalNrBinsLs, 0., totalNrBinsLs, 25, 0., 25.);
688  m_monL1PrescaleFactorSet->setAxisTitle("Luminosity segment", 1);
689  m_monL1PrescaleFactorSet->setAxisTitle("L1 PF set index", 2);
690 
691  m_monL1PfIndicesPerLs = m_dbe->book1D("L1PfIndicesPerLs",
692  "Number of prescale factor indices used per LS", 10, 0., 10.);
693  m_monL1PfIndicesPerLs->setAxisTitle("Number of PF indices used per LS", 1);
694  m_monL1PfIndicesPerLs->setAxisTitle("Entries", 2);
695 
696 
697  // TCS vs FDL common quantity monitoring
698 
699  m_dbe->setCurrentFolder(m_histFolder + "/TCSvsEvmFDL");
700 
701  // orbit number
702  m_monOrbitNrDiffTcsFdlEvm = m_dbe->book1D("OrbitNrDiffTcsFdlEvm",
703  "Orbit number difference (TCS - EVM_FDL)",
704  2 * MaxOrbitNrDiffTcsFdlEvm + 1,
705  static_cast<float>(-(MaxOrbitNrDiffTcsFdlEvm + 1)),
706  static_cast<float>(MaxOrbitNrDiffTcsFdlEvm + 1));
707  m_monOrbitNrDiffTcsFdlEvm->setAxisTitle("Orbit number difference", 1);
708  m_monOrbitNrDiffTcsFdlEvm->setAxisTitle("Entries/run", 2);
709 
710  m_monLsNrDiffTcsFdlEvm = m_dbe->book1D("LsNrDiffTcsFdlEvm",
711  "LS number difference (TCS - EVM_FDL)",
712  2 * MaxLsNrDiffTcsFdlEvm + 1,
713  static_cast<float>(-(MaxLsNrDiffTcsFdlEvm + 1)),
714  static_cast<float>(MaxLsNrDiffTcsFdlEvm + 1));
715  m_monLsNrDiffTcsFdlEvm->setAxisTitle("LS number difference", 1);
716  m_monLsNrDiffTcsFdlEvm->setAxisTitle("Entries/run", 2);
717 
718  // LS number
719 
720  m_monOrbitNrDiffTcsFdlEvmLs = m_dbe->book2D("OrbitNrDiffTcsFdlEvmLs",
721  "Orbit number difference (TCS - EVM_FDL)",
722  TotalNrBinsLs, 0., totalNrBinsLs,
723  2 * MaxOrbitNrDiffTcsFdlEvm + 1,
724  static_cast<float>(-(MaxOrbitNrDiffTcsFdlEvm + 1)),
725  static_cast<float>(MaxOrbitNrDiffTcsFdlEvm + 1));
726  m_monOrbitNrDiffTcsFdlEvmLs->setAxisTitle("Luminosity segment", 1);
727  m_monOrbitNrDiffTcsFdlEvmLs->setAxisTitle("Orbit number difference (TCS - EVM_FDL)", 2);
728 
729  m_monLsNrDiffTcsFdlEvmLs = m_dbe->book2D("LsNrDiffTcsFdlEvmLs",
730  "LS number difference (TCS - EVM_FDL)",
731  TotalNrBinsLs, 0., totalNrBinsLs,
732  2 * MaxLsNrDiffTcsFdlEvm + 1,
733  static_cast<float>(-(MaxLsNrDiffTcsFdlEvm + 1)),
734  static_cast<float>(MaxLsNrDiffTcsFdlEvm + 1));
735  m_monLsNrDiffTcsFdlEvmLs->setAxisTitle("Luminosity segment", 1);
736  m_monLsNrDiffTcsFdlEvmLs->setAxisTitle("LS number difference (TCS - EVM_FDL)", 2);
737 
739  }
740 
741 
742 
743 }
MonitorElement * m_monL1PrescaleFactorSet
Definition: L1TGT.h:156
MonitorElement * gpsfreqwide
Definition: L1TGT.h:153
DQMStore * m_dbe
internal members
Definition: L1TGT.h:180
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
MonitorElement * m_monLsNrDiffTcsFdlEvmLs
Definition: L1TGT.h:172
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 * BST_intensityBeam1
Definition: L1TGT.h:150
static const int MaxOrbitNrDiffTcsFdlEvm
Definition: L1TGT.h:168
MonitorElement * algo_bits_corr
Definition: L1TGT.h:126
MonitorElement * tt_bits
Definition: L1TGT.h:127
MonitorElement * gtfe_bx
Definition: L1TGT.h:142
MonitorElement * BST_beamMode
Definition: L1TGT.h:148
MonitorElement * BST_MasterStatus
Definition: L1TGT.h:145
MonitorElement * BST_intensityBeam2
Definition: L1TGT.h:151
MonitorElement * event_number
Definition: L1TGT.h:134
static const int MaxLsNrDiffTcsFdlEvm
Definition: L1TGT.h:169
MonitorElement * orbit_lumi
Definition: L1TGT.h:139
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1256
std::string m_histFolder
histogram folder for L1 GT plots
Definition: L1TGT.h:187
MonitorElement * algo_bits_lumi
Definition: L1TGT.h:130
MonitorElement * m_monLsNrDiffTcsFdlEvm
Definition: L1TGT.h:160
MonitorElement * gpsfreq
Definition: L1TGT.h:152
MonitorElement * algo_bits
Definition: L1TGT.h:125
MonitorElement * event_type
Definition: L1TGT.h:132
MonitorElement * m_monOrbitNrDiffTcsFdlEvmLs
Definition: L1TGT.h:171
MonitorElement * dbx_module
Definition: L1TGT.h:143
MonitorElement * tt_bits_corr
Definition: L1TGT.h:128
MonitorElement * gpsfreqlum
Definition: L1TGT.h:154
MonitorElement * m_monL1PfIndicesPerLs
Definition: L1TGT.h:157
MonitorElement * trigger_number
Definition: L1TGT.h:136
MonitorElement * BST_beamMomentum
Definition: L1TGT.h:149
MonitorElement * BST_lhcFillNumber
Definition: L1TGT.h:147
MonitorElement * setupversion_lumi
Definition: L1TGT.h:140
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1070
MonitorElement * BST_turnCountNumber
Definition: L1TGT.h:146
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * event_lumi
Definition: L1TGT.h:135
MonitorElement * tt_bits_lumi
Definition: L1TGT.h:131
MonitorElement * trigger_lumi
Definition: L1TGT.h:137
MonitorElement * evnum_trignum_lumi
Definition: L1TGT.h:138
MonitorElement * algo_tt_bits_corr
Definition: L1TGT.h:129
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
MonitorElement * m_monOrbitNrDiffTcsFdlEvm
Definition: L1TGT.h:159
void L1TGT::countPfsIndicesPerLs ( )
private

Definition at line 754 of file L1TGT.cc.

References MonitorElement::Fill(), m_monL1PfIndicesPerLs, m_pairLsNumberPfIndex, MonitorElement::Reset(), python.multivaluedict::sort(), and verbose_.

Referenced by endJob(), endLuminosityBlock(), and endRun().

754  {
755 
756  if (verbose_) {
757  edm::LogInfo("L1TGT") << "\n Prescale factor indices used in a LS "
758  << std::endl;
759 
760  for (CItVecPair cIt = m_pairLsNumberPfIndex.begin(); cIt
761  != m_pairLsNumberPfIndex.end(); ++cIt) {
762 
763  edm::LogVerbatim("L1TGT") << " lsNumber = " << (*cIt).first
764  << " pfIndex = " << (*cIt).second << std::endl;
765  }
766  edm::LogVerbatim("L1TGT") << std::endl;
767  }
768 
769  // reset the histogram...
771 
772  // sort the vector (for pairs: sort after first argument, then after the second argument)
774 
775  int previousLsNumber = -1;
776  int previousPfsIndex = -1;
777 
778  // count the number of pairs (lsNumber, pfIndex) per Ls
779  // there are no duplicate entries, and pairs are sorted after both members
780  // ... and fill again the histogram
781  for (CItVecPair cIt = m_pairLsNumberPfIndex.begin(); cIt
782  != m_pairLsNumberPfIndex.end(); ++cIt) {
783 
784  int pfsIndicesPerLs = 1;
785 
786  if ((*cIt).first == previousLsNumber) {
787 
788  if ((*cIt).second != previousPfsIndex) {
789  pfsIndicesPerLs++;
790  previousPfsIndex = (*cIt).second;
791  }
792 
793  } else {
794 
795  // fill the histogram with the number of PF indices for the previous Ls
796  if (previousLsNumber != -1) {
797  m_monL1PfIndicesPerLs->Fill(pfsIndicesPerLs);
798  }
799 
800  // new Ls
801  previousLsNumber = (*cIt).first;
802  previousPfsIndex = (*cIt).second;
803 
804  pfsIndicesPerLs = 1;
805  }
806 
807  }
808 
809 }
std::vector< std::pair< int, int > >::const_iterator CItVecPair
Definition: L1TGT.h:194
std::vector< std::pair< int, int > > m_pairLsNumberPfIndex
Definition: L1TGT.h:193
bool verbose_
verbosity switch
Definition: L1TGT.h:121
void Fill(long long x)
MonitorElement * m_monL1PfIndicesPerLs
Definition: L1TGT.h:157
void Reset(void)
reset ME (ie. contents, errors, etc)
void L1TGT::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 468 of file L1TGT.cc.

References countPfsIndicesPerLs(), m_nrEvJob, m_runInEndJob, and verbose_.

468  {
469 
470  if (m_runInEndJob) {
472  }
473 
474  if (verbose_) {
475  edm::LogInfo("L1TGT") << "\n Analyzed " << m_nrEvJob << " events";
476  }
477 
478  return;
479 }
bool verbose_
verbosity switch
Definition: L1TGT.h:121
int m_nrEvJob
number of events processed
Definition: L1TGT.h:183
void countPfsIndicesPerLs()
Definition: L1TGT.cc:754
bool m_runInEndJob
Definition: L1TGT.h:117
void L1TGT::endLuminosityBlock ( const edm::LuminosityBlock iLumi,
const edm::EventSetup evSetup 
)
privatevirtual

end section

Reimplemented from edm::EDAnalyzer.

Definition at line 451 of file L1TGT.cc.

References countPfsIndicesPerLs(), and m_runInEndLumi.

452  {
453 
454  if (m_runInEndLumi) {
456  }
457 }
bool m_runInEndLumi
Definition: L1TGT.h:115
void countPfsIndicesPerLs()
Definition: L1TGT.cc:754
void L1TGT::endRun ( const edm::Run iRrun,
const edm::EventSetup evSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 459 of file L1TGT.cc.

References countPfsIndicesPerLs(), and m_runInEndRun.

459  {
460 
461  if (m_runInEndRun) {
463  }
464 
465 }
bool m_runInEndRun
Definition: L1TGT.h:116
void countPfsIndicesPerLs()
Definition: L1TGT.cc:754
bool L1TGT::isActive ( int  word,
int  bit 
)
private

Definition at line 747 of file L1TGT.cc.

Referenced by analyze().

747  {
748  if (word & (1 << bit))
749  return true;
750  return false;
751 }

Member Data Documentation

MonitorElement* L1TGT::algo_bits
private

Definition at line 125 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::algo_bits_corr
private

Definition at line 126 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::algo_bits_lumi
private

Definition at line 130 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::algo_tt_bits_corr
private

Definition at line 129 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::BST_beamMode
private

Definition at line 148 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::BST_beamMomentum
private

Definition at line 149 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::BST_intensityBeam1
private

Definition at line 150 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::BST_intensityBeam2
private

Definition at line 151 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::BST_lhcFillNumber
private

Definition at line 147 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::BST_MasterStatus
private

Definition at line 145 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::BST_turnCountNumber
private

Definition at line 146 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::dbx_module
private

Definition at line 143 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::event_lumi
private

Definition at line 135 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::event_number
private

Definition at line 134 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::event_type
private

Definition at line 132 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::evnum_trignum_lumi
private

Definition at line 138 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::gpsfreq
private

Definition at line 152 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::gpsfreqlum
private

Definition at line 154 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::gpsfreqwide
private

Definition at line 153 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<L1GlobalTriggerEvmReadoutRecord> L1TGT::gtEvmSource_
private

input tag for L1 GT EVM readout record

Definition at line 111 of file L1TGT.h.

Referenced by analyze().

MonitorElement* L1TGT::gtfe_bx
private

Definition at line 142 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> L1TGT::gtSource_L1GT_
private

input parameters

input tag for L1 GT DAQ readout record

Definition at line 107 of file L1TGT.h.

Referenced by analyze().

edm::EDGetTokenT<L1MuGMTReadoutCollection> L1TGT::gtSource_L1MuGMT_
private

Definition at line 108 of file L1TGT.h.

Referenced by analyze().

DQMStore* L1TGT::m_dbe
private

internal members

Definition at line 180 of file L1TGT.h.

Referenced by beginRun(), bookHistograms(), and L1TGT().

std::string L1TGT::m_histFolder
private

histogram folder for L1 GT plots

Definition at line 187 of file L1TGT.h.

Referenced by beginRun(), bookHistograms(), and L1TGT().

MonitorElement* L1TGT::m_monL1PfIndicesPerLs
private

Definition at line 157 of file L1TGT.h.

Referenced by bookHistograms(), and countPfsIndicesPerLs().

MonitorElement* L1TGT::m_monL1PrescaleFactorSet
private

Definition at line 156 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::m_monLsNrDiffTcsFdlEvm
private

Definition at line 160 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::m_monLsNrDiffTcsFdlEvmLs
private

Definition at line 172 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::m_monOrbitNrDiffTcsFdlEvm
private

Definition at line 159 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::m_monOrbitNrDiffTcsFdlEvmLs
private

Definition at line 171 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

int L1TGT::m_nrEvJob
private

number of events processed

Definition at line 183 of file L1TGT.h.

Referenced by analyze(), beginJob(), and endJob().

int L1TGT::m_nrEvRun
private

Definition at line 184 of file L1TGT.h.

Referenced by beginRun().

std::vector<std::pair<int,int> > L1TGT::m_pairLsNumberPfIndex
private

Definition at line 193 of file L1TGT.h.

Referenced by analyze(), beginRun(), countPfsIndicesPerLs(), and L1TGT().

bool L1TGT::m_runInEndJob
private

Definition at line 117 of file L1TGT.h.

Referenced by endJob().

bool L1TGT::m_runInEndLumi
private

Definition at line 115 of file L1TGT.h.

Referenced by endLuminosityBlock().

bool L1TGT::m_runInEndRun
private

Definition at line 116 of file L1TGT.h.

Referenced by endRun().

bool L1TGT::m_runInEventLoop
private

switches to choose the running of various methods

Definition at line 114 of file L1TGT.h.

const int L1TGT::MaxLsNrDiffTcsFdlEvm = 24
staticprivate

Definition at line 169 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

const int L1TGT::MaxOrbitNrDiffTcsFdlEvm = 24
staticprivate

Definition at line 168 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::orbit_lumi
private

Definition at line 139 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

boost::uint64_t L1TGT::preGps_
private

Definition at line 189 of file L1TGT.h.

Referenced by analyze(), and beginJob().

boost::uint64_t L1TGT::preOrb_
private

Definition at line 190 of file L1TGT.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TGT::setupversion_lumi
private

Definition at line 140 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::trigger_lumi
private

Definition at line 137 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::trigger_number
private

Definition at line 136 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::tt_bits
private

Definition at line 127 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::tt_bits_corr
private

Definition at line 128 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TGT::tt_bits_lumi
private

Definition at line 131 of file L1TGT.h.

Referenced by analyze(), and bookHistograms().

bool L1TGT::verbose_
private

verbosity switch

Definition at line 121 of file L1TGT.h.

Referenced by analyze(), countPfsIndicesPerLs(), and endJob().