110 std::cout <<
"Inside Constructor" << std::endl;
121 <<
" , " << iEvent.
id() <<
" , " << std::endl;
127 if (!triggerResults.
isValid()) {
129 std::cout <<
"Trigger results not valid" << std::endl;
134 std::cout <<
"Found triggerResults" << std::endl;
142 bool hasRawTriggerEvent =
true;
143 if (!rawTriggerEvent.
isValid()) {
144 hasRawTriggerEvent =
false;
146 std::cout <<
"No RAW trigger summary found! Returning...";
148 if (!aodTriggerEvent.
isValid()) {
150 std::cout <<
"No AOD trigger summary found! Returning...";
158 for (
unsigned int iPD = 0; iPD < datasetNames.size(); iPD++) {
164 std::cout <<
"Looking at path " << pathName << std::endl;
165 std::cout <<
"Index = " << index <<
" triggerResults->size() = " << triggerResults->
size() << std::endl;
172 TH1F *hist_mini_cppath =
nullptr;
175 hist_mini_cppath = ME_mini_cppath->
getTH1F();
178 if (hist_mini_cppath) {
179 TAxis *axis = hist_mini_cppath->GetXaxis();
182 int bin_num = axis->FindBin(pathNameNoVer.c_str());
183 int bn = bin_num - 1;
184 hist_mini_cppath->Fill(bn, 0);
185 hist_mini_cppath->SetEntries(hist_mini_cppath->Integral());
189 if (index < triggerResults->
size()) {
194 fillHltMatrix(datasetNames[iPD], pathName, accept, hasRawTriggerEvent, rawTriggerEvent, aodTriggerEvent);
204 std::cout <<
"Inside beginRun" << std::endl;
217 std::cout <<
"Warning, didn't find process HLT" << std::endl;
231 auto si = nameStreams.begin();
232 auto se = nameStreams.end();
235 for (; si != se; ++si) {
237 std::cout <<
"This is stream " << *si << std::endl;
239 if (((*si).find(
"Physics") != std::string::npos) || ((*si).find(
"Scouting") != std::string::npos) ||
240 ((*si).find(
"Parking") != std::string::npos) || (*si) ==
"A") {
245 for (
auto const &di : datasetperStream) {
246 datasetNames.push_back(di);
252 std::cout <<
"Number of total datasets " << datasetNames.size() << std::endl;
258 std::cout <<
"Number of datasets to be monitored " << datasetNames.size() << std::endl;
263 std::cout <<
"This is dataset " <<
datasetName <<
"datasetPaths.size() = " << datasetPaths.size() << std::endl;
264 for (
auto const &datasetPath : datasetPaths) {
265 std::cout <<
"Paths in begin job " << datasetPath << std::endl;
271 bool foundDataset =
false;
297 std::cout <<
" Additional runs : Check for additional" 298 <<
"trigger paths per dataset " << std::endl;
303 for (
unsigned int iTrig = 0; iTrig < datasetPaths.size(); iTrig++) {
305 std::cout <<
"Looping over trigger list in dataset " << iTrig <<
" " << datasetPaths[iTrig] << std::endl;
317 std::cout <<
" FOUND " << datasetPaths[iTrig] << std::endl;
325 std::cout << datasetPaths[iTrig] <<
" NOT FOUND - so we added it to the correct dataset " <<
datasetName 345 for (
auto pathName : triggerNames) {
347 auto NumModules =
int(moduleLabels.size());
349 if (!(
pathName.find(
"HLT_") != std::string::npos))
351 if ((
pathName.find(
"HLT_Physics") != std::string::npos) || (
pathName.find(
"HLT_Random") != std::string::npos))
356 std::vector<std::string> good_module_names;
357 good_module_names.clear();
358 for (
int iMod = 0; iMod < NumModules; iMod++) {
361 if (!(moduleEDMType ==
"EDFilter"))
363 if (moduleType.find(
"Selector") != std::string::npos)
365 if (moduleType ==
"HLTTriggerTypeFilter" || moduleType ==
"HLTBool" ||
366 moduleType ==
"PrimaryVertexObjectFilter" || moduleType ==
"JetVertexChecker" ||
367 moduleType ==
"HLTRHemisphere" || moduleType ==
"DetectorStateFilter")
370 if (moduleLabels[iMod].
compare(0, prefix.length(),
prefix) == 0)
372 good_module_names.push_back(moduleLabels[iMod]);
393 for (
unsigned int iPD = 0; iPD <
DataSetNames.size(); iPD++)
406 PD_Folder =
"HLT/GeneralHLTOffline/" +
label;
413 folderz =
"HLT/GeneralHLTOffline/" +
label;
418 TH1F *hist_mini_cppath =
nullptr;
419 cppath_mini_[dnamez] = iBooker.
book1D(dnamez.c_str(), dnamez.c_str(), sizez, 0, sizez);
428 if (hist_mini_cppath) {
429 TAxis *axis = hist_mini_cppath->GetXaxis();
431 axis->SetBinLabel(jPath, pathName.c_str());
436 std::vector<std::string> moduleLabels =
PathModules[pathNameVer];
437 auto NumModules =
int(moduleLabels.size());
445 iBooker.
book1D(pathName_dataset.c_str(), pathName.c_str(), NumModules, 0, NumModules);
450 for (
int iMod = 0; iMod < NumModules; iMod++) {
454 axis->SetBinLabel(iMod + 1, moduleLabels[iMod].c_str());
459 std::cout <<
"book1D for " << pathName << std::endl;
463 std::cout <<
"Success setupHltMatrix( " << label <<
" , " << iPD <<
" )" << std::endl;
469 bool hasRawTriggerEvent,
473 std::cout <<
"Inside fillHltMatrix( " << label <<
" , " << path <<
" ) " << std::endl;
477 fullPathToCPP =
"HLT/GeneralHLTOffline/" + label +
"/cppath_" + label +
"_" +
hlt_menu_;
481 TH1F *hist_mini_cppath =
nullptr;
485 hist_mini_cppath = ME_mini_cppath->
getTH1F();
490 if ((path.find(
"HLT_") != std::string::npos) && !(path.find(
"HLT_Physics") != std::string::npos) &&
491 !(path.find(
"HLT_Random") != std::string::npos)) {
492 unsigned int triggerEventSize = 0;
493 if (hasRawTriggerEvent && triggerEventRAW.
isValid())
494 triggerEventSize = triggerEventRAW->
size();
495 else if (triggerEventAOD.
isValid())
498 std::string pathName_dataset =
"cpfilt_" + label +
"_" + pathNameNoVer;
500 TH1F *hist_cpfilt_mini =
nullptr;
504 hist_cpfilt_mini = ME_cpfilt_mini->
getTH1F();
508 auto NumModules =
int(moduleLabels.size());
510 for (
int iMod = 0; iMod < NumModules; iMod++) {
513 unsigned int idx_module_trg = 0;
514 if (hasRawTriggerEvent && triggerEventRAW.
isValid())
515 idx_module_trg = triggerEventRAW->
filterIndex(moduleWhoseResultsWeWant);
516 else if (triggerEventAOD.
isValid())
517 idx_module_trg = triggerEventAOD->
filterIndex(moduleWhoseResultsWeWant);
519 if (!(idx_module_trg < triggerEventSize))
521 if (hist_cpfilt_mini) {
522 TAxis *axis = hist_cpfilt_mini->GetXaxis();
523 int bin_num = axis->FindBin(moduleLabels[iMod].c_str());
524 int bn = bin_num - 1;
526 if (bin_num != 1 && hasRawTriggerEvent) {
527 bool passPreviousFilters =
true;
528 for (
int ibin = bin_num - 1; ibin > 0; ibin--) {
529 std::string previousFilter(axis->GetBinLabel(ibin));
531 unsigned int idx_previous_module_trg = 0;
532 if (hasRawTriggerEvent && triggerEventRAW.
isValid())
533 idx_previous_module_trg = triggerEventRAW->
filterIndex(previousModuleWhoseResultsWeWant);
534 else if (triggerEventAOD.
isValid())
535 idx_previous_module_trg = triggerEventAOD->
filterIndex(previousModuleWhoseResultsWeWant);
537 if (!(idx_previous_module_trg < triggerEventSize)) {
538 passPreviousFilters =
false;
543 if (passPreviousFilters)
544 hist_cpfilt_mini->Fill(bn, 1);
546 hist_cpfilt_mini->Fill(bn, 1);
551 std::cout <<
"No AOD trigger summary found! Returning..." << std::endl;
554 if (accept && hist_mini_cppath) {
555 TAxis *axis = hist_mini_cppath->GetXaxis();
556 int bin_num = axis->FindBin(pathNameNoVer.c_str());
557 int bn = bin_num - 1;
558 hist_mini_cppath->Fill(bn, 1);
unsigned int size() const
number of trigger paths in trigger table
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool compare(const P &i, const P &j)
edm::EDGetTokenT< trigger::TriggerEventWithRefs > triggerSummaryTokenRAW
void analyze(const edm::Event &, const edm::EventSetup &) override
const std::string moduleType(const std::string &module) const
C++ class name of module.
trigger::size_type sizeFilters() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setCurrentFolder(std::string const &fullpath)
virtual TH1F * getTH1F() const
bool accept() const
Has at least one path accepted the event?
const std::vector< std::string > & triggerNames() const
names of trigger paths
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryTokenAOD
const std::string moduleEDMType(const std::string &module) const
C++ base class name of module.
const std::string & tableName() const
HLT ConfDB table name.
std::map< std::string, std::vector< std::string > > PathModules
std::string plotDirectoryName
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
LuminosityBlockNumber_t luminosityBlock() const
static const std::string removeVersion(const std::string &trigger)
virtual void setupHltMatrix(DQMStore::IBooker &iBooker, const std::string &, int)
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
#define DEFINE_FWK_MODULE(type)
const std::vector< std::string > & streamNames() const
unsigned int size() const
Get number of paths stored.
const std::vector< std::string > & streamContent(unsigned int stream) const
names of datasets in stream with index i
~GeneralHLTOffline() override
std::map< std::string, TH1F * > hist_cpfilt_mini_
static std::string const triggerResults
std::map< std::string, MonitorElement * > cpfilt_mini_
virtual void fillHltMatrix(const std::string &, const std::string &, bool, bool, edm::Handle< trigger::TriggerEventWithRefs >, edm::Handle< trigger::TriggerEvent >)
const std::string & processName() const
process name
size_type filterIndex(const edm::InputTag &filterTag) const
index from tag
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
void dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) override
std::map< std::string, MonitorElement * > cppath_mini_
std::vector< std::string > AddedDatasets
void bookHistograms(DQMStore::IBooker &, edm::Run const &iRun, edm::EventSetup const &iSetup) override
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
HLTConfigProvider hlt_config_
size_type size() const
number of filters
std::vector< std::vector< std::string > > PDsVectorPathsVector
GeneralHLTOffline(const edm::ParameterSet &)
std::vector< std::string > DataSetNames
MonitorElement * bookString(TString const &name, TString const &value)
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken