31 bool isJetDir =
false;
32 bool isMetDir =
false;
44 std::vector<std::string> subdirectories = igetter.
getSubdirs();
45 for(std::vector<std::string>::iterator
dir = subdirectories.begin() ;
dir!= subdirectories.end();
dir++ ){
52 if (TString(*dir).Contains(patternJet)) isJetDir =
true;
53 if (TString(*dir).Contains(patternMet)) isMetDir =
true;
60 dividehistos(ibooker, igetter,
"_meGenMETTrgMC",
"_meGenMET",
"_meTurnOngMET",
"Gen Missing ET",
"Gen Missing ET Turn-On RelVal");
61 dividehistos(ibooker, igetter,
"_meGenMETTrg",
"_meGenMETTrgLow",
"_meTurnOngMETLow",
"Gen Missing ETLow",
"Gen Missing ET Turn-On Data");
64 dividehistos(ibooker, igetter,
"_meHLTMETTrgMC",
"_meHLTMET",
"_meTurnOnhMET",
"HLT Missing ET",
"HLT Missing ET Turn-On RelVal");
65 dividehistos(ibooker, igetter,
"_meHLTMETTrg",
"_meHLTMETTrgLow",
"_meTurnOnhMETLow",
"HLT Missing ETLow",
"HLT Missing ET Turn-On Data");
74 dividehistos(ibooker, igetter,
"_meGenJetPtTrgMC",
"_meGenJetPt",
"_meTurnOngJetPt",
"Gen Jet Pt",
"Gen Jet Pt Turn-On RelVal");
75 dividehistos(ibooker, igetter,
"_meGenJetPtTrg",
"_meGenJetPtTrgLow",
"_meTurnOngJetPt",
"Gen Jet PtLow",
"Gen Jet Pt Turn-On Data");
76 dividehistos(ibooker, igetter,
"_meGenJetEtaTrgMC",
"_meGenJetEta",
"_meTurnOngJetEta",
"Gen Jet Eta",
"Gen Jet Eta Turn-On RelVal");
77 dividehistos(ibooker, igetter,
"_meGenJetEtaTrg",
"_meGenJetEtaTrgLow",
"_meTurnOngJetEta",
"Gen Jet EtaLow",
"Gen Jet Eta Turn-On Data");
78 dividehistos(ibooker, igetter,
"_meGenJetPhiTrgMC",
"_meGenJetPhi",
"_meTurnOngJetPhi",
"Gen Jet Phi",
"Gen Jet Phi Turn-On RelVal");
79 dividehistos(ibooker, igetter,
"_meGenJetPhiTrg",
"_meGenJetPhiTrgLow",
"_meTurnOngJetPhi",
"Gen Jet PhiLow",
"Gen Jet Phi Turn-On Data");
82 dividehistos(ibooker, igetter,
"_meHLTJetPtTrgMC",
"_meHLTJetPt",
"_meTurnOnhJetPt",
"HLT Jet Pt",
"HLT Jet Pt Turn-On RelVal");
83 dividehistos(ibooker, igetter,
"_meHLTJetPtTrg",
"_meHLTJetPtTrgLow",
"_meTurnOnhJetPt",
"HLT Jet PtLow",
"HLT Jet Pt Turn-On Data");
84 dividehistos(ibooker, igetter,
"_meHLTJetEtaTrgMC",
"_meHLTJetEta",
"_meTurnOnhJetEta",
"HLT Jet Eta",
"HLT Jet Eta Turn-On RelVal");
85 dividehistos(ibooker, igetter,
"_meHLTJetEtaTrg",
"_meHLTJetEtaTrgLow",
"_meTurnOnhJetEta",
"HLT Jet EtaLow",
"HLT Jet Eta Turn-On Data");
86 dividehistos(ibooker, igetter,
"_meHLTJetPhiTrgMC",
"_meHLTJetPhi",
"_meTurnOnhJetPhi",
"HLT Jet Phi",
"HLT Jet Phi Turn-On RelVal");
87 dividehistos(ibooker, igetter,
"_meHLTJetPhiTrg",
"_meHLTJetPhiTrgLow",
"_meTurnOnhJetPhi",
"HLT Jet PhiLow",
"HLT Jet Phi Turn-On Data");
107 TH1F* denom =
getHistogram(ibooker, igetter, ibooker.
pwd()+
"/"+denomName);
110 edm::LogWarning(
"JetMETDQMPostProcessor") <<
"numerator histogram " << ibooker.
pwd()+
"/"+numName <<
" does not exist";
112 edm::LogWarning(
"JetMETDQMPostProcessor") <<
"denominator histogram " << ibooker.
pwd()+
"/"+denomName <<
" does not exist";
115 if(!num || !denom)
return 0;
117 MonitorElement* meOut = ibooker.
bookProfile(outName, titel, num->GetXaxis()->GetNbins(), num->GetXaxis()->GetXmin(), num->GetXaxis()->GetXmax(),0.,1.2);
120 out->GetXaxis()->SetTitle(label.c_str());
121 out->SetYTitle(
"Efficiency");
122 out->SetOption(
"PE");
123 out->SetLineColor(2);
124 out->SetLineWidth(2);
125 out->SetMarkerStyle(20);
126 out->SetMarkerSize(0.8);
127 out->SetStats(kFALSE);
129 for(
int i=1;
i<=num->GetNbinsX();
i++){
131 Efficiency( (
int)num->GetBinContent(
i), (int)denom->GetBinContent(
i), 0.683,
e, low, high );
132 double err = e-low>high-e ? e-low : high-
e;
134 out->SetBinContent(
i, e );
135 out->SetBinEntries(
i, 1 );
136 out->SetBinError(
i,
sqrt(e*e+err*err) );
147 if (monElement !=
NULL)
165 mode = passing / ((double) total);
168 lowerBound = TEfficiency::Wilson(total, passing, level,
false);
169 upperBound = TEfficiency::Wilson(total, passing, level,
true);
std::string patternJetTrg_
T getUntrackedParameter(std::string const &, T const &) const
void Efficiency(int passing, int total, double level, double &mode, double &lowerBound, double &upperBound)
MonitorElement * bookProfile(Args &&...args)
MonitorElement * get(const std::string &path)
#define DEFINE_FWK_MODULE(type)
const std::string & pwd(void)
JetMETDQMPostProcessor(const edm::ParameterSet &pset)
std::string patternMetTrg_
TH1F * getHistogram(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &histoPath)
TProfile * dividehistos(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &numName, const std::string &denomName, const std::string &outName, const std::string &label, const std::string &titel)
bool dirExists(const std::string &path)
TH1F * getTH1F(void) const
std::vector< std::string > getSubdirs(void)
TProfile * getTProfile(void) const
void setEfficiencyFlag(void)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override