17 LogDebug(
"HLTMonPhotonClient") <<
"constructor...." ;
19 logFile_.open(
"HLTMonPhotonClient.log");
29 if (outputFile_.size() != 0) {
30 LogInfo(
"HLTMonPhotonClient") <<
"Photon Trigger Monitoring histograms will be saved to "
34 outputFile_ =
"PhotonDQM.root";
45 theHLTCollectionLabels = iConfig.
getParameter<std::vector<edm::InputTag> >(
"theHLTCollectionLabels");
48 sourcedirname_=
"HLT/HLTMonPhoton/"+sourcetag_.label();
51 dbe->setCurrentFolder(dirname_);
74 TH1F* refhisto = eventCounter->getTH1F();
75 if(refhisto->GetBinContent(1) != 0){
78 cumFilterEff->setBinContent(4,refhisto->GetBinContent(4)/refhisto->GetBinContent(1));
79 cumFilterEff->setBinContent(3,refhisto->GetBinContent(3)/refhisto->GetBinContent(1));
80 cumFilterEff->setBinContent(2,refhisto->GetBinContent(2)/refhisto->GetBinContent(1));
82 relFilterEff->setBinContent(6,0);
83 cumFilterEff->setBinContent(5,0);
84 cumFilterEff->setBinContent(4,0);
85 cumFilterEff->setBinContent(3,0);
86 cumFilterEff->setBinContent(2,0);
88 for(
int i = 0;
i<4;
i++){
89 if(refhisto->GetBinContent(4-
i) != 0){
90 relFilterEff->setBinContent(5-
i,refhisto->GetBinContent(5-
i)/refhisto->GetBinContent(4-
i));
92 relFilterEff->setBinContent(5-
i,0);
95 if(refhisto->GetBinContent(1) != 0){
96 relFilterEff->setBinContent(1,refhisto->GetBinContent(1)/refhisto->GetBinContent(1));
97 cumFilterEff->setBinContent(2,refhisto->GetBinContent(2)/refhisto->GetBinContent(1));
98 cumFilterEff->setBinContent(1,refhisto->GetBinContent(1)/refhisto->GetBinContent(1));
100 relFilterEff->setBinContent(1,0);
101 cumFilterEff->setBinContent(2,0);
102 cumFilterEff->setBinContent(1,0);
108 for(
int i=0;
i<3;
i++){
109 denom = pixelhistosEt[0]->getTH1F();
110 num = pixelhistosEt[
i+1]->getTH1F();
111 for(
int j=1;
j <= pixelhistosEtOut[
i]->getNbinsX();
j++ ){
112 if(denom->GetBinContent(
j)!=0){
113 pixelhistosEtOut[
i]->setBinContent(
j,num->GetBinContent(
j)/denom->GetBinContent(
j));
116 pixelhistosEtOut[
i]->setBinContent(
j,0.);
119 denom = pixelhistosEta[0]->getTH1F();
120 num = pixelhistosEta[
i+1]->getTH1F();
121 for(
int j=1;
j <= pixelhistosEtaOut[
i]->getNbinsX();
j++ ){
122 if(denom->GetBinContent(
j)!=0)
123 pixelhistosEtaOut[
i]->setBinContent(
j,num->GetBinContent(
j)/denom->GetBinContent(
j));
125 pixelhistosEtaOut[
i]->setBinContent(
j,0.);
127 denom = pixelhistosPhi[0]->getTH1F();
128 num = pixelhistosPhi[
i+1]->getTH1F();
129 for(
int j=1;
j <= pixelhistosPhiOut[
i]->getNbinsX();
j++ ){
130 if(denom->GetBinContent(
j)!=0)
131 pixelhistosPhiOut[
i]->setBinContent(
j,num->GetBinContent(
j)/denom->GetBinContent(
j));
133 pixelhistosPhiOut[
i]->setBinContent(
j,0.);
137 denom = pixelhistosEt[0]->getTH1F();
138 num = pixelhistosEt[3]->getTH1F();
139 for(
int j=1;
j <= pixelhistosEtOut[3]->getNbinsX();
j++ ){
140 if(denom->GetBinContent(
j)!=0){
141 pixelhistosEtOut[3]->setBinContent(
j,num->GetBinContent(
j)/denom->GetBinContent(
j));
144 pixelhistosEtOut[3]->setBinContent(
j,0.);
148 denom = pixelhistosEta[0]->getTH1F();
149 num = pixelhistosEta[3]->getTH1F();
150 for(
int j=1;
j <= pixelhistosEtaOut[3]->getNbinsX();
j++ ){
151 if(denom->GetBinContent(
j)!=0){
152 pixelhistosEtaOut[3]->setBinContent(
j,num->GetBinContent(
j)/denom->GetBinContent(
j));
155 pixelhistosEtaOut[3]->setBinContent(
j,0.);
159 denom = pixelhistosPhi[0]->getTH1F();
160 num = pixelhistosPhi[3]->getTH1F();
161 for(
int j=1;
j <= pixelhistosPhiOut[3]->getNbinsX();
j++ ){
162 if(denom->GetBinContent(
j)!=0){
163 pixelhistosPhiOut[3]->setBinContent(
j,num->GetBinContent(
j)/denom->GetBinContent(
j));
166 pixelhistosPhiOut[3]->setBinContent(
j,0.);
182 dbe->setCurrentFolder(dirname_);
183 dbe->rmdir(dirname_);
187 dbe->setCurrentFolder(dirname_);
191 for(
int i = 0;
i<4;
i++){
192 LogInfo(
"HLTMonPhotonClient") <<
"loop iteration: "<<
i ;
193 tmpname = sourcedirname_ +
"/" + theHLTCollectionLabels[
i].label() +
" Eta Dist";
194 pixelhistosEta[
i]=dbe->get(tmpname);
195 tmpname = sourcedirname_ +
"/" + theHLTCollectionLabels[
i].label() +
" Et Dist";
196 pixelhistosEt[
i]=dbe->get(tmpname);
197 tmpname = sourcedirname_ +
"/" + theHLTCollectionLabels[
i].label() +
" Phi Dist";
198 pixelhistosPhi[
i]=dbe->get(tmpname);
206 refhist = pixelhistosEt[0]->getTH1F();
207 nBins = refhist->GetNbinsX();
208 xMin = refhist->GetXaxis()->GetXmin();
209 xMax = refhist->GetXaxis()->GetXmax();
210 pixelhistosEtOut[0] =dbe->book1D(
"EcalIsol Eff vs Et",
"EcalIsol Eff vs Et",nBins,xMin,xMax);
211 pixelhistosEtOut[1] =dbe->book1D(
"HcalIsol Eff vs Et",
"HcalIsol Eff vs Et",nBins,xMin,xMax);
212 pixelhistosEtOut[2] =dbe->book1D(
"Track Isol Eff vs Et",
"Track Isol Eff vs Et",nBins,xMin,xMax);
213 pixelhistosEtOut[3] =dbe->book1D(
"Total Eff vs Et",
"Total Eff vs Et",nBins,xMin,xMax);
215 refhist = pixelhistosEta[0]->getTH1F();
216 nBins = refhist->GetNbinsX();
217 xMin = refhist->GetXaxis()->GetXmin();
218 xMax = refhist->GetXaxis()->GetXmax();
219 pixelhistosEtaOut[0] =dbe->book1D(
"EcalIsol Eff vs Eta",
"EcalIsol Eff vs Eta",nBins,xMin,xMax);
220 pixelhistosEtaOut[1] =dbe->book1D(
"HcalIsol Eff vs Eta",
"HcalIsol Eff vs Eta",nBins,xMin,xMax);
221 pixelhistosEtaOut[2] =dbe->book1D(
"Track Isol Eff vs Eta",
"Track Isol Eff vs Eta",nBins,xMin,xMax);
222 pixelhistosEtaOut[3] =dbe->book1D(
"Total Eff vs Eta",
"Total Eff vs Eta",nBins,xMin,xMax);
224 refhist = pixelhistosPhi[0]->getTH1F();
225 nBins = refhist->GetNbinsX();
226 xMin = refhist->GetXaxis()->GetXmin();
227 xMax = refhist->GetXaxis()->GetXmax();
228 pixelhistosPhiOut[0] =dbe->book1D(
"EcalIsol Eff vs Phi",
"EcalIsol Eff vs Phi",nBins,xMin,xMax);
229 pixelhistosPhiOut[1] =dbe->book1D(
"HcalIsol Eff vs Phi",
"HcalIsol Eff vs Phi",nBins,xMin,xMax);
230 pixelhistosPhiOut[2] =dbe->book1D(
"Track Isol Eff vs Phi",
"Track Isol Eff vs Phi",nBins,xMin,xMax);
231 pixelhistosPhiOut[3] =dbe->book1D(
"Total Eff vs Phi",
"Total Eff vs Phi",nBins,xMin,xMax);
233 tmpname = sourcedirname_ +
"/Evts Passing Filters";
234 eventCounter = dbe->get(tmpname);
236 relFilterEff = dbe->book1D(
"Relative Filter Effs",
"Relative Filter Effs",5,0,5);
237 relFilterEff->setBinLabel(1,
"HLTIsoEtFilterEff");
238 relFilterEff->setBinLabel(2,
"HLTIsoEcalIsolEff");
239 relFilterEff->setBinLabel(3,
"HLTIsoHcalIsolEff");
240 relFilterEff->setBinLabel(4,
"HLTIsoTrackIsolEff");
244 cumFilterEff = dbe->book1D(
"Cumulative Filter Effs",
"Cumulative Filter Effs",5,0,5);
245 cumFilterEff->setBinLabel(1,
"HLTIsoEtFilterEff");
246 cumFilterEff->setBinLabel(2,
"HLTIsoEcalIsolEff");
247 cumFilterEff->setBinLabel(3,
"HLTIsoHcalIsolEff");
248 cumFilterEff->setBinLabel(4,
"HLTIsoTrackIsolEff");
260 if (outputFile_.size() != 0 && dbe)
261 dbe->save(outputFile_);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_FWK_MODULE(type)
HLTMonPhotonClient(const edm::ParameterSet &)
virtual void analyze(const edm::Event &, const edm::EventSetup &)