CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
BxTiming Class Reference

#include <BxTiming.h>

Inheritance diagram for BxTiming:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 BxTiming (const edm::ParameterSet &)
 
 ~BxTiming () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Protected Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Types

enum  nsys { NSYS = 10 }
 
enum  syslist {
  PS = 0, ETP, HTP, GCT,
  CTP, CTF, DTP, DTF,
  RPC, GLT
}
 

Private Member Functions

int calcBxDiff (int bx1, int bx2)
 
int verbose ()
 

Private Attributes

std::pair< int, int > fedRange_ [NSYS]
 
int fedRef_
 
edm::InputTag fedSource_
 
edm::EDGetTokenT< FEDRawDataCollectionfedSource_token_
 
edm::InputTag gtSource_
 
edm::EDGetTokenT< L1GlobalTriggerReadoutRecordgtSource_token_
 
MonitorElementhBxDiffAllFed
 histograms More...
 
MonitorElementhBxDiffAllFedSpread [nspr_]
 
MonitorElementhBxDiffSysFed [NSYS]
 
MonitorElementhBxOccyAllFed
 
MonitorElementhBxOccyAllFedSpread [nspr_]
 
MonitorElementhBxOccyGtTrigType [nttype_]
 
MonitorElement ** hBxOccyOneFed
 
MonitorElement ** hBxOccyTrigBit [NSYS]
 
std::string histFile_
 
std::string histFolder_
 
std::vector< int > listGtBits_
 
int nBxDiff [FEDNumbering::MAXFEDID+1][nspr_]
 
int nBxOccy [FEDNumbering::MAXFEDID+1][nspr_]
 
int nEvt_
 
bool runInFF_
 
int verbose_
 

Static Private Attributes

static const int half_norb_ = norb_ / 2
 
static const int nbig_ = 10000
 
static const int norb_ = 3564
 
static const int nspr_ = 3
 
static const int nttype_ = 6
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 32 of file BxTiming.h.

Member Enumeration Documentation

◆ nsys

enum BxTiming::nsys
private
Enumerator
NSYS 

Definition at line 81 of file BxTiming.h.

81 { NSYS = 10 };

◆ syslist

enum BxTiming::syslist
private
Enumerator
PS 
ETP 
HTP 
GCT 
CTP 
CTF 
DTP 
DTF 
RPC 
GLT 

Definition at line 82 of file BxTiming.h.

Constructor & Destructor Documentation

◆ BxTiming()

BxTiming::BxTiming ( const edm::ParameterSet iConfig)
explicit

Definition at line 4 of file BxTiming.cc.

References gather_cfg::cout, fedRef_, fedSource_, fedSource_token_, edm::ParameterSet::getUntrackedParameter(), gtSource_, gtSource_token_, histFile_, histFolder_, mps_fire::i, HLT_2022v15_cff::InputTag, listGtBits_, nEvt_, runInFF_, AlCaHLTBitMon_QueryRunRegistry::string, verbose(), and verbose_.

4  {
5  verbose_ = iConfig.getUntrackedParameter<int>("VerboseFlag", 0);
6  if (verbose())
7  std::cout << "BxTiming::BxTiming()...\n" << std::flush;
8 
9  fedRef_ = iConfig.getUntrackedParameter<int>("ReferenceFedId", 813);
10  fedSource_ = iConfig.getUntrackedParameter<edm::InputTag>("FedSource", edm::InputTag("source"));
11  fedSource_token_ = consumes<FEDRawDataCollection>(
12  iConfig.getUntrackedParameter<edm::InputTag>("FedSource", edm::InputTag("source")));
13  gtSource_ = iConfig.getUntrackedParameter<edm::InputTag>("GtSource", edm::InputTag("gtUnpack"));
14  gtSource_token_ = consumes<L1GlobalTriggerReadoutRecord>(
15  iConfig.getUntrackedParameter<edm::InputTag>("GtSource", edm::InputTag("gtUnpack")));
16  histFile_ = iConfig.getUntrackedParameter<std::string>("HistFile", "");
17  histFolder_ = iConfig.getUntrackedParameter<std::string>("HistFolder", "L1T/BXSynch");
18 
19  runInFF_ = iConfig.getUntrackedParameter<bool>("RunInFilterFarm", true);
20  if (runInFF_)
21  histFolder_ = "L1T/BXSynch_EvF";
22  if (verbose())
23  std::cout << "Filter farm run setting?" << runInFF_ << "\n" << std::flush;
24 
25  listGtBits_ = iConfig.getUntrackedParameter<std::vector<int> >("GtBitList", std::vector<int>(1, 0));
26  if (listGtBits_.size() == 1 && listGtBits_.at(0) == -1) {
27  int ngtbits = 128;
28  listGtBits_.reserve(ngtbits);
29  for (int i = 0; i < ngtbits; i++)
30  listGtBits_[i] = i;
31  }
32 
33  if (verbose()) {
34  std::cout << "BxTiming: gt bits set for timing dqm:";
35  std::cout << "nbits:" << listGtBits_.size() << " list: ";
36  for (size_t i = 0; i != listGtBits_.size(); i++)
37  std::cout << listGtBits_.at(i) << " ";
38  std::cout << "\n" << std::flush;
39  }
40 
41  nEvt_ = 0;
42 
43  if (verbose())
44  std::cout << "BxTiming::BxTiming constructor...done.\n" << std::flush;
45 }
std::vector< int > listGtBits_
Definition: BxTiming.h:79
int verbose()
Definition: BxTiming.h:50
std::string histFile_
Definition: BxTiming.h:64
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtSource_token_
Definition: BxTiming.h:46
T getUntrackedParameter(std::string const &, T const &) const
int nEvt_
Definition: BxTiming.h:61
int verbose_
Definition: BxTiming.h:49
edm::InputTag fedSource_
Definition: BxTiming.h:43
bool runInFF_
Definition: BxTiming.h:70
std::string histFolder_
Definition: BxTiming.h:67
edm::InputTag gtSource_
Definition: BxTiming.h:45
edm::EDGetTokenT< FEDRawDataCollection > fedSource_token_
Definition: BxTiming.h:44
int fedRef_
Definition: BxTiming.h:84

◆ ~BxTiming()

BxTiming::~BxTiming ( )
override

Definition at line 47 of file BxTiming.cc.

47 {}

Member Function Documentation

◆ analyze()

void BxTiming::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprotectedvirtual

get the raw data - if not found, return

Reimplemented from DQMEDAnalyzer.

Definition at line 245 of file BxTiming.cc.

References simKBmtfDigis_cfi::bx, calcBxDiff(), gather_cfg::cout, FEDRawData::data(), data, L1GlobalTriggerReadoutRecord::decisionWord(), FEDRawDataCollection::FEDData(), fedRange_, fedRef_, fedSource_, fedSource_token_, dqm::impl::MonitorElement::Fill(), dqmdumpme::first, GLT, gtSource_token_, hBxDiffAllFed, hBxDiffAllFedSpread, hBxDiffSysFed, hBxOccyAllFed, hBxOccyAllFedSpread, hBxOccyGtTrigType, hBxOccyOneFed, hBxOccyTrigBit, RecoTauValidation_cfi::header, mps_fire::i, iEvent, cuy::ii, createfilelist::int, edm::HandleBase::isValid(), dqmiolumiharvest::j, dqmdumpme::k, listGtBits_, FEDNumbering::MAXFEDID, nBxDiff, nBxOccy, nEvt_, nfed_, nspr_, NSYS, nttype_, runInFF_, edm::second(), dqm::impl::MonitorElement::setBinContent(), findQualityFiles::size, and verbose().

245  {
246  if (verbose())
247  std::cout << "BxTiming::analyze() start\n" << std::flush;
248 
249  nEvt_++;
250 
253  iEvent.getByToken(fedSource_token_, rawdata);
254 
255  if (!rawdata.isValid()) {
256  if (verbose())
257  std::cout << "BxTiming::analyze() | FEDRawDataCollection with input tag " << fedSource_ << " not found.";
258 
259  return;
260  }
261 
262  // get the GT bits
264  iEvent.getByToken(gtSource_token_, gtdata);
265  std::vector<bool> gtbits;
266  int ngtbits = 128;
267  gtbits.reserve(ngtbits);
268  for (int i = 0; i < ngtbits; i++)
269  gtbits[i] = false;
270  if (gtdata.isValid())
271  gtbits = gtdata->decisionWord();
272 
273  if (gtbits.empty()) {
274  gtbits.push_back(true); // gtdata->decision();
275  if (verbose())
276  std::cout << "BxTiming::analyze() | unexpected empty decision bits!";
277  }
278 
279  if (verbose()) {
280  std::cout << "BxTiming::analyze() gt data valid:" << (int)(gtdata.isValid() ? 0 : 1)
281  << " decision word size:" << (int)(gtbits.size()) << " bits: ";
282  for (size_t i = 0; i != gtbits.size(); i++) {
283  int ii = gtbits.at(i) ? 1 : 0;
284  std::cout << ii;
285  }
286  std::cout << ".\n" << std::flush;
287  }
288 
289  // get reference bx
290  int bxRef = FEDHeader(rawdata->FEDData(fedRef_).data()).bxID();
291 
292  // triggerType
293  // trigger types: physics (1), calibration (2), random (3), traced physics (5), test (6)
294  int ttype = static_cast<double>(iEvent.eventAuxiliary().experimentType());
295 
296  // loop over feds
297  for (int i = 0; i < FEDNumbering::MAXFEDID + 1; i++) {
298  const FEDRawData &data = rawdata->FEDData(i);
299  size_t size = data.size();
300 
301  if (!size)
302  continue;
303  FEDHeader header(data.data());
304  //int lvl1id = header.lvl1ID(); //Level-1 event number generated by the TTC system
305  int bx = header.bxID(); // The bunch crossing number
306 
307  int bxDiff = calcBxDiff(bx, bxRef); // deviation from reference bx
308 
309  //min
310  if (nBxDiff[i][1] > bxDiff)
311  nBxDiff[i][1] = bxDiff;
312  if (nBxOccy[i][1] > bx)
313  nBxOccy[i][1] = bx;
314  //max
315  if (nBxDiff[i][2] < bxDiff)
316  nBxDiff[i][2] = bxDiff;
317  if (nBxOccy[i][2] < bx)
318  nBxOccy[i][2] = bx;
319 
320  if (verbose())
321  std::cout << " fed:" << i << " bx:" << bx << " bxRef:" << bxRef << " diff:" << bxDiff << " nBxDiff"
322  << " del:" << nBxDiff[i][0] << " min:" << nBxDiff[i][1] << " max:" << nBxDiff[i][2] << " nBxOccy"
323  << " del:" << nBxOccy[i][0] << " min:" << nBxOccy[i][1] << " max:" << nBxOccy[i][2] << "\n"
324  << std::flush;
325 
326  hBxDiffAllFed->Fill(i, bxDiff);
327 
328  //if(ttype==1) //skip if not a physics trigger
330 
331  // done if running in filter farm
332  if (runInFF_)
333  continue;
334 
335  for (int j = 0; j < NSYS; j++)
336  if (i >= fedRange_[j].first && i <= fedRange_[j].second)
337  hBxDiffSysFed[j]->Fill(i, bxDiff);
338 
339  for (size_t k = 0; k != listGtBits_.size(); k++) {
340  if ((int)gtbits.size() <= listGtBits_.at(k)) {
341  if (verbose())
342  std::cout << "BxTiming analyze | problem with vector size!\n" << std::endl;
343  continue;
344  } else if (!gtbits.at(listGtBits_.at(k)))
345  continue;
346  for (int j = 0; j < NSYS; j++) {
347  if (i >= fedRange_[j].first && i <= fedRange_[j].second) {
348  hBxOccyTrigBit[j][k]->Fill(bx);
349  }
350  }
351  }
352 
353  if (i >= fedRange_[GLT].first && i <= fedRange_[GLT].second) //GT fed
354  if (ttype < nttype_)
355  hBxOccyGtTrigType[ttype - 1]->Fill(bx);
356 
357  if (ttype != 1)
358  continue; //skip if not a physics trigger
359  //hBxOccyAllFed->Fill(bx);
360  hBxOccyOneFed[i]->Fill(bx);
361  }
362 
363  for (int i = 0; i < nfed_; i++) {
364  nBxDiff[i][0] = nBxDiff[i][2] - nBxDiff[i][1];
365  nBxOccy[i][0] = nBxOccy[i][2] - nBxOccy[i][1];
366  if (nBxDiff[i][0] < 0 || nBxOccy[i][0] < 0)
367  continue;
368  for (int j = 0; j < nspr_; j++) {
371  }
372  if (verbose())
373  std::cout << "BxTiming fed:" << i << " Bx-Bx(" << fedRef_ << ")::"
374  << " del:" << nBxDiff[i][0] << " min:" << nBxDiff[i][1] << " max:" << nBxDiff[i][2] << " Occy: "
375  << " del:" << nBxOccy[i][0] << " min:" << nBxOccy[i][1] << " max:" << nBxOccy[i][2] << "\n"
376  << std::flush;
377  }
378 
379  if (verbose())
380  std::cout << "BxTiming::analyze() end.\n" << std::flush;
381 }
size
Write out results.
static const int nttype_
Definition: BxTiming.h:77
MonitorElement * hBxDiffAllFed
histograms
Definition: BxTiming.h:92
int nBxOccy[FEDNumbering::MAXFEDID+1][nspr_]
Definition: BxTiming.h:89
MonitorElement * hBxDiffAllFedSpread[nspr_]
Definition: BxTiming.h:97
std::vector< int > listGtBits_
Definition: BxTiming.h:79
int verbose()
Definition: BxTiming.h:50
#define nfed_
Definition: BxTiming.h:30
const DecisionWord & decisionWord(int bxInEventValue) const
MonitorElement * hBxOccyAllFed
Definition: BxTiming.h:94
MonitorElement ** hBxOccyOneFed
Definition: BxTiming.h:95
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtSource_token_
Definition: BxTiming.h:46
void Fill(long long x)
U second(std::pair< T, U > const &p)
MonitorElement * hBxOccyGtTrigType[nttype_]
Definition: BxTiming.h:100
int iEvent
Definition: GenABIO.cc:224
int nEvt_
Definition: BxTiming.h:61
edm::InputTag fedSource_
Definition: BxTiming.h:43
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
ii
Definition: cuy.py:589
std::pair< int, int > fedRange_[NSYS]
Definition: BxTiming.h:83
bool runInFF_
Definition: BxTiming.h:70
edm::EDGetTokenT< FEDRawDataCollection > fedSource_token_
Definition: BxTiming.h:44
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
int fedRef_
Definition: BxTiming.h:84
MonitorElement * hBxDiffSysFed[NSYS]
Definition: BxTiming.h:93
bool isValid() const
Definition: HandleBase.h:70
MonitorElement ** hBxOccyTrigBit[NSYS]
Definition: BxTiming.h:101
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
int calcBxDiff(int bx1, int bx2)
Definition: BxTiming.cc:385
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
int nBxDiff[FEDNumbering::MAXFEDID+1][nspr_]
Definition: BxTiming.h:88
MonitorElement * hBxOccyAllFedSpread[nspr_]
Definition: BxTiming.h:98
static const int nspr_
Definition: BxTiming.h:87

◆ bookHistograms()

void BxTiming::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

initialize counters

book the histograms

labeling (cosmetics added here)

Implements DQMEDAnalyzer.

Definition at line 49 of file BxTiming.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::bookProfile(), fedRange_, fedRef_, dqmdumpme::first, hBxDiffAllFed, hBxDiffAllFedSpread, hBxDiffSysFed, hBxOccyAllFed, hBxOccyAllFedSpread, hBxOccyGtTrigType, hBxOccyOneFed, hBxOccyTrigBit, histFolder_, mps_fire::i, dqmiolumiharvest::j, listGtBits_, FEDNumbering::MAXCSCFEDID, FEDNumbering::MAXCSCTFFEDID, FEDNumbering::MAXDTFEDID, FEDNumbering::MAXDTTFFEDID, FEDNumbering::MAXECALFEDID, FEDNumbering::MAXHCALFEDID, FEDNumbering::MAXPreShowerFEDID, FEDNumbering::MAXRPCFEDID, FEDNumbering::MAXTriggerEGTPFEDID, FEDNumbering::MAXTriggerGTPFEDID, FEDNumbering::MINCSCFEDID, FEDNumbering::MINCSCTFFEDID, FEDNumbering::MINDTFEDID, FEDNumbering::MINDTTFFEDID, FEDNumbering::MINECALFEDID, FEDNumbering::MINHCALFEDID, FEDNumbering::MINPreShowerFEDID, FEDNumbering::MINRPCFEDID, FEDNumbering::MINTriggerGCTFEDID, FEDNumbering::MINTriggerGTPFEDID, nbig_, nBxDiff, nBxOccy, nfed_, norb_, nspr_, NSYS, nttype_, runInFF_, edm::second(), dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and cond::impl::to_string().

49  {
51 
53  for (int i = 0; i < nfed_; i++) {
54  nBxDiff[i][0] = 0;
55  nBxDiff[i][1] = nbig_;
56  nBxDiff[i][2] = -1 * nbig_;
57  nBxOccy[i][0] = 0;
58  nBxOccy[i][1] = nbig_;
59  nBxOccy[i][2] = -1 * nbig_;
60  }
61 
62  std::string lbl("");
63  std::string SysLabel[NSYS] = {"PreShower", "ECAL", "HCAL", "GCT", "CSCTPG", "CSCTF", "DTTPG", "DTTF", "RPC", "GT"};
64 
65  typedef std::pair<int, int> FEDRange;
66 
67  std::pair<int, int> fedRange[NSYS] = {
78  };
79  for (int i = 0; i < NSYS; i++)
80  fedRange_[i] = fedRange[i];
81 
82  int fedRefSys = -1;
83  for (int i = 0; i < NSYS; i++)
84  if (fedRef_ >= fedRange_[i].first && fedRef_ <= fedRange_[i].second) {
85  fedRefSys = i;
86  break;
87  }
88  std::string refName("");
89  std::string spreadLabel[nspr_] = {"Spread", "Min", "Max"};
90  if (fedRefSys >= 0)
91  refName += SysLabel[fedRefSys];
92  else
93  refName += fedRef_;
94 
96 
97  const int dbx = nbig_;
98 
100 
101  hBxDiffAllFed = ibooker.bookProfile(
102  "BxDiffAllFed", "BxDiffAllFed", nfed_ + 1, -0.5, nfed_ + 0.5, 2 * dbx + 1, -1 * dbx - 0.5, dbx + 0.5);
103 
104  for (int i = 0; i < nspr_; i++) {
105  lbl.clear();
106  lbl += "BxDiffAllFed";
107  lbl += spreadLabel[i];
108  hBxDiffAllFedSpread[i] = ibooker.book1D(lbl.data(), lbl.data(), nfed_ + 1, -0.5, nfed_ + 0.5);
109  lbl.clear();
110  lbl += "BxOccyAllFed";
111  lbl += spreadLabel[i];
112  hBxOccyAllFedSpread[i] = ibooker.book1D(lbl.data(), lbl.data(), nfed_ + 1, -0.5, nfed_ + 0.5);
113 
114  lbl.clear();
115  lbl += "BxOccyAllFed";
116  hBxOccyAllFed = ibooker.book1D(lbl.data(), lbl.data(), norb_ + 1, -0.5, norb_ + 0.5);
117  }
118 
119  // following histos defined only when not runing in the ff
120  if (!runInFF_) {
121  ibooker.setCurrentFolder(histFolder_);
122 
123  for (int i = 0; i < NSYS; i++) {
124  lbl.clear();
125  lbl += SysLabel[i];
126  lbl += "FedBxDiff";
127  int nfeds = fedRange_[i].second - fedRange_[i].first + 1;
128  nfeds = (nfeds > 0) ? nfeds : 1;
129  hBxDiffSysFed[i] = ibooker.bookProfile(lbl.data(),
130  lbl.data(),
131  nfeds,
132  fedRange_[i].first - 0.5,
133  fedRange_[i].second + 0.5,
134  2 * dbx + 1,
135  -1 * dbx - 0.5,
136  dbx + 0.5);
137  }
138 
139  lbl.clear();
140  lbl += "BxOccyAllFed";
142  ibooker.setCurrentFolder(histFolder_ + "/SingleFed");
143  for (int i = 0; i < nfed_; i++) {
144  lbl.clear();
145  lbl += "BxOccyOneFed";
146  lbl += std::to_string(i);
147  hBxOccyOneFed[i] = ibooker.book1D(lbl.data(), lbl.data(), norb_ + 1, -0.5, norb_ + 0.5);
148  }
149 
150  ibooker.setCurrentFolder(histFolder_);
151  for (int i = 0; i < nttype_; i++) {
152  lbl.clear();
153  lbl += "BxOccyGtTrigType";
154  lbl += std::to_string(i + 1);
155  hBxOccyGtTrigType[i] = ibooker.book1D(lbl.data(), lbl.data(), norb_ + 1, -0.5, norb_ + 0.5);
156  }
157 
158  ibooker.setCurrentFolder(histFolder_ + "/SingleBit");
159  for (int i = 0; i < NSYS; i++) {
160  hBxOccyTrigBit[i] = new MonitorElement *[listGtBits_.size()];
161  for (size_t j = 0; j < listGtBits_.size(); j++) {
162  lbl.clear();
163  lbl += SysLabel[i];
164  lbl += "BxOccyGtBit";
165  lbl += std::to_string(listGtBits_.at(j));
166  hBxOccyTrigBit[i][j] = ibooker.book1D(lbl.data(), lbl.data(), norb_ + 1, -0.5, norb_ + 0.5);
167  }
168  }
169  }
170 
172  hBxDiffAllFed->setAxisTitle("FED ID", 1);
173  lbl.clear();
174  lbl += "BX(fed)-BX(";
175  lbl += refName;
176  lbl += ")";
177  hBxDiffAllFed->setAxisTitle(lbl, 2);
178  for (int i = 0; i < nspr_; i++) {
179  lbl.clear();
180  lbl += "BX(fed)-BX(";
181  lbl += refName;
182  lbl += ") " + spreadLabel[i];
183  hBxDiffAllFedSpread[i]->setAxisTitle("FED ID", 1);
185  lbl.clear();
186  lbl += "Bx FED occupancy";
187  lbl += " ";
188  lbl += spreadLabel[i];
189  hBxOccyAllFedSpread[i]->setAxisTitle("FED ID", 1);
191  }
192 
193  hBxOccyAllFed->setAxisTitle("bx", 1);
194  lbl.clear();
195  lbl += "Combined FED occupancy";
196  hBxOccyAllFed->setAxisTitle(lbl, 2);
197 
198  // skip next if running in filter farm
199  if (runInFF_)
200  return;
201 
202  for (int i = 0; i < NSYS; i++) {
203  lbl.clear();
204  lbl += SysLabel[i];
205  lbl += " FED ID";
206  hBxDiffSysFed[i]->setAxisTitle(lbl, 1);
207  lbl.clear();
208  lbl += "BX(";
209  lbl += SysLabel[i];
210  lbl += ")-BX(";
211  lbl += refName;
212  lbl += ")";
213  hBxDiffSysFed[i]->setAxisTitle(lbl, 2);
214  }
215 
216  for (int i = 0; i < nfed_; i++) {
217  hBxOccyOneFed[i]->setAxisTitle("bx", 1);
218  lbl.clear();
219  lbl += " FED ";
220  lbl += std::to_string(i);
221  lbl += " occupancy";
222  hBxOccyOneFed[i]->setAxisTitle(lbl, 2);
223  }
224  for (int i = 0; i < nttype_; i++) {
225  hBxOccyGtTrigType[i]->setAxisTitle("bx", 1);
226  lbl.clear();
227  lbl += "GT occupancy for trigger type ";
228  lbl += std::to_string(i + 1);
229  hBxOccyGtTrigType[i]->setAxisTitle(lbl, 2);
230  }
231 
232  for (int i = 0; i < NSYS; i++) {
233  for (size_t j = 0; j < listGtBits_.size(); j++) {
234  hBxOccyTrigBit[i][j]->setAxisTitle("bx", 1);
235  lbl.clear();
236  lbl += SysLabel[i];
237  lbl += " Bx occupancy for Trigger bit ";
238  lbl += std::to_string(listGtBits_.at(j));
239  hBxOccyTrigBit[i][j]->setAxisTitle(lbl, 2);
240  }
241  }
242 }
static const int nttype_
Definition: BxTiming.h:77
static const int norb_
Definition: BxTiming.h:73
MonitorElement * hBxDiffAllFed
histograms
Definition: BxTiming.h:92
int nBxOccy[FEDNumbering::MAXFEDID+1][nspr_]
Definition: BxTiming.h:89
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * hBxDiffAllFedSpread[nspr_]
Definition: BxTiming.h:97
std::vector< int > listGtBits_
Definition: BxTiming.h:79
#define nfed_
Definition: BxTiming.h:30
std::string to_string(const V &value)
Definition: OMSAccess.h:71
MonitorElement * hBxOccyAllFed
Definition: BxTiming.h:94
MonitorElement ** hBxOccyOneFed
Definition: BxTiming.h:95
static const int nbig_
Definition: BxTiming.h:76
U second(std::pair< T, U > const &p)
MonitorElement * hBxOccyGtTrigType[nttype_]
Definition: BxTiming.h:100
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:399
std::pair< int, int > fedRange_[NSYS]
Definition: BxTiming.h:83
bool runInFF_
Definition: BxTiming.h:70
std::string histFolder_
Definition: BxTiming.h:67
int fedRef_
Definition: BxTiming.h:84
MonitorElement * hBxDiffSysFed[NSYS]
Definition: BxTiming.h:93
MonitorElement ** hBxOccyTrigBit[NSYS]
Definition: BxTiming.h:101
int nBxDiff[FEDNumbering::MAXFEDID+1][nspr_]
Definition: BxTiming.h:88
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * hBxOccyAllFedSpread[nspr_]
Definition: BxTiming.h:98
static const int nspr_
Definition: BxTiming.h:87
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

◆ calcBxDiff()

int BxTiming::calcBxDiff ( int  bx1,
int  bx2 
)
private

calculates the difference (closest distance) between two bunch crossing numbers. This is similar to calculating delta phi between two vectors.

Calculates bx1 - bx2 but makes sure that the value is in the range -num_bx_per_orbit / 2 .. + num_bx_per_orbit / 2 .

Definition at line 385 of file BxTiming.cc.

References change_name::diff, half_norb_, and norb_.

Referenced by analyze().

385  {
386  int diff = bx1 - bx2;
387 
388  while (diff < -half_norb_)
389  diff += norb_;
390 
391  while (diff > half_norb_)
392  diff -= norb_;
393 
394  return diff;
395 }
static const int norb_
Definition: BxTiming.h:73
static const int half_norb_
Definition: BxTiming.h:74

◆ verbose()

int BxTiming::verbose ( )
inlineprivate

Definition at line 50 of file BxTiming.h.

References verbose_.

Referenced by analyze(), and BxTiming().

50 { return verbose_; }
int verbose_
Definition: BxTiming.h:49

Member Data Documentation

◆ fedRange_

std::pair<int, int> BxTiming::fedRange_[NSYS]
private

Definition at line 83 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

◆ fedRef_

int BxTiming::fedRef_
private

Definition at line 84 of file BxTiming.h.

Referenced by analyze(), bookHistograms(), and BxTiming().

◆ fedSource_

edm::InputTag BxTiming::fedSource_
private

Definition at line 43 of file BxTiming.h.

Referenced by analyze(), and BxTiming().

◆ fedSource_token_

edm::EDGetTokenT<FEDRawDataCollection> BxTiming::fedSource_token_
private

Definition at line 44 of file BxTiming.h.

Referenced by analyze(), and BxTiming().

◆ gtSource_

edm::InputTag BxTiming::gtSource_
private

Definition at line 45 of file BxTiming.h.

Referenced by BxTiming().

◆ gtSource_token_

edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> BxTiming::gtSource_token_
private

Definition at line 46 of file BxTiming.h.

Referenced by analyze(), and BxTiming().

◆ half_norb_

const int BxTiming::half_norb_ = norb_ / 2
staticprivate

Definition at line 74 of file BxTiming.h.

Referenced by calcBxDiff().

◆ hBxDiffAllFed

MonitorElement* BxTiming::hBxDiffAllFed
private

histograms

Definition at line 92 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

◆ hBxDiffAllFedSpread

MonitorElement* BxTiming::hBxDiffAllFedSpread[nspr_]
private

Definition at line 97 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

◆ hBxDiffSysFed

MonitorElement* BxTiming::hBxDiffSysFed[NSYS]
private

Definition at line 93 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

◆ hBxOccyAllFed

MonitorElement* BxTiming::hBxOccyAllFed
private

Definition at line 94 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

◆ hBxOccyAllFedSpread

MonitorElement* BxTiming::hBxOccyAllFedSpread[nspr_]
private

Definition at line 98 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

◆ hBxOccyGtTrigType

MonitorElement* BxTiming::hBxOccyGtTrigType[nttype_]
private

Definition at line 100 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

◆ hBxOccyOneFed

MonitorElement** BxTiming::hBxOccyOneFed
private

Definition at line 95 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

◆ hBxOccyTrigBit

MonitorElement** BxTiming::hBxOccyTrigBit[NSYS]
private

Definition at line 101 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

◆ histFile_

std::string BxTiming::histFile_
private

Definition at line 64 of file BxTiming.h.

Referenced by BxTiming().

◆ histFolder_

std::string BxTiming::histFolder_
private

Definition at line 67 of file BxTiming.h.

Referenced by bookHistograms(), and BxTiming().

◆ listGtBits_

std::vector<int> BxTiming::listGtBits_
private

Definition at line 79 of file BxTiming.h.

Referenced by analyze(), bookHistograms(), and BxTiming().

◆ nbig_

const int BxTiming::nbig_ = 10000
staticprivate

Definition at line 76 of file BxTiming.h.

Referenced by bookHistograms().

◆ nBxDiff

int BxTiming::nBxDiff[FEDNumbering::MAXFEDID+1][nspr_]
private

Definition at line 88 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

◆ nBxOccy

int BxTiming::nBxOccy[FEDNumbering::MAXFEDID+1][nspr_]
private

Definition at line 89 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

◆ nEvt_

int BxTiming::nEvt_
private

Definition at line 61 of file BxTiming.h.

Referenced by analyze(), and BxTiming().

◆ norb_

const int BxTiming::norb_ = 3564
staticprivate

Definition at line 73 of file BxTiming.h.

Referenced by bookHistograms(), and calcBxDiff().

◆ nspr_

const int BxTiming::nspr_ = 3
staticprivate

Definition at line 87 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

◆ nttype_

const int BxTiming::nttype_ = 6
staticprivate

Definition at line 77 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

◆ runInFF_

bool BxTiming::runInFF_
private

Definition at line 70 of file BxTiming.h.

Referenced by analyze(), bookHistograms(), and BxTiming().

◆ verbose_

int BxTiming::verbose_
private

Definition at line 49 of file BxTiming.h.

Referenced by BxTiming(), and verbose().