CMS 3D CMS Logo

Public Member Functions | Protected Attributes

HMassVSPart Class Reference

#include <Histograms.h>

Inheritance diagram for HMassVSPart:
Histograms

List of all members.

Public Member Functions

virtual void Clear ()
virtual void Fill (const reco::Particle::LorentzVector &p41, const reco::Particle::LorentzVector &p42, const int charge, const double &weight=1.)
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 int charge, const double &weight=1.)
virtual void Fill (const CLHEP::HepLorentzVector &momentum1, const CLHEP::HepLorentzVector &momentum2, const CLHEP::HepLorentzVector &momentumRes, const double &weight=1.)
 Used to fill 2D histograms for comparison of opposite charge muons quantities.
 HMassVSPart (const TString &name, const double &minMass=0., const double &maxMass=150., const double maxPt=100.)
 HMassVSPart (const TString &name, TFile *file)
virtual void Write ()
 ~HMassVSPart ()

Protected Attributes

TH2F * hMassVSCosThetaCS_
TProfile * hMassVSCosThetaCS_prof
TH2F * hMassVSEta_
TH2F * hMassVSEtaMinus_
TH3F * hMassVSEtaPhiMinus_
TH3F * hMassVSEtaPhiPlus_
TH2F * hMassVSEtaPlus_
TH3F * hMassVSEtaPlusEtaMinus_
TH2F * hMassVSEtaPlusMinusDiff_
TH2F * hMassVSPhiCS_
TH2F * hMassVSPhiMinus_
TH2F * hMassVSPhiPlus_
TH2F * hMassVSPhiPlusMinusDiff_
TH3F * hMassVSPhiPlusPhiMinus_
TH2F * hMassVSPt_

Detailed Description

Definition at line 793 of file Histograms.h.


Constructor & Destructor Documentation

HMassVSPart::HMassVSPart ( const TString &  name,
const double &  minMass = 0.,
const double &  maxMass = 150.,
const double  maxPt = 100. 
) [inline]

Definition at line 796 of file Histograms.h.

References hMassVSCosThetaCS_, hMassVSCosThetaCS_prof, hMassVSEta_, hMassVSEtaMinus_, hMassVSEtaPhiMinus_, hMassVSEtaPhiPlus_, hMassVSEtaPlus_, hMassVSEtaPlusEtaMinus_, hMassVSEtaPlusMinusDiff_, hMassVSPhiCS_, hMassVSPhiMinus_, hMassVSPhiPlus_, hMassVSPhiPlusMinusDiff_, hMassVSPhiPlusPhiMinus_, hMassVSPt_, mergeVDriftHistosByStation::name, and Histograms::name_.

                                                                                                                             {
    name_ = name;

    // Kinematical variables
    // ---------------------
    hMassVSPt_       = new TH2F( name+"_MassVSPt", "resonance mass vs muon transverse momentum", 200, 0., maxPt, 6000, minMass, maxMass );

    hMassVSEta_      = new TH2F( name+"_MassVSEta", "resonance mass vs muon pseudorapidity", 64, -6.4, 6.4, 6000, minMass, maxMass );
    hMassVSEtaPlus_  = new TH2F( name+"_MassVSEtaPlus", "resonance mass vs muon+ pseudorapidity",  64, -6.4, 6.4,  6000, minMass, maxMass );
    hMassVSEtaMinus_ = new TH2F( name+"_MassVSEtaMinus", "resonance mass vs muon- pseudorapidity", 64, -6.4, 6.4,  6000, minMass, maxMass );

    hMassVSPhiPlus_  = new TH2F( name+"_MassVSPhiPlus", "resonance mass vs muon+ phi angle",  64, -3.2, 3.2, 6000, minMass, maxMass );
    hMassVSPhiMinus_ = new TH2F( name+"_MassVSPhiMinus", "resonance mass vs muon- phi angle", 64, -3.2, 3.2, 6000, minMass, maxMass );

    
    // J/Psi mass -----
//     hMassVSEtaPhiPlus_      = new TH3F( name+"_MassVSEtaPhiPlus", "resonance mass vs muon+ phi/pseudorapidity",6, -3.2, 3.2, 20, -2.5, 2.5, 6000, minMass, maxMass );
//     hMassVSEtaPhiMinus_      = new TH3F( name+"_MassVSEtaPhiMinus", "resonance mass vs muon- phi/pseudorapidity", 6, -3.2, 3.2, 20, -2.5, 2.5, 6000, minMass, maxMass );
 
    //Z mass -----------
    hMassVSEtaPhiPlus_      = new TH3F( name+"_MassVSEtaPhiPlus",  "resonance mass vs muon+ phi/pseudorapidity", 16, -3.2, 3.2, 20, -2.4, 2.4, 300, minMass, maxMass );
    hMassVSEtaPhiMinus_     = new TH3F( name+"_MassVSEtaPhiMinus", "resonance mass vs muon- phi/pseudorapidity", 16, -3.2, 3.2, 20, -2.4, 2.4, 300, minMass, maxMass );


    hMassVSCosThetaCS_      = new TH2F( name+"_MassVSCosThetaCS", "resonance mass vs cos(theta) (CS frame)", 40, -1., 1., 6000, minMass, maxMass );
    hMassVSPhiCS_           = new TH2F( name+"_MassVSPhiCS", "resonance mass vs phi (CS frame)", 64, -3.2, 3.2, 6000, minMass, maxMass );


    hMassVSPhiPlusPhiMinus_ = new TH3F( name+"_MassVSPhiPlusPhiMinus", "resonance mass vs muon+ phi/muon- phi",16, -3.2, 3.2,16, -3.2, 3.2, 6000, minMass, maxMass );
    hMassVSEtaPlusEtaMinus_ = new TH3F( name+"_MassVSEtaPlusEtaMinus", "resonance mass vs muon+ eta/muon- eta",16, -3.2, 3.2,16, -3.2, 3.2, 6000, minMass, maxMass );

   
    hMassVSPhiPlusMinusDiff_ = new TH2F( name+"_MassVSPhiPlusMinusDiff", "resonance mass vs delta phi between mu+/mu-", 64, -6.4, 6.4, 6000, minMass, maxMass );
    hMassVSEtaPlusMinusDiff_ = new TH2F( name+"_MassVSEtaPlusMinusDiff", "resonance mass vs delta pseudorapidity between mu+/mu-", 32, -4.4, 4.4, 6000, minMass, maxMass );
    hMassVSCosThetaCS_prof   = new TProfile (name+"_MassVScosTheta_prof", "resonance mass vs cosTheta", 40, -1., 1., 85., 95.);   

    //hMassVSPt_prof       = new TProfile (name+"_MassVSPt_prof", "resonance mass vs muon transverse momentum", 100, 0., 200., minMass, maxMass);
    //hMassVSEta_prof      = new TProfile (name+"_MassVSEta_prof", "resonance mass vs muon pseudorapidity", 30, -6., 6., minMass, maxMass);
    //hMassVSPhiPlus_prof  = new TProfile (name+"_MassVSPhiPlus_prof", "resonance mass vs muon+ phi angle", 32, -3.2, 3.2, minMass, maxMass);
    //hMassVSPhiMinus_prof = new TProfile (name+"_MassVSPhiMinus_prof", "resonance mass vs muon- phi angle", 32, -3.2, 3.2, minMass, maxMass);
   }
HMassVSPart::HMassVSPart ( const TString &  name,
TFile *  file 
) [inline]

Definition at line 838 of file Histograms.h.

References hMassVSCosThetaCS_prof, hMassVSEta_, hMassVSEtaMinus_, hMassVSEtaPhiMinus_, hMassVSEtaPhiPlus_, hMassVSEtaPlus_, hMassVSEtaPlusMinusDiff_, hMassVSPhiMinus_, hMassVSPhiPlus_, hMassVSPhiPlusMinusDiff_, hMassVSPt_, mergeVDriftHistosByStation::name, and Histograms::name_.

                                                {
    name_=name;
    hMassVSPt_       = (TH2F *) file->Get(name+"_MassVSPt");
    hMassVSEta_      = (TH2F *) file->Get(name+"_MassVSEta");

    hMassVSEtaPhiPlus_    = (TH3F *) file->Get(name+"_MassVSEtaPlus");
    hMassVSEtaPhiMinus_   = (TH3F *) file->Get(name+"_MassVSEtaMinus");
    hMassVSEtaPlus_      = (TH2F *) file->Get(name+"_MassVSEtaPlus");
    hMassVSEtaMinus_      = (TH2F *) file->Get(name+"_MassVSEtaMinus");

    hMassVSPhiPlusMinusDiff_ = (TH2F *) file->Get(name+"_MassVSPhiPlusMinusDiff");
    hMassVSEtaPlusMinusDiff_ = (TH2F *) file->Get(name+"_MassVSEtaPlusMinusDiff");
    
    hMassVSPhiPlus_  = (TH2F *) file->Get(name+"_MassVSPhiPlus");
    hMassVSPhiMinus_ = (TH2F *) file->Get(name+"_MassVSPhiMinus");
    
    hMassVSCosThetaCS_prof  = (TProfile *) file->Get(name+"_MassVScosTheta_prof");  
    //hMassVSPt_prof       = (TProfile *) file->Get(name+"_MassVSPt_prof");
    //hMassVSEta_prof      = (TProfile *) file->Get(name+"_MassVSEta_prof");
    //hMassVSPhiPlus_prof  = (TProfile *) file->Get(name+"_MassVSPhiPlus_prof");
    //hMassVSPhiMinus_prof = (TProfile *) file->Get(name+"_MassVSPhiMinus_prof");
  }
HMassVSPart::~HMassVSPart ( ) [inline]

Member Function Documentation

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

Implements Histograms.

Definition at line 1013 of file Histograms.h.

References hMassVSCosThetaCS_, hMassVSCosThetaCS_prof, hMassVSEta_, hMassVSEtaMinus_, hMassVSEtaPhiMinus_, hMassVSEtaPhiPlus_, hMassVSEtaPlus_, hMassVSEtaPlusEtaMinus_, hMassVSEtaPlusMinusDiff_, hMassVSPhiCS_, hMassVSPhiMinus_, hMassVSPhiPlus_, hMassVSPhiPlusMinusDiff_, hMassVSPhiPlusPhiMinus_, and hMassVSPt_.

                       {
    hMassVSPt_->Clear();
    hMassVSEta_->Clear();    
    hMassVSPhiPlus_->Clear();
    hMassVSPhiMinus_->Clear();

    hMassVSEtaPhiPlus_->Clear();   
    hMassVSEtaPhiMinus_->Clear();   
    hMassVSEtaPlus_->Clear();   
    hMassVSEtaMinus_->Clear();    

    hMassVSPhiPlusPhiMinus_->Clear();
    hMassVSEtaPlusEtaMinus_->Clear();
    hMassVSCosThetaCS_->Clear();
    hMassVSPhiCS_->Clear();
    hMassVSPhiPlusMinusDiff_->Clear();
    hMassVSEtaPlusMinusDiff_->Clear();
    hMassVSCosThetaCS_prof->Clear();

    //hMassVSPt_prof_->Clear();
    //hMassVSEta_prof_->Clear();    
    //hMassVSPhiPlus_prof_->Clear();
    //hMassVSPhiMinus_prof_->Clear();
  }
virtual void HMassVSPart::Fill ( const CLHEP::HepLorentzVector &  momentum1,
const CLHEP::HepLorentzVector &  momentum2,
const CLHEP::HepLorentzVector &  momentumRes,
const double &  weight = 1. 
) [inline, virtual]

Used to fill 2D histograms for comparison of opposite charge muons quantities.

Reimplemented from Histograms.

Definition at line 897 of file Histograms.h.

References funct::D, hMassVSCosThetaCS_, hMassVSCosThetaCS_prof, hMassVSEtaPlusEtaMinus_, hMassVSEtaPlusMinusDiff_, hMassVSPhiCS_, hMassVSPhiPlusMinusDiff_, hMassVSPhiPlusPhiMinus_, RPCpg::mu, RPCpg::mubar, funct::pow(), dttmaxenums::R, mathSSE::sqrt(), and CommonMethods::weight().

  {

    /************************************************************************
     *
     * Observable: cos(theta) = 2 Q^-1 (Q^2+Qt^2)^-(1/2) (mu^+ mubar^- - mu^- mubar^+)
     * (computed in Collins-Soper frame)
     *
     ************************************************************************/
    
    double costhetaCS, phiCS;

    CLHEP::HepLorentzVector mu= momentum1;
    CLHEP::HepLorentzVector mubar= momentum2;    
    CLHEP::HepLorentzVector Q(mu+mubar);
    double muplus  = 1.0/sqrt(2.0) * (mu.e() + mu.z());
    double muminus = 1.0/sqrt(2.0) * (mu.e() - mu.z());
    double mubarplus  = 1.0/sqrt(2.0) * (mubar.e() + mubar.z());
    double mubarminus = 1.0/sqrt(2.0) * (mubar.e() - mubar.z());
    //double costheta = 2.0 / Q.Mag() / sqrt(pow(Q.Mag(), 2) + pow(Q.Pt(), 2)) * (muplus * mubarminus - muminus * mubarplus);
    costhetaCS = 2.0 / Q.mag() / sqrt(pow(Q.mag(), 2) + pow(Q.perp(), 2)) * (muplus * mubarminus - muminus * mubarplus);
    if (momentumRes.rapidity()<0) costhetaCS = -costhetaCS;
    



  /************************************************************************
   *
   * 3) tanphi = (Q^2 + Qt^2)^1/2 / Q (Dt dot R unit) /(Dt dot Qt unit)
   *
   ************************************************************************/

  // unit vector on R direction
    CLHEP::HepLorentzVector Pbeam(0.,0.,3500.,3500.);
    CLHEP::Hep3Vector R = Pbeam.vect().cross(Q.vect());
    CLHEP::Hep3Vector Runit = R.unit();


    // unit vector on Qt
    CLHEP::Hep3Vector Qt = Q.vect(); Qt.setZ(0);
    CLHEP::Hep3Vector Qtunit = Qt.unit();


    CLHEP::HepLorentzVector D(mu-mubar);
    CLHEP::Hep3Vector Dt = D.vect(); Dt.setZ(0);
    double tanphi = sqrt(pow(Q.mag(), 2) + pow(Q.perp(), 2)) / Q.mag() * Dt.dot(Runit) / Dt.dot(Qtunit);
    if (momentumRes.rapidity()<0) tanphi = -tanphi;
    phiCS = atan(tanphi); 

    hMassVSPhiCS_->Fill(phiCS,momentumRes.m(), weight);
    hMassVSCosThetaCS_->Fill(costhetaCS,momentumRes.m(), weight);
    hMassVSCosThetaCS_prof ->Fill(costhetaCS,momentumRes.m());  
    /*************************************************************************
     *************************************************************************/
   
    hMassVSPhiPlusPhiMinus_->Fill(momentum1.phi(), momentum2.phi(), momentumRes.m(), weight);
    hMassVSEtaPlusEtaMinus_->Fill(momentum1.eta(), momentum2.eta(), momentumRes.m(), weight);

    hMassVSPhiPlusMinusDiff_->Fill( (momentum1.phi()-momentum2.phi()), momentumRes.m(), weight);
    hMassVSEtaPlusMinusDiff_->Fill( (momentum1.eta()-momentum2.eta()), momentumRes.m(), weight);
  }
virtual void HMassVSPart::Fill ( const reco::Particle::LorentzVector p41,
const reco::Particle::LorentzVector p42,
const reco::Particle::LorentzVector p4Res,
const double &  weight = 1. 
) [inline, virtual]

Reimplemented from Histograms.

Definition at line 885 of file Histograms.h.

References Fill(), and CommonMethods::weight().

  {
    Fill(CLHEP::HepLorentzVector(p41.x(),p41.y(),p41.z(),p41.t()),
         CLHEP::HepLorentzVector(p42.x(),p42.y(),p42.z(),p42.t()),
         CLHEP::HepLorentzVector(p4Res.x(),p4Res.y(),p4Res.z(),p4Res.t()),
         weight);
  }
virtual void HMassVSPart::Fill ( const CLHEP::HepLorentzVector &  momentum1,
const CLHEP::HepLorentzVector &  momentum2,
const int  charge,
const double &  weight = 1. 
) [inline, virtual]

Reimplemented from Histograms.

Definition at line 962 of file Histograms.h.

References hMassVSEta_, hMassVSEtaMinus_, hMassVSEtaPhiMinus_, hMassVSEtaPhiPlus_, hMassVSEtaPlus_, hMassVSPhiMinus_, hMassVSPhiPlus_, hMassVSPt_, LogDebug, and CommonMethods::weight().

  {
     hMassVSPt_->Fill(momentum1.perp(),momentum2.m(), weight); 
     //hMassVSPt_prof_->Fill(momentum1.perp(),momentum2.m()); 
     

     hMassVSEta_->Fill(momentum1.eta(),momentum2.m(), weight);                                                           
     //hMassVSEta_prof_->Fill(momentum1.eta(),momentum2.m()); 

     if(charge>0){
       hMassVSPhiPlus_->Fill(momentum1.phi(),momentum2.m(), weight);
       hMassVSEtaPlus_->Fill(momentum1.eta(),momentum2.m(), weight); 
       hMassVSEtaPhiPlus_->Fill(momentum1.phi(),momentum1.eta(),momentum2.m(), weight);
     }
     else if(charge<0){
       hMassVSPhiMinus_->Fill(momentum1.phi(),momentum2.m(), weight);
       hMassVSEtaMinus_->Fill(momentum1.eta(),momentum2.m(), weight); 
       hMassVSEtaPhiMinus_->Fill(momentum1.phi(),momentum1.eta(),momentum2.m(), weight);
     }
     else {
       LogDebug("Histograms") << "HMassVSPart: wrong charge value = " << charge << std::endl;
       abort();
     }
   }
virtual void HMassVSPart::Fill ( const reco::Particle::LorentzVector p41,
const reco::Particle::LorentzVector p42,
const int  charge,
const double &  weight = 1. 
) [inline, virtual]

Reimplemented from Histograms.

Definition at line 879 of file Histograms.h.

References CommonMethods::weight().

Referenced by Fill().

  {
    Fill(CLHEP::HepLorentzVector(p41.x(),p41.y(),p41.z(),p41.t()),
         CLHEP::HepLorentzVector(p42.x(),p42.y(),p42.z(),p42.t()), charge, weight);
  }
virtual void HMassVSPart::Write ( ) [inline, virtual]

Implements Histograms.

Definition at line 987 of file Histograms.h.

References hMassVSCosThetaCS_, hMassVSCosThetaCS_prof, hMassVSEta_, hMassVSEtaMinus_, hMassVSEtaPhiMinus_, hMassVSEtaPhiPlus_, hMassVSEtaPlus_, hMassVSEtaPlusEtaMinus_, hMassVSEtaPlusMinusDiff_, hMassVSPhiCS_, hMassVSPhiMinus_, hMassVSPhiPlus_, hMassVSPhiPlusMinusDiff_, hMassVSPhiPlusPhiMinus_, and hMassVSPt_.

                       {
    hMassVSPt_->Write();
    hMassVSEta_->Write();
    hMassVSPhiPlus_->Write();
    hMassVSPhiMinus_->Write();

    hMassVSEtaPhiPlus_->Write();
    hMassVSEtaPhiMinus_->Write();
    hMassVSEtaPlus_->Write();
    hMassVSEtaMinus_->Write();

    hMassVSPhiPlusPhiMinus_->Write();
    hMassVSEtaPlusEtaMinus_->Write();
    hMassVSCosThetaCS_->Write();
    hMassVSPhiCS_->Write();

    hMassVSPhiPlusMinusDiff_->Write();
    hMassVSEtaPlusMinusDiff_->Write();
    hMassVSCosThetaCS_prof->Write();

    //hMassVSPt_prof_->Write();
    //hMassVSEta_prof_->Write();    
    //hMassVSPhiPlus_prof_->Write();
    //hMassVSPhiMinus_prof_->Write();
  }

Member Data Documentation

Definition at line 1043 of file Histograms.h.

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

TProfile* HMassVSPart::hMassVSCosThetaCS_prof [protected]

Definition at line 1057 of file Histograms.h.

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

TH2F* HMassVSPart::hMassVSEta_ [protected]

Definition at line 1040 of file Histograms.h.

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

TH2F* HMassVSPart::hMassVSEtaMinus_ [protected]

Definition at line 1049 of file Histograms.h.

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

Definition at line 1047 of file Histograms.h.

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

Definition at line 1046 of file Histograms.h.

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

TH2F* HMassVSPart::hMassVSEtaPlus_ [protected]

Definition at line 1048 of file Histograms.h.

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

Definition at line 1055 of file Histograms.h.

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

Definition at line 1052 of file Histograms.h.

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

TH2F* HMassVSPart::hMassVSPhiCS_ [protected]

Definition at line 1044 of file Histograms.h.

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

TH2F* HMassVSPart::hMassVSPhiMinus_ [protected]

Definition at line 1042 of file Histograms.h.

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

TH2F* HMassVSPart::hMassVSPhiPlus_ [protected]

Definition at line 1041 of file Histograms.h.

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

Definition at line 1051 of file Histograms.h.

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

Definition at line 1054 of file Histograms.h.

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

TH2F* HMassVSPart::hMassVSPt_ [protected]

Definition at line 1039 of file Histograms.h.

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