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, 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_, HLTConfigProvider::streamContent(), 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 = hlt_config_.streamContent("A");
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)
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: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
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 610 of file GeneralHLTOffline.cc.

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

Implements DQMEDAnalyzer.

Definition at line 412 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_.

415 {
417 
419 
420  iBooker.setCurrentFolder("HLT/GeneralHLTOffline/");
421  iBooker.bookString("hltMenuName", hlt_menu_.c_str());
422  cppath_ = iBooker.book1D("cppath" + hlt_menu_,
423  "Counts/Path",
424  hlt_config_.size(), 0, hlt_config_.size());
425 
426  if (streamA_found_) {
427 
428  for (unsigned int iPD = 0; iPD < DataSetNames.size(); iPD++)
429  setupHltMatrix(iBooker, DataSetNames[iPD], iPD);
430 
431  } // if stream A found
432 } // 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_using_db::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  for ( ; si != se; ++si) {
261  if ((*si) == "A") {
262  streamA_found_ = true;
263  break;
264  }
265  }
266 
267 
268 
269  if (streamA_found_) {
270  const std::vector<std::string> &datasetNames = hlt_config_.streamContent("A");
272 
273  if (debugPrint)
274  std::cout << "Number of Stream A datasets "
275  << datasetNames.size() << std::endl;
276 
277  for (unsigned int i = 0; i < datasetNames.size(); i++) {
278  const std::vector<std::string> &datasetPaths = hlt_config_.datasetContent(datasetNames[i]);
279  if (debugPrint) {
280  std::cout << "This is dataset " << datasetNames[i]
281  << "datasetPaths.size() = " << datasetPaths.size() << std::endl;
282  for (unsigned int iPath = 0;
283  iPath < datasetPaths.size(); iPath++) {
284  std::cout << "Before setupHltMatrix - MET dataset "
285  << datasetPaths[iPath] << std::endl;
286  }
287  }
288  // Check if dataset has been added - if not add it
289  // need to loop through AddedDatasets and compare
290  bool foundDataset = false;
291  int datasetNum = -1;
292  for (unsigned int d = 0; d < AddedDatasets.size(); d++) {
293  if (AddedDatasets[d].compare(datasetNames[i]) == 0) {
294  foundDataset = true;
295  datasetNum = d;
296  if (debugPrint)
297  std::cout << "Dataset " << datasetNames[i]
298  << " found in AddedDatasets at position " << d << std::endl;
299  break;
300  }
301  }
302 
303  if (!foundDataset) {
304  if (debugPrint)
305  std::cout << " Fill trigger paths for dataset "
306  << datasetNames[i] << std::endl;
307  PDsVectorPathsVector.push_back(datasetPaths);
308  // store dataset pathname
309  AddedDatasets.push_back(datasetNames[i]);
310  } else {
311  // This trigger path has already been added - this implies that
312  // this is a new run What we want to do is check if there is a
313  // new trigger that was not in the original dataset For a given
314  // dataset, loop over the stored list of triggers, and compare
315  // to the current list of triggers If any of the triggers are
316  // missing, add them to the end of the appropriate dataset
317  if (debugPrint)
318  std::cout << " Additional runs : Check for additional"
319  << "trigger paths per dataset " << std::endl;
320  // Loop over correct path of PDsVectorPathsVector
321  bool found = false;
322 
323  // Loop over triggers in the path
324  for (unsigned int iTrig = 0; iTrig < datasetPaths.size(); iTrig++) {
325  if (debugPrint)
326  std::cout << "Looping over trigger list in dataset "
327  << iTrig << " "
328  << datasetPaths[iTrig] << std::endl;
329  found = false;
330  // Loop over triggers already on the list
331  for (unsigned int od = 0; od < PDsVectorPathsVector[datasetNum].size(); od++) {
332  if (debugPrint)
333  std::cout << "Looping over existing trigger list " << od
334  << " " << PDsVectorPathsVector[datasetNum][od] << std::endl;
335  // Compare, see if match is found
336  if (hlt_config_.removeVersion(datasetPaths[iTrig]).compare(
337  hlt_config_.removeVersion(PDsVectorPathsVector[datasetNum][od])) == 0) {
338  found = true;
339  if (debugPrint)
340  std::cout << " FOUND " << datasetPaths[iTrig] << std::endl;
341  break;
342  }
343  }
344  // If match is not found, add trigger to correct path of PDsVectorPathsVector
345  if (!found)
346  PDsVectorPathsVector[datasetNum].push_back(datasetPaths[iTrig]);
347  if (debugPrint)
348  std::cout << datasetPaths[iTrig]
349  << " NOT FOUND - so we added it to the correct dataset "
350  << datasetNames[i] << std::endl;
351  }
352  }
353  // Let's check this whole big structure
354  if (debugPrint) {
355  for (unsigned int is = 0; is < PDsVectorPathsVector.size(); is++) {
356  std::cout << " PDsVectorPathsVector[" << is << "] is "
357  << PDsVectorPathsVector[is].size() << std::endl;
358  for (unsigned int ip = 0; ip < PDsVectorPathsVector[is].size(); ip++) {
359  std::cout << " trigger " << ip << " path "
360  << PDsVectorPathsVector[is][ip] << std::endl;
361  }
362  }
363  }
364 
365  if (debugPrint)
366  std::cout <<"Found PD: " << datasetNames[i] << std::endl;
367  } // end of loop over dataset names
368 
369 
370 
371  std::vector<std::string> triggerNames = hlt_config_.triggerNames();
372 
373  for( unsigned int iPath=0; iPath<triggerNames.size(); iPath++ ){
374  std::string pathName = triggerNames[iPath];
375 
376  const std::vector<std::string>& moduleLabels = hlt_config_.moduleLabels(pathName);
377  int NumModules = int( moduleLabels.size() );
378 
379  if( !(pathName.find("HLT_") != std::string::npos) ) continue;
380  if( (pathName.find("HLT_Physics")!=std::string::npos) ||
381  (pathName.find("HLT_Random")!=std::string::npos) ) continue;
382 
383  std::string prefix("hltPre");
384 
385  std::vector<std::string> good_module_names;
386  good_module_names.clear();
387  for( int iMod=0; iMod<NumModules; iMod++ ){
388  std::string moduleType = hlt_config_.moduleType(moduleLabels[iMod]);
389  std::string moduleEDMType = hlt_config_.moduleEDMType(moduleLabels[iMod]);
390  if( !(moduleEDMType == "EDFilter") ) continue;
391  if( moduleType.find("Selector")!= std::string::npos ) continue;
392  if( moduleType == "HLTTriggerTypeFilter" ||
393  moduleType == "HLTBool" ||
394  moduleType == "PrimaryVertexObjectFilter" ||
395  moduleType == "JetVertexChecker" ||
396  moduleType == "HLTRHemisphere" ||
397  moduleType == "DetectorStateFilter" ) continue;
398 
399  if( moduleLabels[iMod].compare(0, prefix.length(), prefix) == 0 ) continue;
400  good_module_names.push_back(moduleLabels[iMod]);
401  }
402  PathModules[pathName] = good_module_names;
403  } // loop over paths
404 
405  } // if stream A found
406 
407 
408 }
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.
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 615 of file GeneralHLTOffline.cc.

616  {
617 }
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 510 of file GeneralHLTOffline.cc.

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

Referenced by analyze().

515  {
516  if (debugPrint)
517  std::cout << "Inside fillHltMatrix( " << label << " , "
518  << path << " ) " << std::endl;
519 
520  std::string fullPathToCPP;
521 
522  fullPathToCPP = "HLT/GeneralHLTOffline/" + label + "/cppath_" + label + "_" + hlt_menu_;
523 
524  std::string dnamez = "cppath_" + label + "_" + hlt_menu_;
525 
526  TH1F * hist_mini_cppath = NULL;
527  MonitorElement * ME_mini_cppath = NULL;
528  if( cppath_mini_.find(dnamez)!=cppath_mini_.end() ){
529  ME_mini_cppath = cppath_mini_[dnamez];
530  hist_mini_cppath = ME_mini_cppath->getTH1F();
531  }
532 
533  std::string pathNameNoVer = hlt_config_.removeVersion(path);
534 
535  if( (path.find("HLT_") != std::string::npos) &&
536  !(path.find("HLT_Physics")!=std::string::npos) &&
537  !(path.find("HLT_Random")!=std::string::npos) ){
538 
539  unsigned int triggerEventSize = 0;
540  if( hasRawTriggerEvent && triggerEventRAW.isValid() ) triggerEventSize = triggerEventRAW->size();
541  else if( triggerEventAOD.isValid() ) triggerEventSize = triggerEventAOD->sizeFilters();
542 
543  std::string pathName_dataset = "cpfilt_" + label + "_" + pathNameNoVer;
544 
545  TH1F * hist_cpfilt_mini = NULL;
546  MonitorElement * ME_cpfilt_mini = NULL;
547  if( cpfilt_mini_.find(pathName_dataset)!=cpfilt_mini_.end() ){
548  ME_cpfilt_mini = cpfilt_mini_[pathName_dataset];
549  hist_cpfilt_mini = ME_cpfilt_mini->getTH1F();
550  }
551 
552 
553  std::vector<std::string> moduleLabels = PathModules[path];
554  int NumModules = int( moduleLabels.size() );
555 
556  for( int iMod=0; iMod<NumModules; iMod++ ){
557  edm::InputTag moduleWhoseResultsWeWant(moduleLabels[iMod],
558  "",
559  hltTag);
560 
561  unsigned int idx_module_trg = 0;
562  if( hasRawTriggerEvent && triggerEventRAW.isValid() ) idx_module_trg = triggerEventRAW->filterIndex(moduleWhoseResultsWeWant);
563  else if( triggerEventAOD.isValid() ) idx_module_trg = triggerEventAOD->filterIndex(moduleWhoseResultsWeWant);
564 
565  if( !(idx_module_trg < triggerEventSize) ) continue;
566  if( hist_cpfilt_mini ){
567  TAxis * axis = hist_cpfilt_mini->GetXaxis();
568  int bin_num = axis->FindBin(moduleLabels[iMod].c_str());
569  int bn = bin_num - 1;
570 
571  if( bin_num!=1 && hasRawTriggerEvent ){
572  bool passPreviousFilters = true;
573  for( int ibin = bin_num-1; ibin>0; ibin-- ){
574  std::string previousFilter(axis->GetBinLabel(ibin));
575  edm::InputTag previousModuleWhoseResultsWeWant(previousFilter,
576  "",
577  hltTag);
578  unsigned int idx_previous_module_trg = 0;
579  if( hasRawTriggerEvent && triggerEventRAW.isValid() ) idx_previous_module_trg = triggerEventRAW->filterIndex(previousModuleWhoseResultsWeWant);
580  else if( triggerEventAOD.isValid() ) idx_previous_module_trg = triggerEventAOD->filterIndex(previousModuleWhoseResultsWeWant);
581 
582  if( !(idx_previous_module_trg < triggerEventSize) ){
583  passPreviousFilters = false;
584  break;
585  }
586  }
587  // Only fill if previous filters have been passed
588  if( passPreviousFilters ) hist_cpfilt_mini->Fill(bn, 1);
589  }
590  else hist_cpfilt_mini->Fill(bn, 1);
591 
592  }
593  }
594  }
595  else{
596  if (debugPrint) std::cout << "No AOD trigger summary found! Returning..." << std::endl;
597  }
598 
599  if( accept && hist_mini_cppath ){
600  TAxis * axis = hist_mini_cppath->GetXaxis();
601  int bin_num = axis->FindBin(pathNameNoVer.c_str());
602  int bn = bin_num - 1;
603  hist_mini_cppath->Fill(bn, 1);
604  }
605 
606  if (debugPrint)
607  std::cout << "hist->Fill" << std::endl;
608 } // 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)
tuple path
else: Piece not in the list, fine.
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 435 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().

435  {
436  std::string h_name;
437  std::string h_title;
439  std::string PD_Folder;
440  std::string Path_Folder;
441 
442  PD_Folder = TString("HLT/GeneralHLTOffline/"+label);
443 
444  iBooker.setCurrentFolder(PD_Folder.c_str());
445 
446  // make it the top level directory, that is on the same dir level as
447  // paths
448  std::string folderz;
449  folderz = TString("HLT/GeneralHLTOffline/"+label);
450  iBooker.setCurrentFolder(folderz.c_str());
451 
452  std::string dnamez = "cppath_" + label + "_" + hlt_menu_;
453  int sizez = PDsVectorPathsVector[iPD].size();
454  TH1F * hist_mini_cppath = NULL;
455  cppath_mini_[dnamez] = iBooker.book1D(dnamez.c_str(),
456  dnamez.c_str(),
457  sizez,
458  0,
459  sizez);
460  if( cppath_mini_[dnamez] )
461  hist_mini_cppath = cppath_mini_[dnamez]->getTH1F();
462 
463  unsigned int jPath;
464  for (unsigned int iPath = 0; iPath < PDsVectorPathsVector[iPD].size(); iPath++) {
465  pathName = hlt_config_.removeVersion(PDsVectorPathsVector[iPD][iPath]);
466  jPath = iPath + 1;
467 
468  if (hist_mini_cppath) {
469  TAxis * axis = hist_mini_cppath->GetXaxis();
470  if (axis)
471  axis->SetBinLabel(jPath, pathName.c_str());
472  }
473 
474  std::string pathNameVer = PDsVectorPathsVector[iPD][iPath];
475 
476  std::vector<std::string> moduleLabels = PathModules[pathNameVer];
477  int NumModules = int( moduleLabels.size() );
478 
479  if( NumModules==0 ) continue;
480 
481  std::string pathName_dataset = "cpfilt_" + label + "_" + pathName;
482 
483  cpfilt_mini_[pathName_dataset] = iBooker.book1D(pathName_dataset.c_str(),
484  pathName.c_str(),
485  NumModules,
486  0,
487  NumModules);
488 
489  if( cpfilt_mini_[pathName_dataset] )
490  hist_cpfilt_mini_[pathName_dataset] = cpfilt_mini_[pathName_dataset]->getTH1F();
491 
492  for( int iMod=0; iMod<NumModules; iMod++ ){
493  if( cpfilt_mini_[pathName_dataset] && hist_cpfilt_mini_[pathName_dataset] ){
494  TAxis * axis = hist_cpfilt_mini_[pathName_dataset]->GetXaxis();
495  if (axis)
496  axis->SetBinLabel(iMod+1,moduleLabels[iMod].c_str());
497  }
498  }
499 
500  if (debugPrint)
501  std::cout << "book1D for " << pathName << std::endl;
502  }
503 
504  if (debugPrint)
505  std::cout << "Success setupHltMatrix( " << label << " , "
506  << iPD << " )" << std::endl;
507 } // 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 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().