CMS 3D CMS Logo

Public Member Functions | Public Attributes

HDelta Class Reference

#include <Histograms.h>

Inheritance diagram for HDelta:
Histograms

List of all members.

Public Member Functions

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

Public Attributes

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

Detailed Description

Definition at line 327 of file Histograms.h.


Constructor & Destructor Documentation

HDelta::HDelta ( const TString &  name) [inline]

Definition at line 330 of file Histograms.h.

                                :
    Histograms(name),
    // Kinematical variables
    // ---------------------
    hEta_( new TH1F (name+"_DeltaEta", "#Delta#eta", 100, 0, 6) ),
    hEtaSign_( new TH1F (name+"_DeltaEtaSign", "#Delta#eta with sign", 100, -6, 6) ),
    hPhi_( new TH1F (name+"_DeltaPhi", "#Delta#phi", 100,0,3.2) ),
    hTheta_( new TH1F (name+"_DeltaTheta", "#Delta#theta", 100,-3.2,3.2) ),
    hCotgTheta_( new TH1F (name+"_DeltaCotgTheta", "#Delta Cotg(#theta )", 100,-3.2,3.2) ),
    hDeltaR_( new TH1F (name+"_DeltaR","#Delta R", 400, 0, 4 ) )
  {}
HDelta::HDelta ( TFile *  outputFile,
const TString &  name 
) [inline]

Definition at line 342 of file Histograms.h.

                                                   :
    Histograms(outputFile, name),
    // Kinematical variables
    // ---------------------
    hEta_( new TH1F (name+"_DeltaEta", "#Delta#eta", 100, 0, 6) ),
    hEtaSign_( new TH1F (name+"_DeltaEtaSign", "#Delta#eta with sign", 100, -6, 6) ),
    hPhi_( new TH1F (name+"_DeltaPhi", "#Delta#phi", 100,0,3.2) ),
    hTheta_( new TH1F (name+"_DeltaTheta", "#Delta#theta", 100,-3.2,3.2) ),
    hCotgTheta_( new TH1F (name+"_DeltaCotgTheta", "#Delta Cotg(#theta )", 100,-3.2,3.2) ),
    hDeltaR_( new TH1F (name+"_DeltaR","#DeltaR", 400, 0, 4 ) )
  {}
HDelta::HDelta ( const TString &  name,
TFile *  file 
) [inline]

Definition at line 354 of file Histograms.h.

References hCotgTheta_, hDeltaR_, hEta_, hEtaSign_, hPhi_, hTheta_, AlCaRecoCosmics_cfg::name, and Histograms::name_.

                                             {
    name_ = name;
    hEta_       = (TH1F *) file->Get(name+"_DeltaEta");
    hEtaSign_   = (TH1F *) file->Get(name+"_DeltaEtaSign");
    hPhi_       = (TH1F *) file->Get(name+"_DeltaPhi");
    hTheta_     = (TH1F *) file->Get(name+"_DeltaTheta");
    hCotgTheta_ = (TH1F *) file->Get(name+"_DeltaCotgTheta");
    hDeltaR_    = (TH1F *) file->Get(name+"_DeltaR");
   }
HDelta::~HDelta ( ) [inline]

Definition at line 364 of file Histograms.h.

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

            {
    delete hEta_;
    delete hEtaSign_;
    delete hPhi_;
    delete hTheta_;
    delete hCotgTheta_;
    delete hDeltaR_;
  }

Member Function Documentation

virtual void HDelta::Clear ( ) [inline, virtual]

Implements Histograms.

Definition at line 407 of file Histograms.h.

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

                       {
    hEta_->Clear();
    hEtaSign_->Clear();
    hPhi_->Clear();
    hTheta_->Clear();
    hDeltaR_->Clear();
    hCotgTheta_->Clear();
  }
virtual void HDelta::Fill ( const CLHEP::HepLorentzVector &  p1,
const reco::Particle::LorentzVector p2 
) [inline, virtual]

Reimplemented from Histograms.

Definition at line 378 of file Histograms.h.

References Fill().

                                                                                             {
    Fill (p1,CLHEP::HepLorentzVector(p2.x(),p2.y(),p2.z(),p2.t()));
  }
virtual void HDelta::Fill ( const reco::Particle::LorentzVector p1,
const reco::Particle::LorentzVector p2 
) [inline, virtual]

Reimplemented from Histograms.

Definition at line 373 of file Histograms.h.

Referenced by Fill().

                                                                                                 {
    Fill (CLHEP::HepLorentzVector(p1.x(),p1.y(),p1.z(),p1.t()), 
          CLHEP::HepLorentzVector(p2.x(),p2.y(),p2.z(),p2.t()));
  }
virtual void HDelta::Fill ( const CLHEP::HepLorentzVector &  momentum1,
const CLHEP::HepLorentzVector &  momentum2 
) [inline, virtual]

Reimplemented from Histograms.

Definition at line 382 of file Histograms.h.

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

                                                                                                       {
    hEta_->Fill(fabs( momentum1.eta()-momentum2.eta() ));
    hEtaSign_->Fill(momentum1.eta()-momentum2.eta());
    hPhi_->Fill(MuScleFitUtils::deltaPhi(momentum1.phi(),momentum2.phi()));
    hTheta_->Fill(momentum1.theta()-momentum2.theta());
    // hCotgTheta->Fill(1/(TMath::Tan(momentum1.theta()))-1/(TMath::Tan(momentum2.theta())));
    double theta1 = momentum1.theta();
    double theta2 = momentum2.theta();
    hCotgTheta_->Fill(TMath::Cos(theta1)/TMath::Sin(theta1) - TMath::Cos(theta2)/TMath::Sin(theta2));
    hDeltaR_->Fill(sqrt((momentum1.eta()-momentum2.eta())*(momentum1.eta()-momentum2.eta()) +
                        (MuScleFitUtils::deltaPhi(momentum1.phi(),momentum2.phi()))*
                        (MuScleFitUtils::deltaPhi(momentum1.phi(),momentum2.phi()))));
  }
virtual void HDelta::Write ( ) [inline, virtual]

Implements Histograms.

Definition at line 396 of file Histograms.h.

References hCotgTheta_, hDeltaR_, hEta_, hEtaSign_, Histograms::histoDir_, hPhi_, and hTheta_.

                       {
    if(histoDir_ != 0) histoDir_->cd();

    hEta_->Write();
    hEtaSign_->Write();
    hPhi_->Write();
    hTheta_->Write();
    hCotgTheta_->Write();
    hDeltaR_->Write();
  }

Member Data Documentation

Definition at line 421 of file Histograms.h.

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

Definition at line 422 of file Histograms.h.

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

Definition at line 417 of file Histograms.h.

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

Definition at line 418 of file Histograms.h.

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

Definition at line 419 of file Histograms.h.

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

Definition at line 420 of file Histograms.h.

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