CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
HParticle Class Reference

#include <Histograms.h>

Inherits Histograms.

Public Member Functions

void Clear () override
 
void Fill (const reco::Particle::LorentzVector &p4, const int charge, const double &weight=1.) override
 
void Fill (const CLHEP::HepLorentzVector &momentum, const int charge, const double &weight=1.) override
 
void Fill (unsigned int number) override
 
 HParticle (const TString &name, const double &minMass=0., const double &maxMass=200., const double &maxPt=100.)
 
 HParticle (TFile *outputFile, const TString &name, const double &minMass=0., const double &maxMass=200., const double &maxPt=100.)
 Constructor that puts the histograms inside a TDirectory. More...
 
 HParticle (const TString &name, TFile *file)
 
void Write () override
 
 ~HParticle () override
 

Protected Attributes

TProfile * hCurvVsEtaNeg_
 
TProfile * hCurvVsEtaPos_
 
TProfile * hCurvVsPhiNeg_
 
TProfile * hCurvVsPhiPos_
 
TH1F * hEta_
 
TH1F * hMass_
 
TH1F * hNumber_
 
TH1F * hPhi_
 
TH1F * hPt_
 
TH2F * hPtVsEta_
 
TProfile * hPtVsPhiNeg_
 
TProfile * hPtVsPhiPos_
 

Detailed Description

Definition at line 244 of file Histograms.h.

Constructor & Destructor Documentation

◆ HParticle() [1/3]

HParticle::HParticle ( const TString &  name,
const double &  minMass = 0.,
const double &  maxMass = 200.,
const double &  maxPt = 100. 
)
inline

Definition at line 246 of file Histograms.h.

247  : Histograms(name),
248  // Kinematical variables
249  hPt_(new TH1F(name + "_Pt", "transverse momentum", 100, 0, maxPt)),
250  hPtVsEta_(new TH2F(name + "_PtVsEta", "transverse momentum vs #eta", 100, 0, maxPt, 100, -3.0, 3.0)),
251 
252  hCurvVsEtaNeg_(new TProfile(name + "_CurvVsEtaNeg", "q/pT vs #eta neg.", 64, -3.2, 3.2, -1., 0.)),
253  hCurvVsEtaPos_(new TProfile(name + "_CurvVsEtaPos", "q/pT vs #eta pos.", 64, -3.2, 3.2, 0., 1.)),
254  hCurvVsPhiNeg_(new TProfile(name + "_CurvVsPhiNeg", "q/pT vs #phi neg.", 32, -3.2, 3.2, -1., 0.)),
255  hCurvVsPhiPos_(new TProfile(name + "_CurvVsPhiPos", "q/pT vs #phi pos.", 32, -3.2, 3.2, 0., 1.)),
256 
257  hPtVsPhiNeg_(new TProfile(name + "_PtVsPhiNeg", "pT vs #phi neg.", 32, -3.2, 3.2, 0., 100)),
258  hPtVsPhiPos_(new TProfile(name + "_PtVsPhiPos", "pT vs #phi pos.", 32, -3.2, 3.2, 0., 100)),
259 
260  hEta_(new TH1F(name + "_Eta", "pseudorapidity", 64, -3.2, 3.2)),
261  hPhi_(new TH1F(name + "_Phi", "phi angle", 64, -3.2, 3.2)),
262  hMass_(new TH1F(name + "_Mass", "mass", 10000, minMass, maxMass)),
263  hNumber_(new TH1F(name + "_Number", "number", 20, -0.5, 19.5)) {}
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:412
TH1F * hPt_
Definition: Histograms.h:404
TH2F * hPtVsEta_
Definition: Histograms.h:405
TH1F * hPhi_
Definition: Histograms.h:416
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:408
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:407
TProfile * hPtVsPhiPos_
Definition: Histograms.h:413
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:410
TH1F * hNumber_
Definition: Histograms.h:419
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:409
maxPt
Definition: PV_cfg.py:224
TH1F * hMass_
Definition: Histograms.h:417
TH1F * hEta_
Definition: Histograms.h:415

◆ HParticle() [2/3]

HParticle::HParticle ( TFile *  outputFile,
const TString &  name,
const double &  minMass = 0.,
const double &  maxMass = 200.,
const double &  maxPt = 100. 
)
inline

Constructor that puts the histograms inside a TDirectory.

Definition at line 266 of file Histograms.h.

References hCurvVsEtaNeg_, hCurvVsEtaPos_, hCurvVsPhiNeg_, hCurvVsPhiPos_, hEta_, hMass_, hNumber_, hPhi_, hPt_, hPtVsEta_, hPtVsPhiNeg_, hPtVsPhiPos_, B2GTnPMonitor_cfi::maxMass, PV_cfg::maxPt, B2GTnPMonitor_cfi::minMass, and Skims_PA_cff::name.

271  : Histograms(outputFile, name) {
272  // Kinematical variables
273  hPt_ = new TH1F(name + "_Pt", "transverse momentum", 100, 0, maxPt);
274  hPtVsEta_ = new TH2F(name + "_PtVsEta", "transverse momentum vs #eta", 100, 0, maxPt, 100, -3.0, 3.0);
275 
276  hPtVsEta_ = new TH2F(name + "_PtVsEta", "transverse momentum vs #eta", 100, 0, maxPt, 100, -3.0, 3.0);
277 
278  hCurvVsEtaNeg_ = new TProfile(name + "_CurvVsEtaNeg", "q/pT vs #eta neg.", 100, -3.0, 3.0, -1., 0.);
279  hCurvVsEtaPos_ = new TProfile(name + "_CurvVsEtaPos", "q/pT vs #eta pos.", 100, -3.0, 3.0, 0., 1.);
280  hCurvVsPhiNeg_ = new TProfile(name + "_CurvVsPhiNeg", "q/pT vs #phi neg.", 32, -3.2, 3.2, -1., 0.);
281  hCurvVsPhiPos_ = new TProfile(name + "_CurvVsPhiPos", "q/pT vs #phi pos.", 32, -3.2, 3.2, 0., 1.);
282 
283  hPtVsPhiNeg_ = new TProfile(name + "_PtVsPhiNeg", "pT vs #phi neg.", 32, -3.2, 3.2, 0., 100);
284  hPtVsPhiPos_ = new TProfile(name + "_PtVsPhiPos", "pT vs #phi pos.", 32, -3.2, 3.2, 0., 100);
285 
286  //hPtVSPhi_prof_ = new TProfile (name+"_PtVSPhi_prof", "pt vs phi angle",12, -3.2, 3.2, 0, 200);
287 
288  hEta_ = new TH1F(name + "_Eta", "pseudorapidity", 64, -3.2, 3.2);
289  hPhi_ = new TH1F(name + "_Phi", "phi angle", 64, -3.2, 3.2);
290  hMass_ = new TH1F(name + "_Mass", "mass", 40000, minMass, maxMass);
291  hNumber_ = new TH1F(name + "_Number", "number", 20, -0.5, 19.5);
292  }
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:412
TH1F * hPt_
Definition: Histograms.h:404
TH2F * hPtVsEta_
Definition: Histograms.h:405
TH1F * hPhi_
Definition: Histograms.h:416
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:408
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:407
TProfile * hPtVsPhiPos_
Definition: Histograms.h:413
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:410
TH1F * hNumber_
Definition: Histograms.h:419
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:409
maxPt
Definition: PV_cfg.py:224
TH1F * hMass_
Definition: Histograms.h:417
TH1F * hEta_
Definition: Histograms.h:415

◆ HParticle() [3/3]

HParticle::HParticle ( const TString &  name,
TFile *  file 
)
inline

Definition at line 294 of file Histograms.h.

295  : Histograms(name),
296  hPt_((TH1F*)file->Get(name_ + "_Pt")),
297  hPtVsEta_((TH2F*)file->Get(name_ + "_PtVsEta")),
298 
299  hCurvVsEtaNeg_((TProfile*)file->Get(name_ + "_CurvVsEtaNeg")),
300  hCurvVsEtaPos_((TProfile*)file->Get(name_ + "_CurvVsEtaPos")),
301  hCurvVsPhiNeg_((TProfile*)file->Get(name_ + "_CurvVsPhiNeg")),
302  hCurvVsPhiPos_((TProfile*)file->Get(name_ + "_CurvVsPhiPos")),
303 
304  hPtVsPhiNeg_((TProfile*)file->Get(name_ + "_PtVsPhiNeg")),
305  hPtVsPhiPos_((TProfile*)file->Get(name_ + "_PtVsPhiPos")),
306 
307  hEta_((TH1F*)file->Get(name_ + "_Eta")),
308  hPhi_((TH1F*)file->Get(name_ + "_Phi")),
309  hMass_((TH1F*)file->Get(name_ + "_Mass")),
310  //hMass_fine_ = (TH1F *) file->Get(name_+"_Mass_fine");
311  hNumber_((TH1F*)file->Get(name_ + "_Number")) {}
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:412
TH1F * hPt_
Definition: Histograms.h:404
TH2F * hPtVsEta_
Definition: Histograms.h:405
TH1F * hPhi_
Definition: Histograms.h:416
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:408
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:407
TProfile * hPtVsPhiPos_
Definition: Histograms.h:413
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:410
TH1F * hNumber_
Definition: Histograms.h:419
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:409
TH1F * hMass_
Definition: Histograms.h:417
TH1F * hEta_
Definition: Histograms.h:415

◆ ~HParticle()

HParticle::~HParticle ( )
inlineoverride

Definition at line 313 of file Histograms.h.

References hCurvVsEtaNeg_, hCurvVsEtaPos_, hCurvVsPhiNeg_, hCurvVsPhiPos_, hEta_, hMass_, hNumber_, hPhi_, hPt_, hPtVsEta_, hPtVsPhiNeg_, and hPtVsPhiPos_.

313  {
314  delete hPt_;
315  delete hPtVsEta_;
316 
317  delete hCurvVsEtaNeg_;
318  delete hCurvVsEtaPos_;
319  delete hCurvVsPhiNeg_;
320  delete hCurvVsPhiPos_;
321 
322  delete hPtVsPhiNeg_;
323  delete hPtVsPhiPos_;
324 
325  delete hEta_;
326  delete hPhi_;
327  delete hMass_;
328  // delete hMass_fine_;
329  delete hNumber_;
330  }
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:412
TH1F * hPt_
Definition: Histograms.h:404
TH2F * hPtVsEta_
Definition: Histograms.h:405
TH1F * hPhi_
Definition: Histograms.h:416
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:408
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:407
TProfile * hPtVsPhiPos_
Definition: Histograms.h:413
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:410
TH1F * hNumber_
Definition: Histograms.h:419
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:409
TH1F * hMass_
Definition: Histograms.h:417
TH1F * hEta_
Definition: Histograms.h:415

Member Function Documentation

◆ Clear()

void HParticle::Clear ( )
inlineoverride

Definition at line 384 of file Histograms.h.

References hCurvVsEtaNeg_, hCurvVsEtaPos_, hCurvVsPhiNeg_, hCurvVsPhiPos_, hEta_, hMass_, hNumber_, hPhi_, hPt_, hPtVsEta_, hPtVsPhiNeg_, and hPtVsPhiPos_.

384  {
385  hPt_->Clear();
386  hPtVsEta_->Clear();
387 
388  hCurvVsEtaNeg_->Clear();
389  hCurvVsEtaPos_->Clear();
390  hCurvVsPhiNeg_->Clear();
391  hCurvVsPhiPos_->Clear();
392 
393  hPtVsPhiNeg_->Clear();
394  hPtVsPhiPos_->Clear();
395 
396  hEta_->Clear();
397  hPhi_->Clear();
398  hMass_->Clear();
399  //hMass_fine_->Clear();
400  hNumber_->Clear();
401  }
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:412
TH1F * hPt_
Definition: Histograms.h:404
TH2F * hPtVsEta_
Definition: Histograms.h:405
TH1F * hPhi_
Definition: Histograms.h:416
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:408
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:407
TProfile * hPtVsPhiPos_
Definition: Histograms.h:413
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:410
TH1F * hNumber_
Definition: Histograms.h:419
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:409
TH1F * hMass_
Definition: Histograms.h:417
TH1F * hEta_
Definition: Histograms.h:415

◆ Fill() [1/3]

void HParticle::Fill ( const reco::Particle::LorentzVector p4,
const int  charge,
const double &  weight = 1. 
)
inlineoverride

Definition at line 332 of file Histograms.h.

References ALCARECOTkAlJpsiMuMu_cff::charge.

332  {
333  Fill(CLHEP::HepLorentzVector(p4.x(), p4.y(), p4.z(), p4.t()), charge, weight);
334  }
void Fill(const reco::Particle::LorentzVector &p4, const int charge, const double &weight=1.) override
Definition: Histograms.h:332
Definition: weight.py:1

◆ Fill() [2/3]

void HParticle::Fill ( const CLHEP::HepLorentzVector &  momentum,
const int  charge,
const double &  weight = 1. 
)
inlineoverride

Definition at line 336 of file Histograms.h.

References ALCARECOTkAlJpsiMuMu_cff::charge, hCurvVsEtaNeg_, hCurvVsEtaPos_, hCurvVsPhiNeg_, hCurvVsPhiPos_, hEta_, hMass_, hPhi_, hPt_, hPtVsEta_, hPtVsPhiNeg_, hPtVsPhiPos_, and mps_merge::weight.

336  {
337  hPt_->Fill(momentum.perp(), weight);
338  hPtVsEta_->Fill(momentum.perp(), momentum.eta(), weight);
339 
340  // std::cout<< "charge-> " <<charge<<std::endl;
341  if (charge < 0)
342  hCurvVsEtaNeg_->Fill(momentum.eta(), charge / (momentum.perp()), weight);
343  if (charge > 0)
344  hCurvVsEtaPos_->Fill(momentum.eta(), charge / (momentum.perp()), weight);
345  if (charge < 0)
346  hCurvVsPhiNeg_->Fill(momentum.phi(), charge / (momentum.perp()), weight);
347  if (charge > 0)
348  hCurvVsPhiPos_->Fill(momentum.phi(), charge / (momentum.perp()), weight);
349 
350  if (charge < 0)
351  hPtVsPhiNeg_->Fill(momentum.phi(), momentum.perp(), weight);
352  if (charge > 0)
353  hPtVsPhiPos_->Fill(momentum.phi(), momentum.perp(), weight);
354 
355  hEta_->Fill(momentum.eta(), weight);
356  hPhi_->Fill(momentum.phi(), weight);
357  hMass_->Fill(momentum.m(), weight);
358  //hMass_fine_->Fill(momentum.m(), weight);
359  }
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:412
Definition: weight.py:1
TH1F * hPt_
Definition: Histograms.h:404
TH2F * hPtVsEta_
Definition: Histograms.h:405
TH1F * hPhi_
Definition: Histograms.h:416
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:408
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:407
TProfile * hPtVsPhiPos_
Definition: Histograms.h:413
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:410
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:409
TH1F * hMass_
Definition: Histograms.h:417
TH1F * hEta_
Definition: Histograms.h:415

◆ Fill() [3/3]

void HParticle::Fill ( unsigned int  number)
inlineoverride

Definition at line 361 of file Histograms.h.

References hNumber_, and contentValuesFiles::number.

361 { hNumber_->Fill(number); }
TH1F * hNumber_
Definition: Histograms.h:419

◆ Write()

void HParticle::Write ( )
inlineoverride

Definition at line 363 of file Histograms.h.

References hCurvVsEtaNeg_, hCurvVsEtaPos_, hCurvVsPhiNeg_, hCurvVsPhiPos_, hEta_, hMass_, hNumber_, hPhi_, hPt_, hPtVsEta_, hPtVsPhiNeg_, and hPtVsPhiPos_.

363  {
364  if (histoDir_ != nullptr)
365  histoDir_->cd();
366  hPt_->Write();
367  hPtVsEta_->Write();
368 
369  hCurvVsEtaNeg_->Write();
370  hCurvVsEtaPos_->Write();
371  hCurvVsPhiNeg_->Write();
372  hCurvVsPhiPos_->Write();
373 
374  hPtVsPhiNeg_->Write();
375  hPtVsPhiPos_->Write();
376 
377  hEta_->Write();
378  hPhi_->Write();
379  hMass_->Write();
380  //hMass_fine_->Write();
381  hNumber_->Write();
382  }
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:412
TH1F * hPt_
Definition: Histograms.h:404
TH2F * hPtVsEta_
Definition: Histograms.h:405
TH1F * hPhi_
Definition: Histograms.h:416
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:408
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:407
TProfile * hPtVsPhiPos_
Definition: Histograms.h:413
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:410
TH1F * hNumber_
Definition: Histograms.h:419
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:409
TH1F * hMass_
Definition: Histograms.h:417
TH1F * hEta_
Definition: Histograms.h:415

Member Data Documentation

◆ hCurvVsEtaNeg_

TProfile* HParticle::hCurvVsEtaNeg_
protected

Definition at line 407 of file Histograms.h.

Referenced by Clear(), Fill(), HParticle(), Write(), and ~HParticle().

◆ hCurvVsEtaPos_

TProfile* HParticle::hCurvVsEtaPos_
protected

Definition at line 408 of file Histograms.h.

Referenced by Clear(), Fill(), HParticle(), Write(), and ~HParticle().

◆ hCurvVsPhiNeg_

TProfile* HParticle::hCurvVsPhiNeg_
protected

Definition at line 409 of file Histograms.h.

Referenced by Clear(), Fill(), HParticle(), Write(), and ~HParticle().

◆ hCurvVsPhiPos_

TProfile* HParticle::hCurvVsPhiPos_
protected

Definition at line 410 of file Histograms.h.

Referenced by Clear(), Fill(), HParticle(), Write(), and ~HParticle().

◆ hEta_

TH1F* HParticle::hEta_
protected

Definition at line 415 of file Histograms.h.

Referenced by Clear(), Fill(), HParticle(), Write(), and ~HParticle().

◆ hMass_

TH1F* HParticle::hMass_
protected

Definition at line 417 of file Histograms.h.

Referenced by Clear(), Fill(), HParticle(), Write(), and ~HParticle().

◆ hNumber_

TH1F* HParticle::hNumber_
protected

Definition at line 419 of file Histograms.h.

Referenced by Clear(), Fill(), HParticle(), Write(), and ~HParticle().

◆ hPhi_

TH1F* HParticle::hPhi_
protected

Definition at line 416 of file Histograms.h.

Referenced by Clear(), Fill(), HParticle(), Write(), and ~HParticle().

◆ hPt_

TH1F* HParticle::hPt_
protected

Definition at line 404 of file Histograms.h.

Referenced by Clear(), Fill(), HParticle(), Write(), and ~HParticle().

◆ hPtVsEta_

TH2F* HParticle::hPtVsEta_
protected

Definition at line 405 of file Histograms.h.

Referenced by Clear(), Fill(), HParticle(), Write(), and ~HParticle().

◆ hPtVsPhiNeg_

TProfile* HParticle::hPtVsPhiNeg_
protected

Definition at line 412 of file Histograms.h.

Referenced by Clear(), Fill(), HParticle(), Write(), and ~HParticle().

◆ hPtVsPhiPos_

TProfile* HParticle::hPtVsPhiPos_
protected

Definition at line 413 of file Histograms.h.

Referenced by Clear(), Fill(), HParticle(), Write(), and ~HParticle().