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

Public Member Functions

 BxTiming (const edm::ParameterSet &)
 
 ~BxTiming ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Protected Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob (void)
 
virtual void endJob ()
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Types

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

Private Member Functions

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

Private Attributes

DQMStoredbe
 
std::pair< int, int > fedRange_ [NSYS]
 
int fedRef_
 
edm::InputTag fedSource_
 
edm::InputTag gtSource_
 
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
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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 25 of file BxTiming.h.

Member Enumeration Documentation

enum BxTiming::nsys
private
Enumerator
NSYS 

Definition at line 80 of file BxTiming.h.

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

Definition at line 81 of file BxTiming.h.

Constructor & Destructor Documentation

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

Definition at line 10 of file BxTiming.cc.

References gather_cfg::cout, dbe, fedRef_, fedSource_, edm::ParameterSet::getUntrackedParameter(), gtSource_, histFile_, histFolder_, i, listGtBits_, FEDNumbering::MAXFEDID, nEvt_, nfed_, NULL, cppFunctionSkipper::operator, runInFF_, DQMStore::setCurrentFolder(), DQMStore::setVerbose(), verbose(), and verbose_.

10  {
11 
12  verbose_ = iConfig.getUntrackedParameter<int>("VerboseFlag",0);
13  if(verbose())
14  std::cout << "BxTiming::BxTiming()...\n" << std::flush;
15 
16  fedRef_ = iConfig.getUntrackedParameter<int>("ReferenceFedId",813);
18  ("FedSource",edm::InputTag("source"));
20  ("GtSource",edm::InputTag("gtUnpack"));
21  histFile_ = iConfig.getUntrackedParameter<std::string>
22  ("HistFile","");
23  histFolder_ = iConfig.getUntrackedParameter<std::string>
24  ("HistFolder", "L1T/BXSynch");
25 
26  runInFF_ = iConfig.getUntrackedParameter<bool> ("RunInFilterFarm", true);
27  if(runInFF_) histFolder_ = "L1T/BXSynch_EvF";
28  if(verbose())
29  std::cout << "Filter farm run setting?" << runInFF_
30  << "\n" << std::flush;
31 
32  listGtBits_ = iConfig.getUntrackedParameter<std::vector<int> > ("GtBitList", std::vector<int>(1,0));
33  if(listGtBits_.size()==1 && listGtBits_.at(0)==-1) {
34  int ngtbits = 128;
35  listGtBits_.reserve(ngtbits);
36  for(int i=0; i<ngtbits; i++)
37  listGtBits_[i]=i;
38  }
39 
40  if(verbose()) {
41  std::cout << "BxTiming: gt bits set for timing dqm:";
42  std::cout << "nbits:" << listGtBits_.size() << " list: " ;
43  for(size_t i=0; i!=listGtBits_.size(); i++)
44  std::cout << listGtBits_.at(i) << " " ;
45  std::cout << "\n" << std::flush;
46  }
47 
49 
50  dbe = NULL;
51  if (iConfig.getUntrackedParameter<bool>("DQMStore", false)) {
53  dbe->setVerbose(0);
54  }
55 
56  if(dbe!=NULL)
57  dbe->setCurrentFolder(histFolder_);
58 
59  nEvt_ = 0;
60 
61  if(verbose())
62  std::cout << "BxTiming::BxTiming constructor...done.\n" << std::flush;
63 }
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
DQMStore * dbe
Definition: BxTiming.h:66
std::vector< int > listGtBits_
Definition: BxTiming.h:78
int verbose()
Definition: BxTiming.h:46
std::string histFile_
Definition: BxTiming.h:60
#define NULL
Definition: scimark2.h:8
int nEvt_
Definition: BxTiming.h:57
int verbose_
Definition: BxTiming.h:45
void setVerbose(unsigned level)
Definition: DQMStore.cc:393
edm::InputTag fedSource_
Definition: BxTiming.h:41
bool runInFF_
Definition: BxTiming.h:69
std::string histFolder_
Definition: BxTiming.h:63
edm::InputTag gtSource_
Definition: BxTiming.h:42
int fedRef_
Definition: BxTiming.h:84
int nfed_
Definition: BxTiming.h:83
tuple cout
Definition: gather_cfg.py:121
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
BxTiming::~BxTiming ( )

Definition at line 65 of file BxTiming.cc.

65 {}

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

References calcBxDiff(), gather_cfg::cout, FEDRawData::data(), data, fedRange_, fedRef_, fedSource_, MonitorElement::Fill(), first, edm::Event::getByLabel(), GLT, gtSource_, hBxDiffAllFed, hBxDiffAllFedSpread, hBxDiffSysFed, hBxOccyAllFed, hBxOccyAllFedSpread, hBxOccyGtTrigType, hBxOccyOneFed, hBxOccyTrigBit, errorMatrix2Lands::header, i, edm::HandleBase::isValid(), j, gen::k, listGtBits_, FEDNumbering::MAXFEDID, nBxDiff, nBxOccy, nEvt_, nfed_, nspr_, NSYS, nttype_, lumiPlot::rawdata, runInFF_, edm::second(), MonitorElement::setBinContent(), FEDRawData::size(), findQualityFiles::size, and verbose().

262  {
263 
264  if(verbose())
265  std::cout << "BxTiming::analyze() start\n" << std::flush;
266 
267  nEvt_++;
268 
271  iEvent.getByLabel(fedSource_, rawdata);
272 
273  if (!rawdata.isValid()) {
274 
275  if (verbose())
276  std::cout
277  << "BxTiming::analyze() | FEDRawDataCollection with input tag "
278  << fedSource_ << " not found.";
279 
280  return;
281  }
282 
283  // get the GT bits
285  iEvent.getByLabel(gtSource_, gtdata);
286  std::vector<bool> gtbits;
287  int ngtbits = 128;
288  gtbits.reserve(ngtbits); for(int i=0; i<ngtbits; i++) gtbits[i]=false;
289  if(gtdata.isValid())
290  gtbits = gtdata->decisionWord();
291 
292  if(gtbits.size()==0) {
293  gtbits.push_back(true); // gtdata->decision();
294  if(verbose())
295  std::cout << "BxTiming::analyze() | unexpected empty decision bits!";
296  }
297 
298  if(verbose()) {
299  std::cout << "BxTiming::analyze() gt data valid:" << (int)(gtdata.isValid()?0:1)
300  << " decision word size:" << (int)(gtbits.size()) << " bits: ";
301  for(size_t i=0; i!=gtbits.size(); i++) {
302  int ii = gtbits.at(i)? 1:0;
303  std::cout << ii;
304  }
305  std::cout << ".\n" << std::flush;
306  }
307 
308 
309  // get reference bx
310  int bxRef = FEDHeader(rawdata->FEDData(fedRef_).data()).bxID();
311 
312  // triggerType
313  //trigger types: physics (1), calibration (2), random (3), traced physics (5), test (6)
314  int ttype = FEDHeader(rawdata->FEDData(812).data()).triggerType();
315 
316  // loop over feds
317  for (int i = 0; i<FEDNumbering::MAXFEDID+1; i++){
318  const FEDRawData& data = rawdata->FEDData(i);
319  size_t size=data.size();
320 
321  if(!size) continue;
322  FEDHeader header(data.data());
323  //int lvl1id = header.lvl1ID();//Level-1 event number generated by the TTC system
324  int bx = header.bxID(); // The bunch crossing number
325 
326  int bxDiff = calcBxDiff(bx,bxRef); // deviation from reference bx
327 
328  //min
329  if(nBxDiff[i][1]>bxDiff) nBxDiff[i][1] = bxDiff;
330  if(nBxOccy[i][1]>bx ) nBxOccy[i][1] = bx;
331  //max
332  if(nBxDiff[i][2]<bxDiff) nBxDiff[i][2] = bxDiff;
333  if(nBxOccy[i][2]<bx ) nBxOccy[i][2] = bx;
334 
335  if(verbose())
336  std::cout << " fed:" << i
337  << " bx:" << bx
338  << " bxRef:" << bxRef
339  << " diff:" << bxDiff
340  << " nBxDiff"<<" del:"<<nBxDiff[i][0]<<" min:"<<nBxDiff[i][1]<<" max:"<<nBxDiff[i][2]
341  << " nBxOccy"<<" del:"<<nBxOccy[i][0]<<" min:"<<nBxOccy[i][1]<<" max:"<<nBxOccy[i][2]
342  << "\n" << std::flush;
343 
344  hBxDiffAllFed->Fill(i,bxDiff);
345 
346  //if(ttype==1) //skip if not a physics trigger
347  hBxOccyAllFed->Fill(bx);
348 
349 
350  // done if running in filter farm
351  if(runInFF_)
352  continue;
353 
354  for(int j=0; j<NSYS; j++)
355  if(i>=fedRange_[j].first && i<=fedRange_[j].second)
356  hBxDiffSysFed[j]->Fill(i,bxDiff);
357 
358  for(size_t k=0; k!=listGtBits_.size(); k++) {
359  if((int)gtbits.size() <= listGtBits_.at(k)) {
360  if(verbose())
361  std::cout << "BxTiming analyze | problem with vector size!\n" << std::endl;
362  continue;
363  }
364  else if(!gtbits.at(listGtBits_.at(k)))
365  continue;
366  for(int j=0; j<NSYS; j++) {
367  if(i>=fedRange_[j].first && i<=fedRange_[j].second) {
368  hBxOccyTrigBit[j][k]->Fill(bx);
369  }
370  }
371  }
372 
373  if(i>=fedRange_[GLT].first && i<=fedRange_[GLT].second) //GT fed
374  if(ttype<nttype_)
375  hBxOccyGtTrigType[ttype-1]->Fill(bx);
376 
377  if(ttype!=1) continue; //skip if not a physics trigger
378  //hBxOccyAllFed->Fill(bx);
379  hBxOccyOneFed[i]->Fill(bx);
380 
381  }
382 
383  for(int i=0; i<nfed_;i++) {
384  nBxDiff[i][0]=nBxDiff[i][2]-nBxDiff[i][1];
385  nBxOccy[i][0]=nBxOccy[i][2]-nBxOccy[i][1];
386  if(nBxDiff[i][0]<0 || nBxOccy[i][0]<0) continue;
387  for(int j=0; j<nspr_; j++) {
388  hBxDiffAllFedSpread[j]->setBinContent(i,nBxDiff[i][j]);
389  hBxOccyAllFedSpread[j]->setBinContent(i,nBxOccy[i][j]);
390  }
391  if(verbose())
392  std::cout << "BxTiming fed:" << i
393  << " Bx-Bx(" << fedRef_ << ")::"
394  << " del:" << nBxDiff[i][0]
395  << " min:" << nBxDiff[i][1]
396  << " max:" << nBxDiff[i][2]
397  << " Occy: "
398  << " del:" << nBxOccy[i][0]
399  << " min:" << nBxOccy[i][1]
400  << " max:" << nBxOccy[i][2]
401  <<"\n" << std::flush;
402 
403  }
404 
405 
406  if(verbose())
407  std::cout << "BxTiming::analyze() end.\n" << std::flush;
408 }
static const int nttype_
Definition: BxTiming.h:76
int i
Definition: DBlmapReader.cc:9
MonitorElement * hBxDiffAllFed
histograms
Definition: BxTiming.h:92
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * hBxDiffAllFedSpread[nspr_]
Definition: BxTiming.h:97
std::vector< int > listGtBits_
Definition: BxTiming.h:78
int verbose()
Definition: BxTiming.h:46
unsigned long long bx[ScalersRaw::N_BX_v2]
Definition: ScalersRaw.h:228
MonitorElement * hBxOccyAllFed
Definition: BxTiming.h:94
MonitorElement ** hBxOccyOneFed
Definition: BxTiming.h:95
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
void Fill(long long x)
int nBxOccy[1500][nspr_]
Definition: BxTiming.h:89
U second(std::pair< T, U > const &p)
MonitorElement * hBxOccyGtTrigType[nttype_]
Definition: BxTiming.h:100
int nEvt_
Definition: BxTiming.h:57
int nBxDiff[1500][nspr_]
Definition: BxTiming.h:88
int j
Definition: DBlmapReader.cc:9
edm::InputTag fedSource_
Definition: BxTiming.h:41
bool first
Definition: L1TdeRCT.cc:94
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
int k[5][pyjets_maxn]
bool runInFF_
Definition: BxTiming.h:69
edm::InputTag gtSource_
Definition: BxTiming.h:42
int fedRef_
Definition: BxTiming.h:84
MonitorElement * hBxDiffSysFed[NSYS]
Definition: BxTiming.h:93
MonitorElement ** hBxOccyTrigBit[NSYS]
Definition: BxTiming.h:101
int nfed_
Definition: BxTiming.h:83
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:29
int calcBxDiff(int bx1, int bx2)
Definition: BxTiming.cc:413
tuple cout
Definition: gather_cfg.py:121
dictionary rawdata
Definition: lumiPlot.py:393
std::pair< int, int > fedRange_[NSYS]
Definition: BxTiming.h:82
MonitorElement * hBxOccyAllFedSpread[nspr_]
Definition: BxTiming.h:98
tuple size
Write out results.
static const int nspr_
Definition: BxTiming.h:87
void BxTiming::beginJob ( void  )
protectedvirtual

initialize counters

book the histograms

labeling (cosmetics added here)

Reimplemented from edm::EDAnalyzer.

Definition at line 68 of file BxTiming.cc.

References DQMStore::book1D(), DQMStore::bookProfile(), gather_cfg::cout, dbe, fedRange_, fedRef_, first, hBxDiffAllFed, hBxDiffAllFedSpread, hBxDiffSysFed, hBxOccyAllFed, hBxOccyAllFedSpread, hBxOccyGtTrigType, hBxOccyOneFed, hBxOccyTrigBit, histFolder_, i, 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_, cppFunctionSkipper::operator, runInFF_, edm::second(), MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), and verbose().

68  {
69 
70  if(verbose())
71  std::cout << "BxTiming::beginJob() start\n" << std::flush;
72 
73  DQMStore* dbe = 0;
74  dbe = edm::Service<DQMStore>().operator->();
75  if(dbe) {
77  //dbe->rmdir(histFolder_);
78  }
79 
81  for(int i=0; i<nfed_;i++) {
82  nBxDiff[i][0]=0; nBxDiff[i][1]=nbig_; nBxDiff[i][2]=-1*nbig_;
83  nBxOccy[i][0]=0; nBxOccy[i][1]=nbig_; nBxOccy[i][2]=-1*nbig_;
84  }
85 
86  std::string lbl("");
87  std::string SysLabel[NSYS] = {
88  "PreShower", "ECAL", "HCAL", "GCT", "CSCTPG", "CSCTF", "DTTPG", "DTTF", "RPC", "GT"
89  };
90 
91  typedef std::pair<int, int> FEDRange;
92 
93  std::pair<int,int> fedRange[NSYS] = {
104  };
105  for(int i=0; i<NSYS; i++) fedRange_[i]=fedRange[i];
106 
107 
108  int fedRefSys=-1;
109  for(int i=0; i<NSYS; i++)
111  {fedRefSys=i; break;}
112  std::string refName("");
113  std::string spreadLabel[nspr_] = {"Spread","Min", "Max"};
114  if(fedRefSys>=0)
115  refName+=SysLabel[fedRefSys];
116  else
117  refName+=fedRef_;
118 
120 
121  const int dbx = nbig_;
122 
123  if(dbe) {
124 
126 
127  hBxDiffAllFed = dbe->bookProfile("BxDiffAllFed", "BxDiffAllFed",
128  nfed_ + 1, -0.5, nfed_+0.5,
129  2*dbx+1, -1*dbx-0.5,dbx+0.5
130  );
131 
132  for(int i=0; i<nspr_; i++) {
133  lbl.clear();lbl+="BxDiffAllFed";lbl+=spreadLabel[i];
134  hBxDiffAllFedSpread[i] = dbe->book1D(lbl.data(),lbl.data(), nfed_ + 1, -0.5, nfed_+0.5);
135  lbl.clear();lbl+="BxOccyAllFed";lbl+=spreadLabel[i];
136  hBxOccyAllFedSpread[i] = dbe->book1D(lbl.data(),lbl.data(), nfed_ + 1, -0.5, nfed_+0.5);
137  }
138 
139  lbl.clear();lbl+="BxOccyAllFed";
140  hBxOccyAllFed = dbe->book1D(lbl.data(),lbl.data(),norb_+1,-0.5,norb_+0.5);
141 
142  }
143 
144  // following histos defined only when not runing in the ff
145  if(dbe && !runInFF_) {
146 
148 
149  for(int i=0; i<NSYS; i++) {
150  lbl.clear();lbl+=SysLabel[i];lbl+="FedBxDiff";
151  int nfeds = fedRange_[i].second - fedRange_[i].first + 1;
152  nfeds = (nfeds>0)? nfeds:1;
153  hBxDiffSysFed[i] = dbe->bookProfile(lbl.data(),lbl.data(), nfeds,
154  fedRange_[i].first-0.5, fedRange_[i].second+0.5,
155  2*dbx+1,-1*dbx-0.5,dbx+0.5);
156 
157  }
158 
159 
160  lbl.clear();lbl+="BxOccyAllFed";
162  dbe->setCurrentFolder(histFolder_+"/SingleFed");
163  for(int i=0; i<nfed_; i++) {
164  lbl.clear(); lbl+="BxOccyOneFed";
165  char *ii = new char[1000]; std::sprintf(ii,"%d",i);lbl+=ii;
166  hBxOccyOneFed[i] = dbe->book1D(lbl.data(),lbl.data(),norb_+1,-0.5,norb_+0.5);
167  delete [] ii;
168  }
169 
171  for(int i=0; i<nttype_; i++) {
172  lbl.clear();lbl+="BxOccyGtTrigType";
173  char *ii = new char[10]; std::sprintf(ii,"%d",i+1);lbl+=ii;
174  hBxOccyGtTrigType[i] = dbe->book1D(lbl.data(),lbl.data(),norb_+1,-0.5,norb_+0.5);
175  delete [] ii;
176  }
177 
178  dbe->setCurrentFolder(histFolder_+"/SingleBit");
179  for(int i=0; i<NSYS; i++) {
180  hBxOccyTrigBit[i] = new MonitorElement*[listGtBits_.size()];
181  for(size_t j=0; j<listGtBits_.size(); j++) {
182  lbl.clear();lbl+=SysLabel[i];lbl+="BxOccyGtBit";
183  char *ii = new char[1000]; std::sprintf(ii,"%d",listGtBits_.at(j)); lbl+=ii;
184  hBxOccyTrigBit[i][j] = dbe->book1D(lbl.data(),lbl.data(),norb_+1,-0.5,norb_+0.5);
185  delete [] ii;
186  }
187  }
188 
189  }
190 
192  hBxDiffAllFed->setAxisTitle("FED ID",1);
193  lbl.clear(); lbl+="BX(fed)-BX("; lbl+=refName; lbl+=")";
194  hBxDiffAllFed->setAxisTitle(lbl,2);
195  for(int i=0; i<nspr_; i++) {
196  lbl.clear(); lbl+="BX(fed)-BX("; lbl+=refName; lbl+=") "+spreadLabel[i];
197  hBxDiffAllFedSpread[i]->setAxisTitle("FED ID",1);
199  lbl.clear(); lbl+="Bx FED occupancy"; lbl+=" "; lbl+=spreadLabel[i];
200  hBxOccyAllFedSpread[i]->setAxisTitle("FED ID",1);
202  }
203 
204  hBxOccyAllFed->setAxisTitle("bx",1);
205  lbl.clear(); lbl+="Combined FED occupancy";
206  hBxOccyAllFed->setAxisTitle(lbl,2);
207 
208  // skip next if running in filter farm
209  if(runInFF_)
210  return;
211 
212  for(int i=0; i<NSYS; i++) {
213  lbl.clear(); lbl+=SysLabel[i]; lbl+=" FED ID";
214  hBxDiffSysFed[i]->setAxisTitle(lbl,1);
215  lbl.clear(); lbl+="BX("; lbl+=SysLabel[i]; lbl+=")-BX(";lbl+=refName; lbl+=")";
216  hBxDiffSysFed[i]->setAxisTitle(lbl,2);
217  }
218 
219  for(int i=0; i<nfed_; i++) {
220  hBxOccyOneFed[i] ->setAxisTitle("bx",1);
221  lbl.clear(); lbl+=" FED "; char *ii = new char[1000]; std::sprintf(ii,"%d",i);lbl+=ii; lbl+=" occupancy";
222  hBxOccyOneFed[i] ->setAxisTitle(lbl,2);
223  delete [] ii;
224  }
225  for(int i=0; i<nttype_; i++) {
226  hBxOccyGtTrigType[i]->setAxisTitle("bx",1);
227  lbl.clear(); lbl+="GT occupancy for trigger type "; char *ii = new char[10]; std::sprintf(ii,"%d",i+1);lbl+=ii;
229  delete [] ii;
230  }
231 
232  for(int i=0; i<NSYS; i++) {
233  for(size_t j=0; j<listGtBits_.size(); j++) {
234  hBxOccyTrigBit[i][j]->setAxisTitle("bx",1);
235  lbl.clear();lbl+=SysLabel[i];lbl+=" Bx occupancy for Trigger bit ";
236  char *ii = new char[10]; std::sprintf(ii,"%d",listGtBits_.at(j)); lbl+=ii;
237  hBxOccyTrigBit[i][j]->setAxisTitle(lbl,2);
238  delete [] ii;
239  }
240  }
241 
242  if(verbose())
243  std::cout << "BxTiming::beginJob() end.\n" << std::flush;
244 }
static const int nttype_
Definition: BxTiming.h:76
int i
Definition: DBlmapReader.cc:9
static const int norb_
Definition: BxTiming.h:72
DQMStore * dbe
Definition: BxTiming.h:66
MonitorElement * hBxDiffAllFed
histograms
Definition: BxTiming.h:92
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
MonitorElement * hBxDiffAllFedSpread[nspr_]
Definition: BxTiming.h:97
std::vector< int > listGtBits_
Definition: BxTiming.h:78
int verbose()
Definition: BxTiming.h:46
MonitorElement * hBxOccyAllFed
Definition: BxTiming.h:94
MonitorElement ** hBxOccyOneFed
Definition: BxTiming.h:95
static const int nbig_
Definition: BxTiming.h:75
int nBxOccy[1500][nspr_]
Definition: BxTiming.h:89
U second(std::pair< T, U > const &p)
MonitorElement * hBxOccyGtTrigType[nttype_]
Definition: BxTiming.h:100
int nBxDiff[1500][nspr_]
Definition: BxTiming.h:88
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:1031
bool first
Definition: L1TdeRCT.cc:94
bool runInFF_
Definition: BxTiming.h:69
std::string histFolder_
Definition: BxTiming.h:63
int fedRef_
Definition: BxTiming.h:84
MonitorElement * hBxDiffSysFed[NSYS]
Definition: BxTiming.h:93
MonitorElement ** hBxOccyTrigBit[NSYS]
Definition: BxTiming.h:101
int nfed_
Definition: BxTiming.h:83
tuple cout
Definition: gather_cfg.py:121
std::pair< int, int > fedRange_[NSYS]
Definition: BxTiming.h:82
MonitorElement * hBxOccyAllFedSpread[nspr_]
Definition: BxTiming.h:98
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:429
static const int nspr_
Definition: BxTiming.h:87
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 413 of file BxTiming.cc.

References diffTreeTool::diff, half_norb_, and norb_.

Referenced by analyze().

414 {
415  int diff = bx1 - bx2;
416 
417  while (diff < -half_norb_)
418  diff += norb_;
419 
420  while (diff > half_norb_)
421  diff -= norb_;
422 
423  return diff;
424 }
static const int norb_
Definition: BxTiming.h:72
static const int half_norb_
Definition: BxTiming.h:73
void BxTiming::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 247 of file BxTiming.cc.

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

247  {
248 
249  if(verbose())
250  std::cout << "BxTiming::endJob Nevents: " << nEvt_ << "\n" << std::flush;
251 
252  if(histFile_.size()!=0 && dbe)
253  dbe->save(histFile_);
254 
255  if(verbose())
256  std::cout << "BxTiming::endJob() end.\n" << std::flush;
257 }
DQMStore * dbe
Definition: BxTiming.h:66
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2113
int verbose()
Definition: BxTiming.h:46
std::string histFile_
Definition: BxTiming.h:60
int nEvt_
Definition: BxTiming.h:57
tuple cout
Definition: gather_cfg.py:121
int BxTiming::verbose ( )
inlineprivate

Definition at line 46 of file BxTiming.h.

References verbose_.

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

46 {return verbose_;}
int verbose_
Definition: BxTiming.h:45

Member Data Documentation

DQMStore* BxTiming::dbe
private

Definition at line 66 of file BxTiming.h.

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

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

Definition at line 82 of file BxTiming.h.

Referenced by analyze(), and beginJob().

int BxTiming::fedRef_
private

Definition at line 84 of file BxTiming.h.

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

edm::InputTag BxTiming::fedSource_
private

Definition at line 41 of file BxTiming.h.

Referenced by analyze(), and BxTiming().

edm::InputTag BxTiming::gtSource_
private

Definition at line 42 of file BxTiming.h.

Referenced by analyze(), and BxTiming().

const int BxTiming::half_norb_ = norb_ / 2
staticprivate

Definition at line 73 of file BxTiming.h.

Referenced by calcBxDiff().

MonitorElement* BxTiming::hBxDiffAllFed
private

histograms

Definition at line 92 of file BxTiming.h.

Referenced by analyze(), and beginJob().

MonitorElement* BxTiming::hBxDiffAllFedSpread[nspr_]
private

Definition at line 97 of file BxTiming.h.

Referenced by analyze(), and beginJob().

MonitorElement* BxTiming::hBxDiffSysFed[NSYS]
private

Definition at line 93 of file BxTiming.h.

Referenced by analyze(), and beginJob().

MonitorElement* BxTiming::hBxOccyAllFed
private

Definition at line 94 of file BxTiming.h.

Referenced by analyze(), and beginJob().

MonitorElement* BxTiming::hBxOccyAllFedSpread[nspr_]
private

Definition at line 98 of file BxTiming.h.

Referenced by analyze(), and beginJob().

MonitorElement* BxTiming::hBxOccyGtTrigType[nttype_]
private

Definition at line 100 of file BxTiming.h.

Referenced by analyze(), and beginJob().

MonitorElement** BxTiming::hBxOccyOneFed
private

Definition at line 95 of file BxTiming.h.

Referenced by analyze(), and beginJob().

MonitorElement** BxTiming::hBxOccyTrigBit[NSYS]
private

Definition at line 101 of file BxTiming.h.

Referenced by analyze(), and beginJob().

std::string BxTiming::histFile_
private

Definition at line 60 of file BxTiming.h.

Referenced by BxTiming(), and endJob().

std::string BxTiming::histFolder_
private

Definition at line 63 of file BxTiming.h.

Referenced by beginJob(), and BxTiming().

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

Definition at line 78 of file BxTiming.h.

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

const int BxTiming::nbig_ = 10000
staticprivate

Definition at line 75 of file BxTiming.h.

Referenced by beginJob().

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

Definition at line 88 of file BxTiming.h.

Referenced by analyze(), and beginJob().

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

Definition at line 89 of file BxTiming.h.

Referenced by analyze(), and beginJob().

int BxTiming::nEvt_
private

Definition at line 57 of file BxTiming.h.

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

int BxTiming::nfed_
private

Definition at line 83 of file BxTiming.h.

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

const int BxTiming::norb_ = 3564
staticprivate

Definition at line 72 of file BxTiming.h.

Referenced by beginJob(), and calcBxDiff().

const int BxTiming::nspr_ =3
staticprivate

Definition at line 87 of file BxTiming.h.

Referenced by analyze(), and beginJob().

const int BxTiming::nttype_ = 6
staticprivate

Definition at line 76 of file BxTiming.h.

Referenced by analyze(), and beginJob().

bool BxTiming::runInFF_
private

Definition at line 69 of file BxTiming.h.

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

int BxTiming::verbose_
private

Definition at line 45 of file BxTiming.h.

Referenced by BxTiming(), and verbose().