15 #define BOOK1D(name,title,nbinsx,lowx,highx) \
16 h##name = DQM ? DQM->book1D(#name,title,nbinsx,lowx,highx)->getTH1F() \
17 : new TH1F(#name,title,nbinsx,lowx,highx)
20 #define BOOK2D(name,title,nbinsx,lowx,highx,nbinsy,lowy,highy) \
21 h##name = DQM ? DQM->book2D(#name,title,nbinsx,lowx,highx,nbinsy,lowy,highy)->getTH2F() \
22 : new TH2F(#name,title,nbinsx,lowx,highx,nbinsy,lowy,highy)
28 #define SETAXES(name,xtitle,ytitle) \
29 h##name->GetXaxis()->SetTitle(xtitle); h##name->GetYaxis()->SetTitle(ytitle)
31 #define ET (PlotAgainstReco_)?"reconstructed E_{T} [GeV]":"generated E_{T} [GeV]"
32 #define ETA (PlotAgainstReco_)?"reconstructed #eta":"generated #eta"
33 #define PHI (PlotAgainstReco_)?"reconstructed #phi (rad)":"generated #phi (rad)"
70 int nbinsDeltaEta = 1000;
74 int nbinsDeltaPhi = 1000;
80 BOOK1D(DeltaEt,
"#DeltaE_{T}", nbinsEt, minDeltaEt, maxDeltaEt);
81 BOOK1D(DeltaEx,
"#DeltaE_{X}", nbinsEt, minDeltaEt, maxDeltaEt);
82 BOOK1D(DeltaEy,
"#DeltaE_{Y}", nbinsEt, minDeltaEt, maxDeltaEt);
83 BOOK2D(DeltaEtvsEt,
"#DeltaE_{T} vs E_{T}",
84 nbinsEt, minEt, maxEt,
85 nbinsEt,minDeltaEt, maxDeltaEt);
86 BOOK2D(DeltaEtOverEtvsEt,
"#DeltaE_{T}/E_{T} vsE_{T}",
87 nbinsEt, minEt, maxEt,
89 BOOK2D(DeltaEtvsEta,
"#DeltaE_{T} vs #eta",
90 nbinsEta, minEta, maxEta,
91 nbinsEt,minDeltaEt, maxDeltaEt);
92 BOOK2D(DeltaEtOverEtvsEta,
"#DeltaE_{T}/E_{T} vs #eta",
93 nbinsEta, minEta, maxEta,
95 BOOK2D(DeltaEtvsPhi,
"#DeltaE_{T} vs #phi",
97 nbinsEt,minDeltaEt, maxDeltaEt);
98 BOOK2D(DeltaEtOverEtvsPhi,
"#DeltaE_{T}/E_{T} vs #Phi",
101 BOOK2D(DeltaEtvsDeltaR,
"#DeltaE_{T} vs #DeltaR",
103 nbinsEt,minDeltaEt, maxDeltaEt);
104 BOOK2D(DeltaEtOverEtvsDeltaR,
"#DeltaE_{T}/E_{T} vs #DeltaR",
109 BOOK1D(DeltaEta,
"#Delta#eta",nbinsDeltaEta,minDeltaEta,maxDeltaEta);
110 BOOK2D(DeltaEtavsEt,
"#Delta#eta vs E_{T}",
111 nbinsEt, minEt, maxEt,
112 nbinsDeltaEta,minDeltaEta,maxDeltaEta);
113 BOOK2D(DeltaEtavsEta,
"#Delta#eta vs #eta",
114 nbinsEta, minEta, maxEta,
115 nbinsDeltaEta,minDeltaEta,maxDeltaEta);
118 BOOK1D(
DeltaPhi,
"#Delta#phi",nbinsDeltaPhi,minDeltaPhi,maxDeltaPhi);
119 BOOK2D(DeltaPhivsEt,
"#Delta#phi vs E_{T}",
120 nbinsEt, minEt, maxEt,
121 nbinsDeltaPhi,minDeltaPhi,maxDeltaPhi);
122 BOOK2D(DeltaPhivsEta,
"#Delta#phi vs #eta",
123 nbinsEta, minEta, maxEta,
124 nbinsDeltaPhi,minDeltaPhi,maxDeltaPhi);
128 BOOK2D(DeltaRvsEt,
"#DeltaR vs E_{T}",
129 nbinsEt, minEt, maxEt,
131 BOOK2D(DeltaRvsEta,
"#DeltaR vs #eta",
132 nbinsEta, minEta, maxEta,
135 BOOK1D(NRec,
"Number of reconstructed objects",20,0,20);
138 BOOK1D(EtaSeen,
"seen #eta",100,-5,5);
139 BOOK1D(PhiSeen,
"seen #phi",100,-3.5,3.5);
140 BOOK1D(EtSeen,
"seen E_{T}",nbinsEt, minEt, maxEt);
141 BOOK2D(EtvsEtaSeen,
"seen E_{T} vs eta",100,-5,5,200, 0, 200);
142 BOOK2D(EtvsPhiSeen,
"seen E_{T} vs seen #phi",100,-3.5,3.5,200, 0, 200);
144 BOOK1D(PhiRec,
"Rec #phi",100,-3.5,3.5);
145 BOOK1D(EtRec,
"Rec E_{T}",nbinsEt, minEt, maxEt);
146 BOOK1D(ExRec,
"Rec E_{X}",nbinsEt, -maxEt, maxEt);
147 BOOK1D(EyRec,
"Rec E_{Y}",nbinsEt, -maxEt, maxEt);
149 BOOK2D(EtRecvsEt,
"Rec E_{T} vs E_{T}",
150 nbinsEt, minEt, maxEt,
151 nbinsEt, minEt, maxEt);
152 BOOK2D(EtRecOverTrueEtvsTrueEt,
"Rec E_{T} / E_{T} vs E_{T}",
153 nbinsEt, minEt, maxEt,
156 BOOK1D(EtaGen,
"generated #eta",100,-5,5);
157 BOOK1D(PhiGen,
"generated #phi",100,-3.5,3.5);
158 BOOK1D(EtGen,
"generated E_{T}",nbinsEt, minEt, maxEt);
159 BOOK2D(EtvsEtaGen,
"generated E_{T} vs generated #eta",100,-5,5,200, 0, 200);
160 BOOK2D(EtvsPhiGen,
"generated E_{T} vs generated #phi",100,-3.5,3.5, 200, 0, 200);
162 BOOK1D(NGen,
"Number of generated objects",20,0,20);
166 BOOK1D(SumEt,
"SumEt", 1000, 0., 3000.);
167 BOOK1D(TrueSumEt,
"TrueSumEt", 1000, 0., 3000.);
168 BOOK2D(DeltaSetvsSet,
"#DeltaSEt vs trueSEt",
171 BOOK2D(DeltaMexvsSet,
"#DeltaMEX vs trueSEt",
174 BOOK2D(DeltaSetOverSetvsSet,
"#DeltaSetOverSet vs trueSet",
177 BOOK2D(RecSetvsTrueSet,
"Set vs trueSet",
180 BOOK2D(RecSetOverTrueSetvsTrueSet,
"Set/trueSet vs trueSet",
183 BOOK2D(TrueMexvsTrueSet,
"trueMex vs trueSet",
185 nbinsEt, -maxEt, maxEt);
193 SETAXES(DeltaEt,
"#DeltaE_{T} [GeV]",
"");
194 SETAXES(DeltaEx,
"#DeltaE_{X} [GeV]",
"");
195 SETAXES(DeltaEy,
"#DeltaE_{Y} [GeV]",
"");
196 SETAXES(DeltaEtvsEt,
ET,
"#DeltaE_{T} [GeV]");
197 SETAXES(DeltaEtOverEtvsEt,
ET,
"#DeltaE_{T}/E_{T}");
198 SETAXES(DeltaEtvsEta,
ETA,
"#DeltaE_{T} [GeV]");
199 SETAXES(DeltaEtOverEtvsEta,
ETA,
"#DeltaE_{T}/E_{T}");
200 SETAXES(DeltaEtvsPhi,
PHI,
"#DeltaE_{T} [GeV]");
201 SETAXES(DeltaEtOverEtvsPhi,
PHI,
"#DeltaE_{T}/E_{T}");
202 SETAXES(DeltaEtvsDeltaR,
"#DeltaR",
"#DeltaE_{T} [GeV]");
203 SETAXES(DeltaEtOverEtvsDeltaR,
"#DeltaR",
"#DeltaE_{T}/E_{T}");
206 SETAXES(DeltaEta,
"#Delta#eta",
"Events");
212 SETAXES(DeltaPhivsEt,
ET,
"#Delta#phi [rad]");
213 SETAXES(DeltaPhivsEta,
ETA,
"#Delta#phi [rad]");
220 SETAXES(NRec,
"Number of Rec Objects",
"");
222 SETAXES(EtaSeen,
"seen #eta",
"");
223 SETAXES(PhiSeen,
"seen #phi [rad]",
"");
224 SETAXES(EtSeen,
"seen E_{T} [GeV]",
"");
225 SETAXES(EtvsEtaSeen,
"seen #eta",
"seen E_{T}");
226 SETAXES(EtvsPhiSeen,
"seen #phi [rad]",
"seen E_{T}");
228 SETAXES(PhiRec,
"#phi [rad]",
"");
229 SETAXES(EtRec,
"E_{T} [GeV]",
"");
230 SETAXES(ExRec,
"E_{X} [GeV]",
"");
231 SETAXES(EyRec,
"E_{Y} [GeV]",
"");
233 SETAXES(EtRecOverTrueEtvsTrueEt,
ET,
"Rec E_{T} / E_{T} [GeV]");
235 SETAXES(EtaGen,
"generated #eta",
"");
236 SETAXES(PhiGen,
"generated #phi [rad]",
"");
237 SETAXES(EtGen,
"generated E_{T} [GeV]",
"");
238 SETAXES(EtvsPhiGen,
"generated #phi [rad]",
"generated E_{T} [GeV]");
239 SETAXES(EtvsEtaGen,
"generated #eta",
"generated E_{T} [GeV]");
241 SETAXES(NGen,
"Number of Gen Objects",
"");
245 SETAXES(SumEt,
"SumEt [GeV]",
"");
246 SETAXES(TrueSumEt,
"TrueSumEt [GeV]",
"");
247 SETAXES(DeltaSetvsSet,
"TrueSumEt",
"#DeltaSumEt [GeV]");
248 SETAXES(DeltaMexvsSet,
"TrueSumEt",
"#DeltaMEX [GeV]");
249 SETAXES(DeltaSetOverSetvsSet,
"TrueSumEt",
"#DeltaSumEt/trueSumEt");
250 SETAXES(RecSetvsTrueSet,
"TrueSumEt",
"SumEt");
251 SETAXES(RecSetOverTrueSetvsTrueSet,
"TrueSumEt",
"SumEt/trueSumEt");
252 SETAXES(TrueMexvsTrueSet,
"TrueSumEt",
"TrueMEX");
255 TDirectory* oldpwd = gDirectory;
258 TIter
next( gROOT->GetListOfFiles() );
260 const bool debug=
false;
262 while ( TFile *
file = (TFile *)
next() )
264 if (debug)
cout<<
"file "<<
file->GetName()<<endl;
268 cout<<
"DQM subdir"<<endl;
269 cout<< DQM->pwd().c_str()<<endl;
271 DQM->cd( DQM->pwd() );
276 cout<<
"current dir"<<endl;
291 double maxEtaCut )
const {
294 if (particle->
pt() < ptCut and ptCut != -1.)
297 if (fabs(particle->
eta())>maxEtaCut and maxEtaCut > 0)
299 if (fabs(particle->
eta())<minEtaCut and minEtaCut > 0)
314 double et = genParticle->
et();
315 double eta = genParticle->
eta();
316 double phi = genParticle->
phi();
324 if (plotAgainstReco) {
325 et = recParticle->
et();
326 eta = recParticle->
eta();
327 phi = recParticle->
phi();
332 double deltaEt =
algo_->deltaEt(recParticle,genParticle);
333 double deltaR =
algo_->deltaR(recParticle,genParticle);
340 if (deltaR>deltaR_cut && deltaR_cut != -1.)
343 hDeltaEt->Fill(deltaEt);
344 hDeltaEx->Fill(recParticle->
px()-genParticle->
px());
345 hDeltaEy->Fill(recParticle->
py()-genParticle->
py());
346 hDeltaEtvsEt->Fill(et,deltaEt);
347 hDeltaEtOverEtvsEt->Fill(et,deltaEt/et);
348 hDeltaEtvsEta->Fill(eta,deltaEt);
349 hDeltaEtOverEtvsEta->Fill(eta,deltaEt/et);
350 hDeltaEtvsPhi->Fill(phi,deltaEt);
351 hDeltaEtOverEtvsPhi->Fill(phi,deltaEt/et);
352 hDeltaEtvsDeltaR->Fill(deltaR,deltaEt);
353 hDeltaEtOverEtvsDeltaR->Fill(deltaR,deltaEt/et);
355 hDeltaEta->Fill(deltaEta);
356 hDeltaEtavsEt->Fill(et,deltaEta);
357 hDeltaEtavsEta->Fill(eta,deltaEta);
359 hDeltaPhi->Fill(deltaPhi);
360 hDeltaPhivsEt->Fill(et,deltaPhi);
361 hDeltaPhivsEta->Fill(eta,deltaPhi);
363 hDeltaR->Fill(deltaR);
364 hDeltaRvsEt->Fill(et,deltaR);
365 hDeltaRvsEta->Fill(eta,deltaR);
380 hTrueSumEt->Fill((*met1).sumEt());
381 hSumEt->Fill((*met2).sumEt());
382 hDeltaSetvsSet->Fill((*met1).sumEt(),(*met2).sumEt()-(*met1).sumEt());
383 hDeltaMexvsSet->Fill((*met1).sumEt(),recParticle->
px()-genParticle->
px());
384 hDeltaMexvsSet->Fill((*met1).sumEt(),recParticle->
py()-genParticle->
py());
385 if ((*met1).sumEt()>0.01) hDeltaSetOverSetvsSet->Fill((*met1).sumEt(),((*met2).sumEt()-(*met1).sumEt())/(*met1).sumEt());
386 hRecSetvsTrueSet->Fill((*met1).sumEt(),(*met2).sumEt());
387 hRecSetOverTrueSetvsTrueSet->Fill((*met1).sumEt(),(*met2).sumEt()/((*met1).sumEt()));
388 hTrueMexvsTrueSet->Fill((*met1).sumEt(),(*met1).px());
389 hTrueMexvsTrueSet->Fill((*met1).sumEt(),(*met1).py());
393 std::cout <<
"Warning : reco::MET* == NULL" << std::endl;
403 if (Filename.size() != 0 && file_)
404 file_->Write(Filename.c_str());
void fillHistos(const reco::Candidate *genParticle, const reco::Candidate *recParticle, double deltaR_cut, bool plotAgainstReco)
algo_(conf.existsAs< bool >("Correct")?conf.getParameter< bool >("Correct"):true, conf.getParameter< double >("e9e25Cut"), conf.getParameter< double >("intercept2DCut"), conf.existsAs< bool >("intercept2DSlope")?conf.getParameter< double >("intercept2DSlope"):defaultSlope2D_, conf.getParameter< std::vector< double > >("e1e9Cut"), conf.getParameter< std::vector< double > >("eCOREe9Cut"), conf.getParameter< std::vector< double > >("eSeLCut"), hfvars_)
virtual ~GenericBenchmark()
virtual double et() const =0
transverse energy
virtual double pt() const =0
transverse momentum
#define BOOK1D(name, title, nbinsx, lowx, highx)
void setfile(TFile *file)
bool accepted(const reco::Candidate *particle, double ptCut, double minEtaCut, double maxEtaCut) const
#define BOOK2D(name, title, nbinsx, lowx, highx, nbinsy, lowy, highy)
virtual double py() const =0
y coordinate of momentum vector
virtual double px() const =0
x coordinate of momentum vector
double deltaR(double eta1, double eta2, double phi1, double phi2)
Geom::Phi< T > phi() const
void write(std::string Filename)
#define SETAXES(name, xtitle, ytitle)
void setup(DQMStore *DQM=NULL, bool PlotAgainstReco_=true, float minDeltaEt=-100., float maxDeltaEt=50., float minDeltaPhi=-0.5, float maxDeltaPhi=0.5, bool doMetPlots=false)
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity