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>

Inheritance diagram for HParticle:
Histograms

Public Member Functions

virtual void Clear ()
 
virtual void Fill (const reco::Particle::LorentzVector &p4, const int charge, const double &weight=1.)
 
virtual void Fill (const CLHEP::HepLorentzVector &momentum, const int charge, const double &weight=1.)
 
virtual void Fill (unsigned int number)
 
 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)
 
virtual void Write ()
 
 ~HParticle ()
 
- Public Member Functions inherited from Histograms
virtual void Fill (const reco::Particle::LorentzVector &p1, const reco::Particle::LorentzVector &p2)
 
virtual void Fill (const reco::Particle::LorentzVector &p1, const reco::Particle::LorentzVector &p2, const int charge, const double &weight=1.)
 
virtual void Fill (const CLHEP::HepLorentzVector &momentum1, const CLHEP::HepLorentzVector &momentum2)
 
virtual void Fill (const CLHEP::HepLorentzVector &momentum1, const CLHEP::HepLorentzVector &momentum2, const int charge, const double &weight=1.)
 
virtual void Fill (const CLHEP::HepLorentzVector &p1, const reco::Particle::LorentzVector &p2)
 
virtual void Fill (const reco::Particle::LorentzVector &p4, const double &weight=1.)
 
virtual void Fill (const reco::Particle::LorentzVector &p4, const double &resValue, const int charge)
 
virtual void Fill (const reco::Particle::LorentzVector &p4, const double &genValue, const double recValue, const int charge)
 
virtual void Fill (const CLHEP::HepLorentzVector &p, const double &likeValue)
 
virtual void Fill (const reco::Particle::LorentzVector &recoP1, const int charge1, const reco::Particle::LorentzVector &genP1, const reco::Particle::LorentzVector &recoP2, const int charge2, const reco::Particle::LorentzVector &genP2, const double &recoMass, const double &genMass)
 
virtual void Fill (const reco::Particle::LorentzVector &recoP1, const int charge1, const reco::Particle::LorentzVector &recoP2, const int charge2, const double &recoMass, const double &genMass)
 
virtual void Fill (const reco::Particle::LorentzVector &recoP1, const reco::Particle::LorentzVector &genP1, const reco::Particle::LorentzVector &recoP2, const reco::Particle::LorentzVector &genP2)
 
virtual void Fill (const double &x, const double &y)
 
virtual void Fill (const double &x, const double &y, const double &a, const double &b)
 
virtual void Fill (const reco::Particle::LorentzVector &p41, const reco::Particle::LorentzVector &p42, const reco::Particle::LorentzVector &p4Res, const double &weight=1.)
 
virtual void Fill (const CLHEP::HepLorentzVector &momentum1, const CLHEP::HepLorentzVector &momentum2, const CLHEP::HepLorentzVector &momentumRes, const double &weight=1.)
 
virtual double Get (const reco::Particle::LorentzVector &recoP1, const TString &covarianceName)
 
virtual TString GetName ()
 
 Histograms ()
 
 Histograms (const TString &name)
 
 Histograms (TFile *outputFile, const TString &name)
 
virtual void SetWeight (double weight)
 
virtual ~Histograms ()
 

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_
 
- Protected Attributes inherited from Histograms
TDirectory * histoDir_
 
TString name_
 
TFile * outputFile_
 
double theWeight_
 

Detailed Description

Definition at line 237 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 239 of file Histograms.h.

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

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

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

287  :
288  Histograms(name),
289  hPt_( (TH1F *) file->Get(name_+"_Pt") ),
290  hPtVsEta_( (TH2F *) file->Get(name_+"_PtVsEta") ),
291 
292 
293  hCurvVsEtaNeg_( (TProfile *) file->Get(name_+"_CurvVsEtaNeg") ),
294  hCurvVsEtaPos_( (TProfile *) file->Get(name_+"_CurvVsEtaPos") ),
295  hCurvVsPhiNeg_( (TProfile *) file->Get(name_+"_CurvVsPhiNeg") ),
296  hCurvVsPhiPos_( (TProfile *) file->Get(name_+"_CurvVsPhiPos") ),
297 
298  hPtVsPhiNeg_( (TProfile *) file->Get(name_+"_PtVsPhiNeg") ),
299  hPtVsPhiPos_( (TProfile *) file->Get(name_+"_PtVsPhiPos") ),
300 
301  hEta_( (TH1F *) file->Get(name_+"_Eta") ),
302  hPhi_( (TH1F *) file->Get(name_+"_Phi") ),
303  hMass_( (TH1F *) file->Get(name_+"_Mass") ),
304  //hMass_fine_ = (TH1F *) file->Get(name_+"_Mass_fine");
305  hNumber_( (TH1F *) file->Get(name_+"_Number") )
306  {}
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:410
virtual double Get(const reco::Particle::LorentzVector &recoP1, const TString &covarianceName)
Definition: Histograms.h:107
TH1F * hPt_
Definition: Histograms.h:402
TH2F * hPtVsEta_
Definition: Histograms.h:403
TH1F * hPhi_
Definition: Histograms.h:414
TString name_
Definition: Histograms.h:122
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 ( )
inline

Definition at line 308 of file Histograms.h.

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

309  {
310  delete hPt_;
311  delete hPtVsEta_;
312 
313  delete hCurvVsEtaNeg_;
314  delete hCurvVsEtaPos_;
315  delete hCurvVsPhiNeg_;
316  delete hCurvVsPhiPos_;
317 
318  delete hPtVsPhiNeg_;
319  delete hPtVsPhiPos_;
320 
321  delete hEta_;
322  delete hPhi_;
323  delete hMass_;
324  // delete hMass_fine_;
325  delete hNumber_;
326  }
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

virtual void HParticle::Clear ( )
inlinevirtual

Implements Histograms.

Definition at line 381 of file Histograms.h.

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

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
virtual void HParticle::Fill ( const reco::Particle::LorentzVector p4,
const int  charge,
const double &  weight = 1. 
)
inlinevirtual

Reimplemented from Histograms.

Definition at line 328 of file Histograms.h.

References histoStyle::weight.

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

Reimplemented from Histograms.

Definition at line 333 of file Histograms.h.

References hCurvVsEtaNeg_, hCurvVsEtaPos_, hCurvVsPhiNeg_, hCurvVsPhiPos_, hEta_, hMass_, hPhi_, hPt_, hPtVsEta_, hPtVsPhiNeg_, hPtVsPhiPos_, and histoStyle::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)hCurvVsEtaNeg_->Fill( momentum.eta(),charge/(momentum.perp()),weight);
340  if(charge>0)hCurvVsEtaPos_->Fill( momentum.eta(),charge/(momentum.perp()),weight);
341  if(charge<0)hCurvVsPhiNeg_->Fill( momentum.phi(),charge/(momentum.perp()),weight);
342  if(charge>0)hCurvVsPhiPos_->Fill( momentum.phi(),charge/(momentum.perp()),weight);
343 
344  if(charge<0)hPtVsPhiNeg_->Fill( momentum.phi(),momentum.perp(),weight);
345  if(charge>0)hPtVsPhiPos_->Fill( momentum.phi(),momentum.perp(),weight);
346 
347  hEta_->Fill(momentum.eta(), weight);
348  hPhi_->Fill(momentum.phi(), weight);
349  hMass_->Fill(momentum.m(), weight);
350  //hMass_fine_->Fill(momentum.m(), weight);
351  }
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
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:407
TH1F * hMass_
Definition: Histograms.h:415
int weight
Definition: histoStyle.py:50
TH1F * hEta_
Definition: Histograms.h:413
virtual void HParticle::Fill ( unsigned int  number)
inlinevirtual

Reimplemented from Histograms.

Definition at line 355 of file Histograms.h.

References hNumber_.

356  {
357  hNumber_->Fill(number);
358  }
TH1F * hNumber_
Definition: Histograms.h:417
virtual void HParticle::Write ( )
inlinevirtual

Implements Histograms.

Definition at line 360 of file Histograms.h.

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

361  {
362  if(histoDir_ != 0) histoDir_->cd();
363  hPt_->Write();
364  hPtVsEta_->Write();
365 
366  hCurvVsEtaNeg_->Write();
367  hCurvVsEtaPos_->Write();
368  hCurvVsPhiNeg_->Write();
369  hCurvVsPhiPos_->Write();
370 
371  hPtVsPhiNeg_->Write();
372  hPtVsPhiPos_->Write();
373 
374  hEta_->Write();
375  hPhi_->Write();
376  hMass_->Write();
377  //hMass_fine_->Write();
378  hNumber_->Write();
379  }
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
TDirectory * histoDir_
Definition: Histograms.h:124
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.

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

TProfile* HParticle::hCurvVsEtaPos_
protected

Definition at line 406 of file Histograms.h.

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

TProfile* HParticle::hCurvVsPhiNeg_
protected

Definition at line 407 of file Histograms.h.

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

TProfile* HParticle::hCurvVsPhiPos_
protected

Definition at line 408 of file Histograms.h.

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

TH1F* HParticle::hEta_
protected

Definition at line 413 of file Histograms.h.

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

TH1F* HParticle::hMass_
protected

Definition at line 415 of file Histograms.h.

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

TH1F* HParticle::hNumber_
protected

Definition at line 417 of file Histograms.h.

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

TH1F* HParticle::hPhi_
protected

Definition at line 414 of file Histograms.h.

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

TH1F* HParticle::hPt_
protected

Definition at line 402 of file Histograms.h.

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

TH2F* HParticle::hPtVsEta_
protected

Definition at line 403 of file Histograms.h.

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

TProfile* HParticle::hPtVsPhiNeg_
protected

Definition at line 410 of file Histograms.h.

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

TProfile* HParticle::hPtVsPhiPos_
protected

Definition at line 411 of file Histograms.h.

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