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() ) {
207 bool accept = triggerResults->accept(index);
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();
260 for ( ; si != se; ++si) {
274 std::cout <<
"Number of Stream A datasets "
275 << datasetNames.size() << std::endl;
277 for (
unsigned int i = 0;
i < datasetNames.size();
i++) {
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;
290 bool foundDataset =
false;
298 <<
" found in AddedDatasets at position " <<
d << std::endl;
305 std::cout <<
" Fill trigger paths for dataset "
306 << datasetNames[
i] << std::endl;
318 std::cout <<
" Additional runs : Check for additional"
319 <<
"trigger paths per dataset " << std::endl;
324 for (
unsigned int iTrig = 0; iTrig < datasetPaths.size(); iTrig++) {
326 std::cout <<
"Looping over trigger list in dataset "
328 << datasetPaths[iTrig] << std::endl;
333 std::cout <<
"Looping over existing trigger list " << od
340 std::cout <<
" FOUND " << datasetPaths[iTrig] << std::endl;
349 <<
" NOT FOUND - so we added it to the correct dataset "
350 << datasetNames[
i] << std::endl;
356 std::cout <<
" PDsVectorPathsVector[" << is <<
"] is "
359 std::cout <<
" trigger " << ip <<
" path "
366 std::cout <<
"Found PD: " << datasetNames[
i] << std::endl;
373 for(
unsigned int iPath=0; iPath<triggerNames.size(); iPath++ ){
377 int NumModules = int( moduleLabels.size() );
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;
385 std::vector<std::string> good_module_names;
386 good_module_names.clear();
387 for(
int iMod=0; iMod<NumModules; 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;
399 if( moduleLabels[iMod].
compare(0, prefix.length(),
prefix) == 0 )
continue;
400 good_module_names.push_back(moduleLabels[iMod]);
428 for (
unsigned int iPD = 0; iPD <
DataSetNames.size(); iPD++)
442 PD_Folder = TString(
"HLT/GeneralHLTOffline/"+label);
449 folderz = TString(
"HLT/GeneralHLTOffline/"+label);
454 TH1F * hist_mini_cppath =
NULL;
468 if (hist_mini_cppath) {
469 TAxis * axis = hist_mini_cppath->GetXaxis();
471 axis->SetBinLabel(jPath, pathName.c_str());
476 std::vector<std::string> moduleLabels =
PathModules[pathNameVer];
477 int NumModules = int( moduleLabels.size() );
479 if( NumModules==0 )
continue;
492 for(
int iMod=0; iMod<NumModules; iMod++ ){
496 axis->SetBinLabel(iMod+1,moduleLabels[iMod].c_str());
501 std::cout <<
"book1D for " << pathName << std::endl;
505 std::cout <<
"Success setupHltMatrix( " << label <<
" , "
506 << iPD <<
" )" << std::endl;
513 bool hasRawTriggerEvent,
517 std::cout <<
"Inside fillHltMatrix( " << label <<
" , "
518 << path <<
" ) " << std::endl;
522 fullPathToCPP =
"HLT/GeneralHLTOffline/" + label +
"/cppath_" + label +
"_" +
hlt_menu_;
526 TH1F * hist_mini_cppath =
NULL;
530 hist_mini_cppath = ME_mini_cppath->
getTH1F();
535 if( (path.find(
"HLT_") != std::string::npos) &&
536 !(path.find(
"HLT_Physics")!=std::string::npos) &&
537 !(path.find(
"HLT_Random")!=std::string::npos) ){
539 unsigned int triggerEventSize = 0;
540 if( hasRawTriggerEvent && triggerEventRAW.
isValid() ) triggerEventSize = triggerEventRAW->size();
541 else if( triggerEventAOD.
isValid() ) triggerEventSize = triggerEventAOD->sizeFilters();
543 std::string pathName_dataset =
"cpfilt_" + label +
"_" + pathNameNoVer;
545 TH1F * hist_cpfilt_mini =
NULL;
549 hist_cpfilt_mini = ME_cpfilt_mini->
getTH1F();
554 int NumModules = int( moduleLabels.size() );
556 for(
int iMod=0; iMod<NumModules; iMod++ ){
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);
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;
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,
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);
582 if( !(idx_previous_module_trg < triggerEventSize) ){
583 passPreviousFilters =
false;
588 if( passPreviousFilters ) hist_cpfilt_mini->Fill(bn, 1);
590 else hist_cpfilt_mini->Fill(bn, 1);
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);
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
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_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
const std::vector< std::string > & triggerNames() const
names of trigger paths
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
tuple path
else: Piece not in the list, fine.
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
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_
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
volatile std::atomic< bool > shutdown_flag false
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
tuple size
Write out results.