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 edm::EDConsumerBase

Public Member Functions

 GeneralHLTOffline (const edm::ParameterSet &)
 
 ~GeneralHLTOffline ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void beginJob () override
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &) override
 
virtual void endJob () override
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
virtual void endRun (edm::Run const &, edm::EventSetup const &) override
 
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
 
- 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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: [one line class summary] Implementation: [Notes on implementation]

Definition at line 47 of file GeneralHLTOffline.cc.

Constructor & Destructor Documentation

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

Definition at line 88 of file GeneralHLTOffline.cc.

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

88  :streamA_found_(false),
89  hlt_menu_(""),
90  dbe_(0),
91  cppath_(0) {
92  debugPrint = false;
93  outputPrint = false;
94 
96  "HLT/General");
97 
98  hltTag = ps.getParameter<std::string> ("HltProcessName");
99 
100  if (debugPrint) {
101  std::cout << "Inside Constructor" << std::endl;
102  std::cout << "Got plot dirname = " << plotDirectoryName << std::endl;
103  }
104 }
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 107 of file GeneralHLTOffline.cc.

107  {
108 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 112 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, trigger::TriggerObject::id(), edm::EventBase::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(), AlCaHLTBitMon_QueryRunRegistry::string, HLTConfigProvider::triggerIndex(), and triggerResults.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 286 of file GeneralHLTOffline.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 682 of file GeneralHLTOffline.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 302 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().

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

Reimplemented from edm::EDAnalyzer.

Definition at line 297 of file GeneralHLTOffline.cc.

297  {
298 }
void GeneralHLTOffline::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 687 of file GeneralHLTOffline.cc.

688  {
689 }
void GeneralHLTOffline::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 451 of file GeneralHLTOffline.cc.

References gather_cfg::cout, and debugPrint.

451  {
452  if (debugPrint)
453  std::cout << " endRun called " << std::endl;
454 }
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 569 of file GeneralHLTOffline.cc.

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

Referenced by analyze().

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

Referenced by beginRun().

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

Member Data Documentation

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

Definition at line 79 of file GeneralHLTOffline.cc.

Referenced by beginRun().

MonitorElement* GeneralHLTOffline::cppath_
private

Definition at line 82 of file GeneralHLTOffline.cc.

Referenced by analyze(), and beginRun().

DQMStore* GeneralHLTOffline::dbe_
private

Definition at line 81 of file GeneralHLTOffline.cc.

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

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

Definition at line 73 of file GeneralHLTOffline.cc.

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

std::string GeneralHLTOffline::hlt_menu_
private

Definition at line 77 of file GeneralHLTOffline.cc.

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

std::string GeneralHLTOffline::hltTag
private

Definition at line 76 of file GeneralHLTOffline.cc.

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

bool GeneralHLTOffline::outputPrint
private

Definition at line 71 of file GeneralHLTOffline.cc.

Referenced by analyze(), and GeneralHLTOffline().

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

Definition at line 78 of file GeneralHLTOffline.cc.

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

std::string GeneralHLTOffline::plotDirectoryName
private

Definition at line 75 of file GeneralHLTOffline.cc.

Referenced by beginJob(), and GeneralHLTOffline().

bool GeneralHLTOffline::streamA_found_
private

Definition at line 72 of file GeneralHLTOffline.cc.

Referenced by analyze(), and beginRun().