CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
GenericBenchmark Class Reference

#include <GenericBenchmark.h>

Inheritance diagram for GenericBenchmark:
GenericBenchmarkAnalyzer

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 

Public Member Functions

template<typename C >
void fill (const C *RecoCollection, const C *GenCollection, bool startFromGen=false, bool PlotAgainstReco=true, bool onlyTwoJets=false, double recPt_cut=-1., double minEta_cut=-1., double maxEta_cut=-1., double deltaR_cut=-1.)
 
 GenericBenchmark ()
 
void setfile (TFile *file)
 
void setup (DQMStore *DQM=nullptr, bool PlotAgainstReco_=true, float minDeltaEt=-100., float maxDeltaEt=50., float minDeltaPhi=-0.5, float maxDeltaPhi=0.5, bool doMetPlots=false)
 
void write (std::string Filename)
 
virtual ~GenericBenchmark () noexcept(false)
 

Protected Attributes

PFBenchmarkAlgoalgo_
 
DQMStoredbe_
 

Private Member Functions

bool accepted (const reco::Candidate *particle, double ptCut, double minEtaCut, double maxEtaCut) const
 
void fillHistos (const reco::Candidate *genParticle, const reco::Candidate *recParticle, double deltaR_cut, bool plotAgainstReco)
 

Private Attributes

bool doMetPlots_
 
TFile * file_
 
TH1F * hDeltaEt
 
TH1F * hDeltaEta
 
TH2F * hDeltaEtavsEt
 
TH2F * hDeltaEtavsEta
 
TH2F * hDeltaEtOverEtvsDeltaR
 
TH2F * hDeltaEtOverEtvsEt
 
TH2F * hDeltaEtOverEtvsEta
 
TH2F * hDeltaEtOverEtvsPhi
 
TH2F * hDeltaEtvsDeltaR
 
TH2F * hDeltaEtvsEt
 
TH2F * hDeltaEtvsEta
 
TH2F * hDeltaEtvsPhi
 
TH1F * hDeltaEx
 
TH1F * hDeltaEy
 
TH2F * hDeltaMexvsSet
 
TH1F * hDeltaPhi
 
TH2F * hDeltaPhivsEt
 
TH2F * hDeltaPhivsEta
 
TH1F * hDeltaR
 
TH2F * hDeltaRvsEt
 
TH2F * hDeltaRvsEta
 
TH2F * hDeltaSetOverSetvsSet
 
TH2F * hDeltaSetvsSet
 
TH1F * hEtaGen
 
TH1F * hEtaSeen
 
TH1F * hEtGen
 
TH1F * hEtRec
 
TH2F * hEtRecOverTrueEtvsTrueEt
 
TH2F * hEtRecvsEt
 
TH1F * hEtSeen
 
TH2F * hEtvsEtaGen
 
TH2F * hEtvsEtaSeen
 
TH2F * hEtvsPhiGen
 
TH2F * hEtvsPhiSeen
 
TH1F * hExRec
 
TH1F * hEyRec
 
TH1F * hNGen
 
TH1F * hNRec
 
TH1F * hPhiGen
 
TH1F * hPhiRec
 
TH1F * hPhiSeen
 
TH2F * hRecSetOverTrueSetvsTrueSet
 
TH2F * hRecSetvsTrueSet
 
TH1F * hSumEt
 
TH2F * hTrueMexvsTrueSet
 
TH1F * hTrueSumEt
 
BenchmarkTreetree_
 

Detailed Description

Definition at line 21 of file GenericBenchmark.h.

Member Typedef Documentation

Definition at line 23 of file GenericBenchmark.h.

Definition at line 24 of file GenericBenchmark.h.

Constructor & Destructor Documentation

GenericBenchmark::GenericBenchmark ( )

Definition at line 33 of file GenericBenchmark.cc.

33 {}
GenericBenchmark::~GenericBenchmark ( )
virtualnoexcept

Definition at line 35 of file GenericBenchmark.cc.

35 {}

Member Function Documentation

bool GenericBenchmark::accepted ( const reco::Candidate particle,
double  ptCut,
double  minEtaCut,
double  maxEtaCut 
) const
private

Definition at line 238 of file GenericBenchmark.cc.

References reco::Candidate::eta(), and reco::Candidate::pt().

Referenced by fill().

241  {
242  //skip reconstructed PFJets with p_t < recPt_cut
243  if (particle->pt() < ptCut and ptCut != -1.)
244  return false;
245 
246  if (fabs(particle->eta()) > maxEtaCut and maxEtaCut > 0)
247  return false;
248  if (fabs(particle->eta()) < minEtaCut and minEtaCut > 0)
249  return false;
250 
251  //accepted!
252  return true;
253 }
virtual double pt() const =0
transverse momentum
virtual double eta() const =0
momentum pseudorapidity
template<typename C >
void GenericBenchmark::fill ( const C *  RecoCollection,
const C *  GenCollection,
bool  startFromGen = false,
bool  PlotAgainstReco = true,
bool  onlyTwoJets = false,
double  recPt_cut = -1.,
double  minEta_cut = -1.,
double  maxEta_cut = -1.,
double  deltaR_cut = -1. 
)

Definition at line 129 of file GenericBenchmark.h.

References accepted(), cms::cuda::assert(), PFBenchmarkAlgo::deltaR(), HLT_FULL_cff::deltaR, reco::Candidate::et(), reco::Candidate::eta(), fillHistos(), mps_fire::i, dqmiolumiharvest::j, PFBenchmarkAlgo::matchByDeltaR(), reco::Candidate::phi(), reco::Candidate::pt(), reco::Candidate::px(), and reco::Candidate::py().

137  {
138  //if (doMetPlots_)
139  //{
140  // const reco::MET* met1=static_cast<const reco::MET*>(&((*RecoCollection)[0]));
141  // if (met1!=NULL) std::cout << "FL: met1.sumEt() = " << (*met1).sumEt() << std::endl;
142  //}
143 
144  // loop over reco particles
145 
146  if (!startFromGen) {
147  int nRec = 0;
148  for (unsigned int i = 0; i < RecoCollection->size(); i++) {
149  // generate histograms comparing the reco and truth candidate (truth = closest in delta-R)
150  const reco::Candidate *particle = &(*RecoCollection)[i];
151 
152  assert(particle != nullptr);
153  if (!accepted(particle, recPt_cut, minEta_cut, maxEta_cut))
154  continue;
155 
156  // Count the number of jets with a larger energy
157  if (onlyTwoJets) {
158  unsigned highJets = 0;
159  for (unsigned j = 0; j < RecoCollection->size(); j++) {
160  const reco::Candidate *otherParticle = &(*RecoCollection)[j];
161  if (j != i && otherParticle->pt() > particle->pt())
162  highJets++;
163  }
164  if (highJets > 1)
165  continue;
166  }
167  nRec++;
168 
169  const reco::Candidate *gen_particle = algo_->matchByDeltaR(particle, GenCollection);
170  if (gen_particle == nullptr)
171  continue;
172 
173  // fill histograms
174  fillHistos(gen_particle, particle, deltaR_cut, PlotAgainstReco);
175  }
176 
177  hNRec->Fill(nRec);
178  }
179 
180  // loop over gen particles
181 
182  // std::cout<<"Reco size = "<<RecoCollection->size()<<", ";
183  // std::cout<<"Gen size = "<<GenCollection->size()<<std::endl;
184 
185  int nGen = 0;
186  for (unsigned int i = 0; i < GenCollection->size(); i++) {
187  const reco::Candidate *gen_particle = &(*GenCollection)[i];
188 
189  if (!accepted(gen_particle, recPt_cut, minEta_cut, maxEta_cut)) {
190  continue;
191  }
192 
193  hEtaGen->Fill(gen_particle->eta());
194  hPhiGen->Fill(gen_particle->phi());
195  hEtGen->Fill(gen_particle->et());
196  hEtvsEtaGen->Fill(gen_particle->eta(), gen_particle->et());
197  hEtvsPhiGen->Fill(gen_particle->phi(), gen_particle->et());
198 
199  const reco::Candidate *rec_particle = algo_->matchByDeltaR(gen_particle, RecoCollection);
200  nGen++;
201  if (!rec_particle)
202  continue; // no match
203  // must make a cut on delta R - so let's do the cut
204 
205  double deltaR = algo_->deltaR(rec_particle, gen_particle);
206  if (deltaR > deltaR_cut && deltaR_cut != -1.)
207  continue;
208 
209  hEtaSeen->Fill(gen_particle->eta());
210  hPhiSeen->Fill(gen_particle->phi());
211  hEtSeen->Fill(gen_particle->et());
212  hEtvsEtaSeen->Fill(gen_particle->eta(), gen_particle->et());
213  hEtvsPhiSeen->Fill(gen_particle->phi(), gen_particle->et());
214 
215  hPhiRec->Fill(rec_particle->phi());
216  hEtRec->Fill(rec_particle->et());
217  hExRec->Fill(rec_particle->px());
218  hEyRec->Fill(rec_particle->py());
219 
220  hEtRecvsEt->Fill(gen_particle->et(), rec_particle->et());
221  if (gen_particle->et() != 0.0)
222  hEtRecOverTrueEtvsTrueEt->Fill(gen_particle->et(), rec_particle->et() / gen_particle->et());
223 
224  if (startFromGen)
225  fillHistos(gen_particle, rec_particle, deltaR_cut, PlotAgainstReco);
226  }
227  hNGen->Fill(nGen);
228 }
void fillHistos(const reco::Candidate *genParticle, const reco::Candidate *recParticle, double deltaR_cut, bool plotAgainstReco)
bool onlyTwoJets
virtual double et() const =0
transverse energy
virtual double pt() const =0
transverse momentum
PFBenchmarkAlgo * algo_
assert(be >=bs)
bool accepted(const reco::Candidate *particle, double ptCut, double minEtaCut, double maxEtaCut) const
static double deltaR(const T *, const U *)
virtual double py() const =0
y coordinate of momentum vector
virtual double px() const =0
x coordinate of momentum vector
static const Collection::value_type * matchByDeltaR(const T *, const Collection *)
TH2F * hEtRecOverTrueEtvsTrueEt
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity
void GenericBenchmark::fillHistos ( const reco::Candidate genParticle,
const reco::Candidate recParticle,
double  deltaR_cut,
bool  plotAgainstReco 
)
private

Definition at line 255 of file GenericBenchmark.cc.

References algo_, gather_cfg::cout, BenchmarkTreeEntry::deltaEt, spr::deltaEta, BenchmarkTreeEntry::deltaEta, srCondWrite_cfg::deltaPhi, HLT_FULL_cff::deltaR, mps_splice::entry, BenchmarkTreeEntry::et, reco::Candidate::et(), BenchmarkTreeEntry::eta, PVValHelper::eta, reco::Candidate::eta(), hDeltaR::Fill(), reco::Candidate::phi(), reco::Candidate::px(), and reco::Candidate::py().

Referenced by fill().

258  {
259  // get the quantities to place on the denominator and/or divide by
260  double et = genParticle->et();
261  double eta = genParticle->eta();
262  double phi = genParticle->phi();
263  //std::cout << "FL : et = " << et << std::endl;
264  //std::cout << "FL : eta = " << eta << std::endl;
265  //std::cout << "FL : phi = " << phi << std::endl;
266  //std::cout << "FL : rec et = " << recParticle->et() << std::endl;
267  //std::cout << "FL : rec eta = " << recParticle->eta() << std::endl;
268  //std::cout << "FL : rec phi = " <<recParticle-> phi() << std::endl;
269 
270  if (plotAgainstReco) {
271  et = recParticle->et();
272  eta = recParticle->eta();
273  phi = recParticle->phi();
274  }
275 
276  // get the delta quantities
277  double deltaEt = algo_->deltaEt(recParticle, genParticle);
278  double deltaR = algo_->deltaR(recParticle, genParticle);
279  double deltaEta = algo_->deltaEta(recParticle, genParticle);
280  double deltaPhi = algo_->deltaPhi(recParticle, genParticle);
281 
282  //std::cout << "FL :deltaR_cut = " << deltaR_cut << std::endl;
283  //std::cout << "FL :deltaR = " << deltaR << std::endl;
284 
285  if (deltaR > deltaR_cut && deltaR_cut != -1.)
286  return;
287 
288  hDeltaEt->Fill(deltaEt);
289  hDeltaEx->Fill(recParticle->px() - genParticle->px());
290  hDeltaEy->Fill(recParticle->py() - genParticle->py());
291  hDeltaEtvsEt->Fill(et, deltaEt);
292  hDeltaEtOverEtvsEt->Fill(et, deltaEt / et);
293  hDeltaEtvsEta->Fill(eta, deltaEt);
294  hDeltaEtOverEtvsEta->Fill(eta, deltaEt / et);
295  hDeltaEtvsPhi->Fill(phi, deltaEt);
296  hDeltaEtOverEtvsPhi->Fill(phi, deltaEt / et);
297  hDeltaEtvsDeltaR->Fill(deltaR, deltaEt);
298  hDeltaEtOverEtvsDeltaR->Fill(deltaR, deltaEt / et);
299 
300  hDeltaEta->Fill(deltaEta);
301  hDeltaEtavsEt->Fill(et, deltaEta);
302  hDeltaEtavsEta->Fill(eta, deltaEta);
303 
304  hDeltaPhi->Fill(deltaPhi);
305  hDeltaPhivsEt->Fill(et, deltaPhi);
306  hDeltaPhivsEta->Fill(eta, deltaPhi);
307 
308  hDeltaR->Fill(deltaR);
309  hDeltaRvsEt->Fill(et, deltaR);
310  hDeltaRvsEta->Fill(eta, deltaR);
311 
313  entry.deltaEt = deltaEt;
314  entry.deltaEta = deltaEta;
315  entry.et = et;
316  entry.eta = eta;
317 
318  if (doMetPlots_) {
319  const reco::MET* met1 = static_cast<const reco::MET*>(genParticle);
320  const reco::MET* met2 = static_cast<const reco::MET*>(recParticle);
321  if (met1 != nullptr && met2 != nullptr) {
322  //std::cout << "FL: met1.sumEt() = " << (*met1).sumEt() << std::endl;
323  hTrueSumEt->Fill((*met1).sumEt());
324  hSumEt->Fill((*met2).sumEt());
325  hDeltaSetvsSet->Fill((*met1).sumEt(), (*met2).sumEt() - (*met1).sumEt());
326  hDeltaMexvsSet->Fill((*met1).sumEt(), recParticle->px() - genParticle->px());
327  hDeltaMexvsSet->Fill((*met1).sumEt(), recParticle->py() - genParticle->py());
328  if ((*met1).sumEt() > 0.01)
329  hDeltaSetOverSetvsSet->Fill((*met1).sumEt(), ((*met2).sumEt() - (*met1).sumEt()) / (*met1).sumEt());
330  hRecSetvsTrueSet->Fill((*met1).sumEt(), (*met2).sumEt());
331  hRecSetOverTrueSetvsTrueSet->Fill((*met1).sumEt(), (*met2).sumEt() / ((*met1).sumEt()));
332  hTrueMexvsTrueSet->Fill((*met1).sumEt(), (*met1).px());
333  hTrueMexvsTrueSet->Fill((*met1).sumEt(), (*met1).py());
334  } else {
335  std::cout << "Warning : reco::MET* == NULL" << std::endl;
336  }
337  }
338 
339  // tree_->Fill(entry);
340 }
void Fill(double xEntry, double yEntry, double zEntry, double path, double path_x, double SM, double pAbs, double En, int type)
Definition: Histograms.h:464
virtual double et() const =0
transverse energy
PFBenchmarkAlgo * algo_
static double deltaEt(const T *, const U *)
static const double deltaEta
Definition: CaloConstants.h:8
static double deltaEta(const T *, const U *)
Definition: MET.h:41
TH2F * hRecSetOverTrueSetvsTrueSet
static double deltaR(const T *, const U *)
TH2F * hDeltaEtOverEtvsDeltaR
virtual double py() const =0
y coordinate of momentum vector
virtual double px() const =0
x coordinate of momentum vector
bool plotAgainstReco
list entry
Definition: mps_splice.py:68
tuple cout
Definition: gather_cfg.py:144
static double deltaPhi(const T *, const U *)
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity
void GenericBenchmark::setfile ( TFile *  file)
void GenericBenchmark::setup ( DQMStore DQM = nullptr,
bool  PlotAgainstReco_ = true,
float  minDeltaEt = -100.,
float  maxDeltaEt = 50.,
float  minDeltaPhi = -0.5,
float  maxDeltaPhi = 0.5,
bool  doMetPlots = false 
)

Definition at line 37 of file GenericBenchmark.cc.

References BOOK1D, BOOK2D, dqm::implementation::DQMStore::cd(), gather_cfg::cout, debug, HLT_FULL_cff::DeltaEta, ET, ETA, mergeVDriftHistosByStation::file, M_PI, CommPDSkim_cfg::maxDeltaEta, maxEta, HLT_FULL_cff::minDeltaEta, GetRecoTauVFromDQM_MC_cff::next, PHI, dqm::implementation::DQMStore::pwd(), and SETAXES.

43  {
44  //std::cout << "minDeltaPhi = " << minDeltaPhi << std::endl;
45 
46  // CMSSW_2_X_X
47  // use bare Root if no DQM (FWLite applications)
48  //if (!DQM)
49  //{
50  // file_ = new TFile("pfmetBenchmark.root", "recreate");
51  // cout << "Info: DQM is not available to provide data storage service. Using TFile to save histograms. "<<endl;
52  //}
53  // Book Histograms
54 
55  //std::cout << "FL : pwd = ";
56  //gDirectory->pwd();
57  //std::cout << std::endl;
58 
59  int nbinsEt = 1000;
60  float minEt = 0;
61  float maxEt = 1000;
62 
63  //float minDeltaEt = -100;
64  //float maxDeltaEt = 50;
65 
66  int nbinsEta = 200;
67  float minEta = -5;
68  float maxEta = 5;
69 
70  int nbinsDeltaEta = 1000;
71  float minDeltaEta = -0.5;
72  float maxDeltaEta = 0.5;
73 
74  int nbinsDeltaPhi = 1000;
75  //float minDeltaPhi = -0.5;
76  //float maxDeltaPhi = 0.5;
77 
78  // delta et quantities
79  BOOK1D(DeltaEt, "#DeltaE_{T}", nbinsEt, minDeltaEt, maxDeltaEt);
80  BOOK1D(DeltaEx, "#DeltaE_{X}", nbinsEt, minDeltaEt, maxDeltaEt);
81  BOOK1D(DeltaEy, "#DeltaE_{Y}", nbinsEt, minDeltaEt, maxDeltaEt);
82  BOOK2D(DeltaEtvsEt, "#DeltaE_{T} vs E_{T}", nbinsEt, minEt, maxEt, nbinsEt, minDeltaEt, maxDeltaEt);
83  BOOK2D(DeltaEtOverEtvsEt, "#DeltaE_{T}/E_{T} vsE_{T}", nbinsEt, minEt, maxEt, nbinsEt, -1, 1);
84  BOOK2D(DeltaEtvsEta, "#DeltaE_{T} vs #eta", nbinsEta, minEta, maxEta, nbinsEt, minDeltaEt, maxDeltaEt);
85  BOOK2D(DeltaEtOverEtvsEta, "#DeltaE_{T}/E_{T} vs #eta", nbinsEta, minEta, maxEta, 100, -1, 1);
86  BOOK2D(DeltaEtvsPhi, "#DeltaE_{T} vs #phi", 200, -M_PI, M_PI, nbinsEt, minDeltaEt, maxDeltaEt);
87  BOOK2D(DeltaEtOverEtvsPhi, "#DeltaE_{T}/E_{T} vs #Phi", 200, -M_PI, M_PI, 100, -1, 1);
88  BOOK2D(DeltaEtvsDeltaR, "#DeltaE_{T} vs #DeltaR", 100, 0, 1, nbinsEt, minDeltaEt, maxDeltaEt);
89  BOOK2D(DeltaEtOverEtvsDeltaR, "#DeltaE_{T}/E_{T} vs #DeltaR", 100, 0, 1, 100, -1, 1);
90 
91  // delta eta quantities
92  BOOK1D(DeltaEta, "#Delta#eta", nbinsDeltaEta, minDeltaEta, maxDeltaEta);
93  BOOK2D(DeltaEtavsEt, "#Delta#eta vs E_{T}", nbinsEt, minEt, maxEt, nbinsDeltaEta, minDeltaEta, maxDeltaEta);
94  BOOK2D(DeltaEtavsEta, "#Delta#eta vs #eta", nbinsEta, minEta, maxEta, nbinsDeltaEta, minDeltaEta, maxDeltaEta);
95 
96  // delta phi quantities
97  BOOK1D(DeltaPhi, "#Delta#phi", nbinsDeltaPhi, minDeltaPhi, maxDeltaPhi);
98  BOOK2D(DeltaPhivsEt, "#Delta#phi vs E_{T}", nbinsEt, minEt, maxEt, nbinsDeltaPhi, minDeltaPhi, maxDeltaPhi);
99  BOOK2D(DeltaPhivsEta, "#Delta#phi vs #eta", nbinsEta, minEta, maxEta, nbinsDeltaPhi, minDeltaPhi, maxDeltaPhi);
100 
101  // delta R quantities
102  BOOK1D(DeltaR, "#DeltaR", 100, 0, 1);
103  BOOK2D(DeltaRvsEt, "#DeltaR vs E_{T}", nbinsEt, minEt, maxEt, 100, 0, 1);
104  BOOK2D(DeltaRvsEta, "#DeltaR vs #eta", nbinsEta, minEta, maxEta, 100, 0, 1);
105 
106  BOOK1D(NRec, "Number of reconstructed objects", 20, 0, 20);
107 
108  // seen and gen distributions, for efficiency computation
109  BOOK1D(EtaSeen, "seen #eta", 100, -5, 5);
110  BOOK1D(PhiSeen, "seen #phi", 100, -3.5, 3.5);
111  BOOK1D(EtSeen, "seen E_{T}", nbinsEt, minEt, maxEt);
112  BOOK2D(EtvsEtaSeen, "seen E_{T} vs eta", 100, -5, 5, 200, 0, 200);
113  BOOK2D(EtvsPhiSeen, "seen E_{T} vs seen #phi", 100, -3.5, 3.5, 200, 0, 200);
114 
115  BOOK1D(PhiRec, "Rec #phi", 100, -3.5, 3.5);
116  BOOK1D(EtRec, "Rec E_{T}", nbinsEt, minEt, maxEt);
117  BOOK1D(ExRec, "Rec E_{X}", nbinsEt, -maxEt, maxEt);
118  BOOK1D(EyRec, "Rec E_{Y}", nbinsEt, -maxEt, maxEt);
119 
120  BOOK2D(EtRecvsEt, "Rec E_{T} vs E_{T}", nbinsEt, minEt, maxEt, nbinsEt, minEt, maxEt);
121  BOOK2D(EtRecOverTrueEtvsTrueEt, "Rec E_{T} / E_{T} vs E_{T}", nbinsEt, minEt, maxEt, 1000, 0., 100.);
122 
123  BOOK1D(EtaGen, "generated #eta", 100, -5, 5);
124  BOOK1D(PhiGen, "generated #phi", 100, -3.5, 3.5);
125  BOOK1D(EtGen, "generated E_{T}", nbinsEt, minEt, maxEt);
126  BOOK2D(EtvsEtaGen, "generated E_{T} vs generated #eta", 100, -5, 5, 200, 0, 200);
127  BOOK2D(EtvsPhiGen, "generated E_{T} vs generated #phi", 100, -3.5, 3.5, 200, 0, 200);
128 
129  BOOK1D(NGen, "Number of generated objects", 20, 0, 20);
130 
131  if (doMetPlots) {
132  BOOK1D(SumEt, "SumEt", 1000, 0., 3000.);
133  BOOK1D(TrueSumEt, "TrueSumEt", 1000, 0., 3000.);
134  BOOK2D(DeltaSetvsSet, "#DeltaSEt vs trueSEt", 3000, 0., 3000., 1000, -1000., 1000.);
135  BOOK2D(DeltaMexvsSet, "#DeltaMEX vs trueSEt", 3000, 0., 3000., 1000, -400., 400.);
136  BOOK2D(DeltaSetOverSetvsSet, "#DeltaSetOverSet vs trueSet", 3000, 0., 3000., 1000, -1., 1.);
137  BOOK2D(RecSetvsTrueSet, "Set vs trueSet", 3000, 0., 3000., 3000, 0., 3000.);
138  BOOK2D(RecSetOverTrueSetvsTrueSet, "Set/trueSet vs trueSet", 3000, 0., 3000., 500, 0., 2.);
139  BOOK2D(TrueMexvsTrueSet, "trueMex vs trueSet", 3000, 0., 3000., nbinsEt, -maxEt, maxEt);
140  }
141  // number of truth particles found within given cone radius of reco
142  //BOOK2D(NumInConeVsConeSize,NumInConeVsConeSize,100,0,1,25,0,25);
143 
144  // Set Axis Titles
145 
146  // delta et quantities
147  SETAXES(DeltaEt, "#DeltaE_{T} [GeV]", "");
148  SETAXES(DeltaEx, "#DeltaE_{X} [GeV]", "");
149  SETAXES(DeltaEy, "#DeltaE_{Y} [GeV]", "");
150  SETAXES(DeltaEtvsEt, ET, "#DeltaE_{T} [GeV]");
151  SETAXES(DeltaEtOverEtvsEt, ET, "#DeltaE_{T}/E_{T}");
152  SETAXES(DeltaEtvsEta, ETA, "#DeltaE_{T} [GeV]");
153  SETAXES(DeltaEtOverEtvsEta, ETA, "#DeltaE_{T}/E_{T}");
154  SETAXES(DeltaEtvsPhi, PHI, "#DeltaE_{T} [GeV]");
155  SETAXES(DeltaEtOverEtvsPhi, PHI, "#DeltaE_{T}/E_{T}");
156  SETAXES(DeltaEtvsDeltaR, "#DeltaR", "#DeltaE_{T} [GeV]");
157  SETAXES(DeltaEtOverEtvsDeltaR, "#DeltaR", "#DeltaE_{T}/E_{T}");
158 
159  // delta eta quantities
160  SETAXES(DeltaEta, "#Delta#eta", "Events");
161  SETAXES(DeltaEtavsEt, ET, "#Delta#eta");
162  SETAXES(DeltaEtavsEta, ETA, "#Delta#eta");
163 
164  // delta phi quantities
165  SETAXES(DeltaPhi, "#Delta#phi [rad]", "Events");
166  SETAXES(DeltaPhivsEt, ET, "#Delta#phi [rad]");
167  SETAXES(DeltaPhivsEta, ETA, "#Delta#phi [rad]");
168 
169  // delta R quantities
170  SETAXES(DeltaR, "#DeltaR", "Events");
171  SETAXES(DeltaRvsEt, ET, "#DeltaR");
172  SETAXES(DeltaRvsEta, ETA, "#DeltaR");
173 
174  SETAXES(NRec, "Number of Rec Objects", "");
175 
176  SETAXES(EtaSeen, "seen #eta", "");
177  SETAXES(PhiSeen, "seen #phi [rad]", "");
178  SETAXES(EtSeen, "seen E_{T} [GeV]", "");
179  SETAXES(EtvsEtaSeen, "seen #eta", "seen E_{T}");
180  SETAXES(EtvsPhiSeen, "seen #phi [rad]", "seen E_{T}");
181 
182  SETAXES(PhiRec, "#phi [rad]", "");
183  SETAXES(EtRec, "E_{T} [GeV]", "");
184  SETAXES(ExRec, "E_{X} [GeV]", "");
185  SETAXES(EyRec, "E_{Y} [GeV]", "");
186  SETAXES(EtRecvsEt, ET, "Rec E_{T} [GeV]");
187  SETAXES(EtRecOverTrueEtvsTrueEt, ET, "Rec E_{T} / E_{T} [GeV]");
188 
189  SETAXES(EtaGen, "generated #eta", "");
190  SETAXES(PhiGen, "generated #phi [rad]", "");
191  SETAXES(EtGen, "generated E_{T} [GeV]", "");
192  SETAXES(EtvsPhiGen, "generated #phi [rad]", "generated E_{T} [GeV]");
193  SETAXES(EtvsEtaGen, "generated #eta", "generated E_{T} [GeV]");
194 
195  SETAXES(NGen, "Number of Gen Objects", "");
196 
197  if (doMetPlots) {
198  SETAXES(SumEt, "SumEt [GeV]", "");
199  SETAXES(TrueSumEt, "TrueSumEt [GeV]", "");
200  SETAXES(DeltaSetvsSet, "TrueSumEt", "#DeltaSumEt [GeV]");
201  SETAXES(DeltaMexvsSet, "TrueSumEt", "#DeltaMEX [GeV]");
202  SETAXES(DeltaSetOverSetvsSet, "TrueSumEt", "#DeltaSumEt/trueSumEt");
203  SETAXES(RecSetvsTrueSet, "TrueSumEt", "SumEt");
204  SETAXES(RecSetOverTrueSetvsTrueSet, "TrueSumEt", "SumEt/trueSumEt");
205  SETAXES(TrueMexvsTrueSet, "TrueSumEt", "TrueMEX");
206  }
207 
208  TDirectory* oldpwd = gDirectory;
209 
210  TIter next(gROOT->GetListOfFiles());
211 
212  const bool debug = false;
213 
214  while (TFile* file = (TFile*)next()) {
215  if (debug)
216  cout << "file " << file->GetName() << endl;
217  }
218  if (DQM) {
219  cout << "DQM subdir" << endl;
220  cout << DQM->pwd().c_str() << endl;
221 
222  DQM->cd(DQM->pwd());
223  }
224 
225  if (debug) {
226  cout << "current dir" << endl;
227  gDirectory->pwd();
228  }
229 
230  oldpwd->cd();
231  //gDirectory->pwd();
232 
233  doMetPlots_ = doMetPlots;
234 
235  // tree_ = new BenchmarkTree("genericBenchmark", "Generic Benchmark TTree");
236 }
Definition: deltaR.h:58
#define BOOK1D(name, title, nbinsx, lowx, highx)
double maxEta
std::string pwd() override
Definition: DQMStore.h:644
#define ETA
#define BOOK2D(name, title, nbinsx, lowx, highx, nbinsy, lowy, highy)
#define M_PI
#define debug
Definition: HDRShower.cc:19
#define PHI
tuple cout
Definition: gather_cfg.py:144
#define ET
#define SETAXES(name, xtitle, ytitle)
void GenericBenchmark::write ( std::string  Filename)

Definition at line 342 of file GenericBenchmark.cc.

342  {
343  if (!Filename.empty() && file_)
344  file_->Write(Filename.c_str());
345 }

Member Data Documentation

PFBenchmarkAlgo* GenericBenchmark::algo_
protected

Definition at line 125 of file GenericBenchmark.h.

DQMStore* GenericBenchmark::dbe_
protected

Definition at line 124 of file GenericBenchmark.h.

bool GenericBenchmark::doMetPlots_
private

Definition at line 121 of file GenericBenchmark.h.

TFile* GenericBenchmark::file_
private

Definition at line 60 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hDeltaEt
private

Definition at line 62 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hDeltaEta
private

Definition at line 77 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hDeltaEtavsEt
private

Definition at line 78 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hDeltaEtavsEta
private

Definition at line 79 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hDeltaEtOverEtvsDeltaR
private

Definition at line 72 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hDeltaEtOverEtvsEt
private

Definition at line 66 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hDeltaEtOverEtvsEta
private

Definition at line 68 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hDeltaEtOverEtvsPhi
private

Definition at line 70 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hDeltaEtvsDeltaR
private

Definition at line 71 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hDeltaEtvsEt
private

Definition at line 65 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hDeltaEtvsEta
private

Definition at line 67 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hDeltaEtvsPhi
private

Definition at line 69 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hDeltaEx
private

Definition at line 63 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hDeltaEy
private

Definition at line 64 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hDeltaMexvsSet
private

Definition at line 113 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hDeltaPhi
private

Definition at line 81 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hDeltaPhivsEt
private

Definition at line 82 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hDeltaPhivsEta
private

Definition at line 83 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hDeltaR
private

Definition at line 85 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hDeltaRvsEt
private

Definition at line 86 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hDeltaRvsEta
private

Definition at line 87 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hDeltaSetOverSetvsSet
private

Definition at line 114 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hDeltaSetvsSet
private

Definition at line 112 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hEtaGen
private

Definition at line 92 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hEtaSeen
private

Definition at line 100 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hEtGen
private

Definition at line 91 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hEtRec
private

Definition at line 105 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hEtRecOverTrueEtvsTrueEt
private

Definition at line 75 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hEtRecvsEt
private

Definition at line 74 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hEtSeen
private

Definition at line 99 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hEtvsEtaGen
private

Definition at line 93 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hEtvsEtaSeen
private

Definition at line 102 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hEtvsPhiGen
private

Definition at line 94 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hEtvsPhiSeen
private

Definition at line 103 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hExRec
private

Definition at line 106 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hEyRec
private

Definition at line 107 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hNGen
private

Definition at line 97 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hNRec
private

Definition at line 89 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hPhiGen
private

Definition at line 95 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hPhiRec
private

Definition at line 108 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hPhiSeen
private

Definition at line 101 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hRecSetOverTrueSetvsTrueSet
private

Definition at line 116 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hRecSetvsTrueSet
private

Definition at line 115 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hSumEt
private

Definition at line 110 of file GenericBenchmark.h.

TH2F* GenericBenchmark::hTrueMexvsTrueSet
private

Definition at line 117 of file GenericBenchmark.h.

TH1F* GenericBenchmark::hTrueSumEt
private

Definition at line 111 of file GenericBenchmark.h.

BenchmarkTree* GenericBenchmark::tree_
private

Definition at line 119 of file GenericBenchmark.h.