CMS 3D CMS Logo

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

#include <DQM/OccupancyPlotter/src/OccupancyPlotter.cc>

Inheritance diagram for OccupancyPlotter:
edm::EDAnalyzer

Public Member Functions

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

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
bool checkDcsInfo (const edm::Event &jEvent)
 
void checkLumiInfo (const edm::Event &jEvent)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
virtual void fillHltMatrix (std::string, std::string, double, double, bool)
 
virtual void setupHltMatrix (std::string, int)
 

Private Attributes

float _instLumi
 
float _instLumi_err
 
float _pileup
 
int cntBadHV
 
int cntevt
 
DQMStoredbe
 
bool dcs [25]
 
bool debugPrint
 
TH1F * hist_LumivsLS
 
TH1F * hist_PUvsLS
 
HLTConfigProvider hltConfig_
 
bool outputPrint
 
vector< vector< string > > PDsVectorPathsVector
 
std::string plotDirectoryName
 
bool thisiLumiValue
 

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 &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 58 of file OccupancyPlotter.cc.

Constructor & Destructor Documentation

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

Definition at line 127 of file OccupancyPlotter.cc.

References gather_cfg::cout, and edm::ParameterSet::getUntrackedParameter().

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 }
T getUntrackedParameter(std::string const &, T const &) const
std::string plotDirectoryName
tuple cout
Definition: gather_cfg.py:121
OccupancyPlotter::~OccupancyPlotter ( )

Definition at line 147 of file OccupancyPlotter.cc.

148 {
149 
150  // do anything here that needs to be done at desctruction time
151  // (e.g. close files, deallocate resources etc.)
152 
153 }

Member Function Documentation

void OccupancyPlotter::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 162 of file OccupancyPlotter.cc.

References gather_cfg::cout, makeLayoutFileForGui::datasetNames, trigger::TriggerObject::eta(), edm::Event::getByLabel(), getHLTprescales::index, relativeConstraints::keys, edm::EventBase::luminosityBlock(), EgammaValidation_cff::pathName, trigger::TriggerObject::phi(), trigger::TriggerObject::pt(), findQualityFiles::size, and patRefSel_triggerSelection_cff::triggerResults.

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 }
bool saveTags(const std::string &module) const
Is module an L3 filter (ie, tracked saveTags=true)
const std::string moduleType(const std::string &module) const
C++ class name of module.
float phi() const
Definition: TriggerObject.h:60
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
float eta() const
Definition: TriggerObject.h:59
bool checkDcsInfo(const edm::Event &jEvent)
virtual void fillHltMatrix(std::string, std::string, double, double, bool)
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:24
const std::vector< std::string > & streamContent(unsigned int stream) const
names of datasets in stream with index i
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:83
vector< vector< string > > PDsVectorPathsVector
std::vector< size_type > Keys
TH1F * getTH1F(void) const
tuple cout
Definition: gather_cfg.py:121
HLTConfigProvider hltConfig_
tuple size
Write out results.
void checkLumiInfo(const edm::Event &jEvent)
void OccupancyPlotter::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 310 of file OccupancyPlotter.cc.

References gather_cfg::cout, and cppFunctionSkipper::operator.

311 {
312 
313  if (debugPrint) std::cout << "Inside begin job" << std::endl;
314 
316 
317  if (dbe) {
318 
320 
321  }
322 
323 }
std::string plotDirectoryName
tuple cout
Definition: gather_cfg.py:121
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void OccupancyPlotter::beginLuminosityBlock ( edm::LuminosityBlock const &  lb,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 615 of file OccupancyPlotter.cc.

References gather_cfg::cout, and edm::LuminosityBlockBase::luminosityBlock().

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 }
tuple cout
Definition: gather_cfg.py:121
void OccupancyPlotter::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 333 of file OccupancyPlotter.cc.

References gather_cfg::cout, makeLayoutFileForGui::datasetNames, and i.

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
int i
Definition: DBlmapReader.cc:9
virtual void setupHltMatrix(std::string, int)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
const std::vector< std::string > & streamContent(unsigned int stream) const
names of datasets in stream with index i
const std::vector< std::string > & datasetContent(unsigned int dataset) const
names of trigger paths in dataset with index i
vector< vector< string > > PDsVectorPathsVector
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
tuple cout
Definition: gather_cfg.py:121
HLTConfigProvider hltConfig_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
bool OccupancyPlotter::checkDcsInfo ( const edm::Event jEvent)
private

Definition at line 508 of file OccupancyPlotter.cc.

References DcsStatus::BPIX, gather_cfg::cout, DcsStatus::CSCm, DcsStatus::CSCp, DcsStatus::DT0, DcsStatus::DTm, DcsStatus::DTp, DcsStatus::EBm, DcsStatus::EBp, DcsStatus::EEm, DcsStatus::EEp, DcsStatus::ESm, DcsStatus::ESp, DcsStatus::FPIX, edm::Event::getByLabel(), DcsStatus::HBHEa, DcsStatus::HBHEb, DcsStatus::HBHEc, DcsStatus::HF, i, edm::HandleBase::isValid(), DcsStatus::RPC, DcsStatus::TECm, DcsStatus::TECp, DcsStatus::TIBTID, and DcsStatus::TOB.

508  {
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 }
int i
Definition: DBlmapReader.cc:9
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
tuple cout
Definition: gather_cfg.py:121
void OccupancyPlotter::checkLumiInfo ( const edm::Event jEvent)
private

Definition at line 576 of file OccupancyPlotter.cc.

References gather_cfg::cout, edm::Event::getByLabel(), and edm::HandleBase::isValid().

576  {
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 }
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
tuple cout
Definition: gather_cfg.py:121
void OccupancyPlotter::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 327 of file OccupancyPlotter.cc.

328 {
329 }
void OccupancyPlotter::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 625 of file OccupancyPlotter.cc.

626 {
627 }
void OccupancyPlotter::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 373 of file OccupancyPlotter.cc.

References gather_cfg::cout.

374 {
375  std::cout << "[OccupancyPlotter::endRun] Total events received=" << cntevt << ", events with HV problem=" << cntBadHV << std::endl;
376 }
tuple cout
Definition: gather_cfg.py:121
void OccupancyPlotter::fillHltMatrix ( std::string  label,
std::string  path,
double  Eta,
double  Phi,
bool  first_count 
)
privatevirtual

Definition at line 449 of file OccupancyPlotter.cc.

References gather_cfg::cout, MonitorElement::getTH1F(), and MonitorElement::getTH2F().

449  {
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
list path
Definition: scaleCards.py:51
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
TH1F * getTH1F(void) const
tuple cout
Definition: gather_cfg.py:121
TH2F * getTH2F(void) const
void OccupancyPlotter::setupHltMatrix ( std::string  label,
int  iPD 
)
privatevirtual

Definition at line 378 of file OccupancyPlotter.cc.

References gather_cfg::cout, Gflash::EtaMax, EgammaValidation_cff::pathName, and Pi.

378  {
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
const double Pi
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
const double EtaMax[kNumberCalorimeter]
vector< vector< string > > PDsVectorPathsVector
tuple cout
Definition: gather_cfg.py:121
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:845
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429

Member Data Documentation

float OccupancyPlotter::_instLumi
private

Definition at line 98 of file OccupancyPlotter.cc.

float OccupancyPlotter::_instLumi_err
private

Definition at line 99 of file OccupancyPlotter.cc.

float OccupancyPlotter::_pileup
private

Definition at line 100 of file OccupancyPlotter.cc.

int OccupancyPlotter::cntBadHV
private

Definition at line 108 of file OccupancyPlotter.cc.

int OccupancyPlotter::cntevt
private

Definition at line 107 of file OccupancyPlotter.cc.

DQMStore* OccupancyPlotter::dbe
private

Definition at line 91 of file OccupancyPlotter.cc.

bool OccupancyPlotter::dcs[25]
private

Definition at line 103 of file OccupancyPlotter.cc.

bool OccupancyPlotter::debugPrint
private

Definition at line 86 of file OccupancyPlotter.cc.

TH1F* OccupancyPlotter::hist_LumivsLS
private

Definition at line 111 of file OccupancyPlotter.cc.

TH1F* OccupancyPlotter::hist_PUvsLS
private

Definition at line 112 of file OccupancyPlotter.cc.

HLTConfigProvider OccupancyPlotter::hltConfig_
private

Definition at line 93 of file OccupancyPlotter.cc.

bool OccupancyPlotter::outputPrint
private

Definition at line 87 of file OccupancyPlotter.cc.

vector< vector<string> > OccupancyPlotter::PDsVectorPathsVector
private

Definition at line 95 of file OccupancyPlotter.cc.

std::string OccupancyPlotter::plotDirectoryName
private

Definition at line 89 of file OccupancyPlotter.cc.

bool OccupancyPlotter::thisiLumiValue
private

Definition at line 104 of file OccupancyPlotter.cc.