CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 242 of file Histograms.h.

Constructor & Destructor Documentation

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)) {}
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:410
TH1F * hPt_
Definition: Histograms.h:402
TH2F * hPtVsEta_
Definition: Histograms.h:403
TH1F * hPhi_
Definition: Histograms.h:414
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:406
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:405
TProfile * hPtVsPhiPos_
Definition: Histograms.h:411
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:408
TH1F * hNumber_
Definition: Histograms.h:417
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:407
TH1F * hMass_
Definition: Histograms.h:415
TH1F * hEta_
Definition: Histograms.h:413
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.

References B2GTnPMonitor_cfi::maxMass, MuonErrorMatrixAnalyzer_cfi::maxPt, and B2GTnPMonitor_cfi::minMass.

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  }
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:410
TH1F * hPt_
Definition: Histograms.h:402
TH2F * hPtVsEta_
Definition: Histograms.h:403
TH1F * hPhi_
Definition: Histograms.h:414
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:406
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:405
TProfile * hPtVsPhiPos_
Definition: Histograms.h:411
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:408
TH1F * hNumber_
Definition: Histograms.h:417
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:407
TH1F * hMass_
Definition: Histograms.h:415
TH1F * hEta_
Definition: Histograms.h:413
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")) {}
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:410
TH1F * hPt_
Definition: Histograms.h:402
TH2F * hPtVsEta_
Definition: Histograms.h:403
TH1F * hPhi_
Definition: Histograms.h:414
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:406
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:405
TProfile * hPtVsPhiPos_
Definition: Histograms.h:411
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:408
TH1F * hNumber_
Definition: Histograms.h:417
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:407
TH1F * hMass_
Definition: Histograms.h:415
TH1F * hEta_
Definition: Histograms.h:413
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  }
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:410
TH1F * hPt_
Definition: Histograms.h:402
TH2F * hPtVsEta_
Definition: Histograms.h:403
TH1F * hPhi_
Definition: Histograms.h:414
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:406
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:405
TProfile * hPtVsPhiPos_
Definition: Histograms.h:411
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:408
TH1F * hNumber_
Definition: Histograms.h:417
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:407
TH1F * hMass_
Definition: Histograms.h:415
TH1F * hEta_
Definition: Histograms.h:413

Member Function Documentation

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  }
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:410
TH1F * hPt_
Definition: Histograms.h:402
TH2F * hPtVsEta_
Definition: Histograms.h:403
TH1F * hPhi_
Definition: Histograms.h:414
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:406
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:405
TProfile * hPtVsPhiPos_
Definition: Histograms.h:411
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:408
TH1F * hNumber_
Definition: Histograms.h:417
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:407
TH1F * hMass_
Definition: Histograms.h:415
TH1F * hEta_
Definition: Histograms.h:413
void HParticle::Fill ( const reco::Particle::LorentzVector p4,
const int  charge,
const double &  weight = 1. 
)
inlineoverride

Definition at line 330 of file Histograms.h.

References HcalObjRepresent::Fill().

330  {
331  Fill(CLHEP::HepLorentzVector(p4.x(), p4.y(), p4.z(), p4.t()), charge, weight);
332  }
void Fill(const reco::Particle::LorentzVector &p4, const int charge, const double &weight=1.) override
Definition: Histograms.h:330
Definition: weight.py:1
double p4[4]
Definition: TauolaWrapper.h:92
void HParticle::Fill ( const CLHEP::HepLorentzVector &  momentum,
const int  charge,
const double &  weight = 1. 
)
inlineoverride

Definition at line 334 of file Histograms.h.

References mps_merge::weight.

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  }
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:410
Definition: weight.py:1
TH1F * hPt_
Definition: Histograms.h:402
TH2F * hPtVsEta_
Definition: Histograms.h:403
TH1F * hPhi_
Definition: Histograms.h:414
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:406
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:405
TProfile * hPtVsPhiPos_
Definition: Histograms.h:411
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:408
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:407
TH1F * hMass_
Definition: Histograms.h:415
TH1F * hEta_
Definition: Histograms.h:413
void HParticle::Fill ( unsigned int  number)
inlineoverride

Definition at line 359 of file Histograms.h.

359 { hNumber_->Fill(number); }
TH1F * hNumber_
Definition: Histograms.h:417
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  }
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:410
TH1F * hPt_
Definition: Histograms.h:402
TH2F * hPtVsEta_
Definition: Histograms.h:403
TH1F * hPhi_
Definition: Histograms.h:414
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:406
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:405
TProfile * hPtVsPhiPos_
Definition: Histograms.h:411
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:408
TH1F * hNumber_
Definition: Histograms.h:417
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:407
TH1F * hMass_
Definition: Histograms.h:415
TH1F * hEta_
Definition: Histograms.h:413

Member Data Documentation

TProfile* HParticle::hCurvVsEtaNeg_
protected

Definition at line 405 of file Histograms.h.

TProfile* HParticle::hCurvVsEtaPos_
protected

Definition at line 406 of file Histograms.h.

TProfile* HParticle::hCurvVsPhiNeg_
protected

Definition at line 407 of file Histograms.h.

TProfile* HParticle::hCurvVsPhiPos_
protected

Definition at line 408 of file Histograms.h.

TH1F* HParticle::hEta_
protected

Definition at line 413 of file Histograms.h.

TH1F* HParticle::hMass_
protected

Definition at line 415 of file Histograms.h.

TH1F* HParticle::hNumber_
protected

Definition at line 417 of file Histograms.h.

TH1F* HParticle::hPhi_
protected

Definition at line 414 of file Histograms.h.

TH1F* HParticle::hPt_
protected

Definition at line 402 of file Histograms.h.

TH2F* HParticle::hPtVsEta_
protected

Definition at line 403 of file Histograms.h.

TProfile* HParticle::hPtVsPhiNeg_
protected

Definition at line 410 of file Histograms.h.

TProfile* HParticle::hPtVsPhiPos_
protected

Definition at line 411 of file Histograms.h.