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::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &iRun, edm::EventSetup const &iSetup) override
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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)
 

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::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 33 of file BxTiming.h.

Member Enumeration Documentation

enum BxTiming::nsys
private
Enumerator
NSYS 

Definition at line 83 of file BxTiming.h.

83 { NSYS = 10 };
enum BxTiming::syslist
private
Enumerator
PS 
ETP 
HTP 
GCT 
CTP 
CTF 
DTP 
DTF 
RPC 
GLT 

Definition at line 84 of file BxTiming.h.

Constructor & Destructor Documentation

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_2018_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 }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< int > listGtBits_
Definition: BxTiming.h:81
int verbose()
Definition: BxTiming.h:52
std::string histFile_
Definition: BxTiming.h:66
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtSource_token_
Definition: BxTiming.h:48
int nEvt_
Definition: BxTiming.h:63
int verbose_
Definition: BxTiming.h:51
edm::InputTag fedSource_
Definition: BxTiming.h:45
bool runInFF_
Definition: BxTiming.h:72
std::string histFolder_
Definition: BxTiming.h:69
edm::InputTag gtSource_
Definition: BxTiming.h:47
edm::EDGetTokenT< FEDRawDataCollection > fedSource_token_
Definition: BxTiming.h:46
int fedRef_
Definition: BxTiming.h:86
BxTiming::~BxTiming ( )
override

Definition at line 47 of file BxTiming.cc.

47 {}

Member Function Documentation

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

get the raw data - if not found, return

Definition at line 265 of file BxTiming.cc.

References l1GtPatternGenerator_cfi::bx, calcBxDiff(), gather_cfg::cout, FEDRawData::data(), data, L1GlobalTriggerReadoutRecord::decisionWord(), edm::Event::eventAuxiliary(), edm::EventAuxiliary::experimentType(), FEDRawDataCollection::FEDData(), fedRange_, fedRef_, fedSource_, fedSource_token_, dqm::impl::MonitorElement::Fill(), dqmdumpme::first, edm::Event::getByToken(), GLT, gtSource_token_, hBxDiffAllFed, hBxDiffAllFedSpread, hBxDiffSysFed, hBxOccyAllFed, hBxOccyAllFedSpread, hBxOccyGtTrigType, hBxOccyOneFed, hBxOccyTrigBit, RecoTauValidation_cfi::header, mps_fire::i, 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(), FEDRawData::size(), findQualityFiles::size, and verbose().

265  {
266  if (verbose())
267  std::cout << "BxTiming::analyze() start\n" << std::flush;
268 
269  nEvt_++;
270 
273  iEvent.getByToken(fedSource_token_, rawdata);
274 
275  if (!rawdata.isValid()) {
276  if (verbose())
277  std::cout << "BxTiming::analyze() | FEDRawDataCollection with input tag " << fedSource_ << " not found.";
278 
279  return;
280  }
281 
282  // get the GT bits
284  iEvent.getByToken(gtSource_token_, gtdata);
285  std::vector<bool> gtbits;
286  int ngtbits = 128;
287  gtbits.reserve(ngtbits);
288  for (int i = 0; i < ngtbits; i++)
289  gtbits[i] = false;
290  if (gtdata.isValid())
291  gtbits = gtdata->decisionWord();
292 
293  if (gtbits.empty()) {
294  gtbits.push_back(true); // gtdata->decision();
295  if (verbose())
296  std::cout << "BxTiming::analyze() | unexpected empty decision bits!";
297  }
298 
299  if (verbose()) {
300  std::cout << "BxTiming::analyze() gt data valid:" << (int)(gtdata.isValid() ? 0 : 1)
301  << " decision word size:" << (int)(gtbits.size()) << " bits: ";
302  for (size_t i = 0; i != gtbits.size(); i++) {
303  int ii = gtbits.at(i) ? 1 : 0;
304  std::cout << ii;
305  }
306  std::cout << ".\n" << std::flush;
307  }
308 
309  // get reference bx
310  int bxRef = FEDHeader(rawdata->FEDData(fedRef_).data()).bxID();
311 
312  // triggerType
313  // trigger types: physics (1), calibration (2), random (3), traced physics (5), test (6)
314  int ttype = static_cast<double>(iEvent.eventAuxiliary().experimentType());
315 
316  // loop over feds
317  for (int i = 0; i < FEDNumbering::MAXFEDID + 1; i++) {
318  const FEDRawData &data = rawdata->FEDData(i);
319  size_t size = data.size();
320 
321  if (!size)
322  continue;
323  FEDHeader header(data.data());
324  //int lvl1id = header.lvl1ID(); //Level-1 event number generated by the TTC system
325  int bx = header.bxID(); // The bunch crossing number
326 
327  int bxDiff = calcBxDiff(bx, bxRef); // deviation from reference bx
328 
329  //min
330  if (nBxDiff[i][1] > bxDiff)
331  nBxDiff[i][1] = bxDiff;
332  if (nBxOccy[i][1] > bx)
333  nBxOccy[i][1] = bx;
334  //max
335  if (nBxDiff[i][2] < bxDiff)
336  nBxDiff[i][2] = bxDiff;
337  if (nBxOccy[i][2] < bx)
338  nBxOccy[i][2] = bx;
339 
340  if (verbose())
341  std::cout << " fed:" << i << " bx:" << bx << " bxRef:" << bxRef << " diff:" << bxDiff << " nBxDiff"
342  << " del:" << nBxDiff[i][0] << " min:" << nBxDiff[i][1] << " max:" << nBxDiff[i][2] << " nBxOccy"
343  << " del:" << nBxOccy[i][0] << " min:" << nBxOccy[i][1] << " max:" << nBxOccy[i][2] << "\n"
344  << std::flush;
345 
346  hBxDiffAllFed->Fill(i, bxDiff);
347 
348  //if(ttype==1) //skip if not a physics trigger
349  hBxOccyAllFed->Fill(bx);
350 
351  // done if running in filter farm
352  if (runInFF_)
353  continue;
354 
355  for (int j = 0; j < NSYS; j++)
356  if (i >= fedRange_[j].first && i <= fedRange_[j].second)
357  hBxDiffSysFed[j]->Fill(i, bxDiff);
358 
359  for (size_t k = 0; k != listGtBits_.size(); k++) {
360  if ((int)gtbits.size() <= listGtBits_.at(k)) {
361  if (verbose())
362  std::cout << "BxTiming analyze | problem with vector size!\n" << std::endl;
363  continue;
364  } else if (!gtbits.at(listGtBits_.at(k)))
365  continue;
366  for (int j = 0; j < NSYS; j++) {
367  if (i >= fedRange_[j].first && i <= fedRange_[j].second) {
368  hBxOccyTrigBit[j][k]->Fill(bx);
369  }
370  }
371  }
372 
373  if (i >= fedRange_[GLT].first && i <= fedRange_[GLT].second) //GT fed
374  if (ttype < nttype_)
375  hBxOccyGtTrigType[ttype - 1]->Fill(bx);
376 
377  if (ttype != 1)
378  continue; //skip if not a physics trigger
379  //hBxOccyAllFed->Fill(bx);
380  hBxOccyOneFed[i]->Fill(bx);
381  }
382 
383  for (int i = 0; i < nfed_; i++) {
384  nBxDiff[i][0] = nBxDiff[i][2] - nBxDiff[i][1];
385  nBxOccy[i][0] = nBxOccy[i][2] - nBxOccy[i][1];
386  if (nBxDiff[i][0] < 0 || nBxOccy[i][0] < 0)
387  continue;
388  for (int j = 0; j < nspr_; j++) {
389  hBxDiffAllFedSpread[j]->setBinContent(i, nBxDiff[i][j]);
390  hBxOccyAllFedSpread[j]->setBinContent(i, nBxOccy[i][j]);
391  }
392  if (verbose())
393  std::cout << "BxTiming fed:" << i << " Bx-Bx(" << fedRef_ << ")::"
394  << " del:" << nBxDiff[i][0] << " min:" << nBxDiff[i][1] << " max:" << nBxDiff[i][2] << " Occy: "
395  << " del:" << nBxOccy[i][0] << " min:" << nBxOccy[i][1] << " max:" << nBxOccy[i][2] << "\n"
396  << std::flush;
397  }
398 
399  if (verbose())
400  std::cout << "BxTiming::analyze() end.\n" << std::flush;
401 }
size
Write out results.
static const int nttype_
Definition: BxTiming.h:79
MonitorElement * hBxDiffAllFed
histograms
Definition: BxTiming.h:94
int nBxOccy[FEDNumbering::MAXFEDID+1][nspr_]
Definition: BxTiming.h:91
EventAuxiliary const & eventAuxiliary() const override
Definition: Event.h:93
MonitorElement * hBxDiffAllFedSpread[nspr_]
Definition: BxTiming.h:99
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
std::vector< int > listGtBits_
Definition: BxTiming.h:81
int verbose()
Definition: BxTiming.h:52
#define nfed_
Definition: BxTiming.h:31
MonitorElement * hBxOccyAllFed
Definition: BxTiming.h:96
MonitorElement ** hBxOccyOneFed
Definition: BxTiming.h:97
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtSource_token_
Definition: BxTiming.h:48
ExperimentType experimentType() const
void Fill(long long x)
U second(std::pair< T, U > const &p)
MonitorElement * hBxOccyGtTrigType[nttype_]
Definition: BxTiming.h:102
int nEvt_
Definition: BxTiming.h:63
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
edm::InputTag fedSource_
Definition: BxTiming.h:45
bool isValid() const
Definition: HandleBase.h:70
const DecisionWord & decisionWord(int bxInEventValue) const
ii
Definition: cuy.py:590
std::pair< int, int > fedRange_[NSYS]
Definition: BxTiming.h:85
bool runInFF_
Definition: BxTiming.h:72
edm::EDGetTokenT< FEDRawDataCollection > fedSource_token_
Definition: BxTiming.h:46
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
int fedRef_
Definition: BxTiming.h:86
MonitorElement * hBxDiffSysFed[NSYS]
Definition: BxTiming.h:95
MonitorElement ** hBxOccyTrigBit[NSYS]
Definition: BxTiming.h:103
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
int calcBxDiff(int bx1, int bx2)
Definition: BxTiming.cc:405
int nBxDiff[FEDNumbering::MAXFEDID+1][nspr_]
Definition: BxTiming.h:90
MonitorElement * hBxOccyAllFedSpread[nspr_]
Definition: BxTiming.h:100
static const int nspr_
Definition: BxTiming.h:89
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::dqmstoreimpl::DQMStore::IBooker::book1D(), dqm::dqmstoreimpl::DQMStore::IBooker::bookProfile(), fedRange_, fedRef_, dqmdumpme::first, hBxDiffAllFed, hBxDiffAllFedSpread, hBxDiffSysFed, hBxOccyAllFed, hBxOccyAllFedSpread, hBxOccyGtTrigType, hBxOccyOneFed, hBxOccyTrigBit, histFolder_, mps_fire::i, cuy::ii, 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::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

49  {
50  ibooker.setCurrentFolder(histFolder_);
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 
99  ibooker.setCurrentFolder(histFolder_);
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  char *ii = new char[1000];
147  std::sprintf(ii, "%d", i);
148  lbl += ii;
149  hBxOccyOneFed[i] = ibooker.book1D(lbl.data(), lbl.data(), norb_ + 1, -0.5, norb_ + 0.5);
150  delete[] ii;
151  }
152 
153  ibooker.setCurrentFolder(histFolder_);
154  for (int i = 0; i < nttype_; i++) {
155  lbl.clear();
156  lbl += "BxOccyGtTrigType";
157  char *ii = new char[16];
158  std::sprintf(ii, "%d", i + 1);
159  lbl += ii;
160  hBxOccyGtTrigType[i] = ibooker.book1D(lbl.data(), lbl.data(), norb_ + 1, -0.5, norb_ + 0.5);
161  delete[] ii;
162  }
163 
164  ibooker.setCurrentFolder(histFolder_ + "/SingleBit");
165  for (int i = 0; i < NSYS; i++) {
166  hBxOccyTrigBit[i] = new MonitorElement *[listGtBits_.size()];
167  for (size_t j = 0; j < listGtBits_.size(); j++) {
168  lbl.clear();
169  lbl += SysLabel[i];
170  lbl += "BxOccyGtBit";
171  char *ii = new char[1000];
172  std::sprintf(ii, "%d", listGtBits_.at(j));
173  lbl += ii;
174  hBxOccyTrigBit[i][j] = ibooker.book1D(lbl.data(), lbl.data(), norb_ + 1, -0.5, norb_ + 0.5);
175  delete[] ii;
176  }
177  }
178  }
179 
181  hBxDiffAllFed->setAxisTitle("FED ID", 1);
182  lbl.clear();
183  lbl += "BX(fed)-BX(";
184  lbl += refName;
185  lbl += ")";
186  hBxDiffAllFed->setAxisTitle(lbl, 2);
187  for (int i = 0; i < nspr_; i++) {
188  lbl.clear();
189  lbl += "BX(fed)-BX(";
190  lbl += refName;
191  lbl += ") " + spreadLabel[i];
192  hBxDiffAllFedSpread[i]->setAxisTitle("FED ID", 1);
194  lbl.clear();
195  lbl += "Bx FED occupancy";
196  lbl += " ";
197  lbl += spreadLabel[i];
198  hBxOccyAllFedSpread[i]->setAxisTitle("FED ID", 1);
200  }
201 
202  hBxOccyAllFed->setAxisTitle("bx", 1);
203  lbl.clear();
204  lbl += "Combined FED occupancy";
205  hBxOccyAllFed->setAxisTitle(lbl, 2);
206 
207  // skip next if running in filter farm
208  if (runInFF_)
209  return;
210 
211  for (int i = 0; i < NSYS; i++) {
212  lbl.clear();
213  lbl += SysLabel[i];
214  lbl += " FED ID";
215  hBxDiffSysFed[i]->setAxisTitle(lbl, 1);
216  lbl.clear();
217  lbl += "BX(";
218  lbl += SysLabel[i];
219  lbl += ")-BX(";
220  lbl += refName;
221  lbl += ")";
222  hBxDiffSysFed[i]->setAxisTitle(lbl, 2);
223  }
224 
225  for (int i = 0; i < nfed_; i++) {
226  hBxOccyOneFed[i]->setAxisTitle("bx", 1);
227  lbl.clear();
228  lbl += " FED ";
229  char *ii = new char[1000];
230  std::sprintf(ii, "%d", i);
231  lbl += ii;
232  lbl += " occupancy";
233  hBxOccyOneFed[i]->setAxisTitle(lbl, 2);
234  delete[] ii;
235  }
236  for (int i = 0; i < nttype_; i++) {
237  hBxOccyGtTrigType[i]->setAxisTitle("bx", 1);
238  lbl.clear();
239  lbl += "GT occupancy for trigger type ";
240  char *ii = new char[16];
241  std::sprintf(ii, "%d", i + 1);
242  lbl += ii;
243  hBxOccyGtTrigType[i]->setAxisTitle(lbl, 2);
244  delete[] ii;
245  }
246 
247  for (int i = 0; i < NSYS; i++) {
248  for (size_t j = 0; j < listGtBits_.size(); j++) {
249  hBxOccyTrigBit[i][j]->setAxisTitle("bx", 1);
250  lbl.clear();
251  lbl += SysLabel[i];
252  lbl += " Bx occupancy for Trigger bit ";
253  char *ii = new char[10];
254  std::sprintf(ii, "%d", listGtBits_.at(j));
255  lbl += ii;
256  hBxOccyTrigBit[i][j]->setAxisTitle(lbl, 2);
257  delete[] ii;
258  }
259  }
260 }
static const int nttype_
Definition: BxTiming.h:79
static const int norb_
Definition: BxTiming.h:75
MonitorElement * hBxDiffAllFed
histograms
Definition: BxTiming.h:94
int nBxOccy[FEDNumbering::MAXFEDID+1][nspr_]
Definition: BxTiming.h:91
MonitorElement * hBxDiffAllFedSpread[nspr_]
Definition: BxTiming.h:99
std::vector< int > listGtBits_
Definition: BxTiming.h:81
#define nfed_
Definition: BxTiming.h:31
MonitorElement * hBxOccyAllFed
Definition: BxTiming.h:96
MonitorElement ** hBxOccyOneFed
Definition: BxTiming.h:97
static const int nbig_
Definition: BxTiming.h:78
U second(std::pair< T, U > const &p)
MonitorElement * hBxOccyGtTrigType[nttype_]
Definition: BxTiming.h:102
ii
Definition: cuy.py:590
std::pair< int, int > fedRange_[NSYS]
Definition: BxTiming.h:85
bool runInFF_
Definition: BxTiming.h:72
std::string histFolder_
Definition: BxTiming.h:69
int fedRef_
Definition: BxTiming.h:86
MonitorElement * hBxDiffSysFed[NSYS]
Definition: BxTiming.h:95
MonitorElement ** hBxOccyTrigBit[NSYS]
Definition: BxTiming.h:103
int nBxDiff[FEDNumbering::MAXFEDID+1][nspr_]
Definition: BxTiming.h:90
MonitorElement * hBxOccyAllFedSpread[nspr_]
Definition: BxTiming.h:100
static const int nspr_
Definition: BxTiming.h:89
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
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 405 of file BxTiming.cc.

References change_name::diff, half_norb_, and norb_.

Referenced by analyze(), and verbose().

405  {
406  int diff = bx1 - bx2;
407 
408  while (diff < -half_norb_)
409  diff += norb_;
410 
411  while (diff > half_norb_)
412  diff -= norb_;
413 
414  return diff;
415 }
static const int norb_
Definition: BxTiming.h:75
static const int half_norb_
Definition: BxTiming.h:76
void BxTiming::dqmBeginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 262 of file BxTiming.cc.

262 {}
int BxTiming::verbose ( )
inlineprivate

Definition at line 52 of file BxTiming.h.

References calcBxDiff(), and verbose_.

Referenced by analyze(), and BxTiming().

52 { return verbose_; }
int verbose_
Definition: BxTiming.h:51

Member Data Documentation

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

Definition at line 85 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

int BxTiming::fedRef_
private

Definition at line 86 of file BxTiming.h.

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

edm::InputTag BxTiming::fedSource_
private

Definition at line 45 of file BxTiming.h.

Referenced by analyze(), and BxTiming().

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

Definition at line 46 of file BxTiming.h.

Referenced by analyze(), and BxTiming().

edm::InputTag BxTiming::gtSource_
private

Definition at line 47 of file BxTiming.h.

Referenced by BxTiming().

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

Definition at line 48 of file BxTiming.h.

Referenced by analyze(), and BxTiming().

const int BxTiming::half_norb_ = norb_ / 2
staticprivate

Definition at line 76 of file BxTiming.h.

Referenced by calcBxDiff().

MonitorElement* BxTiming::hBxDiffAllFed
private

histograms

Definition at line 94 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BxTiming::hBxDiffAllFedSpread[nspr_]
private

Definition at line 99 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BxTiming::hBxDiffSysFed[NSYS]
private

Definition at line 95 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BxTiming::hBxOccyAllFed
private

Definition at line 96 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BxTiming::hBxOccyAllFedSpread[nspr_]
private

Definition at line 100 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BxTiming::hBxOccyGtTrigType[nttype_]
private

Definition at line 102 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

MonitorElement** BxTiming::hBxOccyOneFed
private

Definition at line 97 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

MonitorElement** BxTiming::hBxOccyTrigBit[NSYS]
private

Definition at line 103 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

std::string BxTiming::histFile_
private

Definition at line 66 of file BxTiming.h.

Referenced by BxTiming().

std::string BxTiming::histFolder_
private

Definition at line 69 of file BxTiming.h.

Referenced by bookHistograms(), and BxTiming().

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

Definition at line 81 of file BxTiming.h.

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

const int BxTiming::nbig_ = 10000
staticprivate

Definition at line 78 of file BxTiming.h.

Referenced by bookHistograms().

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

Definition at line 90 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 91 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

int BxTiming::nEvt_
private

Definition at line 63 of file BxTiming.h.

Referenced by analyze(), and BxTiming().

const int BxTiming::norb_ = 3564
staticprivate

Definition at line 75 of file BxTiming.h.

Referenced by bookHistograms(), and calcBxDiff().

const int BxTiming::nspr_ = 3
staticprivate

Definition at line 89 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

const int BxTiming::nttype_ = 6
staticprivate

Definition at line 79 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

bool BxTiming::runInFF_
private

Definition at line 72 of file BxTiming.h.

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

int BxTiming::verbose_
private

Definition at line 51 of file BxTiming.h.

Referenced by BxTiming(), and verbose().