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

Constructor & Destructor Documentation

◆ HDelta() [1/3]

HDelta::HDelta ( const TString &  name)
inline

Definition at line 427 of file Histograms.h.

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

◆ HDelta() [2/3]

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

Definition at line 438 of file Histograms.h.

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

◆ HDelta() [3/3]

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

Definition at line 449 of file Histograms.h.

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

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

◆ ~HDelta()

HDelta::~HDelta ( )
inlineoverride

Definition at line 459 of file Histograms.h.

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

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

Member Function Documentation

◆ Clear()

void HDelta::Clear ( )
inlineoverride

Definition at line 503 of file Histograms.h.

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

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

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

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

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

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

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

References p1, and p2.

Referenced by Fill().

◆ Write()

void HDelta::Write ( )
inlineoverride

Definition at line 491 of file Histograms.h.

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

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

Member Data Documentation

◆ hCotgTheta_

TH1F* HDelta::hCotgTheta_

Definition at line 517 of file Histograms.h.

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

◆ hDeltaR_

TH1F* HDelta::hDeltaR_

Definition at line 518 of file Histograms.h.

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

◆ hEta_

TH1F* HDelta::hEta_

Definition at line 513 of file Histograms.h.

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

◆ hEtaSign_

TH1F* HDelta::hEtaSign_

Definition at line 514 of file Histograms.h.

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

◆ hPhi_

TH1F* HDelta::hPhi_

Definition at line 515 of file Histograms.h.

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

◆ hTheta_

TH1F* HDelta::hTheta_

Definition at line 516 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:514
download_sqlite_cfg.outputFile
outputFile
Definition: download_sqlite_cfg.py:5
HDelta::hDeltaR_
TH1F * hDeltaR_
Definition: Histograms.h:518
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:517
HDelta::hEta_
TH1F * hEta_
Definition: Histograms.h:513
HDelta::hPhi_
TH1F * hPhi_
Definition: Histograms.h:515
geometryDiff.file
file
Definition: geometryDiff.py:13
p1
double p1[4]
Definition: TauolaWrapper.h:89
HDelta::hTheta_
TH1F * hTheta_
Definition: Histograms.h:516
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:468