49 #include "TDirectory.h"
53 #include "TObjString.h"
75 dirname_(iConfig.getUntrackedParameter(
"dirname",
76 std::
string(
"HLT/SusyExo"))),
77 HistoFileName(iConfig.getUntrackedParameter(
"histoFileName",
78 std::
string(
"SusyBsmTriggerValidation.root"))),
79 StatFileName(iConfig.getUntrackedParameter(
"statFileName",
80 std::
string(
"SusyBsmTriggerValidation.stat"))),
82 hltLabel(iConfig.getParameter<edm::
InputTag>(
"HltLabel")),
84 mcFlag(iConfig.getUntrackedParameter<bool>(
"mc_flag",
false)),
85 l1Flag(iConfig.getUntrackedParameter<bool>(
"l1_flag",
false)),
86 reco_parametersets(iConfig.getParameter<
VParameterSet>(
"reco_parametersets")),
87 mc_parametersets(iConfig.getParameter<
VParameterSet>(
"mc_parametersets")),
88 turnOn_params(iConfig.getParameter<
ParameterSet>(
"TurnOnParams")),
89 plotMakerL1Input(iConfig.getParameter<
ParameterSet>(
"PlotMakerL1Input")),
90 plotMakerRecoInput(iConfig.getParameter<
ParameterSet>(
"PlotMakerRecoInput")),
91 muonTag_(iConfig.getParameter<edm::
InputTag>(
"muonTag")),
92 triggerTag_(iConfig.getParameter<edm::
InputTag>(
"triggerTag")),
93 processName_(iConfig.getParameter<std::
string>(
"hltConfigName")),
94 triggerName_(iConfig.getParameter<std::
string>(
"triggerName")),
112 LogDebug(
"TriggerValidator") <<
"constructor...." ;
116 LogInfo(
"TriggerValidator") <<
"unabel to get DQMStore service?";
164 vector<bool> eventRecoSelected, eventMcSelected;
167 for(
unsigned int i=0;
i<eventRecoSelected.size(); ++
i) eventRecoSelected[
i] =
myRecoSelector[
i]->isSelected(iEvent);
168 for(
unsigned int i=0;
i<eventMcSelected.size(); ++
i) eventMcSelected[
i] =
mcFlag ?
myMcSelector[
i]->isSelected(iEvent) :
false;
179 if (!L1GTRR.isValid()) {
edm::LogWarning(
"Readout Error|L1") <<
"L1ParticleMapCollection Not Valid!";}
180 int nL1size = L1GTRR->decisionWord().size();
190 vCorrL1.resize(L1GTRR->decisionWord().size());
191 for(
unsigned int i=0; i<L1GTRR->decisionWord().size(); i++) {
vCorrL1[
i].resize(L1GTRR->decisionWord().size());}
193 for(
unsigned int i=0; i<L1GTRR->decisionWord().size(); i++) {
vCorrNormL1[
i].resize(L1GTRR->decisionWord().size());}
201 const std::vector<L1GlobalTriggerObjectMap>& objMapVec =
202 gtObjectMapRecord->gtObjectMap();
203 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itMap = objMapVec.begin();
204 itMap != objMapVec.end(); ++itMap) {
205 int algoBit = (*itMap).algoBitNumber();
210 l1Names_.resize(L1GTRR->decisionWord().size()+1);
211 for (
unsigned int i=0; i!=L1GTRR->decisionWord().size(); i++) {
214 l1Names_[L1GTRR->decisionWord().size()] =
"Total";
217 for(
unsigned int i=0; i<
l1Names_.size(); ++
i) {
225 for (
int i=0; i<nL1size; ++
i) {
226 l1bits.push_back(L1GTRR->decisionWord()[
i]);
227 if(L1GTRR->decisionWord()[
i]) {
231 for(
unsigned int j=0;
j<eventRecoSelected.size(); ++
j)
232 if(eventRecoSelected[
j]) {
237 for(
unsigned int j=0; j<eventMcSelected.size(); ++
j)
238 if(eventMcSelected[j]) {
247 for(
int i=0; i<nL1size; ++
i) {
248 for(
int j=0;
j<nL1size; ++
j) {
257 for(
unsigned int i=0; i<eventRecoSelected.size(); ++
i)
258 if(eventRecoSelected[i]) {
263 for(
unsigned int i=0; i<eventMcSelected.size(); ++
i)
264 if(eventMcSelected[i]) {
276 if( ! trhv.isValid() ) {
301 for(
unsigned int i=0; i<trhv->size(); i++) {
vCorrHlt[
i].resize(trhv->size());}
303 for(
unsigned int i=0; i<trhv->size(); i++) {
vCorrNormHlt[
i].resize(trhv->size());}
312 for (
unsigned int i=0; i<
hlNames_.size(); ++
i) {
320 for(
unsigned int i=0; i< trhv->size(); i++) {
321 hltbits.push_back(trhv->at(i).accept());
322 if(trhv->at(i).accept()) {
326 for(
unsigned int j=0;
j<eventRecoSelected.size(); ++
j)
327 if(eventRecoSelected[
j]) {
332 for(
unsigned int j=0; j<eventMcSelected.size(); ++
j)
333 if(eventMcSelected[j]) {
342 for(
unsigned int i=0; i< trhv->size(); i++) {
343 for(
unsigned int j=0;
j< trhv->size();
j++) {
358 for(
unsigned int i=0; i<eventRecoSelected.size(); ++
i)
359 if(eventRecoSelected[i]) {
364 for(
unsigned int i=0; i<eventMcSelected.size(); ++
i)
365 if(eventMcSelected[i]) {
485 char histo_name[256], histo_title[256];
487 sprintf(histo_name,
"L1Bits_%s", path_name.c_str());
488 sprintf(histo_title,
"L1 Trigger Bits for %s Selection", path_name.c_str());
492 sprintf(histo_name,
"HltBits_%s", path_name.c_str());
493 sprintf(histo_title,
"HL Trigger Bits for %s Selection", path_name.c_str());
499 char histo_name[256], histo_title[256];
501 sprintf(histo_name,
"L1Bits_%s", path_name.c_str());
502 sprintf(histo_title,
"L1 Trigger Bits for %s Selection", path_name.c_str());
506 sprintf(histo_name,
"HltBits_%s", path_name.c_str());
507 sprintf(histo_title,
"HL Trigger Bits for %s Selection", path_name.c_str());
526 char histo_name[256];
528 sprintf(histo_name,
"L1Paths_%s", path_name.c_str());
533 sprintf(histo_name,
"HltPaths_%s", path_name.c_str());
541 char histo_name[256];
543 sprintf(histo_name,
"L1Paths_%s", path_name.c_str());
548 sprintf(histo_name,
"HltPaths_%s", path_name.c_str());
645 << right << setw(10) <<
"L1T Bit#" <<
" "
647 for (
unsigned int i=0;
i!=
n;
i++) {
656 << right << setw(10) <<
"HLT Bit#" <<
" "
659 for (
unsigned int i=0;
i!=
n;
i++) {
834 LogInfo(
"TriggerValidator") <<
"endJob";
unsigned int size() const
number of trigger paths in trigger table
std::vector< MonitorElement * > hHltBitsAfterRecoCuts
void dump(const std::string &what) const
Dumping config info to cout.
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::vector< double > > vCorrNormL1
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
std::vector< McSelector * > myMcSelector
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void rmdir(const std::string &fullpath)
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
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 &)
Strings const & triggerNames() const
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_
void setVerbose(unsigned level)
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 &)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * hHltBitsBeforeCuts
std::map< int, std::string > l1NameMap
std::vector< edm::ParameterSet > mc_parametersets