CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
L1TRPCTF Class Reference

#include <L1TRPCTF.h>

Inheritance diagram for L1TRPCTF:
edm::EDAnalyzer

Classes

struct  BxDelays
 

Public Member Functions

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

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void beginJob (void)
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
 
void endJob (void)
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
void endRun (const edm::Run &r, const edm::EventSetup &c)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Member Functions

void fillRateHistos (int orbit, bool flush=false)
 

Private Attributes

MonitorElementm_bxDiff
 
DQMStorem_dbe
 
std::set< unsigned long long int > m_globBX
 
long long int m_lastUsedBxInBxdiff
 
MonitorElementm_muonsEtaPhi [3]
 
MonitorElementm_qualVsEta [3]
 
MonitorElementm_rateAvg
 
int m_rateBinSize
 
L1TRateHelper::L1TRateHelper m_rateHelper
 
MonitorElementm_rateMax
 
MonitorElementm_rateMin
 
int m_rateNoOfBins
 
int m_rateUpdateTime
 
bool monitorDaemon_
 
int nev_
 
int nevRPC_
 
std::string output_dir_
 
std::string outputFile_
 
MonitorElementrpctfbx
 
MonitorElementrpctfchargevalue [3]
 
MonitorElementrpctfcratesynchro [12]
 
MonitorElementrpctfetavalue [3]
 
MonitorElementrpctfntrack_b [3]
 
MonitorElementrpctfntrack_e [3]
 
MonitorElementrpctfphivalue [3]
 
MonitorElementrpctfptvalue [3]
 
MonitorElementrpctfquality [3]
 
edm::InputTag rpctfSource_
 
bool verbose_
 

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)
 

Detailed Description

Definition at line 45 of file L1TRPCTF.h.

Constructor & Destructor Documentation

L1TRPCTF::L1TRPCTF ( const edm::ParameterSet ps)

Definition at line 21 of file L1TRPCTF.cc.

References gather_cfg::cout, edm::ParameterSet::getUntrackedParameter(), m_dbe, NULL, cmsCodeRules.cppFunctionSkipper::operator, output_dir_, outputFile_, DQMStore::setCurrentFolder(), DQMStore::setVerbose(), and verbose_.

22  : rpctfSource_( ps.getParameter< InputTag >("rpctfSource") ),
23 // digiSource_( ps.getParameter< InputTag >("rpctfRPCDigiSource") ),
24 // m_rpcDigiFine(false),
25 // m_useRpcDigi(true),
26  m_rateUpdateTime( ps.getParameter< int >("rateUpdateTime") ),
27  m_rateBinSize( ps.getParameter< int >("rateBinSize") ),
28  m_rateNoOfBins( ps.getParameter< int >("rateNoOfBins") ),
30  output_dir_ (ps.getUntrackedParameter<string>("output_dir") )
31 // m_rpcDigiWithBX0(0),
32 // m_rpcDigiWithBXnon0(0)
33 
34  {
35 
36  // verbosity switch
37  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
38 
39  if(verbose_) cout << "L1TRPCTF: constructor...." << endl;
40 
41 
42  m_dbe = NULL;
43  if ( ps.getUntrackedParameter<bool>("DQMStore", false) )
44  {
46  m_dbe->setVerbose(0);
47  }
48 
49  outputFile_ = ps.getUntrackedParameter<string>("outputFile", "");
50  if ( outputFile_.size() != 0 ) {
51  cout << "L1T Monitoring histograms will be saved to " << outputFile_.c_str() << endl;
52  }
53 
54  bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false);
55  if(disable){
56  outputFile_="";
57  }
58 
59 
60  if ( m_dbe !=NULL ) {
62  }
63 
64 
65 
66 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int m_rateNoOfBins
Definition: L1TRPCTF.h:115
#define NULL
Definition: scimark2.h:8
int m_rateUpdateTime
Definition: L1TRPCTF.h:113
std::string outputFile_
Definition: L1TRPCTF.h:107
void setVerbose(unsigned level)
Definition: DQMStore.cc:196
std::string output_dir_
Definition: L1TRPCTF.h:117
int m_rateBinSize
Definition: L1TRPCTF.h:114
long long int m_lastUsedBxInBxdiff
Definition: L1TRPCTF.h:116
edm::InputTag rpctfSource_
Definition: L1TRPCTF.h:103
bool verbose_
Definition: L1TRPCTF.h:108
tuple cout
Definition: gather_cfg.py:41
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
DQMStore * m_dbe
Definition: L1TRPCTF.h:78
L1TRPCTF::~L1TRPCTF ( )
virtual

Definition at line 68 of file L1TRPCTF.cc.

69 {
70 }

Member Function Documentation

void L1TRPCTF::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Implements edm::EDAnalyzer.

Definition at line 291 of file L1TRPCTF.cc.

References L1TRateHelper::L1TRateHelper::addOrbit(), edm::EventBase::bunchCrossing(), L1TRPCTF::BxDelays::bx, gather_cfg::cout, diffTreeTool::diff, L1TRPCTF::BxDelays::eta_t, MonitorElement::Fill(), fillRateHistos(), edm::Event::getByLabel(), L1MuGMTReadoutCollection::getRecords(), i, edm::HandleBase::isValid(), j, edm::InputTag::label(), m_bxDiff, m_globBX, m_lastUsedBxInBxdiff, m_muonsEtaPhi, m_qualVsEta, m_rateHelper, min, nev_, edm::EventBase::orbitNumber(), L1TRPCTF::BxDelays::phi_p, edm::Handle< T >::product(), rpctfbx, rpctfchargevalue, rpctfcratesynchro, rpctfetavalue, rpctfntrack_b, rpctfntrack_e, rpctfphivalue, rpctfptvalue, rpctfquality, rpctfSource_, and verbose_.

292 {
293  nev_++;
294  if(verbose_) cout << "L1TRPCTF: analyze...." << endl;
295 
297  e.getByLabel(rpctfSource_,pCollection);
298 
299  if (!pCollection.isValid()) {
300  edm::LogInfo("DataNotFound") << "can't find L1MuGMTReadoutCollection with label "
301  << rpctfSource_.label() ;
302  return;
303  }
304 
305 
306  L1MuGMTReadoutCollection const* gmtrc = pCollection.product();
307  vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->getRecords();
308  vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
309 
310  std::vector<int> nrpctftrack_b(3,0);
311  std::vector<int> nrpctftrack_e(3,0);
312  bool rpcCandsPresentInEvent = false;
313 
314  vector<L1TRPCTF::BxDelays> all_bxdelays;
315 
316 
317  for( RRItr = gmt_records.begin() ;
318  RRItr != gmt_records.end() ;
319  RRItr++ )
320  {
321 
322  if (verbose_) cout << "Readout Record " << RRItr->getBxInEvent() << endl;
323 
324  vector<vector<L1MuRegionalCand> > brlAndFwdCands;
325  brlAndFwdCands.push_back(RRItr->getBrlRPCCands());
326  brlAndFwdCands.push_back(RRItr->getFwdRPCCands());
327 
328  int beIndex = 0;
329  vector<vector<L1MuRegionalCand> >::iterator RPCTFCands = brlAndFwdCands.begin();
330  for(; RPCTFCands!= brlAndFwdCands.end(); ++RPCTFCands)
331  {
332 
333  for( vector<L1MuRegionalCand>::const_iterator
334  ECItr = RPCTFCands->begin() ;
335  ECItr != RPCTFCands->end() ;
336  ++ECItr )
337  {
338 
339  int bxindex = 1 ; // bx == 0
340  if (ECItr->bx() > 0) bxindex = 2;
341  if (ECItr->bx() < 0) bxindex = 0;
342 
343  if (!ECItr->empty()) {
344 
345  rpcCandsPresentInEvent = true;
346 
347  if (beIndex == 0) ++nrpctftrack_b[bxindex];
348  if (beIndex == 1) ++nrpctftrack_e[bxindex];
349 
350  if (verbose_) cout << "RPCTFCand bx " << ECItr->bx() << endl;
351 
352  int tower = ECItr->eta_packed();
353  if (tower > 16) {
354  tower = - ( (~tower & 63) + 1);
355  }
356 
357  rpctfbx->Fill(ECItr->bx());
358 
359  rpctfetavalue[bxindex]->Fill(tower);
360  if (verbose_) cout << "\tRPCTFCand eta value " << ECItr->etaValue() << endl;
361 
362  rpctfphivalue[bxindex]->Fill(ECItr->phi_packed());
363  if (verbose_) cout << "\tRPCTFCand phi value " << ECItr->phiValue() << endl;
364 
365  rpctfptvalue[bxindex]->Fill(ECItr->ptValue());
366  if (verbose_) cout << "\tRPCTFCand pt value " << ECItr->ptValue()<< endl;
367 
368  rpctfchargevalue[bxindex]->Fill(ECItr->chargeValue());
369  if (verbose_) cout << "\tRPCTFCand charge value " << ECItr->chargeValue() << endl;
370 
371  rpctfquality[bxindex]->Fill(ECItr->quality());
372  if (verbose_) cout << "\tRPCTFCand quality " << ECItr->quality() << endl;
373 
374 
375  m_qualVsEta[bxindex]->Fill(tower, ECItr->quality());
376  m_muonsEtaPhi[bxindex]->Fill(tower, ECItr->phi_packed());
377 
378  BxDelays bx_del;
379  bx_del.bx = ECItr->bx();
380  bx_del.eta_t = tower;
381  bx_del.phi_p = ECItr->phi_packed();
382  all_bxdelays.push_back(bx_del);
383 
384  } // if !empty
385  } // end candidates iteration
386  ++beIndex;
387  } // end brl/endcap iteration
388  } // end GMT records iteration
389 
390  for (int bxI = 0; bxI < 3; ++bxI){
391  rpctfntrack_b[bxI]->Fill(nrpctftrack_b[bxI]);
392  rpctfntrack_e[bxI]->Fill(nrpctftrack_e[bxI]);
393  }
394 
395 
396  if (rpcCandsPresentInEvent) {
398 
399  unsigned int globBx = e.orbitNumber()*3564+e.bunchCrossing();
400  if (m_globBX.find(globBx)==m_globBX.end()) m_globBX.insert(globBx);
401  if (m_globBX.size()>1020){
402  long long int diff = *m_globBX.begin()-m_lastUsedBxInBxdiff; // first entry will go to overflow bin, ignore
403  m_bxDiff->Fill(diff);
404  m_lastUsedBxInBxdiff = *m_globBX.begin();
405  m_globBX.erase(m_globBX.begin());
406 
407  }
408 
409 
410 
411  }
412 
413 
414  for(unsigned int i = 0; i < all_bxdelays.size(); i++) {
415 
416  int sector= ((all_bxdelays[i].phi_p+ 142)%144)/12;
417  if (sector>11 || sector < 0) continue;
418  int eta_tower = all_bxdelays[i].eta_t;
419  for(unsigned int j = 0; j < all_bxdelays.size(); j++) {
420  if(i == j) continue;
421  int sector2= ((all_bxdelays[j].phi_p + 142)%144)/12;
422 
423  int distance_cut = 1;
424  int distance = ((sector+12)-sector2)%12;
425  distance = min(distance, 11-distance);
426  if(distance<distance_cut) continue;
427 
428  int bxDiff = all_bxdelays[i].bx-all_bxdelays[j].bx;
429  rpctfcratesynchro[sector]->Fill(bxDiff,eta_tower);
430  }
431 
432  }
434 
435 
436 
437 }
std::set< unsigned long long int > m_globBX
Definition: L1TRPCTF.h:97
MonitorElement * rpctfcratesynchro[12]
Definition: L1TRPCTF.h:96
int i
Definition: DBlmapReader.cc:9
MonitorElement * rpctfchargevalue[3]
Definition: L1TRPCTF.h:83
MonitorElement * rpctfetavalue[3]
Definition: L1TRPCTF.h:80
void fillRateHistos(int orbit, bool flush=false)
Definition: L1TRPCTF.cc:442
MonitorElement * rpctfptvalue[3]
Definition: L1TRPCTF.h:82
int bunchCrossing() const
Definition: EventBase.h:62
#define min(a, b)
Definition: mlp_lapack.h:161
void Fill(long long x)
void addOrbit(int orbit)
Adds event with specified orbit. If the event for some reason comes late (after removal of corespondi...
Definition: L1TRateHelper.h:44
L1TRateHelper::L1TRateHelper m_rateHelper
Definition: L1TRPCTF.h:100
MonitorElement * rpctfquality[3]
Definition: L1TRPCTF.h:84
MonitorElement * rpctfphivalue[3]
Definition: L1TRPCTF.h:81
int nev_
Definition: L1TRPCTF.h:105
int j
Definition: DBlmapReader.cc:9
int orbitNumber() const
Definition: EventBase.h:63
MonitorElement * m_bxDiff
Definition: L1TRPCTF.h:95
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
MonitorElement * m_muonsEtaPhi[3]
Definition: L1TRPCTF.h:89
MonitorElement * m_qualVsEta[3]
Definition: L1TRPCTF.h:88
std::vector< L1MuGMTReadoutRecord > getRecords() const
long long int m_lastUsedBxInBxdiff
Definition: L1TRPCTF.h:116
T const * product() const
Definition: Handle.h:74
std::string const & label() const
Definition: InputTag.h:25
MonitorElement * rpctfntrack_e[3]
Definition: L1TRPCTF.h:86
edm::InputTag rpctfSource_
Definition: L1TRPCTF.h:103
MonitorElement * rpctfbx
Definition: L1TRPCTF.h:87
MonitorElement * rpctfntrack_b[3]
Definition: L1TRPCTF.h:85
bool verbose_
Definition: L1TRPCTF.h:108
tuple cout
Definition: gather_cfg.py:41
void L1TRPCTF::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 72 of file L1TRPCTF.cc.

References b, DQMStore::book1D(), DQMStore::book2D(), i, prof2calltree::l, m_bxDiff, m_dbe, m_muonsEtaPhi, m_qualVsEta, m_rateAvg, m_rateMax, m_rateMin, m_rateNoOfBins, nev_, nevRPC_, connectstrParser::o, cmsCodeRules.cppFunctionSkipper::operator, output_dir_, DQMStore::rmdir(), rpctfbx, rpctfchargevalue, rpctfcratesynchro, rpctfetavalue, rpctfntrack_b, rpctfntrack_e, rpctfphivalue, rpctfptvalue, rpctfquality, MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), and DQMStore::setCurrentFolder().

73 {
74 
75  nev_ = 0;
76  nevRPC_ = 0;
77 
78  // get hold of back-end interface
80 
81  if ( m_dbe ) {
84  }
85 
86 
87  if ( m_dbe )
88  {
89 
90 
91  ostringstream oDir; oDir<< output_dir_ << "/CrateSynchroHistograms/";
92  m_dbe->setCurrentFolder(oDir.str());
93  for( unsigned int i = 0; i < 12; i++) {
94 
95  ostringstream o; o<<"RPCTF_crate_"<<i<<"_synchro";
96  rpctfcratesynchro[i] = m_dbe->book2D(o.str(), o.str(), 5, -2.5, 2.5, 33, -16.5, 16.5);
97  for (int bx = -2; bx < 3; ++bx){
98  ostringstream b; b<<"BX="<<bx;
99  rpctfcratesynchro[i]->setBinLabel(bx+3, b.str(),1);
100  }
101  rpctfcratesynchro[i]->setAxisTitle("Tower",2);
102 
103  }
104  m_dbe->setCurrentFolder(output_dir_);
105 
106  rpctfetavalue[1] = m_dbe->book1D("RPCTF_eta_value_bx0",
107  "RPCTF eta value bx=0", 33, -16.5, 16.5 ) ;
108  rpctfetavalue[2] = m_dbe->book1D("RPCTF_eta_value_bx+",
109  "RPCTF eta value bx>0", 33, -16.5, 16.5 ) ;
110  rpctfetavalue[0] = m_dbe->book1D("RPCTF_eta_value_bx-",
111  "RPCTF eta value bx<0", 33, -16.5, 16.5 ) ;
112 
113  rpctfphivalue[1] = m_dbe->book1D("RPCTF_phi_value_bx0",
114  "RPCTF phi value bx=0", 144, -0.5, 143.5) ;
115  rpctfphivalue[2] = m_dbe->book1D("RPCTF_phi_value_bx+",
116  "RPCTF phi value bx>0", 144, -0.5, 143.5 ) ;
117  rpctfphivalue[0] = m_dbe->book1D("RPCTF_phi_value_bx-",
118  "RPCTF phi value bx<0", 144, -0.5, 143.5 ) ;
119 
120 
121 
122  rpctfptvalue[1] = m_dbe->book1D("RPCTF_pt_value_bx0",
123  "RPCTF pt value bx=0", 160, -0.5, 159.5 );
124  rpctfptvalue[2] = m_dbe->book1D("RPCTF_pt_value_bx+",
125  "RPCTF pt value bx>0", 160, -0.5, 159.5 );
126  rpctfptvalue[0] = m_dbe->book1D("RPCTF_pt_value_bx-",
127  "RPCTF pt value bx<0", 160, -0.5, 159.5 );
128 
129 
130  rpctfchargevalue[1] = m_dbe->book1D("RPCTF_charge_value_bx0",
131  "RPCTF charge value bx=0", 3, -1.5, 1.5 ) ;
132  rpctfchargevalue[2] = m_dbe->book1D("RPCTF_charge_value_bx+",
133  "RPCTF charge value bx>0", 3, -1.5, 1.5 ) ;
134  rpctfchargevalue[0] = m_dbe->book1D("RPCTF_charge_value_bx-",
135  "RPCTF charge value bx<01", 3, -1.5, 1.5 ) ;
136 
137  rpctfquality[1] = m_dbe->book1D("RPCTF_quality",
138  "RPCTF quality bx=0", 6, -0.5, 5.5 ) ;
139  rpctfquality[2] = m_dbe->book1D("RPCTF_quality_bx+",
140  "RPCTF quality bx>0", 6, -0.5, 5.5 ) ;
141  rpctfquality[0] = m_dbe->book1D("RPCTF_quality_bx-",
142  "RPCTF quality bx<0", 6, -0.5, 5.5 ) ;
143 
144  rpctfntrack_b[1] = m_dbe->book1D("RPCTF_ntrack_brl_bx0",
145  "RPCTF number of tracks - barrel, bx=0", 5, -0.5, 4.5 ) ;
146  rpctfntrack_b[2] = m_dbe->book1D("RPCTF_ntrack_brl_bx+",
147  "RPCTF number of tracks - barrel, bx>0", 5, -0.5, 4.5 ) ;
148  rpctfntrack_b[0] = m_dbe->book1D("RPCTF_ntrack_brl_bx-",
149  "RPCTF number of tracks - barrel, bx<0", 5, -0.5, 4.5 ) ;
150 
151 
152 
153  rpctfntrack_e[1] = m_dbe->book1D("RPCTF_ntrack_fwd_bx0",
154  "RPCTF number of tracks - endcap, bx=0", 5, -0.5, 4.5 ) ;
155  rpctfntrack_e[2] = m_dbe->book1D("RPCTF_ntrack_fwd_bx+",
156  "RPCTF number of tracks - endcap, bx>0", 5, -0.5, 4.5 ) ;
157  rpctfntrack_e[0] = m_dbe->book1D("RPCTF_ntrack_fwd_bx-",
158  "RPCTF number of tracks - endcap, bx<0", 5, -0.5, 4.5 ) ;
159 
160 
161 
162 
163 
164  m_qualVsEta[1] = m_dbe->book2D("RPCTF_quality_vs_eta_bx0",
165  "RPCTF quality vs eta, bx=0",
166  33, -16.5, 16.5,
167  6, -0.5, 5.5); // Currently only 0...3 quals are possible
168  m_qualVsEta[2] = m_dbe->book2D("RPCTF_quality_vs_eta_bx+",
169  "RPCTF quality vs eta, bx>0",
170  33, -16.5, 16.5,
171  6, -0.5, 5.5); // Currently only 0...3 quals are possible
172  m_qualVsEta[0] = m_dbe->book2D("RPCTF_quality_vs_eta_bx-",
173  "RPCTF quality vs eta, bx<0",
174  33, -16.5, 16.5,
175  6, -0.5, 5.5); // Currently only 0...3 quals are possible
176 
177 
178 
179  m_muonsEtaPhi[1] = m_dbe->book2D("RPCTF_muons_eta_phi_bx0",
180  "RPCTF occupancy(eta,phi), bx=0",
181  33, -16.5, 16.5,
182  144, -0.5, 143.5);
183  m_muonsEtaPhi[2] = m_dbe->book2D("RPCTF_muons_eta_phi_bx+",
184  "RPCTF occupancy(eta,phi), bx>0",
185  33, -16.5, 16.5,
186  144, -0.5, 143.5);
187  m_muonsEtaPhi[0] = m_dbe->book2D("RPCTF_muons_eta_phi_bx-",
188  "RPCTF occupancy(eta,phi), bx<0",
189  33, -16.5, 16.5,
190  144, -0.5, 143.5);
191 
192  rpctfbx = m_dbe->book1D("RPCTF_bx",
193  "RPCTF bx distribiution", 7, -3.5, 3.5 );
194 
195  //axis labels
196  for (int l = 0; l<3; ++l){
197  m_muonsEtaPhi[l]->setAxisTitle("tower",1);
198  m_qualVsEta[l]->setAxisTitle("tower");
199  rpctfetavalue[l]->setAxisTitle("tower");
200 
201  m_muonsEtaPhi[l]->setAxisTitle("phi",2);
202  rpctfphivalue[l]->setAxisTitle("phi");
203  }
204 
205  // set phi bin labels
206  for (int i = 0; i < 12 ; ++i ){
207  //float lPhi = (30./360)*i*2*3.14;
208  int lPhi = 30*i;
209  int lBin = int((30./360)*i*144)+1;
210  std::stringstream ss;
211  ss << "phi=" <<lPhi;
212  for (int l = 0; l<3; ++l){
213  rpctfphivalue[l]->setBinLabel(lBin,ss.str());
214  m_muonsEtaPhi[l]->setBinLabel(lBin,ss.str(), 2);
215  }
216  }
217 
218  /*
219  // set TC numbers on phi axis
220  for (int tc = 0; tc < 12 ; ++tc ){
221  int lBin = (tc*12+3+1)%144;
222  std::stringstream ss;
223  ss << "TC" <<tc;
224  for (int l = 0; l<3; ++l){
225  rpctfphivalue[l]->setBinLabel(lBin,ss.str());
226  m_muonsEtaPhi[l]->setBinLabel(lBin,ss.str(), 2);
227  }
228  }*/
229 
230 
231  // set eta bin labels
232  for (int i = -16; i < 17 ; ++i ){
233  std::stringstream ss;
234  ss << i;
235  for (int l = 0; l<3; ++l){
236  rpctfetavalue[l]->setBinLabel(i+17, ss.str());
237  m_muonsEtaPhi[l]->setBinLabel(i+17, ss.str(), 1);
238  m_qualVsEta[l]->setBinLabel(i+17, ss.str());
239  }
240  }
241 
242 
243 
244  m_rateMin = m_dbe->book1D("RPCTF_rate_min",
245  "RPCTrigger - minimal rate", m_rateNoOfBins, 0, m_rateNoOfBins);
246 
247  m_rateMax = m_dbe->book1D("RPCTF_rate_max",
248  "RPCTrigger - peak rate", m_rateNoOfBins, 0, m_rateNoOfBins);
249 
250  m_rateAvg = m_dbe->book1D("RPCTF_rate_avg",
251  "RPCTrigger - average rate", m_rateNoOfBins, 0, m_rateNoOfBins);
252 
253  m_bxDiff = m_dbe->book1D("RPCTF_bx_diff",
254  "RPCTrigger - bx difference", 12000, -.5, 11999.5);
255 
256 
257 
258  } // if (m_dbe)
259 }
MonitorElement * rpctfcratesynchro[12]
Definition: L1TRPCTF.h:96
int i
Definition: DBlmapReader.cc:9
int m_rateNoOfBins
Definition: L1TRPCTF.h:115
MonitorElement * rpctfchargevalue[3]
Definition: L1TRPCTF.h:83
MonitorElement * rpctfetavalue[3]
Definition: L1TRPCTF.h:80
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2311
MonitorElement * rpctfptvalue[3]
Definition: L1TRPCTF.h:82
MonitorElement * m_rateAvg
Definition: L1TRPCTF.h:92
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * rpctfquality[3]
Definition: L1TRPCTF.h:84
MonitorElement * rpctfphivalue[3]
Definition: L1TRPCTF.h:81
int nev_
Definition: L1TRPCTF.h:105
MonitorElement * m_rateMax
Definition: L1TRPCTF.h:94
MonitorElement * m_bxDiff
Definition: L1TRPCTF.h:95
MonitorElement * m_muonsEtaPhi[3]
Definition: L1TRPCTF.h:89
MonitorElement * m_qualVsEta[3]
Definition: L1TRPCTF.h:88
std::string output_dir_
Definition: L1TRPCTF.h:117
double b
Definition: hdecay.h:120
MonitorElement * rpctfntrack_e[3]
Definition: L1TRPCTF.h:86
MonitorElement * m_rateMin
Definition: L1TRPCTF.h:93
MonitorElement * rpctfbx
Definition: L1TRPCTF.h:87
MonitorElement * rpctfntrack_b[3]
Definition: L1TRPCTF.h:85
int nevRPC_
Definition: L1TRPCTF.h:106
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:642
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:232
DQMStore * m_dbe
Definition: L1TRPCTF.h:78
void L1TRPCTF::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 506 of file L1TRPCTF.cc.

508 {
509 // m_rpcDigiWithBX0=0;
510 // m_rpcDigiWithBXnon0=0;
511 // m_bxs.clear();
512 // m_useRpcDigi = true;
513 
514 
515 }
void L1TRPCTF::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 279 of file L1TRPCTF.cc.

References gather_cfg::cout, m_dbe, nev_, outputFile_, DQMStore::save(), and verbose_.

280 {
281 
282  if(verbose_) cout << "L1TRPCTF: end job...." << endl;
283  LogInfo("EndJob") << "analyzed " << nev_ << " events";
284 
285  if ( outputFile_.size() != 0 && m_dbe ) m_dbe->save(outputFile_);
286 
287  return;
288 
289 }
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:1898
std::string outputFile_
Definition: L1TRPCTF.h:107
int nev_
Definition: L1TRPCTF.h:105
bool verbose_
Definition: L1TRPCTF.h:108
tuple cout
Definition: gather_cfg.py:41
DQMStore * m_dbe
Definition: L1TRPCTF.h:78
void L1TRPCTF::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 518 of file L1TRPCTF.cc.

520 {
521 
522 }
void L1TRPCTF::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 261 of file L1TRPCTF.cc.

References diffTreeTool::diff, MonitorElement::Fill(), fillRateHistos(), m_bxDiff, m_globBX, and m_lastUsedBxInBxdiff.

261  {
262 
263  fillRateHistos(0,true);
264 
265 
266  // fixme, norm iteration would be better
267  while (m_globBX.begin() != m_globBX.end() ) {
268  long long int diff = *m_globBX.begin()-m_lastUsedBxInBxdiff; // first entry will go to overflow bin, ignore
269  m_bxDiff->Fill(diff);
270  m_lastUsedBxInBxdiff = *m_globBX.begin();
271  m_globBX.erase(m_globBX.begin());
272 
273  }
274 
275 
276 }
std::set< unsigned long long int > m_globBX
Definition: L1TRPCTF.h:97
void fillRateHistos(int orbit, bool flush=false)
Definition: L1TRPCTF.cc:442
void Fill(long long x)
MonitorElement * m_bxDiff
Definition: L1TRPCTF.h:95
long long int m_lastUsedBxInBxdiff
Definition: L1TRPCTF.h:116
void L1TRPCTF::fillRateHistos ( int  orbit,
bool  flush = false 
)
private

Fills rate histos.

Definition at line 442 of file L1TRPCTF.cc.

References newFWLiteAna::bin, L1TRateHelper::L1TRateHelper::getEarliestTime(), L1TRateHelper::L1TRateHelper::getTimeForOrbit(), m_rateAvg, m_rateBinSize, m_rateHelper, m_rateMax, m_rateMin, m_rateUpdateTime, max(), min, L1TEmulatorMonitor_cff::p, L1TRateHelper::L1TRateHelper::removeAndGetRateForEarliestTime(), and MonitorElement::setBinContent().

Referenced by analyze(), and endRun().

443 {
444 
445  static bool flushed = false;
446 
447  if (flushed) {
448  LogWarning("L1TRPCTF") << "Rate histos allready flushed \n";
449  }
450 
451  if (flush) flushed = true;
452 
453 
454  int nbinsUsed = 0;
455  do {
456  nbinsUsed = 0;
457  int et = m_rateHelper.getEarliestTime();
458  if (et==-1) break;
459 
460  if ( (( m_rateHelper.getTimeForOrbit(orbit) - et > m_rateUpdateTime+m_rateBinSize) // 1 minute bins
461  && m_rateUpdateTime!=-1) || flush )
462  {
463 
464 
465  int startTimeInMinutes=et/m_rateBinSize;
466  int bin = 0;
467  std::pair<int, int> p;
468  int max = 0, min = 0;
469  float avg=0;
470  int curTimeInMinutes=startTimeInMinutes;
471  while (curTimeInMinutes==startTimeInMinutes){
473  if (p.first < 0) break; // no more items to analize, go fill histos
474 
475  if (nbinsUsed==0) {
476  bin = p.first/m_rateBinSize+1;
477  max = p.second;
478  min = p.second;
479  } else {
480  if (max < p.second) max = p.second;
481  if (min > p.second) min = p.second;
482  }
483 
484  ++nbinsUsed;
485  avg+=p.second;
486  curTimeInMinutes=m_rateHelper.getEarliestTime()/m_rateBinSize;
487  }
488 
489 
490  avg/=m_rateBinSize;
491 
492  if (nbinsUsed > 0){
493  m_rateAvg->setBinContent(bin,avg); // smallest possible value in f.first is 1
495  m_rateMax->setBinContent(bin,max);
496  }
497 
498  }
499  } while (flush);
500 
501 
502 
503 }
std::pair< int, int > removeAndGetRateForEarliestTime()
Definition: L1TRateHelper.cc:7
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * m_rateAvg
Definition: L1TRPCTF.h:92
#define min(a, b)
Definition: mlp_lapack.h:161
int getTimeForOrbit(int orbit)
Definition: L1TRateHelper.h:59
int m_rateUpdateTime
Definition: L1TRPCTF.h:113
L1TRateHelper::L1TRateHelper m_rateHelper
Definition: L1TRPCTF.h:100
const T & max(const T &a, const T &b)
MonitorElement * m_rateMax
Definition: L1TRPCTF.h:94
int m_rateBinSize
Definition: L1TRPCTF.h:114
int getEarliestTime()
gets time of earliest event (orbit) recorded in event. Returned time -1 is invalid ...
Definition: L1TRateHelper.h:47
MonitorElement * m_rateMin
Definition: L1TRPCTF.h:93

Member Data Documentation

MonitorElement* L1TRPCTF::m_bxDiff
private

Definition at line 95 of file L1TRPCTF.h.

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

DQMStore* L1TRPCTF::m_dbe
private

Definition at line 78 of file L1TRPCTF.h.

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

std::set<unsigned long long int> L1TRPCTF::m_globBX
private

Definition at line 97 of file L1TRPCTF.h.

Referenced by analyze(), and endRun().

long long int L1TRPCTF::m_lastUsedBxInBxdiff
private

Definition at line 116 of file L1TRPCTF.h.

Referenced by analyze(), and endRun().

MonitorElement* L1TRPCTF::m_muonsEtaPhi[3]
private

Definition at line 89 of file L1TRPCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TRPCTF::m_qualVsEta[3]
private

Definition at line 88 of file L1TRPCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TRPCTF::m_rateAvg
private

Definition at line 92 of file L1TRPCTF.h.

Referenced by beginJob(), and fillRateHistos().

int L1TRPCTF::m_rateBinSize
private

Definition at line 114 of file L1TRPCTF.h.

Referenced by fillRateHistos().

L1TRateHelper::L1TRateHelper L1TRPCTF::m_rateHelper
private

Definition at line 100 of file L1TRPCTF.h.

Referenced by analyze(), and fillRateHistos().

MonitorElement* L1TRPCTF::m_rateMax
private

Definition at line 94 of file L1TRPCTF.h.

Referenced by beginJob(), and fillRateHistos().

MonitorElement* L1TRPCTF::m_rateMin
private

Definition at line 93 of file L1TRPCTF.h.

Referenced by beginJob(), and fillRateHistos().

int L1TRPCTF::m_rateNoOfBins
private

Definition at line 115 of file L1TRPCTF.h.

Referenced by beginJob().

int L1TRPCTF::m_rateUpdateTime
private

Definition at line 113 of file L1TRPCTF.h.

Referenced by fillRateHistos().

bool L1TRPCTF::monitorDaemon_
private

Definition at line 109 of file L1TRPCTF.h.

int L1TRPCTF::nev_
private

Definition at line 105 of file L1TRPCTF.h.

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

int L1TRPCTF::nevRPC_
private

Definition at line 106 of file L1TRPCTF.h.

Referenced by beginJob().

std::string L1TRPCTF::output_dir_
private

Definition at line 117 of file L1TRPCTF.h.

Referenced by beginJob(), and L1TRPCTF().

std::string L1TRPCTF::outputFile_
private

Definition at line 107 of file L1TRPCTF.h.

Referenced by endJob(), and L1TRPCTF().

MonitorElement* L1TRPCTF::rpctfbx
private

Definition at line 87 of file L1TRPCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TRPCTF::rpctfchargevalue[3]
private

Definition at line 83 of file L1TRPCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TRPCTF::rpctfcratesynchro[12]
private

Definition at line 96 of file L1TRPCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TRPCTF::rpctfetavalue[3]
private

Definition at line 80 of file L1TRPCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TRPCTF::rpctfntrack_b[3]
private

Definition at line 85 of file L1TRPCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TRPCTF::rpctfntrack_e[3]
private

Definition at line 86 of file L1TRPCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TRPCTF::rpctfphivalue[3]
private

Definition at line 81 of file L1TRPCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TRPCTF::rpctfptvalue[3]
private

Definition at line 82 of file L1TRPCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TRPCTF::rpctfquality[3]
private

Definition at line 84 of file L1TRPCTF.h.

Referenced by analyze(), and beginJob().

edm::InputTag L1TRPCTF::rpctfSource_
private

Definition at line 103 of file L1TRPCTF.h.

Referenced by analyze().

bool L1TRPCTF::verbose_
private

Definition at line 108 of file L1TRPCTF.h.

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