87 std::map< std::string, std::vector<std::string> >
PathModules;
118 std::cout <<
"Inside Constructor" << std::endl;
132 std::cout <<
"Inside analyze - run, block, event " 134 <<
" , " << iEvent.
id() <<
" , " << std::endl;
140 if (!triggerResults.
isValid()) {
142 std::cout <<
"Trigger results not valid" << std::endl;
147 std::cout <<
"Found triggerResults" << std::endl;
155 bool hasRawTriggerEvent =
true;
156 if( !rawTriggerEvent.
isValid() ){
157 hasRawTriggerEvent =
false;
159 std::cout <<
"No RAW trigger summary found! Returning...";
161 if( !aodTriggerEvent.
isValid() ){
163 std::cout <<
"No AOD trigger summary found! Returning...";
171 for (
unsigned int iPD = 0; iPD < datasetNames.size(); iPD++) {
173 for (
unsigned int iPath = 0;
178 std::cout <<
"Looking at path " << pathName << std::endl;
180 <<
" triggerResults->size() = " << triggerResults->
size()
186 std::string fullPathToCPP =
"HLT/GeneralHLTOffline/" 187 + label +
"/cppath_" + label +
hlt_menu_;
189 TH1F * hist_mini_cppath =
NULL;
192 hist_mini_cppath = ME_mini_cppath->
getTH1F();
195 if (hist_mini_cppath) {
196 TAxis * axis = hist_mini_cppath->GetXaxis();
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());
206 if( index < triggerResults->
size() ) {
228 std::cout <<
"Inside beginRun" << std::endl;
242 std::cout <<
"Warning, didn't find process HLT" << std::endl;
258 std::vector<std::string>::const_iterator si = nameStreams.begin();
259 std::vector<std::string>::const_iterator se = nameStreams.end();
262 for ( ; si != se; ++si) {
265 if ( ((*si).find(
"Physics") != std::string::npos) ||((*si).find(
"Scouting") != std::string::npos) ||((*si).find(
"Parking") != std::string::npos) || (*si) ==
"A") {
270 for (
auto const & di: datasetperStream) {
271 datasetNames.push_back(di);
276 if (
debugPrint)
std::cout <<
"Number of total datasets " << datasetNames.size() << std::endl;
284 std::cout <<
"Number of datasets to be monitored " 285 << datasetNames.size() << std::endl;
287 for (
unsigned int i = 0;
i < datasetNames.size();
i++) {
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++) {
295 << datasetPaths[iPath] << std::endl;
301 bool foundDataset =
false;
309 <<
" found in AddedDatasets at position " <<
d << std::endl;
316 std::cout <<
" Fill trigger paths for dataset " 317 << datasetNames[
i] << std::endl;
329 std::cout <<
" Additional runs : Check for additional" 330 <<
"trigger paths per dataset " << std::endl;
335 for (
unsigned int iTrig = 0; iTrig < datasetPaths.size(); iTrig++) {
337 std::cout <<
"Looping over trigger list in dataset " 339 << datasetPaths[iTrig] << std::endl;
344 std::cout <<
"Looping over existing trigger list " << od
351 std::cout <<
" FOUND " << datasetPaths[iTrig] << std::endl;
360 <<
" NOT FOUND - so we added it to the correct dataset " 361 << datasetNames[
i] << std::endl;
367 std::cout <<
" PDsVectorPathsVector[" << is <<
"] is " 370 std::cout <<
" trigger " << ip <<
" path " 377 std::cout <<
"Found PD: " << datasetNames[
i] << std::endl;
384 for(
unsigned int iPath=0; iPath<triggerNames.size(); iPath++ ){
388 int NumModules =
int( moduleLabels.size() );
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;
396 std::vector<std::string> good_module_names;
397 good_module_names.clear();
398 for(
int iMod=0; iMod<NumModules; 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;
410 if( moduleLabels[iMod].
compare(0, prefix.length(),
prefix) == 0 )
continue;
411 good_module_names.push_back(moduleLabels[iMod]);
439 for (
unsigned int iPD = 0; iPD <
DataSetNames.size(); iPD++)
453 PD_Folder =
"HLT/GeneralHLTOffline/" +
label;
460 folderz =
"HLT/GeneralHLTOffline/" +
label;
465 TH1F * hist_mini_cppath =
NULL;
479 if (hist_mini_cppath) {
480 TAxis * axis = hist_mini_cppath->GetXaxis();
482 axis->SetBinLabel(jPath, pathName.c_str());
487 std::vector<std::string> moduleLabels =
PathModules[pathNameVer];
488 int NumModules =
int( moduleLabels.size() );
490 if( NumModules==0 )
continue;
492 std::string pathName_dataset =
"cpfilt_" + label +
"_" + pathName;
503 for(
int iMod=0; iMod<NumModules; iMod++ ){
507 axis->SetBinLabel(iMod+1,moduleLabels[iMod].c_str());
512 std::cout <<
"book1D for " << pathName << std::endl;
516 std::cout <<
"Success setupHltMatrix( " << label <<
" , " 517 << iPD <<
" )" << std::endl;
524 bool hasRawTriggerEvent,
528 std::cout <<
"Inside fillHltMatrix( " << label <<
" , " 529 << path <<
" ) " << std::endl;
533 fullPathToCPP =
"HLT/GeneralHLTOffline/" + label +
"/cppath_" + label +
"_" +
hlt_menu_;
537 TH1F * hist_mini_cppath =
NULL;
541 hist_mini_cppath = ME_mini_cppath->
getTH1F();
546 if( (path.find(
"HLT_") != std::string::npos) &&
547 !(path.find(
"HLT_Physics")!=std::string::npos) &&
548 !(path.find(
"HLT_Random")!=std::string::npos) ){
550 unsigned int triggerEventSize = 0;
551 if( hasRawTriggerEvent && triggerEventRAW.
isValid() ) triggerEventSize = triggerEventRAW->
size();
552 else if( triggerEventAOD.
isValid() ) triggerEventSize = triggerEventAOD->
sizeFilters();
554 std::string pathName_dataset =
"cpfilt_" + label +
"_" + pathNameNoVer;
556 TH1F * hist_cpfilt_mini =
NULL;
560 hist_cpfilt_mini = ME_cpfilt_mini->
getTH1F();
565 int NumModules =
int( moduleLabels.size() );
567 for(
int iMod=0; iMod<NumModules; iMod++ ){
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);
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;
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,
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);
593 if( !(idx_previous_module_trg < triggerEventSize) ){
594 passPreviousFilters =
false;
599 if( passPreviousFilters ) hist_cpfilt_mini->Fill(bn, 1);
601 else hist_cpfilt_mini->Fill(bn, 1);
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);
unsigned int size() const
number of trigger paths in trigger table
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
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
const std::string moduleType(const std::string &module) const
C++ class name of module.
std::map< std::string, TH1F * > hist_cpfilt_mini_
trigger::size_type sizeFilters() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
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
MonitorElement * bookString(Args &&...args)
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::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)
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
MonitorElement * book1D(Args &&...args)
static std::string const triggerResults
std::map< std::string, MonitorElement * > cppath_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
std::map< std::string, MonitorElement * > cpfilt_mini_
virtual void dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) override
void setCurrentFolder(const std::string &fullpath)
std::vector< std::vector< std::string > > PDsVectorPathsVector
std::vector< std::string > AddedDatasets
virtual 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
TH1F * getTH1F(void) const
HLTConfigProvider hlt_config_
size_type size() const
number of filters
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
std::map< std::string, std::vector< std::string > > PathModules
GeneralHLTOffline(const edm::ParameterSet &)
std::vector< std::string > DataSetNames
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override