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:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 GeneralHLTOffline (const edm::ParameterSet &)
 
 ~GeneralHLTOffline ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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 beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &iRun, edm::EventSetup const &iSetup) override
 
virtual void dqmBeginRun (edm::Run const &iRun, edm::EventSetup const &iSetup) override
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
virtual void fillHltMatrix (const std::string &, const std::string &, bool, bool, edm::Handle< trigger::TriggerEventWithRefs >, edm::Handle< trigger::TriggerEvent >)
 
virtual void setupHltMatrix (DQMStore::IBooker &iBooker, const std::string &, int)
 

Private Attributes

std::vector< std::string > AddedDatasets
 
std::map< std::string,
MonitorElement * > 
cpfilt_mini_
 
MonitorElementcppath_
 
std::map< std::string,
MonitorElement * > 
cppath_mini_
 
std::vector< std::string > DataSetNames
 
bool debugPrint
 
std::map< std::string, TH1F * > hist_cpfilt_mini_
 
HLTConfigProvider hlt_config_
 
std::string hlt_menu_
 
std::string hltTag
 
bool outputPrint
 
std::map< std::string,
std::vector< std::string > > 
PathModules
 
std::vector< std::vector
< std::string > > 
PDsVectorPathsVector
 
std::string plotDirectoryName
 
bool streamA_found_
 
edm::EDGetTokenT
< edm::TriggerResults
triggerResultsToken
 
edm::EDGetTokenT
< trigger::TriggerEvent
triggerSummaryTokenAOD
 
edm::EDGetTokenT
< trigger::TriggerEventWithRefs
triggerSummaryTokenRAW
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 49 of file GeneralHLTOffline.cc.

Constructor & Destructor Documentation

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

Definition at line 102 of file GeneralHLTOffline.cc.

References gather_cfg::cout, debugPrint, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hltTag, HLT_25ns14e33_v1_cff::InputTag, outputPrint, plotDirectoryName, AlCaHLTBitMon_QueryRunRegistry::string, triggerResultsToken, triggerSummaryTokenAOD, and triggerSummaryTokenRAW.

102  :streamA_found_(false),
103  hlt_menu_(""),
104  cppath_(0) {
105  debugPrint = false;
106  outputPrint = false;
107 
109  "HLT/General");
110 
111  hltTag = ps.getParameter<std::string> ("HltProcessName");
112 
113  triggerSummaryTokenRAW = consumes <trigger::TriggerEventWithRefs> (edm::InputTag(std::string("hltTriggerSummaryRAW"), std::string(""), hltTag));
114  triggerSummaryTokenAOD = consumes <trigger::TriggerEvent> (edm::InputTag(std::string("hltTriggerSummaryAOD"), std::string(""), hltTag));
115  triggerResultsToken = consumes <edm::TriggerResults> (edm::InputTag(std::string("TriggerResults"), std::string(""), hltTag));
116 
117  if (debugPrint) {
118  std::cout << "Inside Constructor" << std::endl;
119  std::cout << "Got plot dirname = " << plotDirectoryName << std::endl;
120  }
121 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< trigger::TriggerEventWithRefs > triggerSummaryTokenRAW
MonitorElement * cppath_
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryTokenAOD
std::string plotDirectoryName
tuple cout
Definition: gather_cfg.py:121
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
GeneralHLTOffline::~GeneralHLTOffline ( )

Definition at line 124 of file GeneralHLTOffline.cc.

124  {
125 }

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 129 of file GeneralHLTOffline.cc.

References accept(), gather_cfg::cout, cppath_, cppath_mini_, makeLayoutFileForGui::datasetNames, DataSetNames, debugPrint, MonitorElement::Fill(), fillHltMatrix(), edm::Event::getByToken(), MonitorElement::getTH1F(), hlt_config_, hlt_menu_, edm::EventBase::id(), cmsHarvester::index, edm::HandleBase::isValid(), diffTwoXMLs::label, edm::EventID::luminosityBlock(), NULL, EgammaValidation_cff::pathName, PDsVectorPathsVector, HLTConfigProvider::removeVersion(), edm::EventID::run(), findQualityFiles::size, streamA_found_, AlCaHLTBitMon_QueryRunRegistry::string, HLTConfigProvider::triggerIndex(), triggerResults, triggerResultsToken, triggerSummaryTokenAOD, and triggerSummaryTokenRAW.

130  {
131  if (debugPrint)
132  std::cout << "Inside analyze - run, block, event "
133  << iEvent.id().run() << " , " << iEvent.id().luminosityBlock()
134  << " , " << iEvent.id() << " , " << std::endl;
135 
136  // Access Trigger Results
138  iEvent.getByToken(triggerResultsToken, triggerResults);
139 
140  if (!triggerResults.isValid()) {
141  if (debugPrint)
142  std::cout << "Trigger results not valid" << std::endl;
143  return;
144  }
145 
146  if (debugPrint)
147  std::cout << "Found triggerResults" << std::endl;
148 
150  iEvent.getByToken(triggerSummaryTokenRAW, rawTriggerEvent);
151 
152  edm::Handle<trigger::TriggerEvent> aodTriggerEvent;
153  iEvent.getByToken(triggerSummaryTokenAOD, aodTriggerEvent);
154 
155  bool hasRawTriggerEvent = true;
156  if( !rawTriggerEvent.isValid() ){
157  hasRawTriggerEvent = false;
158  if (debugPrint)
159  std::cout << "No RAW trigger summary found! Returning...";
160 
161  if( !aodTriggerEvent.isValid() ){
162  if (debugPrint)
163  std::cout << "No AOD trigger summary found! Returning...";
164  return;
165  }
166  }
167 
168  if (streamA_found_) {
169  const std::vector<std::string> &datasetNames = DataSetNames;
170  // Loop over PDs
171  for (unsigned int iPD = 0; iPD < datasetNames.size(); iPD++) {
172  // Loop over Paths in each PD
173  for (unsigned int iPath = 0;
174  iPath < PDsVectorPathsVector[iPD].size(); iPath++) {
176  unsigned int index = hlt_config_.triggerIndex(pathName);
177  if (debugPrint) {
178  std::cout << "Looking at path " << pathName << std::endl;
179  std::cout << "Index = " << index
180  << " triggerResults->size() = " << triggerResults->size()
181  << std::endl;
182  }
183 
184  // fill the histos with empty weights......
185  const std::string &label = datasetNames[iPD];
186  std::string fullPathToCPP = "HLT/GeneralHLTOffline/"
187  + label + "/cppath_" + label + hlt_menu_;
188  MonitorElement * ME_mini_cppath = NULL;
189  TH1F * hist_mini_cppath = NULL;
190  if( cppath_mini_.find(fullPathToCPP)!=cppath_mini_.end() ){
191  ME_mini_cppath = cppath_mini_[fullPathToCPP];
192  hist_mini_cppath = ME_mini_cppath->getTH1F();
193  }
194 
195  if (hist_mini_cppath) {
196  TAxis * axis = hist_mini_cppath->GetXaxis();
197  if (axis) {
198  std::string pathNameNoVer = hlt_config_.removeVersion(PDsVectorPathsVector[iPD][iPath]);
199  int bin_num = axis->FindBin(pathNameNoVer.c_str());
200  int bn = bin_num - 1;
201  hist_mini_cppath->Fill(bn, 0);
202  hist_mini_cppath->SetEntries(hist_mini_cppath->Integral());
203  }
204  }
205 
206  if( index < triggerResults->size() ) {
207  bool accept = triggerResults->accept(index);
208  if( accept ) cppath_->Fill(index, 1);
209 
210  fillHltMatrix(datasetNames[iPD], pathName,
211  accept,
212  hasRawTriggerEvent,
213  rawTriggerEvent,
214  aodTriggerEvent);
215  } // end if (index < triggerResults->size())
216  } // end Loop over Paths in each PD
217  } // end Loop over PDs
218  }
219 }
RunNumber_t run() const
Definition: EventID.h:39
edm::EDGetTokenT< trigger::TriggerEventWithRefs > triggerSummaryTokenRAW
MonitorElement * cppath_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryTokenAOD
#define NULL
Definition: scimark2.h:8
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:25
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
static const std::string removeVersion(const std::string &trigger)
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)
static std::string const triggerResults
Definition: EdmProvDump.cc:40
std::map< std::string, MonitorElement * > cppath_mini_
bool isValid() const
Definition: HandleBase.h:75
virtual void fillHltMatrix(const std::string &, const std::string &, bool, bool, edm::Handle< trigger::TriggerEventWithRefs >, edm::Handle< trigger::TriggerEvent >)
std::vector< std::vector< std::string > > PDsVectorPathsVector
TH1F * getTH1F(void) const
HLTConfigProvider hlt_config_
edm::EventID id() const
Definition: EventBase.h:60
std::vector< std::string > DataSetNames
tuple cout
Definition: gather_cfg.py:121
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
tuple size
Write out results.
void GeneralHLTOffline::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 621 of file GeneralHLTOffline.cc.

622  {
623 }
void GeneralHLTOffline::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 423 of file GeneralHLTOffline.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::bookString(), cppath_, DataSetNames, hlt_config_, hlt_menu_, plotDirectoryName, DQMStore::IBooker::setCurrentFolder(), setupHltMatrix(), HLTConfigProvider::size(), and streamA_found_.

426 {
428 
430 
431  iBooker.setCurrentFolder("HLT/GeneralHLTOffline/");
432  iBooker.bookString("hltMenuName", hlt_menu_.c_str());
433  cppath_ = iBooker.book1D("cppath" + hlt_menu_,
434  "Counts/Path",
435  hlt_config_.size(), 0, hlt_config_.size());
436 
437  if (streamA_found_) {
438 
439  for (unsigned int iPD = 0; iPD < DataSetNames.size(); iPD++)
440  setupHltMatrix(iBooker, DataSetNames[iPD], iPD);
441 
442  } // if stream A or Physics streams are found
443 } // end of bookHistograms
unsigned int size() const
number of trigger paths in trigger table
MonitorElement * cppath_
MonitorElement * bookString(Args &&...args)
Definition: DQMStore.h:97
std::string plotDirectoryName
virtual void setupHltMatrix(DQMStore::IBooker &iBooker, const std::string &, int)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
HLTConfigProvider hlt_config_
std::vector< std::string > DataSetNames
void GeneralHLTOffline::dqmBeginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 225 of file GeneralHLTOffline.cc.

References AddedDatasets, compare(), gather_cfg::cout, ztail::d, HLTConfigProvider::datasetContent(), makeLayoutFileForGui::datasetNames, DataSetNames, debugPrint, alignCSCRings::e, newFWLiteAna::found, hlt_config_, hlt_menu_, hltTag, i, HLTConfigProvider::init(), HLTConfigProvider::moduleEDMType(), HLTConfigProvider::moduleLabels(), HLTConfigProvider::moduleType(), gen::n, PathModules, EgammaValidation_cff::pathName, PDsVectorPathsVector, prof2calltree::prefix, HLTConfigProvider::processName(), HLTConfigProvider::removeVersion(), HLTConfigProvider::size(), streamA_found_, HLTConfigProvider::streamContent(), HLTConfigProvider::streamNames(), AlCaHLTBitMon_QueryRunRegistry::string, HLTConfigProvider::tableName(), and HLTConfigProvider::triggerNames().

226  {
227  if (debugPrint)
228  std::cout << "Inside beginRun" << std::endl;
229 
230  // Reset "condition" variables that could have memory of previous
231  // runs.
232 
233  PDsVectorPathsVector.clear();
234  AddedDatasets.clear();
235  DataSetNames.clear();
236  PathModules.clear();
237 
238 
239  bool changed = true;
240  if (!hlt_config_.init(iRun, iSetup, hltTag, changed)) {
241  if (debugPrint) {
242  std::cout << "Warning, didn't find process HLT" << std::endl;
243  return;
244  }
245  } else {
246  if (debugPrint)
247  std::cout << " HLTConfig processName " << hlt_config_.processName()
248  << " tableName " << hlt_config_.tableName()
249  << " size " << hlt_config_.size() << std::endl;
250  }
252  for (unsigned int n = 0, e = hlt_menu_.length(); n != e; ++n)
253  if (hlt_menu_[n] == '/' || hlt_menu_[n] == '.')
254  hlt_menu_[n] = '_';
255 
256 
257  const std::vector<std::string> &nameStreams = hlt_config_.streamNames();
258  std::vector<std::string>::const_iterator si = nameStreams.begin();
259  std::vector<std::string>::const_iterator se = nameStreams.end();
260  std::vector<std::string> datasetNames;
261 
262  for ( ; si != se; ++si) {
263  if (debugPrint) std::cout << "This is stream " << *si << std::endl;
264 
265  if ( ((*si).find("Physics") != std::string::npos) ||((*si).find("Scouting") != std::string::npos) ||((*si).find("Parking") != std::string::npos) || (*si) == "A") {
266  streamA_found_ = true;
267 
268  std::vector<std::string> datasetperStream = hlt_config_.streamContent(*si);
269 
270  for (auto const & di: datasetperStream) {
271  datasetNames.push_back(di);
272  }
273  }
274  }
275 
276  if (debugPrint) std::cout << "Number of total datasets " << datasetNames.size() << std::endl;
277 
278 
279  if (streamA_found_) {
280 
282 
283  if (debugPrint)
284  std::cout << "Number of datasets to be monitored "
285  << datasetNames.size() << std::endl;
286 
287  for (unsigned int i = 0; i < datasetNames.size(); i++) {
288  const std::vector<std::string> &datasetPaths = hlt_config_.datasetContent(datasetNames[i]);
289  if (debugPrint) {
290  std::cout << "This is dataset " << datasetNames[i]
291  << "datasetPaths.size() = " << datasetPaths.size() << std::endl;
292  for (unsigned int iPath = 0;
293  iPath < datasetPaths.size(); iPath++) {
294  std::cout << "Paths in begin job "
295  << datasetPaths[iPath] << std::endl;
296  }
297  }
298 
299  // Check if dataset has been added - if not add it
300  // need to loop through AddedDatasets and compare
301  bool foundDataset = false;
302  int datasetNum = -1;
303  for (unsigned int d = 0; d < AddedDatasets.size(); d++) {
304  if (AddedDatasets[d].compare(datasetNames[i]) == 0) {
305  foundDataset = true;
306  datasetNum = d;
307  if (debugPrint)
308  std::cout << "Dataset " << datasetNames[i]
309  << " found in AddedDatasets at position " << d << std::endl;
310  break;
311  }
312  }
313 
314  if (!foundDataset) {
315  if (debugPrint)
316  std::cout << " Fill trigger paths for dataset "
317  << datasetNames[i] << std::endl;
318  PDsVectorPathsVector.push_back(datasetPaths);
319  // store dataset pathname
320  AddedDatasets.push_back(datasetNames[i]);
321  } else {
322  // This trigger path has already been added - this implies that
323  // this is a new run What we want to do is check if there is a
324  // new trigger that was not in the original dataset For a given
325  // dataset, loop over the stored list of triggers, and compare
326  // to the current list of triggers If any of the triggers are
327  // missing, add them to the end of the appropriate dataset
328  if (debugPrint)
329  std::cout << " Additional runs : Check for additional"
330  << "trigger paths per dataset " << std::endl;
331  // Loop over correct path of PDsVectorPathsVector
332  bool found = false;
333 
334  // Loop over triggers in the path
335  for (unsigned int iTrig = 0; iTrig < datasetPaths.size(); iTrig++) {
336  if (debugPrint)
337  std::cout << "Looping over trigger list in dataset "
338  << iTrig << " "
339  << datasetPaths[iTrig] << std::endl;
340  found = false;
341  // Loop over triggers already on the list
342  for (unsigned int od = 0; od < PDsVectorPathsVector[datasetNum].size(); od++) {
343  if (debugPrint)
344  std::cout << "Looping over existing trigger list " << od
345  << " " << PDsVectorPathsVector[datasetNum][od] << std::endl;
346  // Compare, see if match is found
347  if (hlt_config_.removeVersion(datasetPaths[iTrig]).compare(
348  hlt_config_.removeVersion(PDsVectorPathsVector[datasetNum][od])) == 0) {
349  found = true;
350  if (debugPrint)
351  std::cout << " FOUND " << datasetPaths[iTrig] << std::endl;
352  break;
353  }
354  }
355  // If match is not found, add trigger to correct path of PDsVectorPathsVector
356  if (!found)
357  PDsVectorPathsVector[datasetNum].push_back(datasetPaths[iTrig]);
358  if (debugPrint)
359  std::cout << datasetPaths[iTrig]
360  << " NOT FOUND - so we added it to the correct dataset "
361  << datasetNames[i] << std::endl;
362  }
363  }
364  // Let's check this whole big structure
365  if (debugPrint) {
366  for (unsigned int is = 0; is < PDsVectorPathsVector.size(); is++) {
367  std::cout << " PDsVectorPathsVector[" << is << "] is "
368  << PDsVectorPathsVector[is].size() << std::endl;
369  for (unsigned int ip = 0; ip < PDsVectorPathsVector[is].size(); ip++) {
370  std::cout << " trigger " << ip << " path "
371  << PDsVectorPathsVector[is][ip] << std::endl;
372  }
373  }
374  }
375 
376  if (debugPrint)
377  std::cout <<"Found PD: " << datasetNames[i] << std::endl;
378  } // end of loop over dataset names
379 
380 
381 
382  std::vector<std::string> triggerNames = hlt_config_.triggerNames();
383 
384  for( unsigned int iPath=0; iPath<triggerNames.size(); iPath++ ){
385  std::string pathName = triggerNames[iPath];
386 
387  const std::vector<std::string>& moduleLabels = hlt_config_.moduleLabels(pathName);
388  int NumModules = int( moduleLabels.size() );
389 
390  if( !(pathName.find("HLT_") != std::string::npos) ) continue;
391  if( (pathName.find("HLT_Physics")!=std::string::npos) ||
392  (pathName.find("HLT_Random")!=std::string::npos) ) continue;
393 
394  std::string prefix("hltPre");
395 
396  std::vector<std::string> good_module_names;
397  good_module_names.clear();
398  for( int iMod=0; iMod<NumModules; iMod++ ){
399  std::string moduleType = hlt_config_.moduleType(moduleLabels[iMod]);
400  std::string moduleEDMType = hlt_config_.moduleEDMType(moduleLabels[iMod]);
401  if( !(moduleEDMType == "EDFilter") ) continue;
402  if( moduleType.find("Selector")!= std::string::npos ) continue;
403  if( moduleType == "HLTTriggerTypeFilter" ||
404  moduleType == "HLTBool" ||
405  moduleType == "PrimaryVertexObjectFilter" ||
406  moduleType == "JetVertexChecker" ||
407  moduleType == "HLTRHemisphere" ||
408  moduleType == "DetectorStateFilter" ) continue;
409 
410  if( moduleLabels[iMod].compare(0, prefix.length(), prefix) == 0 ) continue;
411  good_module_names.push_back(moduleLabels[iMod]);
412  }
413  PathModules[pathName] = good_module_names;
414  } // loop over paths
415 
416  } // if stream A or Physics streams found
417 
418 
419 }
unsigned int size() const
number of trigger paths in trigger table
int i
Definition: DBlmapReader.cc:9
const std::string moduleType(const std::string &module) const
C++ class name of module.
void compare(std::vector< std::string > const &old_files, std::string const &old_process, std::vector< std::string > const &new_files, std::string const &new_process, unsigned int max_events, bool ignore_prescales, int verbose)
Definition: hltDiff.cc:506
const std::vector< std::string > & triggerNames() const
names of trigger paths
const std::string moduleEDMType(const std::string &module) const
C++ base class name of module.
const std::string & tableName() const
HLT ConfDB table name.
static const std::string removeVersion(const std::string &trigger)
tuple d
Definition: ztail.py:151
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
const std::string & processName() const
process name
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
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_
std::map< std::string, std::vector< std::string > > PathModules
std::vector< std::string > DataSetNames
tuple cout
Definition: gather_cfg.py:121
void GeneralHLTOffline::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 626 of file GeneralHLTOffline.cc.

627  {
628 }
void GeneralHLTOffline::fillHltMatrix ( const std::string &  label,
const std::string &  path,
bool  accept,
bool  hasRawTriggerEvent,
edm::Handle< trigger::TriggerEventWithRefs triggerEventRAW,
edm::Handle< trigger::TriggerEvent triggerEventAOD 
)
privatevirtual

Definition at line 521 of file GeneralHLTOffline.cc.

References gather_cfg::cout, cpfilt_mini_, cppath_mini_, debugPrint, MonitorElement::getTH1F(), hlt_config_, hlt_menu_, hltTag, edm::HandleBase::isValid(), NULL, fed_dqm_sourceclient-live_cfg::path, PathModules, HLTConfigProvider::removeVersion(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by analyze().

526  {
527  if (debugPrint)
528  std::cout << "Inside fillHltMatrix( " << label << " , "
529  << path << " ) " << std::endl;
530 
531  std::string fullPathToCPP;
532 
533  fullPathToCPP = "HLT/GeneralHLTOffline/" + label + "/cppath_" + label + "_" + hlt_menu_;
534 
535  std::string dnamez = "cppath_" + label + "_" + hlt_menu_;
536 
537  TH1F * hist_mini_cppath = NULL;
538  MonitorElement * ME_mini_cppath = NULL;
539  if( cppath_mini_.find(dnamez)!=cppath_mini_.end() ){
540  ME_mini_cppath = cppath_mini_[dnamez];
541  hist_mini_cppath = ME_mini_cppath->getTH1F();
542  }
543 
544  std::string pathNameNoVer = hlt_config_.removeVersion(path);
545 
546  if( (path.find("HLT_") != std::string::npos) &&
547  !(path.find("HLT_Physics")!=std::string::npos) &&
548  !(path.find("HLT_Random")!=std::string::npos) ){
549 
550  unsigned int triggerEventSize = 0;
551  if( hasRawTriggerEvent && triggerEventRAW.isValid() ) triggerEventSize = triggerEventRAW->size();
552  else if( triggerEventAOD.isValid() ) triggerEventSize = triggerEventAOD->sizeFilters();
553 
554  std::string pathName_dataset = "cpfilt_" + label + "_" + pathNameNoVer;
555 
556  TH1F * hist_cpfilt_mini = NULL;
557  MonitorElement * ME_cpfilt_mini = NULL;
558  if( cpfilt_mini_.find(pathName_dataset)!=cpfilt_mini_.end() ){
559  ME_cpfilt_mini = cpfilt_mini_[pathName_dataset];
560  hist_cpfilt_mini = ME_cpfilt_mini->getTH1F();
561  }
562 
563 
564  std::vector<std::string> moduleLabels = PathModules[path];
565  int NumModules = int( moduleLabels.size() );
566 
567  for( int iMod=0; iMod<NumModules; iMod++ ){
568  edm::InputTag moduleWhoseResultsWeWant(moduleLabels[iMod],
569  "",
570  hltTag);
571 
572  unsigned int idx_module_trg = 0;
573  if( hasRawTriggerEvent && triggerEventRAW.isValid() ) idx_module_trg = triggerEventRAW->filterIndex(moduleWhoseResultsWeWant);
574  else if( triggerEventAOD.isValid() ) idx_module_trg = triggerEventAOD->filterIndex(moduleWhoseResultsWeWant);
575 
576  if( !(idx_module_trg < triggerEventSize) ) continue;
577  if( hist_cpfilt_mini ){
578  TAxis * axis = hist_cpfilt_mini->GetXaxis();
579  int bin_num = axis->FindBin(moduleLabels[iMod].c_str());
580  int bn = bin_num - 1;
581 
582  if( bin_num!=1 && hasRawTriggerEvent ){
583  bool passPreviousFilters = true;
584  for( int ibin = bin_num-1; ibin>0; ibin-- ){
585  std::string previousFilter(axis->GetBinLabel(ibin));
586  edm::InputTag previousModuleWhoseResultsWeWant(previousFilter,
587  "",
588  hltTag);
589  unsigned int idx_previous_module_trg = 0;
590  if( hasRawTriggerEvent && triggerEventRAW.isValid() ) idx_previous_module_trg = triggerEventRAW->filterIndex(previousModuleWhoseResultsWeWant);
591  else if( triggerEventAOD.isValid() ) idx_previous_module_trg = triggerEventAOD->filterIndex(previousModuleWhoseResultsWeWant);
592 
593  if( !(idx_previous_module_trg < triggerEventSize) ){
594  passPreviousFilters = false;
595  break;
596  }
597  }
598  // Only fill if previous filters have been passed
599  if( passPreviousFilters ) hist_cpfilt_mini->Fill(bn, 1);
600  }
601  else hist_cpfilt_mini->Fill(bn, 1);
602 
603  }
604  }
605  }
606  else{
607  if (debugPrint) std::cout << "No AOD trigger summary found! Returning..." << std::endl;
608  }
609 
610  if( accept && hist_mini_cppath ){
611  TAxis * axis = hist_mini_cppath->GetXaxis();
612  int bin_num = axis->FindBin(pathNameNoVer.c_str());
613  int bn = bin_num - 1;
614  hist_mini_cppath->Fill(bn, 1);
615  }
616 
617  if (debugPrint)
618  std::cout << "hist->Fill" << std::endl;
619 } // End fillHltMatrix
#define NULL
Definition: scimark2.h:8
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:25
static const std::string removeVersion(const std::string &trigger)
std::map< std::string, MonitorElement * > cppath_mini_
bool isValid() const
Definition: HandleBase.h:75
std::map< std::string, MonitorElement * > cpfilt_mini_
TH1F * getTH1F(void) const
HLTConfigProvider hlt_config_
std::map< std::string, std::vector< std::string > > PathModules
tuple cout
Definition: gather_cfg.py:121
void GeneralHLTOffline::setupHltMatrix ( DQMStore::IBooker iBooker,
const std::string &  label,
int  iPD 
)
privatevirtual

Definition at line 446 of file GeneralHLTOffline.cc.

References DQMStore::IBooker::book1D(), gather_cfg::cout, cpfilt_mini_, cppath_mini_, debugPrint, hist_cpfilt_mini_, hlt_config_, hlt_menu_, NULL, PathModules, EgammaValidation_cff::pathName, PDsVectorPathsVector, HLTConfigProvider::removeVersion(), DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by bookHistograms().

446  {
447  std::string h_name;
448  std::string h_title;
450  std::string PD_Folder;
451  std::string Path_Folder;
452 
453  PD_Folder = TString("HLT/GeneralHLTOffline/"+label);
454 
455  iBooker.setCurrentFolder(PD_Folder.c_str());
456 
457  // make it the top level directory, that is on the same dir level as
458  // paths
459  std::string folderz;
460  folderz = TString("HLT/GeneralHLTOffline/"+label);
461  iBooker.setCurrentFolder(folderz.c_str());
462 
463  std::string dnamez = "cppath_" + label + "_" + hlt_menu_;
464  int sizez = PDsVectorPathsVector[iPD].size();
465  TH1F * hist_mini_cppath = NULL;
466  cppath_mini_[dnamez] = iBooker.book1D(dnamez.c_str(),
467  dnamez.c_str(),
468  sizez,
469  0,
470  sizez);
471  if( cppath_mini_[dnamez] )
472  hist_mini_cppath = cppath_mini_[dnamez]->getTH1F();
473 
474  unsigned int jPath;
475  for (unsigned int iPath = 0; iPath < PDsVectorPathsVector[iPD].size(); iPath++) {
476  pathName = hlt_config_.removeVersion(PDsVectorPathsVector[iPD][iPath]);
477  jPath = iPath + 1;
478 
479  if (hist_mini_cppath) {
480  TAxis * axis = hist_mini_cppath->GetXaxis();
481  if (axis)
482  axis->SetBinLabel(jPath, pathName.c_str());
483  }
484 
485  std::string pathNameVer = PDsVectorPathsVector[iPD][iPath];
486 
487  std::vector<std::string> moduleLabels = PathModules[pathNameVer];
488  int NumModules = int( moduleLabels.size() );
489 
490  if( NumModules==0 ) continue;
491 
492  std::string pathName_dataset = "cpfilt_" + label + "_" + pathName;
493 
494  cpfilt_mini_[pathName_dataset] = iBooker.book1D(pathName_dataset.c_str(),
495  pathName.c_str(),
496  NumModules,
497  0,
498  NumModules);
499 
500  if( cpfilt_mini_[pathName_dataset] )
501  hist_cpfilt_mini_[pathName_dataset] = cpfilt_mini_[pathName_dataset]->getTH1F();
502 
503  for( int iMod=0; iMod<NumModules; iMod++ ){
504  if( cpfilt_mini_[pathName_dataset] && hist_cpfilt_mini_[pathName_dataset] ){
505  TAxis * axis = hist_cpfilt_mini_[pathName_dataset]->GetXaxis();
506  if (axis)
507  axis->SetBinLabel(iMod+1,moduleLabels[iMod].c_str());
508  }
509  }
510 
511  if (debugPrint)
512  std::cout << "book1D for " << pathName << std::endl;
513  }
514 
515  if (debugPrint)
516  std::cout << "Success setupHltMatrix( " << label << " , "
517  << iPD << " )" << std::endl;
518 } // End setupHltMatrix
std::map< std::string, TH1F * > hist_cpfilt_mini_
#define NULL
Definition: scimark2.h:8
static const std::string removeVersion(const std::string &trigger)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::map< std::string, MonitorElement * > cppath_mini_
std::map< std::string, MonitorElement * > cpfilt_mini_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
std::vector< std::vector< std::string > > PDsVectorPathsVector
HLTConfigProvider hlt_config_
std::map< std::string, std::vector< std::string > > PathModules
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

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

Definition at line 85 of file GeneralHLTOffline.cc.

Referenced by dqmBeginRun().

std::map<std::string, MonitorElement*> GeneralHLTOffline::cpfilt_mini_
private

Definition at line 94 of file GeneralHLTOffline.cc.

Referenced by fillHltMatrix(), and setupHltMatrix().

MonitorElement* GeneralHLTOffline::cppath_
private

Definition at line 92 of file GeneralHLTOffline.cc.

Referenced by analyze(), and bookHistograms().

std::map<std::string, MonitorElement*> GeneralHLTOffline::cppath_mini_
private

Definition at line 93 of file GeneralHLTOffline.cc.

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

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

Definition at line 86 of file GeneralHLTOffline.cc.

Referenced by analyze(), bookHistograms(), and dqmBeginRun().

bool GeneralHLTOffline::debugPrint
private
std::map<std::string, TH1F*> GeneralHLTOffline::hist_cpfilt_mini_
private

Definition at line 95 of file GeneralHLTOffline.cc.

Referenced by setupHltMatrix().

HLTConfigProvider GeneralHLTOffline::hlt_config_
private
std::string GeneralHLTOffline::hlt_menu_
private
std::string GeneralHLTOffline::hltTag
private

Definition at line 82 of file GeneralHLTOffline.cc.

Referenced by dqmBeginRun(), fillHltMatrix(), and GeneralHLTOffline().

bool GeneralHLTOffline::outputPrint
private

Definition at line 76 of file GeneralHLTOffline.cc.

Referenced by GeneralHLTOffline().

std::map< std::string, std::vector<std::string> > GeneralHLTOffline::PathModules
private

Definition at line 87 of file GeneralHLTOffline.cc.

Referenced by dqmBeginRun(), fillHltMatrix(), and setupHltMatrix().

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

Definition at line 84 of file GeneralHLTOffline.cc.

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

std::string GeneralHLTOffline::plotDirectoryName
private

Definition at line 81 of file GeneralHLTOffline.cc.

Referenced by bookHistograms(), and GeneralHLTOffline().

bool GeneralHLTOffline::streamA_found_
private

Definition at line 77 of file GeneralHLTOffline.cc.

Referenced by analyze(), bookHistograms(), and dqmBeginRun().

edm::EDGetTokenT<edm::TriggerResults> GeneralHLTOffline::triggerResultsToken
private

Definition at line 88 of file GeneralHLTOffline.cc.

Referenced by analyze(), and GeneralHLTOffline().

edm::EDGetTokenT<trigger::TriggerEvent> GeneralHLTOffline::triggerSummaryTokenAOD
private

Definition at line 90 of file GeneralHLTOffline.cc.

Referenced by analyze(), and GeneralHLTOffline().

edm::EDGetTokenT<trigger::TriggerEventWithRefs> GeneralHLTOffline::triggerSummaryTokenRAW
private

Definition at line 89 of file GeneralHLTOffline.cc.

Referenced by analyze(), and GeneralHLTOffline().