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::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > 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 &ev, edm::EventSetup const &es) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 () 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
 
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)
 
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::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)
 

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 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 34 of file BxTiming.h.

Member Enumeration Documentation

enum BxTiming::nsys
private
Enumerator
NSYS 

Definition at line 89 of file BxTiming.h.

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

Definition at line 90 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, listGtBits_, nEvt_, runInFF_, AlCaHLTBitMon_QueryRunRegistry::string, verbose(), and verbose_.

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

Definition at line 52 of file BxTiming.cc.

52 {}

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 226 of file BxTiming.cc.

References calcBxDiff(), gather_cfg::cout, FEDRawData::data(), data, L1GlobalTriggerReadoutRecord::decisionWord(), edm::Event::eventAuxiliary(), edm::EventAuxiliary::experimentType(), FEDRawDataCollection::FEDData(), fedRange_, fedRef_, fedSource_, fedSource_token_, MonitorElement::Fill(), plotBeamSpotDB::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(), gen::k, listGtBits_, FEDNumbering::MAXFEDID, nBxDiff, nBxOccy, nEvt_, nfed_, nspr_, NSYS, nttype_, matplotRender::rawdata, runInFF_, edm::second(), MonitorElement::setBinContent(), FEDRawData::size(), findQualityFiles::size, and verbose().

226  {
227 
228  if(verbose())
229  std::cout << "BxTiming::analyze() start\n" << std::flush;
230 
231  nEvt_++;
232 
235  iEvent.getByToken(fedSource_token_, rawdata);
236 
237  if (!rawdata.isValid()) {
238 
239  if (verbose())
240  std::cout
241  << "BxTiming::analyze() | FEDRawDataCollection with input tag "
242  << fedSource_ << " not found.";
243 
244  return;
245  }
246 
247  // get the GT bits
249  iEvent.getByToken(gtSource_token_, gtdata);
250  std::vector<bool> gtbits;
251  int ngtbits = 128;
252  gtbits.reserve(ngtbits); for(int i=0; i<ngtbits; i++) gtbits[i]=false;
253  if(gtdata.isValid())
254  gtbits = gtdata->decisionWord();
255 
256  if(gtbits.empty()) {
257  gtbits.push_back(true); // gtdata->decision();
258  if(verbose())
259  std::cout << "BxTiming::analyze() | unexpected empty decision bits!";
260  }
261 
262  if(verbose()) {
263  std::cout << "BxTiming::analyze() gt data valid:" << (int)(gtdata.isValid()?0:1)
264  << " decision word size:" << (int)(gtbits.size()) << " bits: ";
265  for(size_t i=0; i!=gtbits.size(); i++) {
266  int ii = gtbits.at(i)? 1:0;
267  std::cout << ii;
268  }
269  std::cout << ".\n" << std::flush;
270  }
271 
272 
273  // get reference bx
274  int bxRef = FEDHeader(rawdata->FEDData(fedRef_).data()).bxID();
275 
276  // triggerType
277  // trigger types: physics (1), calibration (2), random (3), traced physics (5), test (6)
278  int ttype = static_cast<double> (iEvent.eventAuxiliary().experimentType());
279 
280  // loop over feds
281  for (int i = 0; i<FEDNumbering::MAXFEDID+1; i++){
282  const FEDRawData& data = rawdata->FEDData(i);
283  size_t size=data.size();
284 
285  if(!size) continue;
286  FEDHeader header(data.data());
287  //int lvl1id = header.lvl1ID(); //Level-1 event number generated by the TTC system
288  int bx = header.bxID(); // The bunch crossing number
289 
290  int bxDiff = calcBxDiff(bx,bxRef); // deviation from reference bx
291 
292  //min
293  if(nBxDiff[i][1]>bxDiff) nBxDiff[i][1] = bxDiff;
294  if(nBxOccy[i][1]>bx ) nBxOccy[i][1] = bx;
295  //max
296  if(nBxDiff[i][2]<bxDiff) nBxDiff[i][2] = bxDiff;
297  if(nBxOccy[i][2]<bx ) nBxOccy[i][2] = bx;
298 
299  if(verbose())
300  std::cout << " fed:" << i
301  << " bx:" << bx
302  << " bxRef:" << bxRef
303  << " diff:" << bxDiff
304  << " nBxDiff"<<" del:"<<nBxDiff[i][0]<<" min:"<<nBxDiff[i][1]<<" max:"<<nBxDiff[i][2]
305  << " nBxOccy"<<" del:"<<nBxOccy[i][0]<<" min:"<<nBxOccy[i][1]<<" max:"<<nBxOccy[i][2]
306  << "\n" << std::flush;
307 
308  hBxDiffAllFed->Fill(i,bxDiff);
309 
310  //if(ttype==1) //skip if not a physics trigger
311  hBxOccyAllFed->Fill(bx);
312 
313 
314  // done if running in filter farm
315  if(runInFF_)
316  continue;
317 
318  for(int j=0; j<NSYS; j++)
319  if(i>=fedRange_[j].first && i<=fedRange_[j].second)
320  hBxDiffSysFed[j]->Fill(i,bxDiff);
321 
322  for(size_t k=0; k!=listGtBits_.size(); k++) {
323  if((int)gtbits.size() <= listGtBits_.at(k)) {
324  if(verbose())
325  std::cout << "BxTiming analyze | problem with vector size!\n" << std::endl;
326  continue;
327  }
328  else if(!gtbits.at(listGtBits_.at(k)))
329  continue;
330  for(int j=0; j<NSYS; j++) {
331  if(i>=fedRange_[j].first && i<=fedRange_[j].second) {
332  hBxOccyTrigBit[j][k]->Fill(bx);
333  }
334  }
335  }
336 
337  if(i>=fedRange_[GLT].first && i<=fedRange_[GLT].second) //GT fed
338  if(ttype<nttype_)
339  hBxOccyGtTrigType[ttype-1]->Fill(bx);
340 
341  if(ttype!=1) continue; //skip if not a physics trigger
342  //hBxOccyAllFed->Fill(bx);
343  hBxOccyOneFed[i]->Fill(bx);
344 
345  }
346 
347  for(int i=0; i<nfed_;i++) {
348  nBxDiff[i][0]=nBxDiff[i][2]-nBxDiff[i][1];
349  nBxOccy[i][0]=nBxOccy[i][2]-nBxOccy[i][1];
350  if(nBxDiff[i][0]<0 || nBxOccy[i][0]<0) continue;
351  for(int j=0; j<nspr_; j++) {
352  hBxDiffAllFedSpread[j]->setBinContent(i,nBxDiff[i][j]);
353  hBxOccyAllFedSpread[j]->setBinContent(i,nBxOccy[i][j]);
354  }
355  if(verbose())
356  std::cout << "BxTiming fed:" << i
357  << " Bx-Bx(" << fedRef_ << ")::"
358  << " del:" << nBxDiff[i][0]
359  << " min:" << nBxDiff[i][1]
360  << " max:" << nBxDiff[i][2]
361  << " Occy: "
362  << " del:" << nBxOccy[i][0]
363  << " min:" << nBxOccy[i][1]
364  << " max:" << nBxOccy[i][2]
365  <<"\n" << std::flush;
366 
367  }
368 
369 
370  if(verbose())
371  std::cout << "BxTiming::analyze() end.\n" << std::flush;
372 }
size
Write out results.
static const int nttype_
Definition: BxTiming.h:85
MonitorElement * hBxDiffAllFed
histograms
Definition: BxTiming.h:100
void setBinContent(int binx, double content)
set content of bin (1-D)
int nBxOccy[FEDNumbering::MAXFEDID+1][nspr_]
Definition: BxTiming.h:97
EventAuxiliary const & eventAuxiliary() const override
Definition: Event.h:92
MonitorElement * hBxDiffAllFedSpread[nspr_]
Definition: BxTiming.h:105
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
std::vector< int > listGtBits_
Definition: BxTiming.h:87
int verbose()
Definition: BxTiming.h:57
#define nfed_
Definition: BxTiming.h:32
MonitorElement * hBxOccyAllFed
Definition: BxTiming.h:102
MonitorElement ** hBxOccyOneFed
Definition: BxTiming.h:103
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtSource_token_
Definition: BxTiming.h:53
void Fill(long long x)
ExperimentType experimentType() const
U second(std::pair< T, U > const &p)
MonitorElement * hBxOccyGtTrigType[nttype_]
Definition: BxTiming.h:108
int nEvt_
Definition: BxTiming.h:68
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
edm::InputTag fedSource_
Definition: BxTiming.h:50
bool isValid() const
Definition: HandleBase.h:74
const DecisionWord & decisionWord(int bxInEventValue) const
ii
Definition: cuy.py:588
int k[5][pyjets_maxn]
bool runInFF_
Definition: BxTiming.h:78
edm::EDGetTokenT< FEDRawDataCollection > fedSource_token_
Definition: BxTiming.h:51
int fedRef_
Definition: BxTiming.h:92
MonitorElement * hBxDiffSysFed[NSYS]
Definition: BxTiming.h:101
MonitorElement ** hBxOccyTrigBit[NSYS]
Definition: BxTiming.h:109
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
int calcBxDiff(int bx1, int bx2)
Definition: BxTiming.cc:377
int nBxDiff[FEDNumbering::MAXFEDID+1][nspr_]
Definition: BxTiming.h:96
std::pair< int, int > fedRange_[NSYS]
Definition: BxTiming.h:91
MonitorElement * hBxOccyAllFedSpread[nspr_]
Definition: BxTiming.h:106
static const int nspr_
Definition: BxTiming.h:95
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 55 of file BxTiming.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::bookProfile(), fedRange_, fedRef_, plotBeamSpotDB::first, hBxDiffAllFed, hBxDiffAllFedSpread, hBxDiffSysFed, hBxOccyAllFed, hBxOccyAllFedSpread, hBxOccyGtTrigType, hBxOccyOneFed, hBxOccyTrigBit, histFolder_, mps_fire::i, cuy::ii, 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(), MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

56 {
58 
60  for(int i=0; i<nfed_;i++) {
61  nBxDiff[i][0]=0; nBxDiff[i][1]=nbig_; nBxDiff[i][2]=-1*nbig_;
62  nBxOccy[i][0]=0; nBxOccy[i][1]=nbig_; nBxOccy[i][2]=-1*nbig_;
63  }
64 
65  std::string lbl("");
66  std::string SysLabel[NSYS] = {
67  "PreShower", "ECAL", "HCAL", "GCT", "CSCTPG", "CSCTF", "DTTPG", "DTTF", "RPC", "GT"
68  };
69 
70  typedef std::pair<int, int> FEDRange;
71 
72  std::pair<int,int> fedRange[NSYS] = {
83  };
84  for(int i=0; i<NSYS; i++) fedRange_[i]=fedRange[i];
85 
86 
87  int fedRefSys=-1;
88  for(int i=0; i<NSYS; i++)
90  {fedRefSys=i; break;}
91  std::string refName("");
92  std::string spreadLabel[nspr_] = {"Spread","Min", "Max"};
93  if(fedRefSys>=0)
94  refName+=SysLabel[fedRefSys];
95  else
96  refName+=fedRef_;
97 
99 
100  const int dbx = nbig_;
101 
102  ibooker.setCurrentFolder(histFolder_);
103 
104  hBxDiffAllFed = ibooker.bookProfile("BxDiffAllFed", "BxDiffAllFed",
105  nfed_ + 1, -0.5, nfed_+0.5,
106  2*dbx+1, -1*dbx-0.5,dbx+0.5
107  );
108 
109  for(int i=0; i<nspr_; i++) {
110  lbl.clear();lbl+="BxDiffAllFed";lbl+=spreadLabel[i];
111  hBxDiffAllFedSpread[i] = ibooker.book1D(lbl.data(),lbl.data(), nfed_ + 1, -0.5, nfed_+0.5);
112  lbl.clear();lbl+="BxOccyAllFed";lbl+=spreadLabel[i];
113  hBxOccyAllFedSpread[i] = ibooker.book1D(lbl.data(),lbl.data(), nfed_ + 1, -0.5, nfed_+0.5);
114 
115  lbl.clear();lbl+="BxOccyAllFed";
116  hBxOccyAllFed = ibooker.book1D(lbl.data(),lbl.data(),norb_+1,-0.5,norb_+0.5);
117 
118  }
119 
120  // following histos defined only when not runing in the ff
121  if(!runInFF_) {
122 
123  ibooker.setCurrentFolder(histFolder_);
124 
125  for(int i=0; i<NSYS; i++) {
126  lbl.clear();lbl+=SysLabel[i];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(),lbl.data(), nfeds,
130  fedRange_[i].first-0.5, fedRange_[i].second+0.5,
131  2*dbx+1,-1*dbx-0.5,dbx+0.5);
132 
133  }
134 
135 
136  lbl.clear();lbl+="BxOccyAllFed";
138  ibooker.setCurrentFolder(histFolder_+"/SingleFed");
139  for(int i=0; i<nfed_; i++) {
140  lbl.clear(); lbl+="BxOccyOneFed";
141  char *ii = new char[1000]; std::sprintf(ii,"%d",i);lbl+=ii;
142  hBxOccyOneFed[i] = ibooker.book1D(lbl.data(),lbl.data(),norb_+1,-0.5,norb_+0.5);
143  delete [] ii;
144  }
145 
146  ibooker.setCurrentFolder(histFolder_);
147  for(int i=0; i<nttype_; i++) {
148  lbl.clear();lbl+="BxOccyGtTrigType";
149  char *ii = new char[10]; std::sprintf(ii,"%d",i+1);lbl+=ii;
150  hBxOccyGtTrigType[i] = ibooker.book1D(lbl.data(),lbl.data(),norb_+1,-0.5,norb_+0.5);
151  delete [] ii;
152  }
153 
154  ibooker.setCurrentFolder(histFolder_+"/SingleBit");
155  for(int i=0; i<NSYS; i++) {
156  hBxOccyTrigBit[i] = new MonitorElement*[listGtBits_.size()];
157  for(size_t j=0; j<listGtBits_.size(); j++) {
158  lbl.clear();lbl+=SysLabel[i];lbl+="BxOccyGtBit";
159  char *ii = new char[1000]; std::sprintf(ii,"%d",listGtBits_.at(j)); lbl+=ii;
160  hBxOccyTrigBit[i][j] = ibooker.book1D(lbl.data(),lbl.data(),norb_+1,-0.5,norb_+0.5);
161  delete [] ii;
162  }
163  }
164 
165  }
166 
168  hBxDiffAllFed->setAxisTitle("FED ID",1);
169  lbl.clear(); lbl+="BX(fed)-BX("; lbl+=refName; lbl+=")";
170  hBxDiffAllFed->setAxisTitle(lbl,2);
171  for(int i=0; i<nspr_; i++) {
172  lbl.clear(); lbl+="BX(fed)-BX("; lbl+=refName; lbl+=") "+spreadLabel[i];
173  hBxDiffAllFedSpread[i]->setAxisTitle("FED ID",1);
175  lbl.clear(); lbl+="Bx FED occupancy"; lbl+=" "; lbl+=spreadLabel[i];
176  hBxOccyAllFedSpread[i]->setAxisTitle("FED ID",1);
178  }
179 
180  hBxOccyAllFed->setAxisTitle("bx",1);
181  lbl.clear(); lbl+="Combined FED occupancy";
182  hBxOccyAllFed->setAxisTitle(lbl,2);
183 
184  // skip next if running in filter farm
185  if(runInFF_)
186  return;
187 
188  for(int i=0; i<NSYS; i++) {
189  lbl.clear(); lbl+=SysLabel[i]; lbl+=" FED ID";
190  hBxDiffSysFed[i]->setAxisTitle(lbl,1);
191  lbl.clear(); lbl+="BX("; lbl+=SysLabel[i]; lbl+=")-BX(";lbl+=refName; lbl+=")";
192  hBxDiffSysFed[i]->setAxisTitle(lbl,2);
193  }
194 
195  for(int i=0; i<nfed_; i++) {
196  hBxOccyOneFed[i] ->setAxisTitle("bx",1);
197  lbl.clear(); lbl+=" FED "; char *ii = new char[1000]; std::sprintf(ii,"%d",i);lbl+=ii; lbl+=" occupancy";
198  hBxOccyOneFed[i] ->setAxisTitle(lbl,2);
199  delete [] ii;
200  }
201  for(int i=0; i<nttype_; i++) {
202  hBxOccyGtTrigType[i]->setAxisTitle("bx",1);
203  lbl.clear(); lbl+="GT occupancy for trigger type "; char *ii = new char[10]; std::sprintf(ii,"%d",i+1);lbl+=ii;
205  delete [] ii;
206  }
207 
208  for(int i=0; i<NSYS; i++) {
209  for(size_t j=0; j<listGtBits_.size(); j++) {
210  hBxOccyTrigBit[i][j]->setAxisTitle("bx",1);
211  lbl.clear();lbl+=SysLabel[i];lbl+=" Bx occupancy for Trigger bit ";
212  char *ii = new char[10]; std::sprintf(ii,"%d",listGtBits_.at(j)); lbl+=ii;
213  hBxOccyTrigBit[i][j]->setAxisTitle(lbl,2);
214  delete [] ii;
215  }
216  }
217 }
static const int nttype_
Definition: BxTiming.h:85
static const int norb_
Definition: BxTiming.h:81
MonitorElement * hBxDiffAllFed
histograms
Definition: BxTiming.h:100
int nBxOccy[FEDNumbering::MAXFEDID+1][nspr_]
Definition: BxTiming.h:97
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:160
MonitorElement * hBxDiffAllFedSpread[nspr_]
Definition: BxTiming.h:105
std::vector< int > listGtBits_
Definition: BxTiming.h:87
#define nfed_
Definition: BxTiming.h:32
MonitorElement * hBxOccyAllFed
Definition: BxTiming.h:102
MonitorElement ** hBxOccyOneFed
Definition: BxTiming.h:103
static const int nbig_
Definition: BxTiming.h:84
U second(std::pair< T, U > const &p)
MonitorElement * hBxOccyGtTrigType[nttype_]
Definition: BxTiming.h:108
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
ii
Definition: cuy.py:588
bool runInFF_
Definition: BxTiming.h:78
std::string histFolder_
Definition: BxTiming.h:74
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
int fedRef_
Definition: BxTiming.h:92
MonitorElement * hBxDiffSysFed[NSYS]
Definition: BxTiming.h:101
MonitorElement ** hBxOccyTrigBit[NSYS]
Definition: BxTiming.h:109
int nBxDiff[FEDNumbering::MAXFEDID+1][nspr_]
Definition: BxTiming.h:96
std::pair< int, int > fedRange_[NSYS]
Definition: BxTiming.h:91
MonitorElement * hBxOccyAllFedSpread[nspr_]
Definition: BxTiming.h:106
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
static const int nspr_
Definition: BxTiming.h:95
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 377 of file BxTiming.cc.

References diffTreeTool::diff, half_norb_, and norb_.

Referenced by analyze(), and verbose().

378 {
379  int diff = bx1 - bx2;
380 
381  while (diff < -half_norb_)
382  diff += norb_;
383 
384  while (diff > half_norb_)
385  diff -= norb_;
386 
387  return diff;
388 }
static const int norb_
Definition: BxTiming.h:81
static const int half_norb_
Definition: BxTiming.h:82
void BxTiming::dqmBeginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 220 of file BxTiming.cc.

220  {
221 
222 }
int BxTiming::verbose ( )
inlineprivate

Definition at line 57 of file BxTiming.h.

References calcBxDiff(), and verbose_.

Referenced by analyze(), and BxTiming().

57 {return verbose_;}
int verbose_
Definition: BxTiming.h:56

Member Data Documentation

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

Definition at line 91 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

int BxTiming::fedRef_
private

Definition at line 92 of file BxTiming.h.

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

edm::InputTag BxTiming::fedSource_
private

Definition at line 50 of file BxTiming.h.

Referenced by analyze(), and BxTiming().

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

Definition at line 51 of file BxTiming.h.

Referenced by analyze(), and BxTiming().

edm::InputTag BxTiming::gtSource_
private

Definition at line 52 of file BxTiming.h.

Referenced by BxTiming().

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

Definition at line 53 of file BxTiming.h.

Referenced by analyze(), and BxTiming().

const int BxTiming::half_norb_ = norb_ / 2
staticprivate

Definition at line 82 of file BxTiming.h.

Referenced by calcBxDiff().

MonitorElement* BxTiming::hBxDiffAllFed
private

histograms

Definition at line 100 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BxTiming::hBxDiffAllFedSpread[nspr_]
private

Definition at line 105 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BxTiming::hBxDiffSysFed[NSYS]
private

Definition at line 101 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BxTiming::hBxOccyAllFed
private

Definition at line 102 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BxTiming::hBxOccyAllFedSpread[nspr_]
private

Definition at line 106 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BxTiming::hBxOccyGtTrigType[nttype_]
private

Definition at line 108 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

MonitorElement** BxTiming::hBxOccyOneFed
private

Definition at line 103 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

MonitorElement** BxTiming::hBxOccyTrigBit[NSYS]
private

Definition at line 109 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

std::string BxTiming::histFile_
private

Definition at line 71 of file BxTiming.h.

Referenced by BxTiming().

std::string BxTiming::histFolder_
private

Definition at line 74 of file BxTiming.h.

Referenced by bookHistograms(), and BxTiming().

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

Definition at line 87 of file BxTiming.h.

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

const int BxTiming::nbig_ = 10000
staticprivate

Definition at line 84 of file BxTiming.h.

Referenced by bookHistograms().

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

Definition at line 96 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 97 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

int BxTiming::nEvt_
private

Definition at line 68 of file BxTiming.h.

Referenced by analyze(), and BxTiming().

const int BxTiming::norb_ = 3564
staticprivate

Definition at line 81 of file BxTiming.h.

Referenced by bookHistograms(), and calcBxDiff().

const int BxTiming::nspr_ =3
staticprivate

Definition at line 95 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

const int BxTiming::nttype_ = 6
staticprivate

Definition at line 85 of file BxTiming.h.

Referenced by analyze(), and bookHistograms().

bool BxTiming::runInFF_
private

Definition at line 78 of file BxTiming.h.

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

int BxTiming::verbose_
private

Definition at line 56 of file BxTiming.h.

Referenced by BxTiming(), and verbose().