CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 BxTiming (const edm::ParameterSet &)
 
 ~BxTiming ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void bookHistograms (DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
 
virtual void dqmBeginRun (edm::Run const &iRun, edm::EventSetup const &iSetup)
 
- 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

MonitorElementeventId_
 
std::pair< int, int > fedRange_ [NSYS]
 
int fedRef_
 
edm::InputTag fedSource_
 
edm::EDGetTokenT
< FEDRawDataCollection
fedSource_token_
 
edm::InputTag gtSource_
 
edm::EDGetTokenT
< L1GlobalTriggerReadoutRecord
gtSource_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_
 
MonitorElementlumisecId_
 
int nBxDiff [FEDNumbering::MAXFEDID+1][nspr_]
 
int nBxOccy [FEDNumbering::MAXFEDID+1][nspr_]
 
int nEvt_
 
MonitorElementrunId_
 
bool runInFF_
 
MonitorElementrunStartTimeStamp_
 
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::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

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_, i, HLT_25ns14e33_v1_cff::InputTag, 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
int i
Definition: DBlmapReader.cc:9
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
tuple cout
Definition: gather_cfg.py:121
BxTiming::~BxTiming ( )

Definition at line 52 of file BxTiming.cc.

52 {}

Member Function Documentation

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

get the raw data - if not found, return

Implements edm::stream::EDAnalyzerBase.

Definition at line 230 of file BxTiming.cc.

References FEDHeader::bxID(), calcBxDiff(), gather_cfg::cout, FEDRawData::data(), AlCaHLTBitMon_QueryRunRegistry::data, edm::Event::eventAuxiliary(), edm::EventAuxiliary::experimentType(), fedRange_, fedRef_, fedSource_, fedSource_token_, MonitorElement::Fill(), plotBeamSpotDB::first, edm::Event::getByToken(), GLT, gtSource_token_, hBxDiffAllFed, hBxDiffAllFedSpread, hBxDiffSysFed, hBxOccyAllFed, hBxOccyAllFedSpread, hBxOccyGtTrigType, hBxOccyOneFed, hBxOccyTrigBit, i, cuy::ii, edm::HandleBase::isValid(), j, relval_steps::k, listGtBits_, FEDNumbering::MAXFEDID, nBxDiff, nBxOccy, nEvt_, nfed_, nspr_, NSYS, nttype_, lumiPlot::rawdata, runInFF_, edm::second(), MonitorElement::setBinContent(), FEDRawData::size(), findQualityFiles::size, and verbose().

230  {
231 
232  if(verbose())
233  std::cout << "BxTiming::analyze() start\n" << std::flush;
234 
235  nEvt_++;
236 
239  iEvent.getByToken(fedSource_token_, rawdata);
240 
241  if (!rawdata.isValid()) {
242 
243  if (verbose())
244  std::cout
245  << "BxTiming::analyze() | FEDRawDataCollection with input tag "
246  << fedSource_ << " not found.";
247 
248  return;
249  }
250 
251  // get the GT bits
253  iEvent.getByToken(gtSource_token_, gtdata);
254  std::vector<bool> gtbits;
255  int ngtbits = 128;
256  gtbits.reserve(ngtbits); for(int i=0; i<ngtbits; i++) gtbits[i]=false;
257  if(gtdata.isValid())
258  gtbits = gtdata->decisionWord();
259 
260  if(gtbits.size()==0) {
261  gtbits.push_back(true); // gtdata->decision();
262  if(verbose())
263  std::cout << "BxTiming::analyze() | unexpected empty decision bits!";
264  }
265 
266  if(verbose()) {
267  std::cout << "BxTiming::analyze() gt data valid:" << (int)(gtdata.isValid()?0:1)
268  << " decision word size:" << (int)(gtbits.size()) << " bits: ";
269  for(size_t i=0; i!=gtbits.size(); i++) {
270  int ii = gtbits.at(i)? 1:0;
271  std::cout << ii;
272  }
273  std::cout << ".\n" << std::flush;
274  }
275 
276 
277  // get reference bx
278  int bxRef = FEDHeader(rawdata->FEDData(fedRef_).data()).bxID();
279 
280  // triggerType
281  // trigger types: physics (1), calibration (2), random (3), traced physics (5), test (6)
282  int ttype = static_cast<double> (iEvent.eventAuxiliary().experimentType());
283 
284  // loop over feds
285  for (int i = 0; i<FEDNumbering::MAXFEDID+1; i++){
286  const FEDRawData& data = rawdata->FEDData(i);
287  size_t size=data.size();
288 
289  if(!size) continue;
290  FEDHeader header(data.data());
291  //int lvl1id = header.lvl1ID(); //Level-1 event number generated by the TTC system
292  int bx = header.bxID(); // The bunch crossing number
293 
294  int bxDiff = calcBxDiff(bx,bxRef); // deviation from reference bx
295 
296  //min
297  if(nBxDiff[i][1]>bxDiff) nBxDiff[i][1] = bxDiff;
298  if(nBxOccy[i][1]>bx ) nBxOccy[i][1] = bx;
299  //max
300  if(nBxDiff[i][2]<bxDiff) nBxDiff[i][2] = bxDiff;
301  if(nBxOccy[i][2]<bx ) nBxOccy[i][2] = bx;
302 
303  if(verbose())
304  std::cout << " fed:" << i
305  << " bx:" << bx
306  << " bxRef:" << bxRef
307  << " diff:" << bxDiff
308  << " nBxDiff"<<" del:"<<nBxDiff[i][0]<<" min:"<<nBxDiff[i][1]<<" max:"<<nBxDiff[i][2]
309  << " nBxOccy"<<" del:"<<nBxOccy[i][0]<<" min:"<<nBxOccy[i][1]<<" max:"<<nBxOccy[i][2]
310  << "\n" << std::flush;
311 
312  hBxDiffAllFed->Fill(i,bxDiff);
313 
314  //if(ttype==1) //skip if not a physics trigger
315  hBxOccyAllFed->Fill(bx);
316 
317 
318  // done if running in filter farm
319  if(runInFF_)
320  continue;
321 
322  for(int j=0; j<NSYS; j++)
323  if(i>=fedRange_[j].first && i<=fedRange_[j].second)
324  hBxDiffSysFed[j]->Fill(i,bxDiff);
325 
326  for(size_t k=0; k!=listGtBits_.size(); k++) {
327  if((int)gtbits.size() <= listGtBits_.at(k)) {
328  if(verbose())
329  std::cout << "BxTiming analyze | problem with vector size!\n" << std::endl;
330  continue;
331  }
332  else if(!gtbits.at(listGtBits_.at(k)))
333  continue;
334  for(int j=0; j<NSYS; j++) {
335  if(i>=fedRange_[j].first && i<=fedRange_[j].second) {
336  hBxOccyTrigBit[j][k]->Fill(bx);
337  }
338  }
339  }
340 
341  if(i>=fedRange_[GLT].first && i<=fedRange_[GLT].second) //GT fed
342  if(ttype<nttype_)
343  hBxOccyGtTrigType[ttype-1]->Fill(bx);
344 
345  if(ttype!=1) continue; //skip if not a physics trigger
346  //hBxOccyAllFed->Fill(bx);
347  hBxOccyOneFed[i]->Fill(bx);
348 
349  }
350 
351  for(int i=0; i<nfed_;i++) {
352  nBxDiff[i][0]=nBxDiff[i][2]-nBxDiff[i][1];
353  nBxOccy[i][0]=nBxOccy[i][2]-nBxOccy[i][1];
354  if(nBxDiff[i][0]<0 || nBxOccy[i][0]<0) continue;
355  for(int j=0; j<nspr_; j++) {
356  hBxDiffAllFedSpread[j]->setBinContent(i,nBxDiff[i][j]);
357  hBxOccyAllFedSpread[j]->setBinContent(i,nBxOccy[i][j]);
358  }
359  if(verbose())
360  std::cout << "BxTiming fed:" << i
361  << " Bx-Bx(" << fedRef_ << ")::"
362  << " del:" << nBxDiff[i][0]
363  << " min:" << nBxDiff[i][1]
364  << " max:" << nBxDiff[i][2]
365  << " Occy: "
366  << " del:" << nBxOccy[i][0]
367  << " min:" << nBxOccy[i][1]
368  << " max:" << nBxOccy[i][2]
369  <<"\n" << std::flush;
370 
371  }
372 
373 
374  if(verbose())
375  std::cout << "BxTiming::analyze() end.\n" << std::flush;
376 }
static const int nttype_
Definition: BxTiming.h:85
int i
Definition: DBlmapReader.cc:9
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
MonitorElement * hBxDiffAllFedSpread[nspr_]
Definition: BxTiming.h:105
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
std::vector< int > listGtBits_
Definition: BxTiming.h:87
int verbose()
Definition: BxTiming.h:57
#define nfed_
Definition: BxTiming.h:32
int ii
Definition: cuy.py:588
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
int j
Definition: DBlmapReader.cc:9
edm::InputTag fedSource_
Definition: BxTiming.h:50
bool isValid() const
Definition: HandleBase.h:75
bool runInFF_
Definition: BxTiming.h:78
EventAuxiliary const & eventAuxiliary() const
Definition: Event.h:71
edm::EDGetTokenT< FEDRawDataCollection > fedSource_token_
Definition: BxTiming.h:51
int bxID()
The bunch crossing number.
Definition: FEDHeader.cc:24
int fedRef_
Definition: BxTiming.h:92
MonitorElement * hBxDiffSysFed[NSYS]
Definition: BxTiming.h:101
MonitorElement ** hBxOccyTrigBit[NSYS]
Definition: BxTiming.h:109
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:381
int nBxDiff[FEDNumbering::MAXFEDID+1][nspr_]
Definition: BxTiming.h:96
tuple cout
Definition: gather_cfg.py:121
dictionary rawdata
Definition: lumiPlot.py:393
std::pair< int, int > fedRange_[NSYS]
Definition: BxTiming.h:91
MonitorElement * hBxOccyAllFedSpread[nspr_]
Definition: BxTiming.h:106
tuple size
Write out results.
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::bookFloat(), DQMStore::IBooker::bookInt(), DQMStore::IBooker::bookProfile(), fedRange_, fedRef_, MonitorElement::Fill(), plotBeamSpotDB::first, hBxDiffAllFed, hBxDiffAllFedSpread, hBxDiffSysFed, hBxOccyAllFed, hBxOccyAllFedSpread, hBxOccyGtTrigType, hBxOccyOneFed, hBxOccyTrigBit, histFolder_, i, cuy::ii, 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_, runId_, runInFF_, runStartTimeStamp_, edm::second(), MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

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

References diffTreeTool::diff, half_norb_, and norb_.

Referenced by analyze().

382 {
383  int diff = bx1 - bx2;
384 
385  while (diff < -half_norb_)
386  diff += norb_;
387 
388  while (diff > half_norb_)
389  diff -= norb_;
390 
391  return diff;
392 }
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 
)
protectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 224 of file BxTiming.cc.

224  {
225  //runId_->Fill(r.id().run());
226 }
int BxTiming::verbose ( )
inlineprivate

Definition at line 57 of file BxTiming.h.

References verbose_.

Referenced by analyze(), and BxTiming().

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

Member Data Documentation

MonitorElement* BxTiming::eventId_
private

Definition at line 112 of file BxTiming.h.

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().

MonitorElement* BxTiming::lumisecId_
private

Definition at line 111 of file BxTiming.h.

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().

MonitorElement* BxTiming::runId_
private

Definition at line 110 of file BxTiming.h.

Referenced by bookHistograms().

bool BxTiming::runInFF_
private

Definition at line 78 of file BxTiming.h.

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

MonitorElement* BxTiming::runStartTimeStamp_
private

Definition at line 113 of file BxTiming.h.

Referenced by bookHistograms().

int BxTiming::verbose_
private

Definition at line 56 of file BxTiming.h.

Referenced by BxTiming(), and verbose().