37 outputFileName_ = pset.
getParameter<
string>(
"OutputFileName");
39 isRunCentrally_= pset.
getParameter<
bool>(
"isRunCentrally");
42 etMin = parameters_.getParameter<
double>(
"etMin");
43 etMax = parameters_.getParameter<
double>(
"etMax");
44 etBin = parameters_.getParameter<
int>(
"etBin");
47 etaMin = parameters_.getParameter<
double>(
"etaMin");
48 etaMax = parameters_.getParameter<
double>(
"etaMax");
49 etaBin = parameters_.getParameter<
int>(
"etaBin");
50 etaBin2 = parameters_.getParameter<
int>(
"etaBin2");
52 phiMin = parameters_.getParameter<
double>(
"phiMin");
53 phiMax = parameters_.getParameter<
double>(
"phiMax");
54 phiBin = parameters_.getParameter<
int>(
"phiBin");
56 rMin = parameters_.getParameter<
double>(
"rMin");
57 rMax = parameters_.getParameter<
double>(
"rMax");
58 rBin = parameters_.getParameter<
int>(
"rBin");
60 zMin = parameters_.getParameter<
double>(
"zMin");
61 zMax = parameters_.getParameter<
double>(
"zMax");
62 zBin = parameters_.getParameter<
int>(
"zBin");
84 if(standAlone_) runPostprocessing();
90 if(!standAlone_) runPostprocessing();
99 std::string simInfoPathName =
"EgammaV/"+ analyzerName_+
"/SimulationInfo/";
100 std::string convPathName =
"EgammaV/"+ analyzerName_+
"/ConversionInfo/";
101 std::string effPathName =
"EgammaV/"+ analyzerName_+
"/Efficiencies/";
102 std::string photonPathName =
"EgammaV/"+ analyzerName_+
"/Photons/";
104 if(batch_)
dbe_->
open(inputFileName_);
109 string histname =
"h_simConvEtaMTotal";
110 h_simConvEtaMTotal_ =
dbe_->
book1D(histname,histname,etaBin2,etaMin, etaMax);
111 histname =
"h_simConvPhiMTotal";
112 h_simConvPhiMTotal_ =
dbe_->
book1D(histname,histname,phiBin,phiMin,phiMax);
113 histname =
"h_simConvRMTotal";
114 h_simConvRMTotal_ =
dbe_->
book1D(histname,histname,rBin,rMin, rMax);
115 histname =
"h_simConvZMTotal";
116 h_simConvZMTotal_ =
dbe_->
book1D(histname,histname,zBin,zMin, zMax);
117 histname =
"h_simConvEtMTotal";
118 h_simConvEtMTotal_ =
dbe_->
book1D(histname,histname,etBin,etMin, etMax);
122 histname =
"recoEffVsEta";
123 phoRecoEffEta_ =
dbe_->
book1D(histname,
"Photon reconstruction efficiency vs simulated #eta",etaBin,etaMin, etaMax);
124 histname =
"recoEffVsPhi";
125 phoRecoEffPhi_ =
dbe_->
book1D(histname,
"Photon reconstruction efficiency vs simulated #phi",phiBin,phiMin, phiMax);
126 histname =
"recoEffVsEt";
127 phoRecoEffEt_ =
dbe_->
book1D(histname,
"Photon reconstruction efficiency vs simulated Et",etBin,etMin, etMax) ;
129 histname =
"deadChVsEta";
130 phoDeadChEta_ =
dbe_->
book1D(histname,
"Fraction of photons with >=1 dead Xtal vs simulated #eta",etaBin,etaMin, etaMax);
131 histname =
"deadChVsPhi";
132 phoDeadChPhi_ =
dbe_->
book1D(histname,
"Fraction of photons with >=1 dead Xtal vs simulated #phi",phiBin,phiMin, phiMax);
133 histname =
"deadChVsEt";
134 phoDeadChEt_ =
dbe_->
book1D(histname,
"Fraction of photons with >=1 dead Xtal vs simulated Et",etBin,etMin, etMax) ;
136 if ( ! isRunCentrally_ ) {
137 histname =
"convVsEt";
138 convVsEt_[0] =
dbe_->
book1D(histname+
"Barrel",
"Fraction of good conversions in R9<0.93 vs Et ",etBin,etMin, etMax) ;
139 convVsEt_[1] =
dbe_->
book1D(histname+
"Endcap",
"Fraction of good conversions in R9<0.93 vs Et ",etBin,etMin, etMax) ;
145 histname =
"convEffVsEtaTwoTracks";
146 convEffEtaTwoTracks_ =
dbe_->
book1D(histname,histname,etaBin2,etaMin, etaMax);
148 histname =
"convEffVsPhiTwoTracks";
149 convEffPhiTwoTracks_ =
dbe_->
book1D(histname,histname,phiBin,phiMin,phiMax);
151 histname =
"convEffVsRTwoTracks";
152 convEffRTwoTracks_ =
dbe_->
book1D(histname,histname,rBin,rMin, rMax);
154 histname =
"convEffVsZTwoTracks";
155 convEffZTwoTracks_ =
dbe_->
book1D(histname,histname,zBin,zMin,zMax);
157 histname =
"convEffVsEtTwoTracks";
158 convEffEtTwoTracks_ =
dbe_->
book1D(histname,histname,etBin,etMin, etMax);
160 histname =
"convEffVsEtaTwoTracksAndVtxProbGT0";
161 convEffEtaTwoTracksAndVtxProbGT0_ =
dbe_->
book1D(histname,histname,etaBin2,etaMin, etaMax);
162 histname =
"convEffVsEtaTwoTracksAndVtxProbGT0005";
163 convEffEtaTwoTracksAndVtxProbGT0005_ =
dbe_->
book1D(histname,histname,etaBin2,etaMin, etaMax);
164 histname =
"convEffVsRTwoTracksAndVtxProbGT0";
165 convEffRTwoTracksAndVtxProbGT0_ =
dbe_->
book1D(histname,histname,rBin,rMin,rMax);
166 histname =
"convEffVsRTwoTracksAndVtxProbGT0005";
167 convEffRTwoTracksAndVtxProbGT0005_ =
dbe_->
book1D(histname,histname,rBin,rMin,rMax);
169 histname =
"convEffVsEtaOneTrack";
170 convEffEtaOneTrack_ =
dbe_->
book1D(histname,histname,etaBin2,etaMin, etaMax);
171 histname =
"convEffVsROneTrack";
172 convEffROneTrack_ =
dbe_->
book1D(histname,histname,rBin,rMin, rMax);
173 histname =
"convEffVsZOneTrack";
174 convEffZOneTrack_ =
dbe_->
book1D(histname,histname,rBin,rMin, rMax);
175 histname =
"convEffVsEtOneTrack";
176 convEffEtOneTrack_ =
dbe_->
book1D(histname,histname,etBin,etMin, etMax);
177 histname =
"convEffVsPhiOneTrack";
178 convEffPhiOneTrack_ =
dbe_->
book1D(histname,histname,phiBin,phiMin,phiMax);
180 histname =
"convEffVsEtaTotal";
181 convEffEtaTotal_ =
dbe_->
book1D(histname,histname,etaBin2,etaMin, etaMax);
182 histname =
"convEffVsRTotal";
183 convEffRTotal_ =
dbe_->
book1D(histname,histname,rBin,rMin, rMax);
184 histname =
"convEffVsZTotal";
185 convEffZTotal_ =
dbe_->
book1D(histname,histname,zBin,zMin, zMax);
186 histname =
"convEffVsEtTotal";
187 convEffEtTotal_ =
dbe_->
book1D(histname,histname,etBin,etMin, etMax);
188 histname =
"convEffVsPhiTotal";
189 convEffPhiTotal_ =
dbe_->
book1D(histname,histname,phiBin,phiMin,phiMax);
191 histname =
"convFakeRateVsEtaTwoTracks";
192 convFakeRateEtaTwoTracks_ =
dbe_->
book1D(histname,histname,etaBin2,etaMin, etaMax);
193 histname =
"convFakeRateVsPhiTwoTracks";
194 convFakeRatePhiTwoTracks_ =
dbe_->
book1D(histname,histname,phiBin,phiMin,phiMax);
195 histname =
"convFakeRateVsRTwoTracks";
196 convFakeRateRTwoTracks_ =
dbe_->
book1D(histname,histname,rBin,rMin, rMax);
197 histname =
"convFakeRateVsZTwoTracks";
198 convFakeRateZTwoTracks_ =
dbe_->
book1D(histname,histname,zBin,zMin,zMax);
199 histname =
"convFakeRateVsEtTwoTracks";
200 convFakeRateEtTwoTracks_ =
dbe_->
book1D(histname,histname,etBin,etMin, etMax);
202 histname =
"bkgEffVsEta";
203 bkgRecoEffEta_ =
dbe_->
book1D(histname,
"Bkg reconstruction efficiency vs simulated #eta",etaBin,etaMin, etaMax);
204 histname =
"bkgEffVsPhi";
205 bkgRecoEffPhi_ =
dbe_->
book1D(histname,
"Bkg reconstruction efficiency vs simulated #phi",phiBin,phiMin, phiMax);
206 histname =
"bkgEffVsEt";
207 bkgRecoEffEt_ =
dbe_->
book1D(histname,
"Bkg reconstruction efficiency vs simulated Et",etBin,etMin, etMax) ;
209 histname =
"deadChVsEtaBkg";
210 bkgDeadChEta_ =
dbe_->
book1D(histname,
"Fraction of bkg with >=1 dead Xtal vs simulated #eta",etaBin,etaMin, etaMax);
211 histname =
"deadChVsPhiBkg";
212 bkgDeadChPhi_ =
dbe_->
book1D(histname,
"Fraction of bkg with >=1 dead Xtal vs simulated #phi",phiBin,phiMin, phiMax);
213 histname =
"deadChVsEtBkg";
214 bkgDeadChEt_ =
dbe_->
book1D(histname,
"Fraction of bkg with >=1 dead Xtal vs simulated Et",etBin,etMin, etMax) ;
218 h_simConvPhiMTotal_->getTH1F()->Add(
dbe_->
get(simInfoPathName+
"h_SimConvOneMTracksPhi")->
getTH1F(),
dbe_->
get(convPathName+
"h_RecoConvTwoMTracksPhi")->
getTH1F());
219 h_simConvRMTotal_ ->getTH1F()->Add(
dbe_->
get(simInfoPathName+
"h_SimConvOneMTracksR")->
getTH1F(),
dbe_->
get(convPathName+
"h_RecoConvTwoMTracksR")->
getTH1F());
220 h_simConvZMTotal_ ->getTH1F()->Add(
dbe_->
get(simInfoPathName+
"h_SimConvOneMTracksZ")->
getTH1F(),
dbe_->
get(convPathName+
"h_RecoConvTwoMTracksZ")->
getTH1F());
221 h_simConvEtMTotal_ ->getTH1F()->Add(
dbe_->
get(simInfoPathName+
"h_SimConvOneMTracksEt")->
getTH1F(),
dbe_->
get(convPathName+
"h_RecoConvTwoMTracksEt")->
getTH1F());
225 if ( ! isRunCentrally_ ) {
226 dividePlots(
dbe_->
get(effPathName+
"convVsEtBarrel"),
dbe_->
get(photonPathName+
"EtR9Less093ConvBarrel"),
dbe_->
get(photonPathName+
"EtR9Less093Barrel"),
"effic");
227 dividePlots(
dbe_->
get(effPathName+
"convVsEtEndcap"),
dbe_->
get(photonPathName+
"EtR9Less093ConvEndcap"),
dbe_->
get(photonPathName+
"EtR9Less093Endcap"),
"effic");
230 dividePlots(
dbe_->
get(effPathName+
"recoEffVsEta"),
dbe_->
get(simInfoPathName+
"h_MatchedSimPhoEta"),
dbe_->
get(simInfoPathName+
"h_SimPhoEta"),
"effic");
231 dividePlots(
dbe_->
get(effPathName+
"recoEffVsPhi"),
dbe_->
get(simInfoPathName+
"h_MatchedSimPhoPhi"),
dbe_->
get(simInfoPathName+
"h_SimPhoPhi"),
"effic");
232 dividePlots(
dbe_->
get(effPathName+
"recoEffVsEt"),
dbe_->
get(simInfoPathName+
"h_MatchedSimPhoEt"),
dbe_->
get(simInfoPathName+
"h_SimPhoEt"),
"effic");
234 dividePlots(
dbe_->
get(effPathName+
"deadChVsEta"),
dbe_->
get(simInfoPathName+
"h_MatchedSimPhoBadChEta"),
dbe_->
get(simInfoPathName+
"h_MatchedSimPhoEta"),
"effic");
235 dividePlots(
dbe_->
get(effPathName+
"deadChVsPhi"),
dbe_->
get(simInfoPathName+
"h_MatchedSimPhoBadChPhi"),
dbe_->
get(simInfoPathName+
"h_MatchedSimPhoPhi"),
"effic");
236 dividePlots(
dbe_->
get(effPathName+
"deadChVsEt"),
dbe_->
get(simInfoPathName+
"h_MatchedSimPhoBadChEt"),
dbe_->
get(simInfoPathName+
"h_MatchedSimPhoEt"),
"effic");
239 dividePlots(
dbe_->
get(effPathName+
"convEffVsEtaTwoTracks"),
dbe_->
get(simInfoPathName+
"h_SimConvTwoMTracksEta"),
dbe_->
get(simInfoPathName+
"h_VisSimConvEta"),
"effic");
240 dividePlots(
dbe_->
get(effPathName+
"convEffVsPhiTwoTracks"),
dbe_->
get(simInfoPathName+
"h_SimConvTwoMTracksPhi"),
dbe_->
get(simInfoPathName+
"h_VisSimConvPhi"),
"effic");
241 dividePlots(
dbe_->
get(effPathName+
"convEffVsRTwoTracks"),
dbe_->
get(simInfoPathName+
"h_SimConvTwoMTracksR"),
dbe_->
get(simInfoPathName+
"h_VisSimConvR"),
"effic");
242 dividePlots(
dbe_->
get(effPathName+
"convEffVsZTwoTracks"),
dbe_->
get(simInfoPathName+
"h_SimConvTwoMTracksZ"),
dbe_->
get(simInfoPathName+
"h_VisSimConvZ"),
"effic");
243 dividePlots(
dbe_->
get(effPathName+
"convEffVsEtTwoTracks"),
dbe_->
get(simInfoPathName+
"h_SimConvTwoMTracksEt"),
dbe_->
get(simInfoPathName+
"h_VisSimConvEt"),
"effic");
244 dividePlots(
dbe_->
get(effPathName+
"convEffVsEtaTwoTracksAndVtxProbGT0"),
dbe_->
get(simInfoPathName+
"h_SimConvTwoMTracksEtaAndVtxPGT0"),
dbe_->
get(simInfoPathName+
"h_SimConvTwoMTracksEta"),
"effic");
245 dividePlots(
dbe_->
get(effPathName+
"convEffVsEtaTwoTracksAndVtxProbGT0005"),
dbe_->
get(simInfoPathName+
"h_SimConvTwoMTracksEtaAndVtxPGT0005"),
dbe_->
get(simInfoPathName+
"h_SimConvTwoMTracksEta"),
"effic");
246 dividePlots(
dbe_->
get(effPathName+
"convEffVsRTwoTracksAndVtxProbGT0"),
dbe_->
get(simInfoPathName+
"h_SimConvTwoMTracksRAndVtxPGT0"),
dbe_->
get(simInfoPathName+
"h_SimConvTwoMTracksR"),
"effic");
247 dividePlots(
dbe_->
get(effPathName+
"convEffVsRTwoTracksAndVtxProbGT0005"),
dbe_->
get(simInfoPathName+
"h_SimConvTwoMTracksRAndVtxPGT0005"),
dbe_->
get(simInfoPathName+
"h_SimConvTwoMTracksR"),
"effic");
249 dividePlots(
dbe_->
get(effPathName+
"convEffVsEtaOneTrack"),
dbe_->
get(simInfoPathName+
"h_SimConvOneMTracksEta"),
dbe_->
get(simInfoPathName+
"h_VisSimConvEta"),
"effic");
250 dividePlots(
dbe_->
get(effPathName+
"convEffVsPhiOneTrack"),
dbe_->
get(simInfoPathName+
"h_SimConvOneMTracksPhi"),
dbe_->
get(simInfoPathName+
"h_VisSimConvPhi"),
"effic");
251 dividePlots(
dbe_->
get(effPathName+
"convEffVsROneTrack"),
dbe_->
get(simInfoPathName+
"h_SimConvOneMTracksR"),
dbe_->
get(simInfoPathName+
"h_VisSimConvR"),
"effic");
252 dividePlots(
dbe_->
get(effPathName+
"convEffVsZOneTrack"),
dbe_->
get(simInfoPathName+
"h_SimConvOneMTracksZ"),
dbe_->
get(simInfoPathName+
"h_VisSimConvZ"),
"effic");
253 dividePlots(
dbe_->
get(effPathName+
"convEffVsEtOneTrack"),
dbe_->
get(simInfoPathName+
"h_SimConvOneMTracksEt"),
dbe_->
get(simInfoPathName+
"h_VisSimConvEt"),
"effic");
255 dividePlots(
dbe_->
get(effPathName+
"convEffVsEtaTotal"),
dbe_->
get(simInfoPathName+
"h_simConvEtaMTotal"),
dbe_->
get(simInfoPathName+
"h_VisSimConvEta"),
"effic");
256 dividePlots(
dbe_->
get(effPathName+
"convEffVsPhiTotal"),
dbe_->
get(simInfoPathName+
"h_simConvPhiMTotal"),
dbe_->
get(simInfoPathName+
"h_VisSimConvPhi"),
"effic");
257 dividePlots(
dbe_->
get(effPathName+
"convEffVsRTotal"),
dbe_->
get(simInfoPathName+
"h_simConvRMTotal"),
dbe_->
get(simInfoPathName+
"h_VisSimConvR"),
"effic");
258 dividePlots(
dbe_->
get(effPathName+
"convEffVsZTotal"),
dbe_->
get(simInfoPathName+
"h_simConvZMTotal"),
dbe_->
get(simInfoPathName+
"h_VisSimConvZ"),
"effic");
259 dividePlots(
dbe_->
get(effPathName+
"convEffVsEtTotal"),
dbe_->
get(simInfoPathName+
"h_simConvEtMTotal"),
dbe_->
get(simInfoPathName+
"h_VisSimConvEt"),
"effic");
261 dividePlots(
dbe_->
get(effPathName+
"convFakeRateVsEtaTwoTracks"),
dbe_->
get(convPathName+
"h_RecoConvTwoMTracksEta"),
dbe_->
get(convPathName+
"h_RecoConvTwoTracksEta"),
"fakerate");
262 dividePlots(
dbe_->
get(effPathName+
"convFakeRateVsPhiTwoTracks"),
dbe_->
get(convPathName+
"h_RecoConvTwoMTracksPhi"),
dbe_->
get(convPathName+
"h_RecoConvTwoTracksPhi"),
"fakerate");
263 dividePlots(
dbe_->
get(effPathName+
"convFakeRateVsRTwoTracks"),
dbe_->
get(convPathName+
"h_RecoConvTwoMTracksR"),
dbe_->
get(convPathName+
"h_RecoConvTwoTracksR"),
"fakerate");
264 dividePlots(
dbe_->
get(effPathName+
"convFakeRateVsZTwoTracks"),
dbe_->
get(convPathName+
"h_RecoConvTwoMTracksZ"),
dbe_->
get(convPathName+
"h_RecoConvTwoTracksZ"),
"fakerate");
265 dividePlots(
dbe_->
get(effPathName+
"convFakeRateVsEtTwoTracks"),
dbe_->
get(convPathName+
"h_RecoConvTwoMTracksEt"),
dbe_->
get(convPathName+
"h_RecoConvTwoTracksEt"),
"fakerate");
268 dividePlots(
dbe_->
get(effPathName+
"bkgEffVsEta"),
dbe_->
get(simInfoPathName+
"h_MatchedSimJetEta"),
dbe_->
get(simInfoPathName+
"h_SimJetEta"),
"effic");
269 dividePlots(
dbe_->
get(effPathName+
"bkgEffVsPhi"),
dbe_->
get(simInfoPathName+
"h_MatchedSimJetPhi"),
dbe_->
get(simInfoPathName+
"h_SimJetPhi"),
"effic");
270 dividePlots(
dbe_->
get(effPathName+
"bkgEffVsEt"),
dbe_->
get(simInfoPathName+
"h_MatchedSimJetEt"),
dbe_->
get(simInfoPathName+
"h_SimJetEt"),
"effic");
272 dividePlots(
dbe_->
get(effPathName+
"deadChVsEtaBkg"),
dbe_->
get(simInfoPathName+
"h_MatchedSimJetBadChEta"),
dbe_->
get(simInfoPathName+
"h_MatchedSimJetEta"),
"effic");
273 dividePlots(
dbe_->
get(effPathName+
"deadChVsPhiBkg"),
dbe_->
get(simInfoPathName+
"h_MatchedSimJetBadChPhi"),
dbe_->
get(simInfoPathName+
"h_MatchedSimJetPhi"),
"effic");
274 dividePlots(
dbe_->
get(effPathName+
"deadChVsEtBkg"),
dbe_->
get(simInfoPathName+
"h_MatchedSimJetBadChEt"),
dbe_->
get(simInfoPathName+
"h_MatchedSimJetEt"),
"effic");
278 if(standAlone_)
dbe_->
save(outputFileName_);
279 else if(batch_)
dbe_->
save(inputFileName_);
302 else if (type==
"fakerate")
326 err =
sqrt( value*(1-value) / denominator);
T getParameter(std::string const &) const
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
void setVerbose(unsigned level)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
PhotonPostprocessing(const edm::ParameterSet &pset)
virtual ~PhotonPostprocessing()
virtual void runPostprocessing()
TH1F * getTH1F(void) const
double getBinContent(int binx) const
get content of bin (1-D)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
void dividePlots(MonitorElement *dividend, MonitorElement *numerator, MonitorElement *denominator, std::string type)
int getNbinsX(void) const
get # of bins in X-axis
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
virtual void endRun(const edm::Run &, const edm::EventSetup &)
void setEfficiencyFlag(void)
virtual void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void setCurrentFolder(const std::string &fullpath)
virtual void analyze(const edm::Event &, const edm::EventSetup &)