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 CLHEP::HepLorentzVector &momentum, const int charge, const double &weight=1.) override
 
void Fill (const reco::Particle::LorentzVector &p4, 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 (const TString &name, TFile *file)
 
 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...
 
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 242 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 244 of file Histograms.h.

245  : Histograms(name),
246  // Kinematical variables
247  hPt_(new TH1F(name + "_Pt", "transverse momentum", 100, 0, maxPt)),
248  hPtVsEta_(new TH2F(name + "_PtVsEta", "transverse momentum vs #eta", 100, 0, maxPt, 100, -3.0, 3.0)),
249 
250  hCurvVsEtaNeg_(new TProfile(name + "_CurvVsEtaNeg", "q/pT vs #eta neg.", 64, -3.2, 3.2, -1., 0.)),
251  hCurvVsEtaPos_(new TProfile(name + "_CurvVsEtaPos", "q/pT vs #eta pos.", 64, -3.2, 3.2, 0., 1.)),
252  hCurvVsPhiNeg_(new TProfile(name + "_CurvVsPhiNeg", "q/pT vs #phi neg.", 32, -3.2, 3.2, -1., 0.)),
253  hCurvVsPhiPos_(new TProfile(name + "_CurvVsPhiPos", "q/pT vs #phi pos.", 32, -3.2, 3.2, 0., 1.)),
254 
255  hPtVsPhiNeg_(new TProfile(name + "_PtVsPhiNeg", "pT vs #phi neg.", 32, -3.2, 3.2, 0., 100)),
256  hPtVsPhiPos_(new TProfile(name + "_PtVsPhiPos", "pT vs #phi pos.", 32, -3.2, 3.2, 0., 100)),
257 
258  hEta_(new TH1F(name + "_Eta", "pseudorapidity", 64, -3.2, 3.2)),
259  hPhi_(new TH1F(name + "_Phi", "phi angle", 64, -3.2, 3.2)),
260  hMass_(new TH1F(name + "_Mass", "mass", 10000, minMass, maxMass)),
261  hNumber_(new TH1F(name + "_Number", "number", 20, -0.5, 19.5)) {}

◆ 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 264 of file Histograms.h.

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

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

◆ HParticle() [3/3]

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

Definition at line 292 of file Histograms.h.

293  : Histograms(name),
294  hPt_((TH1F*)file->Get(name_ + "_Pt")),
295  hPtVsEta_((TH2F*)file->Get(name_ + "_PtVsEta")),
296 
297  hCurvVsEtaNeg_((TProfile*)file->Get(name_ + "_CurvVsEtaNeg")),
298  hCurvVsEtaPos_((TProfile*)file->Get(name_ + "_CurvVsEtaPos")),
299  hCurvVsPhiNeg_((TProfile*)file->Get(name_ + "_CurvVsPhiNeg")),
300  hCurvVsPhiPos_((TProfile*)file->Get(name_ + "_CurvVsPhiPos")),
301 
302  hPtVsPhiNeg_((TProfile*)file->Get(name_ + "_PtVsPhiNeg")),
303  hPtVsPhiPos_((TProfile*)file->Get(name_ + "_PtVsPhiPos")),
304 
305  hEta_((TH1F*)file->Get(name_ + "_Eta")),
306  hPhi_((TH1F*)file->Get(name_ + "_Phi")),
307  hMass_((TH1F*)file->Get(name_ + "_Mass")),
308  //hMass_fine_ = (TH1F *) file->Get(name_+"_Mass_fine");
309  hNumber_((TH1F*)file->Get(name_ + "_Number")) {}

◆ ~HParticle()

HParticle::~HParticle ( )
inlineoverride

Definition at line 311 of file Histograms.h.

311  {
312  delete hPt_;
313  delete hPtVsEta_;
314 
315  delete hCurvVsEtaNeg_;
316  delete hCurvVsEtaPos_;
317  delete hCurvVsPhiNeg_;
318  delete hCurvVsPhiPos_;
319 
320  delete hPtVsPhiNeg_;
321  delete hPtVsPhiPos_;
322 
323  delete hEta_;
324  delete hPhi_;
325  delete hMass_;
326  // delete hMass_fine_;
327  delete hNumber_;
328  }

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

Member Function Documentation

◆ Clear()

void HParticle::Clear ( )
inlineoverride

Definition at line 382 of file Histograms.h.

382  {
383  hPt_->Clear();
384  hPtVsEta_->Clear();
385 
386  hCurvVsEtaNeg_->Clear();
387  hCurvVsEtaPos_->Clear();
388  hCurvVsPhiNeg_->Clear();
389  hCurvVsPhiPos_->Clear();
390 
391  hPtVsPhiNeg_->Clear();
392  hPtVsPhiPos_->Clear();
393 
394  hEta_->Clear();
395  hPhi_->Clear();
396  hMass_->Clear();
397  //hMass_fine_->Clear();
398  hNumber_->Clear();
399  }

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

◆ Fill() [1/3]

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

Definition at line 334 of file Histograms.h.

334  {
335  hPt_->Fill(momentum.perp(), weight);
336  hPtVsEta_->Fill(momentum.perp(), momentum.eta(), weight);
337 
338  // std::cout<< "charge-> " <<charge<<std::endl;
339  if (charge < 0)
340  hCurvVsEtaNeg_->Fill(momentum.eta(), charge / (momentum.perp()), weight);
341  if (charge > 0)
342  hCurvVsEtaPos_->Fill(momentum.eta(), charge / (momentum.perp()), weight);
343  if (charge < 0)
344  hCurvVsPhiNeg_->Fill(momentum.phi(), charge / (momentum.perp()), weight);
345  if (charge > 0)
346  hCurvVsPhiPos_->Fill(momentum.phi(), charge / (momentum.perp()), weight);
347 
348  if (charge < 0)
349  hPtVsPhiNeg_->Fill(momentum.phi(), momentum.perp(), weight);
350  if (charge > 0)
351  hPtVsPhiPos_->Fill(momentum.phi(), momentum.perp(), weight);
352 
353  hEta_->Fill(momentum.eta(), weight);
354  hPhi_->Fill(momentum.phi(), weight);
355  hMass_->Fill(momentum.m(), weight);
356  //hMass_fine_->Fill(momentum.m(), weight);
357  }

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

◆ Fill() [2/3]

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

Definition at line 330 of file Histograms.h.

330  {
331  Fill(CLHEP::HepLorentzVector(p4.x(), p4.y(), p4.z(), p4.t()), charge, weight);
332  }

References ALCARECOTkAlJpsiMuMu_cff::charge, and p4.

◆ Fill() [3/3]

void HParticle::Fill ( unsigned int  number)
inlineoverride

Definition at line 359 of file Histograms.h.

359 { hNumber_->Fill(number); }

References hNumber_, and contentValuesFiles::number.

◆ Write()

void HParticle::Write ( )
inlineoverride

Definition at line 361 of file Histograms.h.

361  {
362  if (histoDir_ != nullptr)
363  histoDir_->cd();
364  hPt_->Write();
365  hPtVsEta_->Write();
366 
367  hCurvVsEtaNeg_->Write();
368  hCurvVsEtaPos_->Write();
369  hCurvVsPhiNeg_->Write();
370  hCurvVsPhiPos_->Write();
371 
372  hPtVsPhiNeg_->Write();
373  hPtVsPhiPos_->Write();
374 
375  hEta_->Write();
376  hPhi_->Write();
377  hMass_->Write();
378  //hMass_fine_->Write();
379  hNumber_->Write();
380  }

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

Member Data Documentation

◆ hCurvVsEtaNeg_

TProfile* HParticle::hCurvVsEtaNeg_
protected

Definition at line 405 of file Histograms.h.

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

◆ hCurvVsEtaPos_

TProfile* HParticle::hCurvVsEtaPos_
protected

Definition at line 406 of file Histograms.h.

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

◆ hCurvVsPhiNeg_

TProfile* HParticle::hCurvVsPhiNeg_
protected

Definition at line 407 of file Histograms.h.

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

◆ hCurvVsPhiPos_

TProfile* HParticle::hCurvVsPhiPos_
protected

Definition at line 408 of file Histograms.h.

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

◆ hEta_

TH1F* HParticle::hEta_
protected

Definition at line 413 of file Histograms.h.

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

◆ hMass_

TH1F* HParticle::hMass_
protected

Definition at line 415 of file Histograms.h.

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

◆ hNumber_

TH1F* HParticle::hNumber_
protected

Definition at line 417 of file Histograms.h.

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

◆ hPhi_

TH1F* HParticle::hPhi_
protected

Definition at line 414 of file Histograms.h.

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

◆ hPt_

TH1F* HParticle::hPt_
protected

Definition at line 402 of file Histograms.h.

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

◆ hPtVsEta_

TH2F* HParticle::hPtVsEta_
protected

Definition at line 403 of file Histograms.h.

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

◆ hPtVsPhiNeg_

TProfile* HParticle::hPtVsPhiNeg_
protected

Definition at line 410 of file Histograms.h.

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

◆ hPtVsPhiPos_

TProfile* HParticle::hPtVsPhiPos_
protected

Definition at line 411 of file Histograms.h.

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

HParticle::hPtVsEta_
TH2F * hPtVsEta_
Definition: Histograms.h:403
mps_merge.weight
weight
Definition: mps_merge.py:88
HParticle::hPtVsPhiPos_
TProfile * hPtVsPhiPos_
Definition: Histograms.h:411
HParticle::hPt_
TH1F * hPt_
Definition: Histograms.h:402
MuonErrorMatrixAnalyzer_cfi.maxPt
maxPt
Definition: MuonErrorMatrixAnalyzer_cfi.py:19
HParticle::hPtVsPhiNeg_
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:410
download_sqlite_cfg.outputFile
outputFile
Definition: download_sqlite_cfg.py:5
HParticle::hCurvVsPhiNeg_
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:407
contentValuesFiles.number
number
Definition: contentValuesFiles.py:53
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
B2GTnPMonitor_cfi.maxMass
maxMass
Definition: B2GTnPMonitor_cfi.py:55
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
HParticle::hNumber_
TH1F * hNumber_
Definition: Histograms.h:417
p4
double p4[4]
Definition: TauolaWrapper.h:92
HParticle::hCurvVsPhiPos_
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:408
HParticle::hPhi_
TH1F * hPhi_
Definition: Histograms.h:414
HParticle::hEta_
TH1F * hEta_
Definition: Histograms.h:413
HParticle::Fill
void Fill(const reco::Particle::LorentzVector &p4, const int charge, const double &weight=1.) override
Definition: Histograms.h:330
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
B2GTnPMonitor_cfi.minMass
minMass
Definition: B2GTnPMonitor_cfi.py:54
HParticle::hMass_
TH1F * hMass_
Definition: Histograms.h:415
HParticle::hCurvVsEtaPos_
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:406
HParticle::hCurvVsEtaNeg_
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:405
weight
Definition: weight.py:1