CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
HDelta Class Reference

#include <Histograms.h>

Inherits Histograms.

Public Member Functions

void Clear () override
 
void Fill (const CLHEP::HepLorentzVector &momentum1, const CLHEP::HepLorentzVector &momentum2) override
 
void Fill (const CLHEP::HepLorentzVector &p1, const reco::Particle::LorentzVector &p2) override
 
void Fill (const reco::Particle::LorentzVector &p1, const reco::Particle::LorentzVector &p2) override
 
 HDelta (const TString &name)
 
 HDelta (const TString &name, TFile *file)
 
 HDelta (TFile *outputFile, const TString &name)
 
void Write () override
 
 ~HDelta () override
 

Public Attributes

TH1F * hCotgTheta_
 
TH1F * hDeltaR_
 
TH1F * hEta_
 
TH1F * hEtaSign_
 
TH1F * hPhi_
 
TH1F * hTheta_
 

Detailed Description

Definition at line 423 of file Histograms.h.

Constructor & Destructor Documentation

◆ HDelta() [1/3]

HDelta::HDelta ( const TString &  name)
inline

Definition at line 425 of file Histograms.h.

426  : Histograms(name),
427  // Kinematical variables
428  // ---------------------
429  hEta_(new TH1F(name + "_DeltaEta", "#Delta#eta", 100, 0, 6)),
430  hEtaSign_(new TH1F(name + "_DeltaEtaSign", "#Delta#eta with sign", 100, -6, 6)),
431  hPhi_(new TH1F(name + "_DeltaPhi", "#Delta#phi", 100, 0, 3.2)),
432  hTheta_(new TH1F(name + "_DeltaTheta", "#Delta#theta", 100, -3.2, 3.2)),
433  hCotgTheta_(new TH1F(name + "_DeltaCotgTheta", "#Delta Cotg(#theta )", 100, -3.2, 3.2)),
434  hDeltaR_(new TH1F(name + "_DeltaR", "#Delta R", 400, 0, 4)) {}

◆ HDelta() [2/3]

HDelta::HDelta ( TFile *  outputFile,
const TString &  name 
)
inline

Definition at line 436 of file Histograms.h.

437  : Histograms(outputFile, name),
438  // Kinematical variables
439  // ---------------------
440  hEta_(new TH1F(name + "_DeltaEta", "#Delta#eta", 100, 0, 6)),
441  hEtaSign_(new TH1F(name + "_DeltaEtaSign", "#Delta#eta with sign", 100, -6, 6)),
442  hPhi_(new TH1F(name + "_DeltaPhi", "#Delta#phi", 100, 0, 3.2)),
443  hTheta_(new TH1F(name + "_DeltaTheta", "#Delta#theta", 100, -3.2, 3.2)),
444  hCotgTheta_(new TH1F(name + "_DeltaCotgTheta", "#Delta Cotg(#theta )", 100, -3.2, 3.2)),
445  hDeltaR_(new TH1F(name + "_DeltaR", "#DeltaR", 400, 0, 4)) {}

◆ HDelta() [3/3]

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

Definition at line 447 of file Histograms.h.

447  {
448  name_ = name;
449  hEta_ = (TH1F*)file->Get(name + "_DeltaEta");
450  hEtaSign_ = (TH1F*)file->Get(name + "_DeltaEtaSign");
451  hPhi_ = (TH1F*)file->Get(name + "_DeltaPhi");
452  hTheta_ = (TH1F*)file->Get(name + "_DeltaTheta");
453  hCotgTheta_ = (TH1F*)file->Get(name + "_DeltaCotgTheta");
454  hDeltaR_ = (TH1F*)file->Get(name + "_DeltaR");
455  }

References FrontierConditions_GlobalTag_cff::file, hCotgTheta_, hDeltaR_, hEta_, hEtaSign_, hPhi_, hTheta_, and Skims_PA_cff::name.

◆ ~HDelta()

HDelta::~HDelta ( )
inlineoverride

Definition at line 457 of file Histograms.h.

457  {
458  delete hEta_;
459  delete hEtaSign_;
460  delete hPhi_;
461  delete hTheta_;
462  delete hCotgTheta_;
463  delete hDeltaR_;
464  }

References hCotgTheta_, hDeltaR_, hEta_, hEtaSign_, hPhi_, and hTheta_.

Member Function Documentation

◆ Clear()

void HDelta::Clear ( )
inlineoverride

Definition at line 501 of file Histograms.h.

501  {
502  hEta_->Clear();
503  hEtaSign_->Clear();
504  hPhi_->Clear();
505  hTheta_->Clear();
506  hDeltaR_->Clear();
507  hCotgTheta_->Clear();
508  }

References hCotgTheta_, hDeltaR_, hEta_, hEtaSign_, hPhi_, and hTheta_.

◆ Fill() [1/3]

void HDelta::Fill ( const CLHEP::HepLorentzVector &  momentum1,
const CLHEP::HepLorentzVector &  momentum2 
)
inlineoverride

Definition at line 475 of file Histograms.h.

475  {
476  hEta_->Fill(fabs(momentum1.eta() - momentum2.eta()));
477  hEtaSign_->Fill(momentum1.eta() - momentum2.eta());
478  hPhi_->Fill(MuScleFitUtils::deltaPhi(momentum1.phi(), momentum2.phi()));
479  hTheta_->Fill(momentum1.theta() - momentum2.theta());
480  // hCotgTheta->Fill(1/(TMath::Tan(momentum1.theta()))-1/(TMath::Tan(momentum2.theta())));
481  double theta1 = momentum1.theta();
482  double theta2 = momentum2.theta();
483  hCotgTheta_->Fill(TMath::Cos(theta1) / TMath::Sin(theta1) - TMath::Cos(theta2) / TMath::Sin(theta2));
484  hDeltaR_->Fill(sqrt((momentum1.eta() - momentum2.eta()) * (momentum1.eta() - momentum2.eta()) +
485  (MuScleFitUtils::deltaPhi(momentum1.phi(), momentum2.phi())) *
486  (MuScleFitUtils::deltaPhi(momentum1.phi(), momentum2.phi()))));
487  }

References MuScleFitUtils::deltaPhi(), hCotgTheta_, hDeltaR_, hEta_, hEtaSign_, hPhi_, hTheta_, and mathSSE::sqrt().

◆ Fill() [2/3]

void HDelta::Fill ( const CLHEP::HepLorentzVector &  p1,
const reco::Particle::LorentzVector p2 
)
inlineoverride

Definition at line 471 of file Histograms.h.

471  {
472  Fill(p1, CLHEP::HepLorentzVector(p2.x(), p2.y(), p2.z(), p2.t()));
473  }

References Fill(), p1, and p2.

◆ Fill() [3/3]

void HDelta::Fill ( const reco::Particle::LorentzVector p1,
const reco::Particle::LorentzVector p2 
)
inlineoverride

Definition at line 466 of file Histograms.h.

466  {
467  Fill(CLHEP::HepLorentzVector(p1.x(), p1.y(), p1.z(), p1.t()),
468  CLHEP::HepLorentzVector(p2.x(), p2.y(), p2.z(), p2.t()));
469  }

References p1, and p2.

Referenced by Fill().

◆ Write()

void HDelta::Write ( )
inlineoverride

Definition at line 489 of file Histograms.h.

489  {
490  if (histoDir_ != nullptr)
491  histoDir_->cd();
492 
493  hEta_->Write();
494  hEtaSign_->Write();
495  hPhi_->Write();
496  hTheta_->Write();
497  hCotgTheta_->Write();
498  hDeltaR_->Write();
499  }

References hCotgTheta_, hDeltaR_, hEta_, hEtaSign_, hPhi_, and hTheta_.

Member Data Documentation

◆ hCotgTheta_

TH1F* HDelta::hCotgTheta_

Definition at line 515 of file Histograms.h.

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

◆ hDeltaR_

TH1F* HDelta::hDeltaR_

Definition at line 516 of file Histograms.h.

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

◆ hEta_

TH1F* HDelta::hEta_

Definition at line 511 of file Histograms.h.

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

◆ hEtaSign_

TH1F* HDelta::hEtaSign_

Definition at line 512 of file Histograms.h.

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

◆ hPhi_

TH1F* HDelta::hPhi_

Definition at line 513 of file Histograms.h.

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

◆ hTheta_

TH1F* HDelta::hTheta_

Definition at line 514 of file Histograms.h.

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

MuScleFitUtils::deltaPhi
static double deltaPhi(const double &phi1, const double &phi2)
Definition: MuScleFitUtils.h:109
HDelta::hEtaSign_
TH1F * hEtaSign_
Definition: Histograms.h:512
download_sqlite_cfg.outputFile
outputFile
Definition: download_sqlite_cfg.py:5
HDelta::hDeltaR_
TH1F * hDeltaR_
Definition: Histograms.h:516
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
p2
double p2[4]
Definition: TauolaWrapper.h:90
HDelta::hCotgTheta_
TH1F * hCotgTheta_
Definition: Histograms.h:515
HDelta::hEta_
TH1F * hEta_
Definition: Histograms.h:511
HDelta::hPhi_
TH1F * hPhi_
Definition: Histograms.h:513
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
p1
double p1[4]
Definition: TauolaWrapper.h:89
HDelta::hTheta_
TH1F * hTheta_
Definition: Histograms.h:514
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
HDelta::Fill
void Fill(const reco::Particle::LorentzVector &p1, const reco::Particle::LorentzVector &p2) override
Definition: Histograms.h:466