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
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- 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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) 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_
 
bool debugPrint
 
std::map< std::string, TH1F * > hist_cpfilt_mini_
 
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_
 
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
 
- 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::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 100 of file GeneralHLTOffline.cc.

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

100  :streamA_found_(false),
101  hlt_menu_(""),
102  cppath_(0) {
103  debugPrint = false;
104  outputPrint = false;
105 
107  "HLT/General");
108 
109  hltTag = ps.getParameter<std::string> ("HltProcessName");
110 
111  triggerSummaryTokenRAW = consumes <trigger::TriggerEventWithRefs> (edm::InputTag(std::string("hltTriggerSummaryRAW"), std::string(""), hltTag));
112  triggerSummaryTokenAOD = consumes <trigger::TriggerEvent> (edm::InputTag(std::string("hltTriggerSummaryAOD"), std::string(""), hltTag));
113  triggerResultsToken = consumes <edm::TriggerResults> (edm::InputTag(std::string("TriggerResults"), std::string(""), hltTag));
114 
115  if (debugPrint) {
116  std::cout << "Inside Constructor" << std::endl;
117  std::cout << "Got plot dirname = " << plotDirectoryName << std::endl;
118  }
119 }
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 122 of file GeneralHLTOffline.cc.

122  {
123 }

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

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

128  {
129  if (debugPrint)
130  std::cout << "Inside analyze - run, block, event "
131  << iEvent.id().run() << " , " << iEvent.id().luminosityBlock()
132  << " , " << iEvent.id() << " , " << std::endl;
133 
134  // Access Trigger Results
136  iEvent.getByToken(triggerResultsToken, triggerResults);
137 
138  if (!triggerResults.isValid()) {
139  if (debugPrint)
140  std::cout << "Trigger results not valid" << std::endl;
141  return;
142  }
143 
144  if (debugPrint)
145  std::cout << "Found triggerResults" << std::endl;
146 
148  iEvent.getByToken(triggerSummaryTokenRAW, rawTriggerEvent);
149 
150  edm::Handle<trigger::TriggerEvent> aodTriggerEvent;
151  iEvent.getByToken(triggerSummaryTokenAOD, aodTriggerEvent);
152 
153  bool hasRawTriggerEvent = true;
154  if( !rawTriggerEvent.isValid() ){
155  hasRawTriggerEvent = false;
156  if (debugPrint)
157  std::cout << "No RAW trigger summary found! Returning...";
158 
159  if( !aodTriggerEvent.isValid() ){
160  if (debugPrint)
161  std::cout << "No AOD trigger summary found! Returning...";
162  return;
163  }
164  }
165 
166  if (streamA_found_) {
167  const std::vector<std::string> &datasetNames = hlt_config_.streamContent("A");
168  // Loop over PDs
169  for (unsigned int iPD = 0; iPD < datasetNames.size(); iPD++) {
170  // Loop over Paths in each PD
171  for (unsigned int iPath = 0;
172  iPath < PDsVectorPathsVector[iPD].size(); iPath++) {
174  unsigned int index = hlt_config_.triggerIndex(pathName);
175  if (debugPrint) {
176  std::cout << "Looking at path " << pathName << std::endl;
177  std::cout << "Index = " << index
178  << " triggerResults->size() = " << triggerResults->size()
179  << std::endl;
180  }
181 
182  // fill the histos with empty weights......
183  const std::string &label = datasetNames[iPD];
184  std::string fullPathToCPP = "HLT/GeneralHLTOffline/"
185  + label + "/cppath_" + label + hlt_menu_;
186  MonitorElement * ME_mini_cppath = NULL;
187  TH1F * hist_mini_cppath = NULL;
188  if( cppath_mini_.find(fullPathToCPP)!=cppath_mini_.end() ){
189  ME_mini_cppath = cppath_mini_[fullPathToCPP];
190  hist_mini_cppath = ME_mini_cppath->getTH1F();
191  }
192 
193  if (hist_mini_cppath) {
194  TAxis * axis = hist_mini_cppath->GetXaxis();
195  if (axis) {
196  std::string pathNameNoVer = hlt_config_.removeVersion(PDsVectorPathsVector[iPD][iPath]);
197  int bin_num = axis->FindBin(pathNameNoVer.c_str());
198  int bn = bin_num - 1;
199  hist_mini_cppath->Fill(bn, 0);
200  hist_mini_cppath->SetEntries(hist_mini_cppath->Integral());
201  }
202  }
203 
204  if( index < triggerResults->size() ) {
205  bool accept = triggerResults->accept(index);
206  if( accept ) cppath_->Fill(index, 1);
207 
208  fillHltMatrix(datasetNames[iPD], pathName,
209  accept,
210  hasRawTriggerEvent,
211  rawTriggerEvent,
212  aodTriggerEvent);
213  } // end if (index < triggerResults->size())
214  } // end Loop over Paths in each PD
215  } // end Loop over PDs
216  }
217 }
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:446
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:41
std::map< std::string, MonitorElement * > cppath_mini_
bool isValid() const
Definition: HandleBase.h:76
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:56
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 594 of file GeneralHLTOffline.cc.

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

Implements DQMEDAnalyzer.

Definition at line 237 of file GeneralHLTOffline.cc.

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

240 {
242 
243  bool changed = true;
244  if (!hlt_config_.init(iRun, iSetup, hltTag, changed)) {
245  if (debugPrint) {
246  std::cout << "Warning, didn't find process HLT" << std::endl;
247  return;
248  }
249  } else {
250  if (debugPrint)
251  std::cout << " HLTConfig processName " << hlt_config_.processName()
252  << " tableName " << hlt_config_.tableName()
253  << " size " << hlt_config_.size() << std::endl;
254  }
256  for (unsigned int n = 0, e = hlt_menu_.length(); n != e; ++n)
257  if (hlt_menu_[n] == '/' || hlt_menu_[n] == '.')
258  hlt_menu_[n] = '_';
259 
261 
262  iBooker.setCurrentFolder("HLT/GeneralHLTOffline/");
263  iBooker.bookString("hltMenuName", hlt_menu_.c_str());
264  cppath_ = iBooker.book1D("cppath" + hlt_menu_,
265  "Counts/Path",
266  hlt_config_.size(), 0, hlt_config_.size());
267 
268  const std::vector<std::string> &nameStreams = hlt_config_.streamNames();
269  std::vector<std::string>::const_iterator si = nameStreams.begin();
270  std::vector<std::string>::const_iterator se = nameStreams.end();
271  for ( ; si != se; ++si) {
272  if ((*si) == "A") {
273  streamA_found_ = true;
274  break;
275  }
276  }
277 
278  if (streamA_found_) {
279  const std::vector<std::string> &datasetNames = hlt_config_.streamContent("A");
280  if (debugPrint)
281  std::cout << "Number of Stream A datasets "
282  << datasetNames.size() << std::endl;
283 
284  for (unsigned int i = 0; i < datasetNames.size(); i++) {
285  const std::vector<std::string> &datasetPaths = hlt_config_.datasetContent(datasetNames[i]);
286  if (debugPrint) {
287  std::cout << "This is dataset " << datasetNames[i]
288  << "datasetPaths.size() = " << datasetPaths.size() << std::endl;
289  for (unsigned int iPath = 0;
290  iPath < datasetPaths.size(); iPath++) {
291  std::cout << "Before setupHltMatrix - MET dataset "
292  << datasetPaths[iPath] << std::endl;
293  }
294  }
295  // Check if dataset has been added - if not add it
296  // need to loop through AddedDatasets and compare
297  bool foundDataset = false;
298  int datasetNum = -1;
299  for (unsigned int d = 0; d < AddedDatasets.size(); d++) {
300  if (AddedDatasets[d].compare(datasetNames[i]) == 0) {
301  foundDataset = true;
302  datasetNum = d;
303  if (debugPrint)
304  std::cout << "Dataset " << datasetNames[i]
305  << " found in AddedDatasets at position " << d << std::endl;
306  break;
307  }
308  }
309 
310  if (!foundDataset) {
311  if (debugPrint)
312  std::cout << " Fill trigger paths for dataset "
313  << datasetNames[i] << std::endl;
314  PDsVectorPathsVector.push_back(datasetPaths);
315  // store dataset pathname
316  AddedDatasets.push_back(datasetNames[i]);
317  } else {
318  // This trigger path has already been added - this implies that
319  // this is a new run What we want to do is check if there is a
320  // new trigger that was not in the original dataset For a given
321  // dataset, loop over the stored list of triggers, and compare
322  // to the current list of triggers If any of the triggers are
323  // missing, add them to the end of the appropriate dataset
324  if (debugPrint)
325  std::cout << " Additional runs : Check for additional"
326  << "trigger paths per dataset " << std::endl;
327  // Loop over correct path of PDsVectorPathsVector
328  bool found = false;
329 
330  // Loop over triggers in the path
331  for (unsigned int iTrig = 0; iTrig < datasetPaths.size(); iTrig++) {
332  if (debugPrint)
333  std::cout << "Looping over trigger list in dataset "
334  << iTrig << " "
335  << datasetPaths[iTrig] << std::endl;
336  found = false;
337  // Loop over triggers already on the list
338  for (unsigned int od = 0; od < PDsVectorPathsVector[datasetNum].size(); od++) {
339  if (debugPrint)
340  std::cout << "Looping over existing trigger list " << od
341  << " " << PDsVectorPathsVector[datasetNum][od] << std::endl;
342  // Compare, see if match is found
343  if (hlt_config_.removeVersion(datasetPaths[iTrig]).compare(
344  hlt_config_.removeVersion(PDsVectorPathsVector[datasetNum][od])) == 0) {
345  found = true;
346  if (debugPrint)
347  std::cout << " FOUND " << datasetPaths[iTrig] << std::endl;
348  break;
349  }
350  }
351  // If match is not found, add trigger to correct path of PDsVectorPathsVector
352  if (!found)
353  PDsVectorPathsVector[datasetNum].push_back(datasetPaths[iTrig]);
354  if (debugPrint)
355  std::cout << datasetPaths[iTrig]
356  << " NOT FOUND - so we added it to the correct dataset "
357  << datasetNames[i] << std::endl;
358  }
359  }
360  // Let's check this whole big structure
361  if (debugPrint) {
362  for (unsigned int is = 0; is < PDsVectorPathsVector.size(); is++) {
363  std::cout << " PDsVectorPathsVector[" << is << "] is "
364  << PDsVectorPathsVector[is].size() << std::endl;
365  for (unsigned int ip = 0; ip < PDsVectorPathsVector[is].size(); ip++) {
366  std::cout << " trigger " << ip << " path "
367  << PDsVectorPathsVector[is][ip] << std::endl;
368  }
369  }
370  }
371 
372  if (debugPrint)
373  std::cout <<"Found PD: " << datasetNames[i] << std::endl;
374 
375  setupHltMatrix(iBooker, datasetNames[i], i);
376  } // end of loop over dataset names
377  } // if stream A found
378 } // end of beginRun
unsigned int size() const
number of trigger paths in trigger table
int i
Definition: DBlmapReader.cc:9
MonitorElement * cppath_
MonitorElement * bookString(Args &&...args)
Definition: DQMStore.h:97
const std::string & tableName() const
HLT ConfDB table name.
std::string plotDirectoryName
static const std::string removeVersion(const std::string &trigger)
virtual void setupHltMatrix(DQMStore::IBooker &iBooker, const std::string &, int)
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
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
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
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
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 GeneralHLTOffline::dqmBeginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 223 of file GeneralHLTOffline.cc.

References AddedDatasets, gather_cfg::cout, debugPrint, and PDsVectorPathsVector.

224  {
225  if (debugPrint)
226  std::cout << "Inside beginRun" << std::endl;
227 
228  // Reset "condition" variables that could have memory of previous
229  // runs.
230 
231  PDsVectorPathsVector.clear();
232  AddedDatasets.clear();
233 }
std::vector< std::vector< std::string > > PDsVectorPathsVector
std::vector< std::string > AddedDatasets
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 599 of file GeneralHLTOffline.cc.

600  {
601 }
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 480 of file GeneralHLTOffline.cc.

References compare_using_db::compare, gather_cfg::cout, cpfilt_mini_, cppath_mini_, debugPrint, MonitorElement::getTH1F(), hlt_config_, hlt_menu_, hltTag, edm::HandleBase::isValid(), HLTConfigProvider::moduleEDMType(), HLTConfigProvider::moduleLabels(), HLTConfigProvider::moduleType(), NULL, prof2calltree::prefix, HLTConfigProvider::removeVersion(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by analyze().

485  {
486  if (debugPrint)
487  std::cout << "Inside fillHltMatrix( " << label << " , "
488  << path << " ) " << std::endl;
489 
490  std::string fullPathToCPP;
491 
492  fullPathToCPP = "HLT/GeneralHLTOffline/" + label + "/cppath_" + label + "_" + hlt_menu_;
493 
494  std::string dnamez = "cppath_" + label + "_" + hlt_menu_;
495 
496  TH1F * hist_mini_cppath = NULL;
497  MonitorElement * ME_mini_cppath = NULL;
498  if( cppath_mini_.find(dnamez)!=cppath_mini_.end() ){
499  ME_mini_cppath = cppath_mini_[dnamez];
500  hist_mini_cppath = ME_mini_cppath->getTH1F();
501  }
502 
503  std::string pathNameNoVer = hlt_config_.removeVersion(path);
504 
505  if( (path.find("HLT_") != std::string::npos) &&
506  !(path.find("HLT_Physics")!=std::string::npos) &&
507  !(path.find("HLT_Random")!=std::string::npos) ){
508 
509  unsigned int triggerEventSize = 0;
510  if( hasRawTriggerEvent && triggerEventRAW.isValid() ) triggerEventSize = triggerEventRAW->size();
511  else if( triggerEventAOD.isValid() ) triggerEventSize = triggerEventAOD->sizeFilters();
512 
513  const std::vector<std::string>& moduleLabels = hlt_config_.moduleLabels(path);
514  int NumModules = int( moduleLabels.size() );
515 
516  std::string pathName_dataset = "cpfilt_" + label + "_" + pathNameNoVer;
517 
518  TH1F * hist_cpfilt_mini = NULL;
519  MonitorElement * ME_cpfilt_mini = NULL;
520  if( cpfilt_mini_.find(pathName_dataset)!=cpfilt_mini_.end() ){
521  ME_cpfilt_mini = cpfilt_mini_[pathName_dataset];
522  hist_cpfilt_mini = ME_cpfilt_mini->getTH1F();
523  }
524 
525  std::string prefix("hltPre");
526 
527  for( int iMod=0; iMod<NumModules; iMod++ ){
528  std::string moduleType = hlt_config_.moduleType(moduleLabels[iMod]);
529  std::string moduleEDMType = hlt_config_.moduleEDMType(moduleLabels[iMod]);
530  if( !(moduleEDMType == "EDFilter") ) continue;
531  if( moduleType.find("Selector")!= std::string::npos ) continue;
532  if( moduleType == "HLTTriggerTypeFilter" ||
533  moduleType == "HLTBool" ||
534  moduleType == "PrimaryVertexObjectFilter" ||
535  moduleType == "JetVertexChecker" ||
536  moduleType == "HLTRHemisphere" ||
537  moduleType == "DetectorStateFilter" ) continue;
538 
539  if( moduleLabels[iMod].compare(0, prefix.length(), prefix) == 0 ) continue;
540 
541  edm::InputTag moduleWhoseResultsWeWant(moduleLabels[iMod],
542  "",
543  hltTag);
544 
545  unsigned int idx_module_trg = 0;
546  if( hasRawTriggerEvent && triggerEventRAW.isValid() ) idx_module_trg = triggerEventRAW->filterIndex(moduleWhoseResultsWeWant);
547  else if( triggerEventAOD.isValid() ) idx_module_trg = triggerEventAOD->filterIndex(moduleWhoseResultsWeWant);
548 
549  if( !(idx_module_trg < triggerEventSize) ) continue;
550  if( hist_cpfilt_mini ){
551  TAxis * axis = hist_cpfilt_mini->GetXaxis();
552  int bin_num = axis->FindBin(moduleLabels[iMod].c_str());
553  int bn = bin_num - 1;
554 
555  if( bin_num!=1 && hasRawTriggerEvent ){
556  bool passPreviousFilters = true;
557  for( int ibin = bin_num-1; ibin>0; ibin-- ){
558  std::string previousFilter(axis->GetBinLabel(ibin));
559  edm::InputTag previousModuleWhoseResultsWeWant(previousFilter,
560  "",
561  hltTag);
562  unsigned int idx_previous_module_trg = 0;
563  if( hasRawTriggerEvent && triggerEventRAW.isValid() ) idx_previous_module_trg = triggerEventRAW->filterIndex(previousModuleWhoseResultsWeWant);
564  else if( triggerEventAOD.isValid() ) idx_previous_module_trg = triggerEventAOD->filterIndex(previousModuleWhoseResultsWeWant);
565 
566  if( !(idx_previous_module_trg < triggerEventSize) ){
567  passPreviousFilters = false;
568  break;
569  }
570  }
571  // Only fill if previous filters have been passed
572  if( passPreviousFilters ) hist_cpfilt_mini->Fill(bn, 1);
573  }
574  else hist_cpfilt_mini->Fill(bn, 1);
575 
576  }
577  }
578  }
579  else{
580  if (debugPrint) std::cout << "No AOD trigger summary found! Returning..." << std::endl;
581  }
582 
583  if( accept && hist_mini_cppath ){
584  TAxis * axis = hist_mini_cppath->GetXaxis();
585  int bin_num = axis->FindBin(pathNameNoVer.c_str());
586  int bn = bin_num - 1;
587  hist_mini_cppath->Fill(bn, 1);
588  }
589 
590  if (debugPrint)
591  std::cout << "hist->Fill" << std::endl;
592 } // End fillHltMatrix
const std::string moduleType(const std::string &module) const
C++ class name of module.
const std::string moduleEDMType(const std::string &module) const
C++ base class name of module.
#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:76
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::map< std::string, MonitorElement * > cpfilt_mini_
TH1F * getTH1F(void) const
HLTConfigProvider hlt_config_
tuple cout
Definition: gather_cfg.py:121
void GeneralHLTOffline::setupHltMatrix ( DQMStore::IBooker iBooker,
const std::string &  label,
int  iPD 
)
privatevirtual

Definition at line 381 of file GeneralHLTOffline.cc.

References DQMStore::IBooker::book1D(), compare_using_db::compare, gather_cfg::cout, cpfilt_mini_, cppath_mini_, debugPrint, hist_cpfilt_mini_, hlt_config_, hlt_menu_, HLTConfigProvider::moduleEDMType(), HLTConfigProvider::moduleLabels(), HLTConfigProvider::moduleType(), NULL, EgammaValidation_cff::pathName, PDsVectorPathsVector, prof2calltree::prefix, HLTConfigProvider::removeVersion(), DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by bookHistograms().

381  {
382  std::string h_name;
383  std::string h_title;
385  std::string PD_Folder;
386  std::string Path_Folder;
387 
388  PD_Folder = TString("HLT/GeneralHLTOffline/"+label);
389 
390  iBooker.setCurrentFolder(PD_Folder.c_str());
391 
392  // make it the top level directory, that is on the same dir level as
393  // paths
394  std::string folderz;
395  folderz = TString("HLT/GeneralHLTOffline/"+label);
396  iBooker.setCurrentFolder(folderz.c_str());
397 
398  std::string dnamez = "cppath_" + label + "_" + hlt_menu_;
399  int sizez = PDsVectorPathsVector[iPD].size();
400  TH1F * hist_mini_cppath = NULL;
401  cppath_mini_[dnamez] = iBooker.book1D(dnamez.c_str(),
402  dnamez.c_str(),
403  sizez,
404  0,
405  sizez);
406  if( cppath_mini_[dnamez] )
407  hist_mini_cppath = cppath_mini_[dnamez]->getTH1F();
408 
409  unsigned int jPath;
410  for (unsigned int iPath = 0; iPath < PDsVectorPathsVector[iPD].size(); iPath++) {
411  pathName = hlt_config_.removeVersion(PDsVectorPathsVector[iPD][iPath]);
412  jPath = iPath + 1;
413 
414  if (hist_mini_cppath) {
415  TAxis * axis = hist_mini_cppath->GetXaxis();
416  if (axis)
417  axis->SetBinLabel(jPath, pathName.c_str());
418  }
419 
420  std::string pathNameVer = PDsVectorPathsVector[iPD][iPath];
421  const std::vector<std::string>& moduleLabels = hlt_config_.moduleLabels(pathNameVer);
422  int NumModules = int( moduleLabels.size() );
423 
424  if( !(pathNameVer.find("HLT_") != std::string::npos) ) continue;
425  if( (pathNameVer.find("HLT_Physics")!=std::string::npos) ||
426  (pathNameVer.find("HLT_Random")!=std::string::npos) ) continue;
427 
428  std::string prefix("hltPre");
429 
430  std::vector<std::string> good_module_names;
431  for( int iMod=0; iMod<NumModules; iMod++ ){
432  std::string moduleType = hlt_config_.moduleType(moduleLabels[iMod]);
433  std::string moduleEDMType = hlt_config_.moduleEDMType(moduleLabels[iMod]);
434  if( !(moduleEDMType == "EDFilter") ) continue;
435  if( moduleType.find("Selector")!= std::string::npos ) continue;
436  if( moduleType == "HLTTriggerTypeFilter" ||
437  moduleType == "HLTBool" ||
438  moduleType == "PrimaryVertexObjectFilter" ||
439  moduleType == "JetVertexChecker" ||
440  moduleType == "HLTRHemisphere" ||
441  moduleType == "DetectorStateFilter" ) continue;
442 
443  if( moduleLabels[iMod].compare(0, prefix.length(), prefix) == 0 ) continue;
444  good_module_names.push_back(moduleLabels[iMod]);
445  }
446 
447  int NumGoodModules = int( good_module_names.size() );
448 
449  if( NumGoodModules==0 ) continue;
450 
451  std::string pathName_dataset = "cpfilt_" + label + "_" + pathName;
452 
453  cpfilt_mini_[pathName_dataset] = iBooker.book1D(pathName_dataset.c_str(),
454  pathName.c_str(),
455  NumGoodModules,
456  0,
457  NumGoodModules);
458 
459  if( cpfilt_mini_[pathName_dataset] )
460  hist_cpfilt_mini_[pathName_dataset] = cpfilt_mini_[pathName_dataset]->getTH1F();
461 
462  for( int iMod=0; iMod<NumGoodModules; iMod++ ){
463  if( cpfilt_mini_[pathName_dataset] && hist_cpfilt_mini_[pathName_dataset] ){
464  TAxis * axis = hist_cpfilt_mini_[pathName_dataset]->GetXaxis();
465  if (axis)
466  axis->SetBinLabel(iMod+1,good_module_names[iMod].c_str());
467  }
468  }
469 
470  if (debugPrint)
471  std::cout << "book1D for " << pathName << std::endl;
472  }
473 
474  if (debugPrint)
475  std::cout << "Success setupHltMatrix( " << label << " , "
476  << iPD << " )" << std::endl;
477 } // End setupHltMatrix
const std::string moduleType(const std::string &module) const
C++ class name of module.
std::map< std::string, TH1F * > hist_cpfilt_mini_
const std::string moduleEDMType(const std::string &module) const
C++ base class name of module.
#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_
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
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_
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 bookHistograms(), and dqmBeginRun().

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

Definition at line 92 of file GeneralHLTOffline.cc.

Referenced by fillHltMatrix(), and setupHltMatrix().

MonitorElement* GeneralHLTOffline::cppath_
private

Definition at line 90 of file GeneralHLTOffline.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 91 of file GeneralHLTOffline.cc.

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

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

Definition at line 93 of file GeneralHLTOffline.cc.

Referenced by setupHltMatrix().

HLTConfigProvider GeneralHLTOffline::hlt_config_
private

Definition at line 78 of file GeneralHLTOffline.cc.

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

std::string GeneralHLTOffline::hlt_menu_
private

Definition at line 83 of file GeneralHLTOffline.cc.

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

std::string GeneralHLTOffline::hltTag
private

Definition at line 82 of file GeneralHLTOffline.cc.

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

bool GeneralHLTOffline::outputPrint
private

Definition at line 76 of file GeneralHLTOffline.cc.

Referenced by GeneralHLTOffline().

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

Definition at line 84 of file GeneralHLTOffline.cc.

Referenced by analyze(), bookHistograms(), 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(), and bookHistograms().

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

Definition at line 86 of file GeneralHLTOffline.cc.

Referenced by analyze(), and GeneralHLTOffline().

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

Definition at line 88 of file GeneralHLTOffline.cc.

Referenced by analyze(), and GeneralHLTOffline().

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

Definition at line 87 of file GeneralHLTOffline.cc.

Referenced by analyze(), and GeneralHLTOffline().