CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
OccupancyPlotter.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: OccupancyPlotter
4 // Class: OccupancyPlotter
5 //
13 //
14 // Original Author: Jason Michael Slaunwhite,512 1-008,`+41227670494,
15 // Created: Fri Aug 5 10:34:47 CEST 2011
16 // $Id: OccupancyPlotter.cc,v 1.14 2012/04/05 19:52:43 halil Exp $
17 //
18 //
19 
20 // system include files
21 #include <memory>
22 
23 // user include files
26 
33 
34 
42 
44 
45 #include "TMath.h"
46 
47 #include "TStyle.h"
48 //
49 // class declaration
50 //
51 
52 using namespace edm;
53 using namespace trigger;
54 using std::vector;
55 using std::string;
56 
57 
59  public:
60  explicit OccupancyPlotter(const edm::ParameterSet&);
62 
63  //static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
64 
65 
66  private:
67  virtual void beginJob() ;
68  virtual void analyze(const edm::Event&, const edm::EventSetup&);
69  virtual void endJob() ;
70 
71  virtual void beginRun(edm::Run const&, edm::EventSetup const&);
72  virtual void endRun(edm::Run const&, edm::EventSetup const&);
73  virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&);
74  virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&);
75  virtual void setupHltMatrix(std::string, int);
76  virtual void fillHltMatrix(std::string, std::string, double, double, bool);
77 
78  // a method to unpack the dcs info
79  bool checkDcsInfo (const edm::Event & jEvent);
80 
81  void checkLumiInfo (const edm::Event & jEvent);
82 
83  // ----------member data ---------------------------
84 
85 
86  bool debugPrint;
88 
89  std::string plotDirectoryName;
90 
92 
94 
95  vector< vector<string> > PDsVectorPathsVector;
96 
97  // Lumi info
98  float _instLumi;
100  float _pileup;
101 
102  // Store the HV info
103  bool dcs[25];
105 
106  // counters
107  int cntevt;
108  int cntBadHV;
109 
110  // histograms
112  TH1F * hist_PUvsLS;
113 
114 };
115 
116 //
117 // constants, enums and typedefs
118 //
119 
120 //
121 // static data member definitions
122 //
123 
124 //
125 // constructors and destructor
126 //
128 
129 {
130  //now do what ever initialization is needed
131 
132  debugPrint = false;
133  outputPrint = false;
134  thisiLumiValue = false;
135  cntevt=0;
136  cntBadHV=0;
137  if (debugPrint) std::cout << "Inside Constructor" << std::endl;
138 
139  plotDirectoryName = iConfig.getUntrackedParameter<std::string>("dirname", "HLT/Test");
140 
141  if (debugPrint) std::cout << "Got plot dirname = " << plotDirectoryName << std::endl;
142 
143 
144 }
145 
146 
148 {
149 
150  // do anything here that needs to be done at desctruction time
151  // (e.g. close files, deallocate resources etc.)
152 
153 }
154 
155 
156 //
157 // member functions
158 //
159 
160 // ------------ method called for each event ------------
161 void
163 {
164  using namespace edm;
165  using std::string;
166  int lumisection = (int)iEvent.luminosityBlock();
167 
168  if (debugPrint) std::cout << "Inside analyze" << std::endl;
169  ++cntevt;
170  if (cntevt % 10000 == 0) std::cout << "[OccupancyPlotter::analyze] Received event " << cntevt << std::endl;
171  // === Check the HV and the lumi
172  bool highVoltageOK = checkDcsInfo ( iEvent );
173  if (!highVoltageOK) {
174  if (debugPrint) std::cout << "Skipping event: DCS problem\n";
175  ++cntBadHV;
176  return;
177  }
178  checkLumiInfo( iEvent);
179 
180  if (debugPrint) std::cout << "instantaneous luminosity=" << _instLumi << " ± " << _instLumi_err << std::endl;
181 
182  if (thisiLumiValue){
183  thisiLumiValue = false;
184  std::cout << "LS = " << lumisection << ", Lumi = " << _instLumi << " ± " << _instLumi_err << ", pileup = " << _pileup << std::endl;
185 
186  hist_LumivsLS = dbe->get("HLT/OccupancyPlots/HLT_LumivsLS")->getTH1F();
187  hist_LumivsLS->SetBinContent(lumisection+1,_instLumi);
188  hist_LumivsLS->SetBinError(lumisection+1,_instLumi_err);
189  //
190  hist_PUvsLS = dbe->get("HLT/OccupancyPlots/HLT_PUvsLS")->getTH1F();
191  hist_PUvsLS->SetBinContent(lumisection+1,_pileup);
192 
193  }
194 
195  // Access Trigger Results
197  iEvent.getByLabel(InputTag("TriggerResults","", "HLT"), triggerResults);
198 
199  if (!triggerResults.isValid()) {
200  if (debugPrint) std::cout << "Trigger results not valid" << std::endl;
201  return; }
202 
203  if (debugPrint) std::cout << "Found triggerResults" << std::endl;
204 
205  edm::Handle<trigger::TriggerEvent> aodTriggerEvent;
206  iEvent.getByLabel(InputTag("hltTriggerSummaryAOD", "", "HLT"), aodTriggerEvent);
207 
208  if ( !aodTriggerEvent.isValid() ) {
209  if (debugPrint) std::cout << "No AOD trigger summary found! Returning...";
210  return;
211  }
212 
213  const TriggerObjectCollection objects = aodTriggerEvent->getObjects();
214 
215 
216  vector<string> datasetNames = hltConfig_.streamContent("A");
217 // Loop over PDs
218  for (unsigned int iPD = 0; iPD < datasetNames.size(); iPD++) {
219 
220  // if (datasetNames[iPD] != "SingleMu" && datasetNames[iPD] != "SingleElectron" && datasetNames[iPD] != "Jet") continue;
221 
222  unsigned int keyTracker[1000]; // Array to eliminate double counts by tracking what Keys have already been fired
223  for(unsigned int irreproduceableIterator = 0; irreproduceableIterator < 1000; irreproduceableIterator++) {
224  keyTracker[irreproduceableIterator] = 1001;
225  }
226 // Loop over Paths in each PD
227  for (unsigned int iPath = 0; iPath < PDsVectorPathsVector[iPD].size(); iPath++) { //Andrew - where does PDsVectorPathsVector get defined?
228 
229  std::string pathName = PDsVectorPathsVector[iPD][iPath];
230 
231  if (debugPrint) std::cout << "Looking at path " << pathName << std::endl;
232 
233  unsigned int index = hltConfig_.triggerIndex(pathName);
234 
235  if (debugPrint) std::cout << "Index = " << index << " triggerResults->size() = " << triggerResults->size() << std::endl;
236 
237  if (index < triggerResults->size()) {
238  if(triggerResults->accept(index)) {
239 
240  if (debugPrint) std::cout << "We fired path " << pathName << std::endl;
241 
242  // look up module labels for this path
243 
244  vector<std::string> modulesThisPath = hltConfig_.moduleLabels(pathName);
245 
246  if (debugPrint) std::cout << "Looping over module labels " << std::endl;
247 
248  // Loop backward through module names
249  for ( int iModule = (modulesThisPath.size()-1); iModule >= 0; iModule--) {
250 
251  if (debugPrint) std::cout << "Module name is " << modulesThisPath[iModule] << std::endl;
252 
253  // check to see if you have savetags information
254  if (hltConfig_.saveTags(modulesThisPath[iModule])) {
255 
256  if (debugPrint) std::cout << "For path " << pathName << " this module " << modulesThisPath[iModule] <<" is a saveTags module of type " << hltConfig_.moduleType(modulesThisPath[iModule]) << std::endl;
257 
258  if (hltConfig_.moduleType(modulesThisPath[iModule]) == "HLTLevel1GTSeed") break;
259 
260  InputTag moduleWhoseResultsWeWant(modulesThisPath[iModule], "", "HLT");
261 
262  unsigned int indexOfModuleInAodTriggerEvent = aodTriggerEvent->filterIndex(moduleWhoseResultsWeWant);
263 
264  if ( indexOfModuleInAodTriggerEvent < aodTriggerEvent->sizeFilters() ) {
265  const Keys &keys = aodTriggerEvent->filterKeys( indexOfModuleInAodTriggerEvent );
266  if (debugPrint) std::cout << "Got Keys for index " << indexOfModuleInAodTriggerEvent <<", size of keys is " << keys.size() << std::endl;
267 
268  for ( size_t iKey = 0; iKey < keys.size(); iKey++ ) {
269  TriggerObject foundObject = objects[keys[iKey]];
270  bool first_count = false;
271 
272  if(keyTracker[iKey] != iKey) first_count = true;
273 
274  if (debugPrint || outputPrint) std::cout << "This object has (pt, eta, phi) = "
275  << std::setw(10) << foundObject.pt()
276  << ", " << std::setw(10) << foundObject.eta()
277  << ", " << std::setw(10) << foundObject.phi()
278  << " for path = " << std::setw(20) << pathName
279  << " module " << std::setw(40) << modulesThisPath[iModule]
280  << " iKey " << iKey << std::endl;
281 
282  fillHltMatrix(datasetNames[iPD],pathName,foundObject.eta(),foundObject.phi(),first_count);
283 
284  keyTracker[iKey] = iKey;
285 
286 
287  }// end for each key
288  }// end if filter in aodTriggerEvent
289 
290 
291  // OK, we found the last module. No need to look at the others.
292  // get out of the loop
293 
294  break;
295  }// end if saveTags
296  }//end Loop backward through module names
297  }// end if(triggerResults->accept(index))
298  }// end if (index < triggerResults->size())
299  }// end Loop over Paths in each PD
300  }//end Loop over PDs
301 
302 
303 
304 
305 }
306 
307 
308 // ------------ method called once each job just before starting event loop ------------
309 void
311 {
312 
313  if (debugPrint) std::cout << "Inside begin job" << std::endl;
314 
315  dbe = Service<DQMStore>().operator->();
316 
317  if (dbe) {
318 
319  dbe->setCurrentFolder(plotDirectoryName);
320 
321  }
322 
323 }
324 
325 // ------------ method called once each job just after ending the event loop ------------
326 void
328 {
329 }
330 
331 // ------------ method called when starting to processes a run ------------
332 void
334 {
335 
336  if (debugPrint) std::cout << "Inside beginRun" << std::endl;
337 
338  bool changed = true;
339  if (hltConfig_.init(iRun, iSetup, "HLT", changed)) {
340  if(debugPrint)
341  if(debugPrint) std::cout << "HLT config with process name "
342  << "HLT" << " successfully extracted" << std::endl;
343  } else {
344  if (debugPrint)
345  if (debugPrint) std::cout << "Warning, didn't find process HLT" << std::endl;
346  }
347 
348  vector<string> datasetNames = hltConfig_.streamContent("A");
349  for (unsigned int i=0;i<datasetNames.size();i++) {
350 
351  if (debugPrint) std::cout << "This is dataset " << datasetNames[i] <<std::endl;
352 
353  vector<string> datasetPaths = hltConfig_.datasetContent(datasetNames[i]);
354 
355  if (debugPrint) std::cout << "datasetPaths.size() = " << datasetPaths.size() << std::endl;
356 
357  PDsVectorPathsVector.push_back(datasetPaths);
358 
359  if (debugPrint) std::cout <<"Found PD: " << datasetNames[i] << std::endl;
360  setupHltMatrix(datasetNames[i],i);
361  int maxLumisection=1000;
362  dbe->setCurrentFolder("HLT/OccupancyPlots/");
363  hist_LumivsLS = new TH1F("HLT_LumivsLS", "; Lumisection; Instantaneous Luminosity (cm^{-2} s^{-1})",maxLumisection,0,maxLumisection);
364  dbe->book1D("HLT_LumivsLS", hist_LumivsLS);
365  hist_PUvsLS = new TH1F("HLT_PUvsLS", "; Lumisection; Pileup",maxLumisection,0,maxLumisection);
366  dbe->book1D("HLT_PUvsLS", hist_PUvsLS);
367 
368  }// end of loop over dataset names
369 
370 }// end of beginRun
371 
372 // ------------ method called when ending the processing of a run ------------
374 {
375  std::cout << "[OccupancyPlotter::endRun] Total events received=" << cntevt << ", events with HV problem=" << cntBadHV << std::endl;
376 }
377 
378 void OccupancyPlotter::setupHltMatrix(std::string label, int iPD) {
379 
380 std::string h_name;
381 std::string h_title;
382 std::string h_name_1dEta;
383 std::string h_name_1dPhi;
384 std::string h_title_1dEta;
385 std::string h_title_1dPhi;
386 std::string h_name_1dEtaPath;
387 std::string h_name_1dPhiPath;
388 std::string h_title_1dEtaPath;
389 std::string h_title_1dPhiPath;
390 std::string pathName;
391 std::string PD_Folder;
392 std::string Path_Folder;
393 
394 PD_Folder = TString("HLT/OccupancyPlots");
395 if (label != "SingleMu" && label != "SingleElectron" && label != "Jet") PD_Folder = TString("HLT/OccupancyPlots/"+label);
396 
397 dbe->setCurrentFolder(PD_Folder.c_str());
398 
399 h_name = "HLT_"+label+"_EtaVsPhi";
400 h_title = "HLT_"+label+"_EtaVsPhi; eta; phi";
401 h_name_1dEta = "HLT_"+label+"_1dEta";
402 h_name_1dPhi = "HLT_"+label+"_1dPhi";
403 h_title_1dEta = label+" Occupancy Vs Eta";
404 h_title_1dPhi = label+" Occupancy Vs Phi";
405 //Int_t numBinsEta = 12;
406 //Int_t numBinsPhi = 8;
407 Int_t numBinsEta = 30;
408 Int_t numBinsPhi = 34;
409 Int_t numBinsEtaFine = 60;
410 Int_t numBinsPhiFine = 66;
411 Double_t EtaMax = 2.610;
412 Double_t PhiMax = 17.0*TMath::Pi()/16.0;
413 Double_t PhiMaxFine = 33.0*TMath::Pi()/32.0;
414 
415  //Double_t eta_bins[] = {-2.610,-2.349,-2.088,-1.827,-1.740,-1.653,-1.566,-1.479,-1.392,-1.305,-1.044,-0.783,-0.522,-0.261,0,0.261,0.522,0.783,1.044,1.305,1.392,1.479,1.566,1.653,1.740,1.827,2.088,2.349,2.610}; //Has narrower bins in Barrel/Endcap border region
416 //Double_t eta_bins[] = {-2.610,-2.175,-1.740,-1.305,-0.870,-0.435,0,0.435,0.870,1.305,1.740,2.175,2.610};
417 //Double_t phi_bins[] = {-TMath::Pi(),-3*TMath::Pi()/4,-TMath::Pi()/2,-TMath::Pi()/4,0,TMath::Pi()/4,TMath::Pi()/2,3*TMath::Pi()/4,TMath::Pi()};
418 
419  TH2F * hist_EtaVsPhi = new TH2F(h_name.c_str(),h_title.c_str(),numBinsEta,-EtaMax,EtaMax,numBinsPhi,-PhiMax,PhiMax);
420  TH1F * hist_1dEta = new TH1F(h_name_1dEta.c_str(),h_title_1dEta.c_str(),numBinsEtaFine,-EtaMax,EtaMax);
421  TH1F * hist_1dPhi = new TH1F(h_name_1dPhi.c_str(),h_title_1dPhi.c_str(),numBinsPhiFine,-PhiMaxFine,PhiMaxFine);
422 
423  hist_EtaVsPhi->SetMinimum(0);
424  hist_1dEta->SetMinimum(0);
425  hist_1dPhi->SetMinimum(0);
426 
427 dbe->book2D(h_name.c_str(),hist_EtaVsPhi);
428 dbe->book1D(h_name_1dEta.c_str(),hist_1dEta);
429 dbe->book1D(h_name_1dPhi.c_str(),hist_1dPhi);
430 
431  for (unsigned int iPath = 0; iPath < PDsVectorPathsVector[iPD].size(); iPath++) {
432  pathName = PDsVectorPathsVector[iPD][iPath];
433  h_name_1dEtaPath = "HLT_"+pathName+"_1dEta";
434  h_name_1dPhiPath = "HLT_"+pathName+"_1dPhi";
435  h_title_1dEtaPath = pathName+" Occupancy Vs Eta";
436  h_title_1dPhiPath = pathName+"Occupancy Vs Phi";
437  Path_Folder = TString("HLT/OccupancyPlots/"+label+"/Paths");
438  dbe->setCurrentFolder(Path_Folder.c_str());
439 
440  dbe->book1D(h_name_1dEtaPath.c_str(),h_title_1dEtaPath.c_str(),numBinsEtaFine,-EtaMax,EtaMax);
441  dbe->book1D(h_name_1dPhiPath.c_str(),h_title_1dPhiPath.c_str(),numBinsPhiFine,-PhiMaxFine,PhiMaxFine);
442 
443  if (debugPrint) std::cout << "book1D for " << pathName << std::endl;
444  }
445 
446  if (debugPrint) std::cout << "Success setupHltMatrix( " << label << " , " << iPD << " )" << std::cout;
447 } //End setupHltMatrix
448 
449 void OccupancyPlotter::fillHltMatrix(std::string label, std::string path,double Eta, double Phi, bool first_count) {
450 
451  if (debugPrint) std::cout << "Inside fillHltMatrix( " << label << " , " << path << " ) " << std::endl;
452 
453  std::string fullPathToME;
454  std::string fullPathToME1dEta;
455  std::string fullPathToME1dPhi;
456  std::string fullPathToME1dEtaPath;
457  std::string fullPathToME1dPhiPath;
458 
459  fullPathToME = "HLT/OccupancyPlots/HLT_"+label+"_EtaVsPhi";
460  fullPathToME1dEta = "HLT/OccupancyPlots/HLT_"+label+"_1dEta";
461  fullPathToME1dPhi = "HLT/OccupancyPlots/HLT_"+label+"_1dPhi";
462 
463 if (label != "SingleMu" && label != "SingleElectron" && label != "Jet") {
464  fullPathToME = "HLT/OccupancyPlots/"+label+"/HLT_"+label+"_EtaVsPhi";
465  fullPathToME1dEta = "HLT/OccupancyPlots/"+label+"/HLT_"+label+"_1dEta";
466  fullPathToME1dPhi = "HLT/OccupancyPlots/"+label+"/HLT_"+label+"_1dPhi";
467  }
468 
469  fullPathToME1dEtaPath = "HLT/OccupancyPlots/"+label+"/Paths/HLT_"+path+"_1dEta";
470  fullPathToME1dPhiPath = "HLT/OccupancyPlots/"+label+"/Paths/HLT_"+path+"_1dPhi";
471 
472  if (debugPrint) std::cout << "fullPathToME = " << std::endl;
473 
474  MonitorElement * ME_2d = dbe->get(fullPathToME);
475  MonitorElement * ME_1dEta = dbe->get(fullPathToME1dEta);
476  MonitorElement * ME_1dPhi = dbe->get(fullPathToME1dPhi);
477  MonitorElement * ME_1dEtaPath = dbe->get(fullPathToME1dEtaPath);
478  MonitorElement * ME_1dPhiPath = dbe->get(fullPathToME1dPhiPath);
479 
480  if (debugPrint) std::cout << "MonitorElement * " << std::endl;
481 
482  TH2F * hist_2d = ME_2d->getTH2F();
483  TH1F * hist_1dEta = ME_1dEta->getTH1F();
484  TH1F * hist_1dPhi = ME_1dPhi->getTH1F();
485  TH1F * hist_1dEtaPath = ME_1dEtaPath->getTH1F();
486  TH1F * hist_1dPhiPath = ME_1dPhiPath->getTH1F();
487 
488  if (debugPrint) std::cout << "TH2F *" << std::endl;
489 
490  //int i=2;
491  //if (Eta>1.305 && Eta<1.872) i=0;
492  //if (Eta<-1.305 && Eta>-1.872) i=0;
493  //for (int ii=i; ii<3; ++ii) hist_2d->Fill(Eta,Phi); //Scales narrow bins in Barrel/Endcap border region
494 
495  if(first_count) {
496  hist_1dEta->Fill(Eta);
497  hist_1dPhi->Fill(Phi);
498  hist_2d->Fill(Eta,Phi); }
499  hist_1dEtaPath->Fill(Eta);
500  hist_1dPhiPath->Fill(Phi);
501 
502  if (debugPrint) std::cout << "hist->Fill" << std::endl;
503 
504 } //End fillHltMatrix
505 
506 //=========================================================
507 
509 
510  //Copy of code from DQMServices/Components/src/DQMDcsInfo.cc
511 
513  if ( ! jEvent.getByLabel("hltScalersRawToDigi", dcsStatus) )
514  {
515  std::cout << "[OccupancyPlotter::checkDcsInfo] Could not get scalersRawToDigi by label\n" ;
516  for (int i=0;i<24;i++) dcs[i]=false;
517  return false;
518  }//if (debugPrint)
519 
520  if ( ! dcsStatus.isValid() )
521  {
522  std::cout << "[OccupancyPlotter::checkDcsInfo] scalersRawToDigi not valid\n" ;
523  for (int i=0;i<24;i++) dcs[i]=false; // info not available: set to false
524  return false;
525  }
526 
527  // initialize all to "true"
528  for (int i=0; i<24; i++) dcs[i]=true;
529 
530  for (DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin();
531  dcsStatusItr != dcsStatus->end(); ++dcsStatusItr)
532  {
533 
534  if (debugPrint) std::cout << (*dcsStatusItr) << std::endl;
535 
536  if (!dcsStatusItr->ready(DcsStatus::CSCp)) dcs[0]=false;
537  if (!dcsStatusItr->ready(DcsStatus::CSCm)) dcs[1]=false;
538  if (!dcsStatusItr->ready(DcsStatus::DT0)) dcs[2]=false;
539  if (!dcsStatusItr->ready(DcsStatus::DTp)) dcs[3]=false;
540  if (!dcsStatusItr->ready(DcsStatus::DTm)) dcs[4]=false;
541  if (!dcsStatusItr->ready(DcsStatus::EBp)) dcs[5]=false;
542  if (!dcsStatusItr->ready(DcsStatus::EBm)) dcs[6]=false;
543  if (!dcsStatusItr->ready(DcsStatus::EEp)) dcs[7]=false;
544  if (!dcsStatusItr->ready(DcsStatus::EEm)) dcs[8]=false;
545  if (!dcsStatusItr->ready(DcsStatus::ESp)) dcs[9]=false;
546  if (!dcsStatusItr->ready(DcsStatus::ESm)) dcs[10]=false;
547  if (!dcsStatusItr->ready(DcsStatus::HBHEa)) dcs[11]=false;
548  if (!dcsStatusItr->ready(DcsStatus::HBHEb)) dcs[12]=false;
549  if (!dcsStatusItr->ready(DcsStatus::HBHEc)) dcs[13]=false;
550  if (!dcsStatusItr->ready(DcsStatus::HF)) dcs[14]=false;
551 // if (!dcsStatusItr->ready(DcsStatus::HO)) dcs[15]=false; // ignore HO
552  if (!dcsStatusItr->ready(DcsStatus::BPIX)) dcs[16]=false;
553  if (!dcsStatusItr->ready(DcsStatus::FPIX)) dcs[17]=false;
554  if (!dcsStatusItr->ready(DcsStatus::RPC)) dcs[18]=false;
555  if (!dcsStatusItr->ready(DcsStatus::TIBTID)) dcs[19]=false;
556  if (!dcsStatusItr->ready(DcsStatus::TOB)) dcs[20]=false;
557  if (!dcsStatusItr->ready(DcsStatus::TECp)) dcs[21]=false;
558  if (!dcsStatusItr->ready(DcsStatus::TECm)) dcs[22]=false;
559 // if (!dcsStatusItr->ready(DcsStatus::CASTOR)) dcs[23]=false;
560  }
561 
562 
563  // now we should add some logic that tests the HV status
564  bool decision = true;
565  for (int i=0; i<24; i++) decision=decision && dcs[i];
566  if (debugPrint) {
567  std::cout << "[OccupancyPlotter::checkDcsInfo] DCS Status:";
568  for (int i=0; i<24; i++) std::cout << dcs[i] << "-";
569  std::cout << "; Decision: " << decision << std::endl;
570  }
571  //std::cout << "; Decision: " << decision << std::endl;
572  return decision;
573 
574 }
575 
577 
578  if (debugPrint) std::cout << "Inside method check lumi info" << std::endl;
579 
581  bool lumiHandleOK = jEvent.getByLabel(InputTag("hltScalersRawToDigi","",""), lumiScalers);
582 
583  if (!lumiHandleOK || !lumiScalers.isValid()){
584  if (debugPrint) std::cout << "scalers not valid" << std::endl;
585  return;
586  }
587 
588  if (lumiScalers->size() == 0) {
589  if (debugPrint) std::cout << "scalers has size < 0" << std::endl;
590  return;
591  }
592 
593  LumiScalersCollection::const_iterator it3 = lumiScalers->begin();
594  //unsigned int lumisection = it3->sectionNumber();
595 
596  _instLumi = it3->instantLumi();
597  _instLumi_err = it3->instantLumiErr();
598  _pileup = it3->pileup();
599 
600  if (debugPrint) std::cout << "Instanteous Lumi is " << _instLumi << std::endl;
601  if (debugPrint) std::cout << "Instanteous Lumi Error is " << _instLumi_err << std::endl;
602  if (debugPrint) std::cout << "Lumi Fill is " <<it3->lumiFill() << std::endl;
603  if (debugPrint) std::cout << "Lumi Fill is " <<it3->lumiRun() << std::endl;
604  if (debugPrint) std::cout << "Live Lumi Fill is " <<it3->liveLumiFill() << std::endl;
605  if (debugPrint) std::cout << "Live Lumi Run is " <<it3->liveLumiRun() << std::endl;
606  if (debugPrint) std::cout << "Pileup? = " << _pileup << std::endl;
607 
608  return;
609 
610 }
611 
612 //=========================================================
613 
614 // ------------ method called when starting to processes a luminosity block ------------
616 {
617  unsigned int thisLumiSection = 0;
618  thisLumiSection = lb.luminosityBlock();
619  std::cout << "[OccupancyPlotter::beginLuminosityBlock] New luminosity block: " << thisLumiSection << std::endl;
620  thisiLumiValue=true; // add the instantaneous luminosity of the first event to the LS-Lumi plot
621 }
622 
623 // ------------ method called when ending the processing of a luminosity block ------------
624 void
626 {
627 }
628 
629 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
630 // void
631 // OccupancyPlotter::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
632 // //The following says we do not know what parameters are allowed so do no validation
633 // // Please change this to state exactly what you do use, even if it is no parameters
634 // edm::ParameterSetDescription desc;
635 // desc.setUnknown();
636 // descriptions.addDefault(desc);
637 // }
638 
639 //define this as a plug-in
const double Pi
virtual void endJob()
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
virtual void setupHltMatrix(std::string, int)
float phi() const
Definition: TriggerObject.h:60
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
std::string plotDirectoryName
const double EtaMax[kNumberCalorimeter]
float eta() const
Definition: TriggerObject.h:59
DEFINE_FWK_MODULE(HiMixingModule)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
bool checkDcsInfo(const edm::Event &jEvent)
virtual void fillHltMatrix(std::string, std::string, double, double, bool)
void beginJob()
Definition: Breakpoints.cc:15
LuminosityBlockNumber_t luminosityBlock() const
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:24
list path
Definition: scaleCards.py:51
int iEvent
Definition: GenABIO.cc:243
virtual void endRun(edm::Run const &, edm::EventSetup const &)
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:83
vector< vector< string > > PDsVectorPathsVector
OccupancyPlotter(const edm::ParameterSet &)
std::vector< size_type > Keys
TH1F * getTH1F(void) const
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
virtual void beginJob()
tuple cout
Definition: gather_cfg.py:121
TH2F * getTH2F(void) const
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
HLTConfigProvider hltConfig_
tuple size
Write out results.
Definition: Run.h:33
void checkLumiInfo(const edm::Event &jEvent)