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:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

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

Protected Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob (void)
 
virtual void beginRun (edm::Run const &iRun, edm::EventSetup const &iSetup)
 
virtual void endJob ()
 
- 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

DQMStoredbe
 
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_
 
int nBxDiff [1500][nspr_]
 
int nBxOccy [1500][nspr_]
 
int nEvt_
 
int nfed_
 
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::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 32 of file BxTiming.h.

Member Enumeration Documentation

enum BxTiming::nsys
private
Enumerator
NSYS 

Definition at line 90 of file BxTiming.h.

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

Definition at line 91 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, dbe, fedRef_, fedSource_, fedSource_token_, edm::ParameterSet::getUntrackedParameter(), gtSource_, gtSource_token_, histFile_, histFolder_, i, listGtBits_, FEDNumbering::MAXFEDID, nEvt_, nfed_, NULL, cppFunctionSkipper::operator, runInFF_, DQMStore::setCurrentFolder(), DQMStore::setVerbose(), 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 
47 
48  dbe = NULL;
49  if (iConfig.getUntrackedParameter<bool>("DQMStore", false)) {
51  dbe->setVerbose(0);
52  }
53 
54  if(dbe!=NULL)
55  dbe->setCurrentFolder(histFolder_);
56 
57  nEvt_ = 0;
58 
59  if(verbose())
60  std::cout << "BxTiming::BxTiming constructor...done.\n" << std::flush;
61 }
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
DQMStore * dbe
Definition: BxTiming.h:76
std::vector< int > listGtBits_
Definition: BxTiming.h:88
int verbose()
Definition: BxTiming.h:56
std::string histFile_
Definition: BxTiming.h:70
#define NULL
Definition: scimark2.h:8
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtSource_token_
Definition: BxTiming.h:52
int nEvt_
Definition: BxTiming.h:67
int verbose_
Definition: BxTiming.h:55
void setVerbose(unsigned level)
Definition: DQMStore.cc:648
edm::InputTag fedSource_
Definition: BxTiming.h:49
bool runInFF_
Definition: BxTiming.h:79
std::string histFolder_
Definition: BxTiming.h:73
edm::InputTag gtSource_
Definition: BxTiming.h:51
edm::EDGetTokenT< FEDRawDataCollection > fedSource_token_
Definition: BxTiming.h:50
int fedRef_
Definition: BxTiming.h:94
int nfed_
Definition: BxTiming.h:93
tuple cout
Definition: gather_cfg.py:121
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:684
BxTiming::~BxTiming ( )

Definition at line 63 of file BxTiming.cc.

63 {}

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::EDAnalyzer.

Definition at line 263 of file BxTiming.cc.

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

263  {
264 
265  if(verbose())
266  std::cout << "BxTiming::analyze() start\n" << std::flush;
267 
268  nEvt_++;
269 
272  iEvent.getByToken(fedSource_token_, rawdata);
273 
274  if (!rawdata.isValid()) {
275 
276  if (verbose())
277  std::cout
278  << "BxTiming::analyze() | FEDRawDataCollection with input tag "
279  << fedSource_ << " not found.";
280 
281  return;
282  }
283 
284  // get the GT bits
286  iEvent.getByToken(gtSource_token_, gtdata);
287  std::vector<bool> gtbits;
288  int ngtbits = 128;
289  gtbits.reserve(ngtbits); for(int i=0; i<ngtbits; i++) gtbits[i]=false;
290  if(gtdata.isValid())
291  gtbits = gtdata->decisionWord();
292 
293  if(gtbits.size()==0) {
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 
310  // get reference bx
311  int bxRef = FEDHeader(rawdata->FEDData(fedRef_).data()).bxID();
312 
313  // triggerType
314  //trigger types: physics (1), calibration (2), random (3), traced physics (5), test (6)
315  //int ttype = FEDHeader(rawdata->FEDData(812).data()).triggerType();
316  int ttype = static_cast<double> (iEvent.eventAuxiliary().experimentType());
317 
318  // loop over feds
319  for (int i = 0; i<FEDNumbering::MAXFEDID+1; i++){
320  const FEDRawData& data = rawdata->FEDData(i);
321  size_t size=data.size();
322 
323  if(!size) continue;
324  FEDHeader header(data.data());
325  //int lvl1id = header.lvl1ID();//Level-1 event number generated by the TTC system
326  int bx = header.bxID(); // The bunch crossing number
327 
328  int bxDiff = calcBxDiff(bx,bxRef); // deviation from reference bx
329 
330  //min
331  if(nBxDiff[i][1]>bxDiff) nBxDiff[i][1] = bxDiff;
332  if(nBxOccy[i][1]>bx ) nBxOccy[i][1] = bx;
333  //max
334  if(nBxDiff[i][2]<bxDiff) nBxDiff[i][2] = bxDiff;
335  if(nBxOccy[i][2]<bx ) nBxOccy[i][2] = bx;
336 
337  if(verbose())
338  std::cout << " fed:" << i
339  << " bx:" << bx
340  << " bxRef:" << bxRef
341  << " diff:" << bxDiff
342  << " nBxDiff"<<" del:"<<nBxDiff[i][0]<<" min:"<<nBxDiff[i][1]<<" max:"<<nBxDiff[i][2]
343  << " nBxOccy"<<" del:"<<nBxOccy[i][0]<<" min:"<<nBxOccy[i][1]<<" max:"<<nBxOccy[i][2]
344  << "\n" << 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 
352  // done if running in filter farm
353  if(runInFF_)
354  continue;
355 
356  for(int j=0; j<NSYS; j++)
357  if(i>=fedRange_[j].first && i<=fedRange_[j].second)
358  hBxDiffSysFed[j]->Fill(i,bxDiff);
359 
360  for(size_t k=0; k!=listGtBits_.size(); k++) {
361  if((int)gtbits.size() <= listGtBits_.at(k)) {
362  if(verbose())
363  std::cout << "BxTiming analyze | problem with vector size!\n" << std::endl;
364  continue;
365  }
366  else if(!gtbits.at(listGtBits_.at(k)))
367  continue;
368  for(int j=0; j<NSYS; j++) {
369  if(i>=fedRange_[j].first && i<=fedRange_[j].second) {
370  hBxOccyTrigBit[j][k]->Fill(bx);
371  }
372  }
373  }
374 
375  if(i>=fedRange_[GLT].first && i<=fedRange_[GLT].second) //GT fed
376  if(ttype<nttype_)
377  hBxOccyGtTrigType[ttype-1]->Fill(bx);
378 
379  if(ttype!=1) continue; //skip if not a physics trigger
380  //hBxOccyAllFed->Fill(bx);
381  hBxOccyOneFed[i]->Fill(bx);
382 
383  }
384 
385 
386  for(int i=0; i<nfed_;i++) {
387  nBxDiff[i][0]=nBxDiff[i][2]-nBxDiff[i][1];
388  nBxOccy[i][0]=nBxOccy[i][2]-nBxOccy[i][1];
389  if(nBxDiff[i][0]<0 || nBxOccy[i][0]<0) continue;
390  for(int j=0; j<nspr_; j++) {
391  hBxDiffAllFedSpread[j]->setBinContent(i,nBxDiff[i][j]);
392  hBxOccyAllFedSpread[j]->setBinContent(i,nBxOccy[i][j]);
393  }
394  if(verbose())
395  std::cout << "BxTiming fed:" << i
396  << " Bx-Bx(" << fedRef_ << ")::"
397  << " del:" << nBxDiff[i][0]
398  << " min:" << nBxDiff[i][1]
399  << " max:" << nBxDiff[i][2]
400  << " Occy: "
401  << " del:" << nBxOccy[i][0]
402  << " min:" << nBxOccy[i][1]
403  << " max:" << nBxOccy[i][2]
404  <<"\n" << std::flush;
405 
406  }
407 
408 
409  if(verbose())
410  std::cout << "BxTiming::analyze() end.\n" << std::flush;
411 }
static const int nttype_
Definition: BxTiming.h:86
int i
Definition: DBlmapReader.cc:9
MonitorElement * hBxDiffAllFed
histograms
Definition: BxTiming.h:102
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * hBxDiffAllFedSpread[nspr_]
Definition: BxTiming.h:107
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
std::vector< int > listGtBits_
Definition: BxTiming.h:88
int verbose()
Definition: BxTiming.h:56
int ii
Definition: cuy.py:588
MonitorElement * hBxOccyAllFed
Definition: BxTiming.h:104
MonitorElement ** hBxOccyOneFed
Definition: BxTiming.h:105
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtSource_token_
Definition: BxTiming.h:52
void Fill(long long x)
ExperimentType experimentType() const
int nBxOccy[1500][nspr_]
Definition: BxTiming.h:99
U second(std::pair< T, U > const &p)
MonitorElement * hBxOccyGtTrigType[nttype_]
Definition: BxTiming.h:110
int nEvt_
Definition: BxTiming.h:67
int nBxDiff[1500][nspr_]
Definition: BxTiming.h:98
int j
Definition: DBlmapReader.cc:9
edm::InputTag fedSource_
Definition: BxTiming.h:49
bool first
Definition: L1TdeRCT.cc:75
bool isValid() const
Definition: HandleBase.h:76
bool runInFF_
Definition: BxTiming.h:79
EventAuxiliary const & eventAuxiliary() const
Definition: Event.h:69
edm::EDGetTokenT< FEDRawDataCollection > fedSource_token_
Definition: BxTiming.h:50
int bxID()
The bunch crossing number.
Definition: FEDHeader.cc:24
int fedRef_
Definition: BxTiming.h:94
MonitorElement * hBxDiffSysFed[NSYS]
Definition: BxTiming.h:103
MonitorElement ** hBxOccyTrigBit[NSYS]
Definition: BxTiming.h:111
int nfed_
Definition: BxTiming.h:93
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:416
tuple cout
Definition: gather_cfg.py:121
dictionary rawdata
Definition: lumiPlot.py:393
std::pair< int, int > fedRange_[NSYS]
Definition: BxTiming.h:92
MonitorElement * hBxOccyAllFedSpread[nspr_]
Definition: BxTiming.h:108
tuple size
Write out results.
static const int nspr_
Definition: BxTiming.h:97
void BxTiming::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 66 of file BxTiming.cc.

References gather_cfg::cout, and verbose().

66  {
67 
68  if(verbose())
69  std::cout << "BxTiming::beginJob() start\n" << std::flush;
70 
71  if(verbose())
72  std::cout << "BxTiming::beginJob() end.\n" << std::flush;
73 }
int verbose()
Definition: BxTiming.h:56
tuple cout
Definition: gather_cfg.py:121
void BxTiming::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
protectedvirtual

initialize counters

book the histograms

labeling (cosmetics added here)

Reimplemented from edm::EDAnalyzer.

Definition at line 78 of file BxTiming.cc.

References DQMStore::book1D(), DQMStore::bookProfile(), dbe, fedRange_, fedRef_, 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_, runInFF_, edm::second(), MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

79 {
80  if(dbe) {
82  }
83 
85  for(int i=0; i<nfed_;i++) {
86  nBxDiff[i][0]=0; nBxDiff[i][1]=nbig_; nBxDiff[i][2]=-1*nbig_;
87  nBxOccy[i][0]=0; nBxOccy[i][1]=nbig_; nBxOccy[i][2]=-1*nbig_;
88  }
89 
90  std::string lbl("");
91  std::string SysLabel[NSYS] = {
92  "PreShower", "ECAL", "HCAL", "GCT", "CSCTPG", "CSCTF", "DTTPG", "DTTF", "RPC", "GT"
93  };
94 
95  typedef std::pair<int, int> FEDRange;
96 
97  std::pair<int,int> fedRange[NSYS] = {
108  };
109  for(int i=0; i<NSYS; i++) fedRange_[i]=fedRange[i];
110 
111 
112  int fedRefSys=-1;
113  for(int i=0; i<NSYS; i++)
115  {fedRefSys=i; break;}
116  std::string refName("");
117  std::string spreadLabel[nspr_] = {"Spread","Min", "Max"};
118  if(fedRefSys>=0)
119  refName+=SysLabel[fedRefSys];
120  else
121  refName+=fedRef_;
122 
124 
125  const int dbx = nbig_;
126 
127  if(dbe) {
128 
130 
131  hBxDiffAllFed = dbe->bookProfile("BxDiffAllFed", "BxDiffAllFed",
132  nfed_ + 1, -0.5, nfed_+0.5,
133  2*dbx+1, -1*dbx-0.5,dbx+0.5
134  );
135 
136  for(int i=0; i<nspr_; i++) {
137  lbl.clear();lbl+="BxDiffAllFed";lbl+=spreadLabel[i];
138  hBxDiffAllFedSpread[i] = dbe->book1D(lbl.data(),lbl.data(), nfed_ + 1, -0.5, nfed_+0.5);
139  lbl.clear();lbl+="BxOccyAllFed";lbl+=spreadLabel[i];
140  hBxOccyAllFedSpread[i] = dbe->book1D(lbl.data(),lbl.data(), nfed_ + 1, -0.5, nfed_+0.5);
141  }
142 
143  lbl.clear();lbl+="BxOccyAllFed";
144  hBxOccyAllFed = dbe->book1D(lbl.data(),lbl.data(),norb_+1,-0.5,norb_+0.5);
145 
146  }
147 
148  // following histos defined only when not runing in the ff
149  if(dbe && !runInFF_) {
150 
152 
153  for(int i=0; i<NSYS; i++) {
154  lbl.clear();lbl+=SysLabel[i];lbl+="FedBxDiff";
155  int nfeds = fedRange_[i].second - fedRange_[i].first + 1;
156  nfeds = (nfeds>0)? nfeds:1;
157  hBxDiffSysFed[i] = dbe->bookProfile(lbl.data(),lbl.data(), nfeds,
158  fedRange_[i].first-0.5, fedRange_[i].second+0.5,
159  2*dbx+1,-1*dbx-0.5,dbx+0.5);
160 
161  }
162 
163 
164  lbl.clear();lbl+="BxOccyAllFed";
166  dbe->setCurrentFolder(histFolder_+"/SingleFed");
167  for(int i=0; i<nfed_; i++) {
168  lbl.clear(); lbl+="BxOccyOneFed";
169  char *ii = new char[1000]; std::sprintf(ii,"%d",i);lbl+=ii;
170  hBxOccyOneFed[i] = dbe->book1D(lbl.data(),lbl.data(),norb_+1,-0.5,norb_+0.5);
171  delete [] ii;
172  }
173 
175  for(int i=0; i<nttype_; i++) {
176  lbl.clear();lbl+="BxOccyGtTrigType";
177  char *ii = new char[10]; std::sprintf(ii,"%d",i+1);lbl+=ii;
178  hBxOccyGtTrigType[i] = dbe->book1D(lbl.data(),lbl.data(),norb_+1,-0.5,norb_+0.5);
179  delete [] ii;
180  }
181 
182  dbe->setCurrentFolder(histFolder_+"/SingleBit");
183  for(int i=0; i<NSYS; i++) {
184  hBxOccyTrigBit[i] = new MonitorElement*[listGtBits_.size()];
185  for(size_t j=0; j<listGtBits_.size(); j++) {
186  lbl.clear();lbl+=SysLabel[i];lbl+="BxOccyGtBit";
187  char *ii = new char[1000]; std::sprintf(ii,"%d",listGtBits_.at(j)); lbl+=ii;
188  hBxOccyTrigBit[i][j] = dbe->book1D(lbl.data(),lbl.data(),norb_+1,-0.5,norb_+0.5);
189  delete [] ii;
190  }
191  }
192 
193  }
194 
196  hBxDiffAllFed->setAxisTitle("FED ID",1);
197  lbl.clear(); lbl+="BX(fed)-BX("; lbl+=refName; lbl+=")";
198  hBxDiffAllFed->setAxisTitle(lbl,2);
199  for(int i=0; i<nspr_; i++) {
200  lbl.clear(); lbl+="BX(fed)-BX("; lbl+=refName; lbl+=") "+spreadLabel[i];
201  hBxDiffAllFedSpread[i]->setAxisTitle("FED ID",1);
203  lbl.clear(); lbl+="Bx FED occupancy"; lbl+=" "; lbl+=spreadLabel[i];
204  hBxOccyAllFedSpread[i]->setAxisTitle("FED ID",1);
206  }
207 
208  hBxOccyAllFed->setAxisTitle("bx",1);
209  lbl.clear(); lbl+="Combined FED occupancy";
210  hBxOccyAllFed->setAxisTitle(lbl,2);
211 
212  // skip next if running in filter farm
213  if(runInFF_)
214  return;
215 
216  for(int i=0; i<NSYS; i++) {
217  lbl.clear(); lbl+=SysLabel[i]; lbl+=" FED ID";
218  hBxDiffSysFed[i]->setAxisTitle(lbl,1);
219  lbl.clear(); lbl+="BX("; lbl+=SysLabel[i]; lbl+=")-BX(";lbl+=refName; lbl+=")";
220  hBxDiffSysFed[i]->setAxisTitle(lbl,2);
221  }
222 
223  for(int i=0; i<nfed_; i++) {
224  hBxOccyOneFed[i] ->setAxisTitle("bx",1);
225  lbl.clear(); lbl+=" FED "; char *ii = new char[1000]; std::sprintf(ii,"%d",i);lbl+=ii; lbl+=" occupancy";
226  hBxOccyOneFed[i] ->setAxisTitle(lbl,2);
227  delete [] ii;
228  }
229  for(int i=0; i<nttype_; i++) {
230  hBxOccyGtTrigType[i]->setAxisTitle("bx",1);
231  lbl.clear(); lbl+="GT occupancy for trigger type "; char *ii = new char[10]; std::sprintf(ii,"%d",i+1);lbl+=ii;
233  delete [] ii;
234  }
235 
236  for(int i=0; i<NSYS; i++) {
237  for(size_t j=0; j<listGtBits_.size(); j++) {
238  hBxOccyTrigBit[i][j]->setAxisTitle("bx",1);
239  lbl.clear();lbl+=SysLabel[i];lbl+=" Bx occupancy for Trigger bit ";
240  char *ii = new char[10]; std::sprintf(ii,"%d",listGtBits_.at(j)); lbl+=ii;
241  hBxOccyTrigBit[i][j]->setAxisTitle(lbl,2);
242  delete [] ii;
243  }
244  }
245 }
static const int nttype_
Definition: BxTiming.h:86
int i
Definition: DBlmapReader.cc:9
static const int norb_
Definition: BxTiming.h:82
DQMStore * dbe
Definition: BxTiming.h:76
MonitorElement * hBxDiffAllFed
histograms
Definition: BxTiming.h:102
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:971
MonitorElement * hBxDiffAllFedSpread[nspr_]
Definition: BxTiming.h:107
std::vector< int > listGtBits_
Definition: BxTiming.h:88
int ii
Definition: cuy.py:588
MonitorElement * hBxOccyAllFed
Definition: BxTiming.h:104
MonitorElement ** hBxOccyOneFed
Definition: BxTiming.h:105
static const int nbig_
Definition: BxTiming.h:85
int nBxOccy[1500][nspr_]
Definition: BxTiming.h:99
U second(std::pair< T, U > const &p)
MonitorElement * hBxOccyGtTrigType[nttype_]
Definition: BxTiming.h:110
int nBxDiff[1500][nspr_]
Definition: BxTiming.h:98
int j
Definition: DBlmapReader.cc:9
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1285
bool first
Definition: L1TdeRCT.cc:75
bool runInFF_
Definition: BxTiming.h:79
std::string histFolder_
Definition: BxTiming.h:73
int fedRef_
Definition: BxTiming.h:94
MonitorElement * hBxDiffSysFed[NSYS]
Definition: BxTiming.h:103
MonitorElement ** hBxOccyTrigBit[NSYS]
Definition: BxTiming.h:111
int nfed_
Definition: BxTiming.h:93
std::pair< int, int > fedRange_[NSYS]
Definition: BxTiming.h:92
MonitorElement * hBxOccyAllFedSpread[nspr_]
Definition: BxTiming.h:108
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:684
static const int nspr_
Definition: BxTiming.h:97
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 416 of file BxTiming.cc.

References diffTreeTool::diff, half_norb_, and norb_.

Referenced by analyze().

417 {
418  int diff = bx1 - bx2;
419 
420  while (diff < -half_norb_)
421  diff += norb_;
422 
423  while (diff > half_norb_)
424  diff -= norb_;
425 
426  return diff;
427 }
static const int norb_
Definition: BxTiming.h:82
static const int half_norb_
Definition: BxTiming.h:83
void BxTiming::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 248 of file BxTiming.cc.

References gather_cfg::cout, dbe, histFile_, nEvt_, DQMStore::save(), and verbose().

248  {
249 
250  if(verbose())
251  std::cout << "BxTiming::endJob Nevents: " << nEvt_ << "\n" << std::flush;
252 
253  if(histFile_.size()!=0 && dbe)
254  dbe->save(histFile_);
255 
256  if(verbose())
257  std::cout << "BxTiming::endJob() end.\n" << std::flush;
258 }
DQMStore * dbe
Definition: BxTiming.h:76
int verbose()
Definition: BxTiming.h:56
std::string histFile_
Definition: BxTiming.h:70
int nEvt_
Definition: BxTiming.h:67
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2562
tuple cout
Definition: gather_cfg.py:121
int BxTiming::verbose ( )
inlineprivate

Definition at line 56 of file BxTiming.h.

References verbose_.

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

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

Member Data Documentation

DQMStore* BxTiming::dbe
private

Definition at line 76 of file BxTiming.h.

Referenced by beginRun(), BxTiming(), and endJob().

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

Definition at line 92 of file BxTiming.h.

Referenced by analyze(), and beginRun().

int BxTiming::fedRef_
private

Definition at line 94 of file BxTiming.h.

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

edm::InputTag BxTiming::fedSource_
private

Definition at line 49 of file BxTiming.h.

Referenced by analyze(), and BxTiming().

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

Definition at line 50 of file BxTiming.h.

Referenced by analyze(), and BxTiming().

edm::InputTag BxTiming::gtSource_
private

Definition at line 51 of file BxTiming.h.

Referenced by BxTiming().

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

Definition at line 52 of file BxTiming.h.

Referenced by analyze(), and BxTiming().

const int BxTiming::half_norb_ = norb_ / 2
staticprivate

Definition at line 83 of file BxTiming.h.

Referenced by calcBxDiff().

MonitorElement* BxTiming::hBxDiffAllFed
private

histograms

Definition at line 102 of file BxTiming.h.

Referenced by analyze(), and beginRun().

MonitorElement* BxTiming::hBxDiffAllFedSpread[nspr_]
private

Definition at line 107 of file BxTiming.h.

Referenced by analyze(), and beginRun().

MonitorElement* BxTiming::hBxDiffSysFed[NSYS]
private

Definition at line 103 of file BxTiming.h.

Referenced by analyze(), and beginRun().

MonitorElement* BxTiming::hBxOccyAllFed
private

Definition at line 104 of file BxTiming.h.

Referenced by analyze(), and beginRun().

MonitorElement* BxTiming::hBxOccyAllFedSpread[nspr_]
private

Definition at line 108 of file BxTiming.h.

Referenced by analyze(), and beginRun().

MonitorElement* BxTiming::hBxOccyGtTrigType[nttype_]
private

Definition at line 110 of file BxTiming.h.

Referenced by analyze(), and beginRun().

MonitorElement** BxTiming::hBxOccyOneFed
private

Definition at line 105 of file BxTiming.h.

Referenced by analyze(), and beginRun().

MonitorElement** BxTiming::hBxOccyTrigBit[NSYS]
private

Definition at line 111 of file BxTiming.h.

Referenced by analyze(), and beginRun().

std::string BxTiming::histFile_
private

Definition at line 70 of file BxTiming.h.

Referenced by BxTiming(), and endJob().

std::string BxTiming::histFolder_
private

Definition at line 73 of file BxTiming.h.

Referenced by beginRun(), and BxTiming().

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

Definition at line 88 of file BxTiming.h.

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

const int BxTiming::nbig_ = 10000
staticprivate

Definition at line 85 of file BxTiming.h.

Referenced by beginRun().

int BxTiming::nBxDiff[1500][nspr_]
private

Definition at line 98 of file BxTiming.h.

Referenced by analyze(), and beginRun().

int BxTiming::nBxOccy[1500][nspr_]
private

Definition at line 99 of file BxTiming.h.

Referenced by analyze(), and beginRun().

int BxTiming::nEvt_
private

Definition at line 67 of file BxTiming.h.

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

int BxTiming::nfed_
private

Definition at line 93 of file BxTiming.h.

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

const int BxTiming::norb_ = 3564
staticprivate

Definition at line 82 of file BxTiming.h.

Referenced by beginRun(), and calcBxDiff().

const int BxTiming::nspr_ =3
staticprivate

Definition at line 97 of file BxTiming.h.

Referenced by analyze(), and beginRun().

const int BxTiming::nttype_ = 6
staticprivate

Definition at line 86 of file BxTiming.h.

Referenced by analyze(), and beginRun().

bool BxTiming::runInFF_
private

Definition at line 79 of file BxTiming.h.

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

int BxTiming::verbose_
private

Definition at line 55 of file BxTiming.h.

Referenced by BxTiming(), and verbose().