4 #define BOOK1D(name, title, nbinsx, lowx, highx) \ 6 dbe_ ? dbe_->book1D(#name, title, nbinsx, lowx, highx)->getTH1F() : new TH1F(#name, title, nbinsx, lowx, highx) 9 #define BOOK2D(name, title, nbinsx, lowx, highx, nbinsy, lowy, highy) \ 10 h##name = dbe_ ? dbe_->book2D(#name, title, nbinsx, lowx, highx, nbinsy, lowy, highy)->getTH2F() \ 11 : new TH2F(#name, title, nbinsx, lowx, highx, nbinsy, lowy, highy) 15 #define SETAXES(name, xtitle, ytitle) \ 16 h##name->GetXaxis()->SetTitle(xtitle); \ 17 h##name->GetYaxis()->SetTitle(ytitle) 23 #define PT (plotAgainstReco_) ? "reconstructed P_{T}" : "generated P_{T}" 43 cout <<
"Benchmark output written to file " <<
outputFile_.c_str() << endl;
47 cout <<
"No output file specified (" <<
outputFile_ <<
"). Results will not be saved!" << endl;
59 cout <<
"Filename to write histograms " << Filename << endl;
60 cout <<
"PFMETBenchmark debug " <<
debug_ << endl;
62 cout <<
"benchmarkLabel " << benchmarkLabel_ << endl;
67 string path =
"PFTask/Benchmarks/" + benchmarkLabel_ +
"/";
78 cout <<
"Info: DQM is not available to provide data storage service. Using TFile to save histograms. " << endl;
82 BOOK1D(MEX,
"Particle Flow", 400, -200, 200);
83 BOOK1D(DeltaMEX,
"Particle Flow", 400, -200, 200);
84 BOOK1D(DeltaMET,
"Particle Flow", 400, -200, 200);
86 BOOK1D(DeltaSET,
"Particle Flow", 400, -200, 200);
87 BOOK2D(SETvsDeltaMET,
"Particle Flow", 200, 0.0, 1000.0, 400, -200.0, 200.0);
88 BOOK2D(SETvsDeltaSET,
"Particle Flow", 200, 0.0, 1000.0, 400, -200.0, 200.0);
89 profileSETvsSETresp =
new TProfile(
"#DeltaPFSET / trueSET vs trueSET",
"", 200, 0.0, 1000.0, -1.0, 1.0);
90 profileMETvsMETresp =
new TProfile(
"#DeltaPFMET / trueMET vs trueMET",
"", 50, 0.0, 200.0, -1.0, 1.0);
92 BOOK1D(CaloMEX,
"Calorimeter", 400, -200, 200);
93 BOOK1D(DeltaCaloMEX,
"Calorimeter", 400, -200, 200);
94 BOOK1D(DeltaCaloMET,
"Calorimeter", 400, -200, 200);
95 BOOK1D(DeltaCaloPhi,
"Calorimeter", 1000, -3.2, 3.2);
96 BOOK1D(DeltaCaloSET,
"Calorimeter", 400, -200, 200);
97 BOOK2D(CaloSETvsDeltaCaloMET,
"Calorimeter", 200, 0.0, 1000.0, 400, -200.0, 200.0);
98 BOOK2D(CaloSETvsDeltaCaloSET,
"Calorimeter", 200, 0.0, 1000.0, 400, -200.0, 200.0);
102 BOOK2D(DeltaPFMETvstrueMET,
"Particle Flow", 500, 0.0, 1000.0, 400, -200.0, 200.0);
103 BOOK2D(DeltaCaloMETvstrueMET,
"Calorimeter", 500, 0.0, 1000.0, 400, -200.0, 200.0);
104 BOOK2D(DeltaPFPhivstrueMET,
"Particle Flow", 500, 0.0, 1000.0, 400, -3.2, 3.2);
105 BOOK2D(DeltaCaloPhivstrueMET,
"Calorimeter", 500, 0.0, 1000.0, 400, -3.2, 3.2);
106 BOOK2D(CaloMETvstrueMET,
"Calorimeter", 500, 0.0, 1000.0, 500, 0.0, 1000.0);
107 BOOK2D(PFMETvstrueMET,
"Particle Flow", 500, 0.0, 1000.0, 500, 0.0, 1000.0);
109 BOOK2D(DeltaCaloMEXvstrueSET,
"Calorimeter", 200, 0.0, 1000.0, 400, -200.0, 200.0);
110 BOOK2D(DeltaPFMEXvstrueSET,
"Particle Flow", 200, 0.0, 1000.0, 400, -200.0, 200.0);
116 BOOK1D(TCMEX,
"Track Corrected", 400, -200, 200);
117 BOOK1D(DeltaTCMEX,
"Track Corrected", 400, -200, 200);
118 BOOK1D(DeltaTCMET,
"Track Corrected", 400, -200, 200);
119 BOOK1D(DeltaTCPhi,
"Track Corrected", 1000, -3.2, 3.2);
120 BOOK1D(DeltaTCSET,
"Track Corrected", 400, -200, 200);
121 BOOK2D(TCSETvsDeltaTCMET,
"Track Corrected", 200, 0.0, 1000.0, 400, -200.0, 200.0);
122 BOOK2D(TCSETvsDeltaTCSET,
"Track Corrected", 200, 0.0, 1000.0, 400, -200.0, 200.0);
126 BOOK1D(TCMET,
"Track Corrected", 500, 0, 1000);
127 BOOK2D(DeltaTCMETvstrueMET,
"Track Corrected", 500, 0.0, 1000.0, 400, -200.0, 200.0);
128 BOOK2D(DeltaTCPhivstrueMET,
"Track Corrected", 500, 0.0, 1000.0, 400, -3.2, 3.2);
130 BOOK2D(DeltaTCMEXvstrueSET,
"Track Corrected", 200, 0.0, 1000.0, 400, -200.0, 200.0);
131 BOOK2D(TCMETvstrueMET,
"Track Corrected", 200, 0.0, 1000.0, 500, 0.0, 1000.0);
143 SETAXES(DeltaMEX,
"#DeltaMEX",
"Events");
144 SETAXES(DeltaMET,
"#DeltaMET",
"Events");
146 SETAXES(DeltaSET,
"#DeltaSET",
"Events");
147 SETAXES(SETvsDeltaMET,
"SET",
"#DeltaMET");
148 SETAXES(SETvsDeltaSET,
"SET",
"#DeltaSET");
150 SETAXES(DeltaPFMETvstrueMET,
"trueMET",
"#DeltaMET");
151 SETAXES(DeltaCaloMETvstrueMET,
"trueMET",
"#DeltaCaloMET");
152 SETAXES(DeltaPFPhivstrueMET,
"trueMET",
"#DeltaPFPhi");
153 SETAXES(DeltaCaloPhivstrueMET,
"trueMET",
"#DeltaCaloPhi");
154 SETAXES(CaloMETvstrueMET,
"trueMET",
"CaloMET");
155 SETAXES(PFMETvstrueMET,
"trueMET",
"PFMET");
156 SETAXES(DeltaCaloMEXvstrueSET,
"trueSET",
"#DeltaCaloMEX");
157 SETAXES(DeltaPFMEXvstrueSET,
"trueSET",
"#DeltaPFMEX");
161 SETAXES(TCMET,
"TCMET",
"Events");
163 SETAXES(CaloMEX,
"MEX",
"Events");
164 SETAXES(DeltaCaloMEX,
"#DeltaMEX",
"Events");
165 SETAXES(DeltaCaloMET,
"#DeltaMET",
"Events");
166 SETAXES(DeltaCaloPhi,
"#Delta#phi",
"Events");
167 SETAXES(DeltaCaloSET,
"#DeltaSET",
"Events");
168 SETAXES(CaloSETvsDeltaCaloMET,
"SET",
"#DeltaMET");
169 SETAXES(CaloSETvsDeltaCaloSET,
"SET",
"#DeltaSET");
171 SETAXES(TCMEX,
"MEX",
"Events");
172 SETAXES(DeltaTCMEX,
"#DeltaMEX",
"Events");
173 SETAXES(DeltaTCMET,
"#DeltaMET",
"Events");
174 SETAXES(DeltaTCPhi,
"#Delta#phi",
"Events");
175 SETAXES(DeltaTCSET,
"#DeltaSET",
"Events");
176 SETAXES(TCSETvsDeltaTCMET,
"SET",
"#DeltaMET");
177 SETAXES(TCSETvsDeltaTCSET,
"SET",
"#DeltaSET");
179 SETAXES(DeltaTCMETvstrueMET,
"trueMET",
"#DeltaTCMET");
180 SETAXES(DeltaTCPhivstrueMET,
"trueMET",
"#DeltaTCPhi");
182 SETAXES(DeltaTCMEXvstrueSET,
"trueSET",
"#DeltaTCMEX");
183 SETAXES(TCMETvstrueMET,
"trueMET",
"TCMET");
284 double trueMEY = 0.0;
285 double trueMEX = 0.0;
291 for (
unsigned i = 0;
i < genParticleList.size();
i++) {
292 if (genParticleList[
i].
status() == 1 && fabs(genParticleList[
i].
eta()) < 5.0) {
296 trueMEX += genParticleList[
i].px();
297 trueMEY += genParticleList[
i].py();
335 const std::vector<reco::CaloJet>&
caloJets,
336 const std::vector<reco::CaloJet>& corr_caloJets) {
341 double trueMEY = 0.0;
342 double trueMEX = 0.0;
348 for (
unsigned i = 0;
i < genParticleList.size();
i++) {
349 if (genParticleList[
i].
status() == 1 && fabs(genParticleList[
i].
eta()) < 5.0) {
353 trueMEX += genParticleList[
i].px();
354 trueMEY += genParticleList[
i].py();
371 double caloJetCorPX = 0.0;
372 double caloJetCorPY = 0.0;
374 for (
unsigned int caloJetc = 0; caloJetc < caloJets.size(); ++caloJetc) {
379 for (
unsigned int corr_caloJetc = 0; corr_caloJetc < corr_caloJets.size(); ++corr_caloJetc) {
384 Float_t
DeltaPhi = corr_caloJets[corr_caloJetc].phi() - caloJets[caloJetc].phi();
385 Float_t
DeltaEta = corr_caloJets[corr_caloJetc].eta() - caloJets[caloJetc].eta();
386 Float_t DeltaR2 = DeltaPhi * DeltaPhi + DeltaEta *
DeltaEta;
387 if (DeltaR2 < 0.0001 && caloJets[caloJetc].
pt() > 20.0) {
388 caloJetCorPX += (corr_caloJets[corr_caloJetc].px() - caloJets[caloJetc].px());
389 caloJetCorPY += (corr_caloJets[corr_caloJetc].py() - caloJets[caloJetc].py());
393 double corr_calomet =
394 sqrt((cm.
px() - caloJetCorPX) * (cm.
px() - caloJetCorPX) + (cm.
py() - caloJetCorPY) * (cm.
py() - caloJetCorPY));
398 calo_phi = atan2((cm.
py() - caloJetCorPY), (cm.
px() - caloJetCorPX));
620 const double pi = 3.14159265358979323;
621 const double pi2 = pi * 2.;
TProfile * profileTCSETvsTCSETresp
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
TProfile * profileTCMETvsTCMETresp
TH2F * hCaloSETvsDeltaCaloSET
TH2F * hDeltaPFPhivstrueMET
TH2F * hDeltaTCPhivstrueMET
TH2F * hDeltaTCMETvstrueMET
TProfile * profileMETvsMETresp
#define BOOK2D(name, title, nbinsx, lowx, highx, nbinsy, lowy, highy)
TH2F * hDeltaCaloMETvstrueMET
virtual ~PFMETBenchmark()
#define BOOK1D(name, title, nbinsx, lowx, highx)
void calculateQuantities(const reco::PFMETCollection &, const reco::GenParticleCollection &, const reco::CaloMETCollection &, const reco::METCollection &)
TH2F * hDeltaCaloPhivstrueMET
#define SETAXES(name, xtitle, ytitle)
double px() const final
x coordinate of momentum vector
TProfile * profileSETvsSETresp
double pt() const final
transverse momentum
void setup(std::string Filename, bool debug, bool plotAgainstReco=false, std::string benchmarkLabel_="ParticleFlow", DQMStore *dbe_store=0)
TH2F * hCaloSETvsDeltaCaloMET
std::vector< reco::MET > METCollection
collection of MET objects
double mpi_pi(double angle)
void process(const reco::PFMETCollection &, const reco::GenParticleCollection &, const reco::CaloMETCollection &, const reco::METCollection &)
TH2F * hDeltaPFMETvstrueMET
Abs< T >::type abs(const T &t)
TH2F * hDeltaTCMEXvstrueSET
TH2F * hDeltaCaloMEXvstrueSET
TH2F * hDeltaPFMEXvstrueSET
TProfile * profileCaloSETvsCaloSETresp
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
double py() const final
y coordinate of momentum vector
void setCurrentFolder(std::string const &fullpath)
std::vector< reco::PFMET > PFMETCollection
collection of PFMET objects
TH2F * hTCSETvsDeltaTCSET
TProfile * profileCaloMETvsCaloMETresp
TH2F * hTCSETvsDeltaTCMET
double phi() const final
momentum azimuthal angle
void save(std::string const &filename, std::string const &path="", std::string const &pattern="", std::string const &rewrite="", uint32_t run=0, uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, std::string const &fileupdate="RECREATE")
T angle(T x1, T y1, T z1, T x2, T y2, T z2)