49 #include "TDirectory.h"
53 #include "TObjString.h"
76 dirname_(iConfig.getUntrackedParameter(
"dirname",
77 std::
string(
"HLT/SusyExo"))),
78 HistoFileName(iConfig.getUntrackedParameter(
"histoFileName",
79 std::
string(
"SusyBsmTriggerValidation.root"))),
80 StatFileName(iConfig.getUntrackedParameter(
"statFileName",
81 std::
string(
"SusyBsmTriggerValidation.stat"))),
83 hltLabel(iConfig.getParameter<edm::
InputTag>(
"HltLabel")),
85 mcFlag(iConfig.getUntrackedParameter<bool>(
"mc_flag",
false)),
86 l1Flag(iConfig.getUntrackedParameter<bool>(
"l1_flag",
false)),
87 reco_parametersets(iConfig.getParameter<
VParameterSet>(
"reco_parametersets")),
88 mc_parametersets(iConfig.getParameter<
VParameterSet>(
"mc_parametersets")),
89 turnOn_params(iConfig.getParameter<
ParameterSet>(
"TurnOnParams")),
90 plotMakerL1Input(iConfig.getParameter<
ParameterSet>(
"PlotMakerL1Input")),
91 plotMakerRecoInput(iConfig.getParameter<
ParameterSet>(
"PlotMakerRecoInput")),
92 muonTag_(iConfig.getParameter<edm::
InputTag>(
"muonTag")),
93 triggerTag_(iConfig.getParameter<edm::
InputTag>(
"triggerTag")),
94 processName_(iConfig.getParameter<std::
string>(
"hltConfigName")),
95 hltPathsToCheck_(iConfig.getParameter<vector<
string>>(
"hltPathsToCheck")),
113 LogDebug(
"TriggerValidator") <<
"constructor...." ;
117 LogInfo(
"TriggerValidator") <<
"unabel to get DQMStore service?";
162 vector<bool> eventRecoSelected, eventMcSelected;
165 for(
unsigned int i=0;
i<eventRecoSelected.size(); ++
i) eventRecoSelected[
i] =
myRecoSelector[
i]->isSelected(iEvent);
166 for(
unsigned int i=0;
i<eventMcSelected.size(); ++
i) eventMcSelected[
i] =
mcFlag ?
myMcSelector[
i]->isSelected(iEvent) :
false;
177 if (!L1GTRR.isValid()) {
edm::LogWarning(
"Readout Error|L1") <<
"L1ParticleMapCollection Not Valid!";}
178 int nL1size = L1GTRR->decisionWord().size();
188 vCorrL1.resize(L1GTRR->decisionWord().size());
189 for(
unsigned int i=0; i<L1GTRR->decisionWord().size(); i++) {
vCorrL1[
i].resize(L1GTRR->decisionWord().size());}
191 for(
unsigned int i=0; i<L1GTRR->decisionWord().size(); i++) {
vCorrNormL1[
i].resize(L1GTRR->decisionWord().size());}
199 const std::vector<L1GlobalTriggerObjectMap>& objMapVec =
200 gtObjectMapRecord->gtObjectMap();
201 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itMap = objMapVec.begin();
202 itMap != objMapVec.end(); ++itMap) {
203 int algoBit = (*itMap).algoBitNumber();
208 l1Names_.resize(L1GTRR->decisionWord().size()+1);
209 for (
unsigned int i=0; i!=L1GTRR->decisionWord().size(); i++) {
212 l1Names_[L1GTRR->decisionWord().size()] =
"Total";
215 for(
unsigned int i=0; i<
l1Names_.size(); ++
i) {
223 for (
int i=0; i<nL1size; ++
i) {
224 l1bits.push_back(L1GTRR->decisionWord()[
i]);
225 if(L1GTRR->decisionWord()[
i]) {
229 for(
unsigned int j=0;
j<eventRecoSelected.size(); ++
j)
230 if(eventRecoSelected[
j]) {
235 for(
unsigned int j=0; j<eventMcSelected.size(); ++
j)
236 if(eventMcSelected[j]) {
245 for(
int i=0; i<nL1size; ++
i) {
246 for(
int j=0;
j<nL1size; ++
j) {
255 for(
unsigned int i=0; i<eventRecoSelected.size(); ++
i)
256 if(eventRecoSelected[i]) {
261 for(
unsigned int i=0; i<eventMcSelected.size(); ++
i)
262 if(eventMcSelected[i]) {
274 if( ! trhv.isValid() ) {
287 for(
unsigned int i=0; i <
hlNames_.size(); i++) {
295 for(
unsigned int i=0; i <
hlNames_.size(); i++) {
298 hltbits.push_back(trhv->at(path_index).accept());
299 if( trhv->at(path_index).accept() ) {
303 for(
unsigned int j=0;
j<eventRecoSelected.size(); ++
j)
304 if(eventRecoSelected[
j]) {
309 for(
unsigned int j=0; j<eventMcSelected.size(); ++
j)
310 if(eventMcSelected[j]) {
320 for(
unsigned int i=0; i<
hltbits.size(); i++) {
321 for(
unsigned int j=0;
j<
hltbits.size();
j++) {
330 for(
unsigned int i=0; i<eventRecoSelected.size(); ++
i)
331 if(eventRecoSelected[i]) {
336 for(
unsigned int i=0; i<eventMcSelected.size(); ++
i)
337 if(eventMcSelected[i]) {
387 LogError(
"SUSYBSM") <<
"Initialization of HLTConfigProvider failed!!";
438 char histo_name[256], histo_title[256];
440 sprintf(histo_name,
"L1Bits_%s", path_name.c_str());
441 sprintf(histo_title,
"L1 Trigger Bits for %s Selection", path_name.c_str());
445 sprintf(histo_name,
"HltBits_%s", path_name.c_str());
446 sprintf(histo_title,
"HL Trigger Bits for %s Selection", path_name.c_str());
452 char histo_name[256], histo_title[256];
454 sprintf(histo_name,
"L1Bits_%s", path_name.c_str());
455 sprintf(histo_title,
"L1 Trigger Bits for %s Selection", path_name.c_str());
459 sprintf(histo_name,
"HltBits_%s", path_name.c_str());
460 sprintf(histo_title,
"HL Trigger Bits for %s Selection", path_name.c_str());
478 char histo_name[256];
479 sprintf(histo_name,
"L1Paths_%s", path_name.c_str());
483 sprintf(histo_name,
"HltPaths_%s", path_name.c_str());
491 char histo_name[256];
492 sprintf(histo_name,
"L1Paths_%s", path_name.c_str());
496 sprintf(histo_name,
"HltPaths_%s", path_name.c_str());
593 << right << setw(10) <<
"L1T Bit#" <<
" "
595 for (
unsigned int i=0;
i!=
n;
i++) {
604 << right << setw(10) <<
"HLT Bit#" <<
" "
607 for (
unsigned int i=0;
i!=
n;
i++) {
782 LogInfo(
"TriggerValidator") <<
"endJob";
unsigned int size() const
number of trigger paths in trigger table
std::vector< MonitorElement * > hHltBitsAfterRecoCuts
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::vector< double > > vCorrNormL1
std::vector< McSelector * > myMcSelector
std::vector< MonitorElement * > hL1PathsAfterRecoCuts
void endRun(const edm::Run &run, const edm::EventSetup &c)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< MonitorElement * > hHltPathsAfterRecoCuts
#define DEFINE_FWK_MODULE(type)
std::vector< ParameterSet > VParameterSet
std::vector< int > numTotHltBitsBeforeCuts
const std::vector< std::string > & triggerNames() const
names of trigger paths
std::vector< MonitorElement * > hHltPathsAfterMcCuts
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MuonAnalyzerSBSM * myMuonAnalyzer
void fillPlots(const edm::Event &)
PlotMakerReco * myPlotMakerReco
std::vector< std::string > l1Names_
edm::EDGetTokenT< edm::TriggerResults > hlt_token_
void FillPlots(const edm::Event &, const edm::EventSetup &)
std::vector< MonitorElement * > hL1BitsAfterMcCuts
std::vector< std::vector< int > > vCorrL1
edm::EDGetTokenT< L1GlobalTriggerObjectMapRecord > l1Label
std::vector< int > nEvRecoSelected
std::vector< std::vector< int > > numTotHltBitsAfterMcCuts
std::vector< MonitorElement * > hL1PathsAfterMcCuts
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
std::vector< MonitorElement * > hL1BitsAfterRecoCuts
std::vector< int > nEvMcSelected
std::vector< RecoSelector * > myRecoSelector
MonitorElement * hHltPathsBeforeCuts
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtDigis_token_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void bookHistos(DQMStore *, std::vector< int > *, std::vector< int > *, std::vector< std::string > *, std::vector< std::string > *)
void addParameter(std::string const &name, T const &value)
void fillPlots(const edm::Event &)
void beginRun(const edm::Run &run, const edm::EventSetup &c)
std::string recoSelBitsDir
TH1F * getTH1F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
edm::InputTag triggerTag_
PlotMakerL1 * myPlotMakerL1
MonitorElement * hL1PathsBeforeCuts
std::string triggerBitsDir
std::vector< std::string > hlNames_
std::vector< std::vector< double > > vCorrNormHlt
std::vector< int > numTotL1BitsBeforeCuts
void bookHistos(DQMStore *, std::vector< int > *, std::vector< int > *, std::vector< std::string > *, std::vector< std::string > *)
std::vector< int > l1bits
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
TH1F * getTH1F(void) const
std::vector< MonitorElement * > hHltBitsAfterMcCuts
std::vector< int > hltbits
std::vector< std::vector< int > > numTotHltBitsAfterRecoCuts
std::vector< edm::ParameterSet > reco_parametersets
edm::ParameterSet plotMakerRecoInput
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< std::vector< int > > numTotL1BitsAfterRecoCuts
HLTConfigProvider hltConfig_
volatile std::atomic< bool > shutdown_flag false
std::vector< std::vector< int > > vCorrHlt
edm::ParameterSet plotMakerL1Input
void InitializePlots(DQMStore *, const std::string)
MonitorElement * hL1BitsBeforeCuts
std::vector< std::vector< int > > numTotL1BitsAfterMcCuts
TriggerValidator(const edm::ParameterSet &)
MonitorElement * hHltBitsBeforeCuts
std::vector< std::string > hltPathsToCheck_
std::map< int, std::string > l1NameMap
std::vector< edm::ParameterSet > mc_parametersets