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
void declareHistograms ()
 
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.)
 
void fillEventInfo (int proc, int strk, int ntrkr)
 
void fillRecHistograms (const RecTrack_t &r)
 
void fillSimHistograms (const SimTrack_t &s)
 
void fillVzeroHistograms (const RecVzero_t &r, int part)
 
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)
 
 Histograms (const edm::ParameterSet &pset)
 
virtual void SetWeight (double weight)
 
void writeHistograms ()
 
virtual ~Histograms ()
 
 ~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 238 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 240 of file Histograms.h.

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

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

262  :
264  {
265  // Kinematical variables
266  hPt_ = new TH1F (name+"_Pt", "transverse momentum", 100, 0, maxPt);
267  hPtVsEta_ = new TH2F (name+"_PtVsEta", "transverse momentum vs #eta", 100, 0, maxPt, 100, -3.0, 3.0);
268 
269  hPtVsEta_ = new TH2F (name+"_PtVsEta", "transverse momentum vs #eta", 100, 0, maxPt, 100, -3.0, 3.0);
270 
271  hCurvVsEtaNeg_ = new TProfile(name+"_CurvVsEtaNeg", "q/pT vs #eta neg.", 100, -3.0, 3.0, -1. ,0.);
272  hCurvVsEtaPos_ = new TProfile(name+"_CurvVsEtaPos", "q/pT vs #eta pos.", 100, -3.0, 3.0, 0., 1.);
273  hCurvVsPhiNeg_ = new TProfile(name+"_CurvVsPhiNeg", "q/pT vs #phi neg.", 32, -3.2, 3.2, -1. ,0.);
274  hCurvVsPhiPos_ = new TProfile(name+"_CurvVsPhiPos", "q/pT vs #phi pos.", 32, -3.2, 3.2, 0., 1.);
275 
276  hPtVsPhiNeg_ = new TProfile(name+"_PtVsPhiNeg", "pT vs #phi neg.", 32, -3.2, 3.2, 0.,100);
277  hPtVsPhiPos_ = new TProfile(name+"_PtVsPhiPos", "pT vs #phi pos.", 32, -3.2, 3.2, 0.,100);
278 
279 
280  //hPtVSPhi_prof_ = new TProfile (name+"_PtVSPhi_prof", "pt vs phi angle",12, -3.2, 3.2, 0, 200);
281 
282  hEta_ = new TH1F (name+"_Eta", "pseudorapidity", 64, -3.2, 3.2);
283  hPhi_ = new TH1F (name+"_Phi", "phi angle", 64, -3.2, 3.2);
284  hMass_ = new TH1F (name+"_Mass", "mass", 40000, minMass, maxMass);
285  hNumber_ = new TH1F (name+"_Number", "number", 20, -0.5, 19.5);
286  }
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:411
TH1F * hPt_
Definition: Histograms.h:403
TH2F * hPtVsEta_
Definition: Histograms.h:404
TH1F * hPhi_
Definition: Histograms.h:415
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:407
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:406
TProfile * hPtVsPhiPos_
Definition: Histograms.h:412
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:409
TH1F * hNumber_
Definition: Histograms.h:418
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:408
TH1F * hMass_
Definition: Histograms.h:416
TH1F * hEta_
Definition: Histograms.h:414
HParticle::HParticle ( const TString &  name,
TFile *  file 
)
inline

Definition at line 288 of file Histograms.h.

288  :
289  Histograms(name),
290  hPt_( (TH1F *) file->Get(name_+"_Pt") ),
291  hPtVsEta_( (TH2F *) file->Get(name_+"_PtVsEta") ),
292 
293 
294  hCurvVsEtaNeg_( (TProfile *) file->Get(name_+"_CurvVsEtaNeg") ),
295  hCurvVsEtaPos_( (TProfile *) file->Get(name_+"_CurvVsEtaPos") ),
296  hCurvVsPhiNeg_( (TProfile *) file->Get(name_+"_CurvVsPhiNeg") ),
297  hCurvVsPhiPos_( (TProfile *) file->Get(name_+"_CurvVsPhiPos") ),
298 
299  hPtVsPhiNeg_( (TProfile *) file->Get(name_+"_PtVsPhiNeg") ),
300  hPtVsPhiPos_( (TProfile *) file->Get(name_+"_PtVsPhiPos") ),
301 
302  hEta_( (TH1F *) file->Get(name_+"_Eta") ),
303  hPhi_( (TH1F *) file->Get(name_+"_Phi") ),
304  hMass_( (TH1F *) file->Get(name_+"_Mass") ),
305  //hMass_fine_ = (TH1F *) file->Get(name_+"_Mass_fine");
306  hNumber_( (TH1F *) file->Get(name_+"_Number") )
307  {}
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:411
virtual double Get(const reco::Particle::LorentzVector &recoP1, const TString &covarianceName)
Definition: Histograms.h:108
TH1F * hPt_
Definition: Histograms.h:403
TH2F * hPtVsEta_
Definition: Histograms.h:404
TH1F * hPhi_
Definition: Histograms.h:415
TString name_
Definition: Histograms.h:123
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:407
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:406
TProfile * hPtVsPhiPos_
Definition: Histograms.h:412
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:409
TH1F * hNumber_
Definition: Histograms.h:418
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:408
TH1F * hMass_
Definition: Histograms.h:416
TH1F * hEta_
Definition: Histograms.h:414
HParticle::~HParticle ( )
inline

Definition at line 309 of file Histograms.h.

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

310  {
311  delete hPt_;
312  delete hPtVsEta_;
313 
314  delete hCurvVsEtaNeg_;
315  delete hCurvVsEtaPos_;
316  delete hCurvVsPhiNeg_;
317  delete hCurvVsPhiPos_;
318 
319  delete hPtVsPhiNeg_;
320  delete hPtVsPhiPos_;
321 
322  delete hEta_;
323  delete hPhi_;
324  delete hMass_;
325  // delete hMass_fine_;
326  delete hNumber_;
327  }
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:411
TH1F * hPt_
Definition: Histograms.h:403
TH2F * hPtVsEta_
Definition: Histograms.h:404
TH1F * hPhi_
Definition: Histograms.h:415
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:407
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:406
TProfile * hPtVsPhiPos_
Definition: Histograms.h:412
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:409
TH1F * hNumber_
Definition: Histograms.h:418
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:408
TH1F * hMass_
Definition: Histograms.h:416
TH1F * hEta_
Definition: Histograms.h:414

Member Function Documentation

virtual void HParticle::Clear ( )
inlinevirtual

Implements Histograms.

Definition at line 382 of file Histograms.h.

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

383  {
384  hPt_->Clear();
385  hPtVsEta_->Clear();
386 
387  hCurvVsEtaNeg_->Clear();
388  hCurvVsEtaPos_->Clear();
389  hCurvVsPhiNeg_->Clear();
390  hCurvVsPhiPos_->Clear();
391 
392  hPtVsPhiNeg_->Clear();
393  hPtVsPhiPos_->Clear();
394 
395  hEta_->Clear();
396  hPhi_->Clear();
397  hMass_->Clear();
398  //hMass_fine_->Clear();
399  hNumber_->Clear();
400  }
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:411
TH1F * hPt_
Definition: Histograms.h:403
TH2F * hPtVsEta_
Definition: Histograms.h:404
TH1F * hPhi_
Definition: Histograms.h:415
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:407
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:406
TProfile * hPtVsPhiPos_
Definition: Histograms.h:412
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:409
TH1F * hNumber_
Definition: Histograms.h:418
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:408
TH1F * hMass_
Definition: Histograms.h:416
TH1F * hEta_
Definition: Histograms.h:414
virtual void HParticle::Fill ( const reco::Particle::LorentzVector p4,
const int  charge,
const double &  weight = 1. 
)
inlinevirtual

Reimplemented from Histograms.

Definition at line 329 of file Histograms.h.

References CommonMethods::weight().

330  {
331  Fill(CLHEP::HepLorentzVector(p4.x(),p4.y(),p4.z(),p4.t()),charge, weight);
332  }
double charge(const std::vector< uint8_t > &Ampls)
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:329
virtual void HParticle::Fill ( const CLHEP::HepLorentzVector &  momentum,
const int  charge,
const double &  weight = 1. 
)
inlinevirtual

Reimplemented from Histograms.

Definition at line 334 of file Histograms.h.

References hCurvVsEtaNeg_, hCurvVsEtaPos_, hCurvVsPhiNeg_, hCurvVsPhiPos_, hEta_, hMass_, hPhi_, hPt_, hPtVsEta_, hPtVsPhiNeg_, hPtVsPhiPos_, and CommonMethods::weight().

335  {
336  hPt_->Fill(momentum.perp(), weight);
337  hPtVsEta_->Fill(momentum.perp(), momentum.eta(), weight);
338 
339  // std::cout<< "charge-> " <<charge<<std::endl;
340  if(charge<0)hCurvVsEtaNeg_->Fill( momentum.eta(),charge/(momentum.perp()),weight);
341  if(charge>0)hCurvVsEtaPos_->Fill( momentum.eta(),charge/(momentum.perp()),weight);
342  if(charge<0)hCurvVsPhiNeg_->Fill( momentum.phi(),charge/(momentum.perp()),weight);
343  if(charge>0)hCurvVsPhiPos_->Fill( momentum.phi(),charge/(momentum.perp()),weight);
344 
345  if(charge<0)hPtVsPhiNeg_->Fill( momentum.phi(),momentum.perp(),weight);
346  if(charge>0)hPtVsPhiPos_->Fill( momentum.phi(),momentum.perp(),weight);
347 
348  hEta_->Fill(momentum.eta(), weight);
349  hPhi_->Fill(momentum.phi(), weight);
350  hMass_->Fill(momentum.m(), weight);
351  //hMass_fine_->Fill(momentum.m(), weight);
352  }
TProfile * hPtVsPhiNeg_
Definition: Histograms.h:411
double charge(const std::vector< uint8_t > &Ampls)
TH1F * hPt_
Definition: Histograms.h:403
TH2F * hPtVsEta_
Definition: Histograms.h:404
TH1F * hPhi_
Definition: Histograms.h:415
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:407
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:406
TProfile * hPtVsPhiPos_
Definition: Histograms.h:412
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:409
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:408
TH1F * hMass_
Definition: Histograms.h:416
TH1F * hEta_
Definition: Histograms.h:414
virtual void HParticle::Fill ( unsigned int  number)
inlinevirtual

Reimplemented from Histograms.

Definition at line 356 of file Histograms.h.

References hNumber_.

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

Implements Histograms.

Definition at line 361 of file Histograms.h.

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

362  {
363  if(histoDir_ != 0) 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:411
TH1F * hPt_
Definition: Histograms.h:403
TH2F * hPtVsEta_
Definition: Histograms.h:404
TH1F * hPhi_
Definition: Histograms.h:415
TProfile * hCurvVsEtaPos_
Definition: Histograms.h:407
TDirectory * histoDir_
Definition: Histograms.h:125
TProfile * hCurvVsEtaNeg_
Definition: Histograms.h:406
TProfile * hPtVsPhiPos_
Definition: Histograms.h:412
TProfile * hCurvVsPhiPos_
Definition: Histograms.h:409
TH1F * hNumber_
Definition: Histograms.h:418
TProfile * hCurvVsPhiNeg_
Definition: Histograms.h:408
TH1F * hMass_
Definition: Histograms.h:416
TH1F * hEta_
Definition: Histograms.h:414

Member Data Documentation

TProfile* HParticle::hCurvVsEtaNeg_
protected

Definition at line 406 of file Histograms.h.

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

TProfile* HParticle::hCurvVsEtaPos_
protected

Definition at line 407 of file Histograms.h.

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

TProfile* HParticle::hCurvVsPhiNeg_
protected

Definition at line 408 of file Histograms.h.

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

TProfile* HParticle::hCurvVsPhiPos_
protected

Definition at line 409 of file Histograms.h.

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

TH1F* HParticle::hEta_
protected

Definition at line 414 of file Histograms.h.

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

TH1F* HParticle::hMass_
protected

Definition at line 416 of file Histograms.h.

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

TH1F* HParticle::hNumber_
protected

Definition at line 418 of file Histograms.h.

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

TH1F* HParticle::hPhi_
protected

Definition at line 415 of file Histograms.h.

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

TH1F* HParticle::hPt_
protected

Definition at line 403 of file Histograms.h.

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

TH2F* HParticle::hPtVsEta_
protected

Definition at line 404 of file Histograms.h.

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

TProfile* HParticle::hPtVsPhiNeg_
protected

Definition at line 411 of file Histograms.h.

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

TProfile* HParticle::hPtVsPhiPos_
protected

Definition at line 412 of file Histograms.h.

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