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
GeneralHLTOffline Class Reference
Inheritance diagram for GeneralHLTOffline:
edm::EDAnalyzer

Public Member Functions

 GeneralHLTOffline (const edm::ParameterSet &)
 
 ~GeneralHLTOffline ()
 
- 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 &)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
virtual void fillHltMatrix (const std::string &, const std::string &, double, double, bool)
 
virtual void setupHltMatrix (const std::string &, int)
 

Private Attributes

std::vector< std::string > AddedDatasets
 
MonitorElementcppath_
 
DQMStoredbe_
 
bool debugPrint
 
HLTConfigProvider hlt_config_
 
std::string hlt_menu_
 
std::string hltTag
 
bool outputPrint
 
std::vector< std::vector
< std::string > > 
PDsVectorPathsVector
 
std::string plotDirectoryName
 
bool streamA_found_
 

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 48 of file GeneralHLTOffline.cc.

Constructor & Destructor Documentation

GeneralHLTOffline::GeneralHLTOffline ( const edm::ParameterSet ps)
explicit

Definition at line 89 of file GeneralHLTOffline.cc.

References gather_cfg::cout, debugPrint, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hltTag, outputPrint, and plotDirectoryName.

89  :streamA_found_(false),
90  hlt_menu_(""),
91  dbe_(0),
92  cppath_(0) {
93  debugPrint = false;
94  outputPrint = false;
95 
96  plotDirectoryName = ps.getUntrackedParameter<std::string>("dirname",
97  "HLT/General");
98 
99  hltTag = ps.getParameter<std::string> ("HltProcessName");
100 
101  if (debugPrint) {
102  std::cout << "Inside Constructor" << std::endl;
103  std::cout << "Got plot dirname = " << plotDirectoryName << std::endl;
104  }
105 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * cppath_
std::string plotDirectoryName
tuple cout
Definition: gather_cfg.py:121
GeneralHLTOffline::~GeneralHLTOffline ( )

Definition at line 108 of file GeneralHLTOffline.cc.

108  {
109 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 113 of file GeneralHLTOffline.cc.

References gather_cfg::cout, cppath_, makeLayoutFileForGui::datasetNames, dbe_, debugPrint, trigger::TriggerObject::eta(), MonitorElement::Fill(), fillHltMatrix(), DQMStore::get(), edm::Event::getByLabel(), MonitorElement::getTH1F(), hlt_config_, hlt_menu_, hltTag, edm::EventBase::id(), trigger::TriggerObject::id(), getHLTprescales::index, edm::HandleBase::isValid(), relativeConstraints::keys, diffTwoXMLs::label, edm::EventID::luminosityBlock(), HLTConfigProvider::moduleLabels(), HLTConfigProvider::moduleType(), NULL, outputPrint, EgammaValidation_cff::pathName, PDsVectorPathsVector, trigger::TriggerObject::phi(), trigger::TriggerObject::pt(), edm::EventID::run(), HLTConfigProvider::saveTags(), findQualityFiles::size, streamA_found_, HLTConfigProvider::streamContent(), HLTConfigProvider::triggerIndex(), and patRefSel_triggerSelection_cff::triggerResults.

114  {
115  if (debugPrint)
116  std::cout << "Inside analyze - run, block, event "
117  << iEvent.id().run() << " , " << iEvent.id().luminosityBlock()
118  << " , " << iEvent.id() << " , " << std::endl;
119 
120 
121  // Access Trigger Results
123  iEvent.getByLabel(edm::InputTag("TriggerResults", "", hltTag), triggerResults);
124 
125  if (!triggerResults.isValid()) {
126  if (debugPrint)
127  std::cout << "Trigger results not valid" << std::endl;
128  return;
129  }
130 
131  if (debugPrint)
132  std::cout << "Found triggerResults" << std::endl;
133 
134  edm::Handle<trigger::TriggerEvent> aodTriggerEvent;
135  iEvent.getByLabel(edm::InputTag("hltTriggerSummaryAOD", "", hltTag),
136  aodTriggerEvent);
137 
138  if (!aodTriggerEvent.isValid()) {
139  if (debugPrint)
140  std::cout << "No AOD trigger summary found! Returning...";
141  return;
142  }
143 
144  const trigger::TriggerObjectCollection objects = aodTriggerEvent->getObjects();
145 
146  if (streamA_found_) {
147  const std::vector<std::string> &datasetNames = hlt_config_.streamContent("A");
148  // Loop over PDs
149  for (unsigned int iPD = 0; iPD < datasetNames.size(); iPD++) {
150  // Loop over Paths in each PD
151  bool first_count = true;
152  for (unsigned int iPath = 0;
153  iPath < PDsVectorPathsVector[iPD].size(); iPath++) {
154  std::string &pathName = PDsVectorPathsVector[iPD][iPath];
155  unsigned int index = hlt_config_.triggerIndex(pathName);
156  if (debugPrint) {
157  std::cout << "Looking at path " << pathName << std::endl;
158  std::cout << "Index = " << index
159  << " triggerResults->size() = " << triggerResults->size()
160  << std::endl;
161  }
162 
163  // fill the histos with empty weights......
164  const std::string &label = datasetNames[iPD];
165  std::string fullPathToCPP = "HLT/GeneralHLTOffline/"
166  + label + "/cppath_" + label + hlt_menu_;
167  MonitorElement * ME_mini_cppath = dbe_->get(fullPathToCPP);
168  TH1F * hist_mini_cppath = NULL;
169  if (ME_mini_cppath)
170  hist_mini_cppath = ME_mini_cppath->getTH1F();
171 
172  if (hist_mini_cppath) {
173  TAxis * axis = hist_mini_cppath->GetXaxis();
174  if (axis) {
175  int bin_num = axis->FindBin(pathName.c_str());
176  int bn = bin_num - 1;
177  hist_mini_cppath->Fill(bn, 0);
178  hist_mini_cppath->SetEntries(hist_mini_cppath->Integral());
179  }
180  }
181 
182  if (index < triggerResults->size()) {
183  if (triggerResults->accept(index)) {
184  cppath_->Fill(index, 1);
185  if (debugPrint)
186  std::cout << "Check Event " << iEvent.id()
187  << " Run " << iEvent.id().run()
188  << " fired path " << pathName << std::endl;
189 
190  // look up module labels for this path
191  const std::vector<std::string> &modulesThisPath =
192  hlt_config_.moduleLabels(pathName);
193 
194  if (debugPrint)
195  std::cout << "Looping over module labels " << std::endl;
196 
197  // Loop backward through module names
198  for (int iModule = (modulesThisPath.size() - 1);
199  iModule >= 0; iModule--) {
200  if (debugPrint)
201  std::cout << "Module name is "
202  << modulesThisPath[iModule] << std::endl;
203  // check to see if you have savetags information
204  if (hlt_config_.saveTags(modulesThisPath[iModule])) {
205  if (debugPrint)
206  std::cout << "For path " << pathName
207  << " this module " << modulesThisPath[iModule]
208  <<" is a saveTags module of type "
209  << hlt_config_.moduleType(modulesThisPath[iModule])
210  << std::endl;
211  if (hlt_config_.moduleType(modulesThisPath[iModule])
212  == "HLTLevel1GTSeed")
213  break;
214  edm::InputTag moduleWhoseResultsWeWant(modulesThisPath[iModule],
215  "",
216  hltTag);
217  unsigned int idx_module_aod_trg =
218  aodTriggerEvent->filterIndex(moduleWhoseResultsWeWant);
219  if (idx_module_aod_trg < aodTriggerEvent->sizeFilters()) {
220  const trigger::Keys &keys =
221  aodTriggerEvent->filterKeys(idx_module_aod_trg);
222  if (debugPrint)
223  std::cout << "Got Keys for index "
224  << idx_module_aod_trg
225  <<", size of keys is " << keys.size()
226  << std::endl;
227  if (keys.size() >= 1000)
228  edm::LogWarning("GeneralHLTOffline")
229  << "WARNING!! size of keys is " << keys.size()
230  << " for path " << pathName << " and module "
231  << modulesThisPath[iModule]<< std::endl;
232 
233  // There can be > 100 keys (3-vectors) for some
234  // modules with no ID filled the first one has the
235  // highest value for single-object triggers for
236  // multi-object triggers, seems reasonable to use
237  // the first one as well So loop here has been
238  // commented out for ( size_t iKey = 0; iKey <
239  // keys.size(); iKey++ ) {
240 
241  if (keys.size() > 0) {
242  trigger::TriggerObject foundObject = objects[keys[0]];
243  if (debugPrint || outputPrint)
244  std::cout << "This object has id (pt, eta, phi) = "
245  << " " << foundObject.id() << " "
246  << std::setw(10) << foundObject.pt()
247  << ", " << std::setw(10) << foundObject.eta()
248  << ", " << std::setw(10) << foundObject.phi()
249  << " for path = " << std::setw(20) << pathName
250  << " module " << std::setw(40)
251  << modulesThisPath[iModule] << std::endl;
252  if (debugPrint)
253  std::cout << "CHECK RUN " << iEvent.id().run() << " "
254  << iEvent.id() << " " << pathName << " "
255  << modulesThisPath[iModule] << " "
256  << datasetNames[iPD] << " "
257  << hlt_config_.moduleType(modulesThisPath[iModule])
258  << " " << keys.size() << " "
259  << std::setprecision(4) << foundObject.pt() << " "
260  << foundObject.eta() << " "
261  << foundObject.phi() << std::endl;
262 
263  // first_count is to make sure that the top-level
264  // histograms of each dataset don't get filled
265  // more than once
266  fillHltMatrix(datasetNames[iPD], pathName,
267  foundObject.eta(), foundObject.phi(),
268  first_count);
269  first_count = false;
270  } // at least one key
271  } // end if filter in aodTriggerEvent
272  // OK, we found the last module. No need to look at
273  // the others. get out of the loop
274  break;
275  } // end if saveTags
276  } // end Loop backward through module names
277  } // end if(triggerResults->accept(index))
278  } // end if (index < triggerResults->size())
279  } // end Loop over Paths in each PD
280  } // end Loop over PDs
281  }
282 }
RunNumber_t run() const
Definition: EventID.h:42
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.
int id() const
getters
Definition: TriggerObject.h:57
MonitorElement * cppath_
float phi() const
Definition: TriggerObject.h:60
#define NULL
Definition: scimark2.h:8
float eta() const
Definition: TriggerObject.h:59
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
void Fill(long long x)
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 isValid() const
Definition: HandleBase.h:76
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
std::vector< std::vector< std::string > > PDsVectorPathsVector
std::vector< size_type > Keys
virtual void fillHltMatrix(const std::string &, const std::string &, double, double, bool)
TH1F * getTH1F(void) const
HLTConfigProvider hlt_config_
edm::EventID id() const
Definition: EventBase.h:56
tuple cout
Definition: gather_cfg.py:121
tuple size
Write out results.
void GeneralHLTOffline::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 287 of file GeneralHLTOffline.cc.

References gather_cfg::cout, dbe_, debugPrint, cppFunctionSkipper::operator, plotDirectoryName, and DQMStore::setCurrentFolder().

287  {
288  if (debugPrint)
289  std::cout << "Inside begin job" << std::endl;
290 
292  if (dbe_)
294 }
std::string plotDirectoryName
tuple cout
Definition: gather_cfg.py:121
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void GeneralHLTOffline::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 683 of file GeneralHLTOffline.cc.

684  {
685 }
void GeneralHLTOffline::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 303 of file GeneralHLTOffline.cc.

References AddedDatasets, DQMStore::book1D(), compare_using_db::compare, gather_cfg::cout, cppath_, HLTConfigProvider::datasetContent(), makeLayoutFileForGui::datasetNames, dbe_, debugPrint, alignCSCRings::e, newFWLiteAna::found, hlt_config_, hlt_menu_, hltTag, i, HLTConfigProvider::init(), n, PDsVectorPathsVector, HLTConfigProvider::processName(), HLTConfigProvider::removeVersion(), DQMStore::setCurrentFolder(), setupHltMatrix(), HLTConfigProvider::size(), streamA_found_, HLTConfigProvider::streamContent(), HLTConfigProvider::streamNames(), and HLTConfigProvider::tableName().

304  {
305  if (debugPrint)
306  std::cout << "Inside beginRun" << std::endl;
307 
308  // Reset "condition" variables that could have memory of previous
309  // runs.
310 
311  PDsVectorPathsVector.clear();
312  AddedDatasets.clear();
313 
314  bool changed = true;
315  if (!hlt_config_.init(iRun, iSetup, hltTag, changed)) {
316  if (debugPrint) {
317  std::cout << "Warning, didn't find process HLT" << std::endl;
318  return;
319  }
320  } else {
321  if (debugPrint)
322  std::cout << " HLTConfig processName " << hlt_config_.processName()
323  << " tableName " << hlt_config_.tableName()
324  << " size " << hlt_config_.size() << std::endl;
325  }
327  for (unsigned int n = 0, e = hlt_menu_.length(); n != e; ++n)
328  if (hlt_menu_[n] == '/' || hlt_menu_[n] == '.')
329  hlt_menu_[n] = '_';
330 
331 
333 
334  dbe_->setCurrentFolder("HLT/GeneralHLTOffline/");
335  cppath_ = dbe_->book1D("cppath" + hlt_menu_,
336  "Counts/Path",
337  hlt_config_.size(), 0, hlt_config_.size());
338 
339  const std::vector<std::string> &nameStreams = hlt_config_.streamNames();
340  std::vector<std::string>::const_iterator si = nameStreams.begin();
341  std::vector<std::string>::const_iterator se = nameStreams.end();
342  for ( ; si != se; ++si) {
343  if ((*si) == "A") {
344  streamA_found_ = true;
345  break;
346  }
347  }
348 
349  if (streamA_found_) {
350  const std::vector<std::string> &datasetNames = hlt_config_.streamContent("A");
351  if (debugPrint)
352  std::cout << "Number of Stream A datasets "
353  << datasetNames.size() << std::endl;
354 
355  for (unsigned int i = 0; i < datasetNames.size(); i++) {
356  const std::vector<std::string> &datasetPaths = hlt_config_.datasetContent(datasetNames[i]);
357  if (debugPrint) {
358  std::cout << "This is dataset " << datasetNames[i]
359  << "datasetPaths.size() = " << datasetPaths.size() << std::endl;
360  for (unsigned int iPath = 0;
361  iPath < datasetPaths.size(); iPath++) {
362  std::cout << "Before setupHltMatrix - MET dataset "
363  << datasetPaths[iPath] << std::endl;
364  }
365  }
366  // Check if dataset has been added - if not add it
367  // need to loop through AddedDatasets and compare
368  bool foundDataset = false;
369  int datasetNum = -1;
370  for (unsigned int d = 0; d < AddedDatasets.size(); d++) {
371  if (AddedDatasets[d].compare(datasetNames[i]) == 0) {
372  foundDataset = true;
373  datasetNum = d;
374  if (debugPrint)
375  std::cout << "Dataset " << datasetNames[i]
376  << " found in AddedDatasets at position " << d << std::endl;
377  break;
378  }
379  }
380 
381  if (!foundDataset) {
382  if (debugPrint)
383  std::cout << " Fill trigger paths for dataset "
384  << datasetNames[i] << std::endl;
385  PDsVectorPathsVector.push_back(datasetPaths);
386  // store dataset pathname
387  AddedDatasets.push_back(datasetNames[i]);
388  } else {
389  // This trigger path has already been added - this implies that
390  // this is a new run What we want to do is check if there is a
391  // new trigger that was not in the original dataset For a given
392  // dataset, loop over the stored list of triggers, and compare
393  // to the current list of triggers If any of the triggers are
394  // missing, add them to the end of the appropriate dataset
395  if (debugPrint)
396  std::cout << " Additional runs : Check for additional"
397  << "trigger paths per dataset " << std::endl;
398  // Loop over correct path of PDsVectorPathsVector
399  bool found = false;
400 
401  // Loop over triggers in the path
402  for (unsigned int iTrig = 0; iTrig < datasetPaths.size(); iTrig++) {
403  if (debugPrint)
404  std::cout << "Looping over trigger list in dataset "
405  << iTrig << " "
406  << datasetPaths[iTrig] << std::endl;
407  found = false;
408  // Loop over triggers already on the list
409  for (unsigned int od = 0; od < PDsVectorPathsVector[datasetNum].size(); od++) {
410  if (debugPrint)
411  std::cout << "Looping over existing trigger list " << od
412  << " " << PDsVectorPathsVector[datasetNum][od] << std::endl;
413  // Compare, see if match is found
414  if (hlt_config_.removeVersion(datasetPaths[iTrig]).compare(
415  hlt_config_.removeVersion(PDsVectorPathsVector[datasetNum][od])) == 0) {
416  found = true;
417  if (debugPrint)
418  std::cout << " FOUND " << datasetPaths[iTrig] << std::endl;
419  break;
420  }
421  }
422  // If match is not found, add trigger to correct path of PDsVectorPathsVector
423  if (!found)
424  PDsVectorPathsVector[datasetNum].push_back(datasetPaths[iTrig]);
425  if (debugPrint)
426  std::cout << datasetPaths[iTrig]
427  << " NOT FOUND - so we added it to the correct dataset "
428  << datasetNames[i] << std::endl;
429  }
430  }
431  // Let's check this whole big structure
432  if (debugPrint) {
433  for (unsigned int is = 0; is < PDsVectorPathsVector.size(); is++) {
434  std::cout << " PDsVectorPathsVector[" << is << "] is "
435  << PDsVectorPathsVector[is].size() << std::endl;
436  for (unsigned int ip = 0; ip < PDsVectorPathsVector[is].size(); ip++) {
437  std::cout << " trigger " << ip << " path "
438  << PDsVectorPathsVector[is][ip] << std::endl;
439  }
440  }
441  }
442 
443  if (debugPrint)
444  std::cout <<"Found PD: " << datasetNames[i] << std::endl;
445 
446  setupHltMatrix(datasetNames[i], i);
447  } // end of loop over dataset names
448  } // if stream A found
449 } // end of beginRun
unsigned int size() const
number of trigger paths in trigger table
int i
Definition: DBlmapReader.cc:9
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
MonitorElement * cppath_
const std::string & tableName() const
HLT ConfDB table name.
static const std::string removeVersion(const std::string &trigger)
const std::vector< std::string > & streamNames() const
const std::vector< std::string > & streamContent(unsigned int stream) const
names of datasets in stream with index i
virtual void setupHltMatrix(const std::string &, int)
const std::string & processName() const
process name
const std::vector< std::string > & datasetContent(unsigned int dataset) const
names of trigger paths in dataset with index i
std::vector< std::vector< std::string > > PDsVectorPathsVector
std::vector< std::string > AddedDatasets
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
HLTConfigProvider hlt_config_
tuple cout
Definition: gather_cfg.py:121
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void GeneralHLTOffline::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 298 of file GeneralHLTOffline.cc.

298  {
299 }
void GeneralHLTOffline::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 688 of file GeneralHLTOffline.cc.

689  {
690 }
void GeneralHLTOffline::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 452 of file GeneralHLTOffline.cc.

References gather_cfg::cout, and debugPrint.

452  {
453  if (debugPrint)
454  std::cout << " endRun called " << std::endl;
455 }
tuple cout
Definition: gather_cfg.py:121
void GeneralHLTOffline::fillHltMatrix ( const std::string &  label,
const std::string &  path,
double  Eta,
double  Phi,
bool  first_count 
)
privatevirtual

Definition at line 570 of file GeneralHLTOffline.cc.

References gather_cfg::cout, dbe_, debugPrint, DQMStore::get(), MonitorElement::getTH1F(), MonitorElement::getTH2F(), hlt_config_, hlt_menu_, NULL, and HLTConfigProvider::removeVersion().

Referenced by analyze().

574  {
575  if (debugPrint)
576  std::cout << "Inside fillHltMatrix( " << label << " , "
577  << path << " ) " << std::endl;
578 
579  std::string fullPathToME;
580  std::string fullPathToME1dEta;
581  std::string fullPathToME1dPhi;
582  std::string fullPathToME1dEtaPath;
583  std::string fullPathToME1dPhiPath;
584  std::string fullPathToCPP;
585 
586 
587  fullPathToME = "HLT/GeneralHLTOffline/HLT_" + label + "_EtaVsPhi";
588  fullPathToME1dEta = "HLT/GeneralHLTOffline/HLT_" + label + "_1dEta";
589  fullPathToME1dPhi = "HLT/GeneralHLTOffline/HLT_" + label + "_1dPhi";
590  fullPathToCPP = "HLT/GeneralHLTOffline/" + label
591  + "/cppath_" + label + "_" + hlt_menu_;
592 
593  if (label != "SingleMu" && label != "SingleElectron" && label != "Jet") {
594  fullPathToME = "HLT/GeneralHLTOffline/"
595  + label + "/HLT_" + label + "_EtaVsPhi";
596  fullPathToME1dEta = "HLT/GeneralHLTOffline/"
597  + label + "/HLT_" + label + "_1dEta";
598  fullPathToME1dPhi = "HLT/GeneralHLTOffline/"
599  + label + "/HLT_" + label + "_1dPhi";
600  }
601 
602  fullPathToME1dEtaPath = "HLT/GeneralHLTOffline/"
603  + label + "/Paths/HLT_"
604  + hlt_config_.removeVersion(path) + "_1dEta";
605  fullPathToME1dPhiPath = "HLT/GeneralHLTOffline/"
606  + label + "/Paths/HLT_"
607  + hlt_config_.removeVersion(path) + "_1dPhi";
608 
609  TH1F * hist_mini_cppath = NULL;
610  MonitorElement * ME_mini_cppath = dbe_->get(fullPathToCPP);
611  if (ME_mini_cppath)
612  hist_mini_cppath = ME_mini_cppath->getTH1F();
613 
614  // fill top-level histograms
615  if (first_count) {
616  if (debugPrint)
617  std::cout << " label " << label << " fullPathToME1dPhi "
618  << fullPathToME1dPhi << " path " << path
619  << " Phi " << Phi << " Eta " << Eta << std::endl;
620 
621  if (label != "MET" && label != "HT") {
622  MonitorElement * ME_1dEta = dbe_->get(fullPathToME1dEta);
623  if (ME_1dEta) {
624  TH1F * hist_1dEta = ME_1dEta->getTH1F();
625  if (hist_1dEta)
626  hist_1dEta->Fill(Eta);
627  }
628  }
629  if (label != "HT") {
630  MonitorElement * ME_1dPhi = dbe_->get(fullPathToME1dPhi);
631  if (ME_1dPhi) {
632  TH1F * hist_1dPhi = ME_1dPhi->getTH1F();
633  if (hist_1dPhi)
634  hist_1dPhi->Fill(Phi);
635  if (debugPrint)
636  std::cout << " **FILLED** label " << label << " fullPathToME1dPhi "
637  << fullPathToME1dPhi << " path " << path
638  << " Phi " << Phi << " Eta " << Eta << std::endl;
639  }
640  }
641  if (label != "MET" && label != "HT") {
642  MonitorElement * ME_2d = dbe_->get(fullPathToME);
643  if (ME_2d) {
644  TH2F * hist_2d = ME_2d->getTH2F();
645  if (hist_2d)
646  hist_2d->Fill(Eta, Phi);
647  }
648  }
649  } // end fill top-level histograms
650 
651  if (label != "MET" && label != "HT") {
652  MonitorElement * ME_1dEtaPath = dbe_->get(fullPathToME1dEtaPath);
653  if (ME_1dEtaPath) {
654  TH1F * hist_1dEtaPath = ME_1dEtaPath->getTH1F();
655  if (hist_1dEtaPath)
656  hist_1dEtaPath->Fill(Eta);
657  }
658  }
659  if (label != "HT") {
660  MonitorElement * ME_1dPhiPath = dbe_->get(fullPathToME1dPhiPath);
661  if (ME_1dPhiPath) {
662  TH1F * hist_1dPhiPath = ME_1dPhiPath->getTH1F();
663  if (hist_1dPhiPath)
664  hist_1dPhiPath->Fill(Phi);
665  }
666  }
667 
668  if (debugPrint)
669  if (label == "MET")
670  std::cout << " MET Eta is " << Eta << std::endl;
671 
672  if (hist_mini_cppath) {
673  TAxis * axis = hist_mini_cppath->GetXaxis();
674  int bin_num = axis->FindBin(path.c_str());
675  int bn = bin_num - 1;
676  hist_mini_cppath->Fill(bn, 1);
677  }
678 
679  if (debugPrint)
680  std::cout << "hist->Fill" << std::endl;
681 } // End fillHltMatrix
#define NULL
Definition: scimark2.h:8
static const std::string removeVersion(const std::string &trigger)
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
HLTConfigProvider hlt_config_
tuple cout
Definition: gather_cfg.py:121
TH2F * getTH2F(void) const
void GeneralHLTOffline::setupHltMatrix ( const std::string &  label,
int  iPD 
)
privatevirtual

Definition at line 458 of file GeneralHLTOffline.cc.

References DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookString(), gather_cfg::cout, dbe_, debugPrint, Gflash::EtaMax, MonitorElement::getTH1F(), MonitorElement::getTH2F(), hlt_config_, hlt_menu_, NULL, EgammaValidation_cff::pathName, PDsVectorPathsVector, Pi, HLTConfigProvider::removeVersion(), and DQMStore::setCurrentFolder().

Referenced by beginRun().

458  {
459  std::string h_name;
460  std::string h_title;
461  std::string h_name_1dEta;
462  std::string h_name_1dPhi;
463  std::string h_title_1dEta;
464  std::string h_title_1dPhi;
465  std::string h_name_1dEtaPath;
466  std::string h_name_1dPhiPath;
467  std::string h_title_1dEtaPath;
468  std::string h_title_1dPhiPath;
469  std::string pathName;
470  std::string PD_Folder;
471  std::string Path_Folder;
472 
473  PD_Folder = TString("HLT/GeneralHLTOffline");
474  if (label != "SingleMu" && label != "SingleElectron" && label != "Jet")
475  PD_Folder = TString("HLT/GeneralHLTOffline/"+label);
476 
477  dbe_->setCurrentFolder(PD_Folder.c_str());
478  dbe_->bookString("hltMenuName", hlt_menu_.c_str());
479 
480  h_name = "HLT_" +label + "_EtaVsPhi";
481  h_title = "HLT_" + label + "_EtaVsPhi";
482  h_name_1dEta = "HLT_" + label + "_1dEta";
483  h_name_1dPhi = "HLT_" + label + "_1dPhi";
484  h_title_1dEta = label + " Occupancy Vs Eta";
485  h_title_1dPhi = label + " Occupancy Vs Phi";
486 
487  Int_t numBinsEta = 30;
488  Int_t numBinsPhi = 34;
489  Int_t numBinsEtaFine = 60;
490  Int_t numBinsPhiFine = 66;
491  Double_t EtaMax = 2.610;
492  Double_t PhiMax = 17.0*TMath::Pi()/16.0;
493  Double_t PhiMaxFine = 33.0*TMath::Pi()/32.0;
494  MonitorElement * service_me = NULL;
495 
496  service_me = dbe_->book2D(h_name.c_str(),
497  h_title.c_str(),
498  numBinsEta, -EtaMax, EtaMax,
499  numBinsPhi, -PhiMax, PhiMax);
500  if (TH1 * service_histo = service_me->getTH2F())
501  service_histo->SetMinimum(0);
502 
503  if (label != "MET" && label != "HT") {
504  service_me = dbe_->book1D(h_name_1dEta.c_str(),
505  h_title_1dEta.c_str(),
506  numBinsEtaFine, -EtaMax, EtaMax);
507  if (TH1 * service_histo = service_me->getTH1F())
508  service_histo->SetMinimum(0);
509  }
510  if (label != "HT") {
511  service_me = dbe_->book1D(h_name_1dPhi.c_str(),
512  h_title_1dPhi.c_str(),
513  numBinsPhiFine, -PhiMaxFine, PhiMaxFine);
514  if (TH1 * service_histo = service_me->getTH1F())
515  service_histo->SetMinimum(0);
516  }
517 
518  // make it the top level directory, that is on the same dir level as
519  // paths
520  std::string folderz;
521  folderz = TString("HLT/GeneralHLTOffline/"+label);
522  dbe_->setCurrentFolder(folderz.c_str());
523 
524  std::string dnamez = "cppath_" + label + "_" + hlt_menu_;
525  int sizez = PDsVectorPathsVector[iPD].size();
526  TH1F * hist_mini_cppath = NULL;
527  MonitorElement * hist_mini_cppath_me = dbe_->book1D(dnamez.c_str(),
528  dnamez.c_str(),
529  sizez,
530  0,
531  sizez);
532  if (hist_mini_cppath_me)
533  hist_mini_cppath = hist_mini_cppath_me->getTH1F();
534 
535  unsigned int jPath;
536  for (unsigned int iPath = 0; iPath < PDsVectorPathsVector[iPD].size(); iPath++) {
537  pathName = hlt_config_.removeVersion(PDsVectorPathsVector[iPD][iPath]);
538  h_name_1dEtaPath = "HLT_" + pathName + "_1dEta";
539  h_name_1dPhiPath = "HLT_" + pathName + "_1dPhi";
540  h_title_1dEtaPath = pathName + " Occupancy Vs Eta";
541  h_title_1dPhiPath = pathName + "Occupancy Vs Phi";
542  jPath = iPath + 1;
543 
544  if (hist_mini_cppath) {
545  TAxis * axis = hist_mini_cppath->GetXaxis();
546  if (axis)
547  axis->SetBinLabel(jPath, pathName.c_str());
548  }
549 
550  Path_Folder = TString("HLT/GeneralHLTOffline/" + label + "/Paths");
551  dbe_->setCurrentFolder(Path_Folder.c_str());
552 
553  dbe_->book1D(h_name_1dEtaPath.c_str(),
554  h_title_1dEtaPath.c_str(),
555  numBinsEtaFine, -EtaMax, EtaMax);
556  dbe_->book1D(h_name_1dPhiPath.c_str(),
557  h_title_1dPhiPath.c_str(),
558  numBinsPhiFine, -PhiMaxFine, PhiMaxFine);
559 
560  if (debugPrint)
561  std::cout << "book1D for " << pathName << std::endl;
562  }
563 
564  if (debugPrint)
565  std::cout << "Success setupHltMatrix( " << label << " , "
566  << iPD << " )" << std::cout;
567 } // 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
#define NULL
Definition: scimark2.h:8
const double EtaMax[kNumberCalorimeter]
static const std::string removeVersion(const std::string &trigger)
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:683
std::vector< std::vector< std::string > > PDsVectorPathsVector
TH1F * getTH1F(void) const
HLTConfigProvider hlt_config_
tuple cout
Definition: gather_cfg.py:121
TH2F * getTH2F(void) const
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

std::vector<std::string> GeneralHLTOffline::AddedDatasets
private

Definition at line 80 of file GeneralHLTOffline.cc.

Referenced by beginRun().

MonitorElement* GeneralHLTOffline::cppath_
private

Definition at line 83 of file GeneralHLTOffline.cc.

Referenced by analyze(), and beginRun().

DQMStore* GeneralHLTOffline::dbe_
private

Definition at line 82 of file GeneralHLTOffline.cc.

Referenced by analyze(), beginJob(), beginRun(), fillHltMatrix(), and setupHltMatrix().

bool GeneralHLTOffline::debugPrint
private
HLTConfigProvider GeneralHLTOffline::hlt_config_
private

Definition at line 74 of file GeneralHLTOffline.cc.

Referenced by analyze(), beginRun(), fillHltMatrix(), and setupHltMatrix().

std::string GeneralHLTOffline::hlt_menu_
private

Definition at line 78 of file GeneralHLTOffline.cc.

Referenced by analyze(), beginRun(), fillHltMatrix(), and setupHltMatrix().

std::string GeneralHLTOffline::hltTag
private

Definition at line 77 of file GeneralHLTOffline.cc.

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

bool GeneralHLTOffline::outputPrint
private

Definition at line 72 of file GeneralHLTOffline.cc.

Referenced by analyze(), and GeneralHLTOffline().

std::vector< std::vector<std::string> > GeneralHLTOffline::PDsVectorPathsVector
private

Definition at line 79 of file GeneralHLTOffline.cc.

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

std::string GeneralHLTOffline::plotDirectoryName
private

Definition at line 76 of file GeneralHLTOffline.cc.

Referenced by beginJob(), and GeneralHLTOffline().

bool GeneralHLTOffline::streamA_found_
private

Definition at line 73 of file GeneralHLTOffline.cc.

Referenced by analyze(), and beginRun().