CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes | Private Attributes
hMuonStat Class Reference

#include <Histograms.h>

Public Member Functions

void Fill (int hits, double eta, double phi)
 
 hMuonStat (std::string name_)
 
 hMuonStat (std::string name_, TFile *file)
 
void Write ()
 
 ~hMuonStat ()
 

Public Attributes

std::shared_ptr< TH1F > hMuonNumber
 
std::shared_ptr< TH1F > hMuonVsEta
 
std::shared_ptr< TH1F > hMuonVsPhi
 

Private Attributes

TString name
 

Detailed Description

Definition at line 565 of file Histograms.h.

Constructor & Destructor Documentation

hMuonStat::hMuonStat ( std::string  name_)
inline

Definition at line 567 of file Histograms.h.

References hMuonNumber, hMuonVsEta, hMuonVsPhi, N, name, and Geom::pi().

567  {
568  TString N = name_.c_str();
569  name = N;
570  // booking degli istogrammi unidimensionali
571  hMuonNumber = std::make_shared<TH1F>("hMuon" + N, "Muon hits ", 200, 0., 200.);
572  hMuonVsEta = std::make_shared<TH1F>("hMuon" + N + "VsEta", "Muon " + N + " vs eta", 100, -1.2, 1.2);
573  hMuonVsPhi = std::make_shared<TH1F>("hMuon" + N + "VsPhi", "Muon " + N + " vs phi", 100, -Geom::pi(), +Geom::pi());
574  }
TString name
Definition: Histograms.h:608
std::shared_ptr< TH1F > hMuonNumber
Definition: Histograms.h:603
std::shared_ptr< TH1F > hMuonVsEta
Definition: Histograms.h:604
#define N
Definition: blowfish.cc:9
std::shared_ptr< TH1F > hMuonVsPhi
Definition: Histograms.h:605
constexpr double pi()
Definition: Pi.h:31
hMuonStat::hMuonStat ( std::string  name_,
TFile *  file 
)
inline

Definition at line 576 of file Histograms.h.

References hMuonNumber, hMuonVsEta, hMuonVsPhi, hist_helper::make_non_owning_cast(), and name.

576  {
577  name = name_.c_str();
578  // per lettura da file degli istogrammi
579  // 1D
580  hMuonNumber = hist_helper::make_non_owning_cast<TH1F>(file->Get("hMuon" + name));
581  hMuonVsEta = hist_helper::make_non_owning_cast<TH1F>(file->Get("hMuon" + name + "VsEta"));
582  hMuonVsPhi = hist_helper::make_non_owning_cast<TH1F>(file->Get("hMuon" + name + "VsPhi"));
583  }
TString name
Definition: Histograms.h:608
std::shared_ptr< T > make_non_owning_cast(TObject *iT)
Definition: Histograms.h:30
std::shared_ptr< TH1F > hMuonNumber
Definition: Histograms.h:603
std::shared_ptr< TH1F > hMuonVsEta
Definition: Histograms.h:604
std::shared_ptr< TH1F > hMuonVsPhi
Definition: Histograms.h:605
hMuonStat::~hMuonStat ( )
inline

Definition at line 585 of file Histograms.h.

585  {
586  // delete hMuonNumber;
587  // delete hMuonVsEta;
588  // delete hMuonVsPhi;
589  }

Member Function Documentation

void hMuonStat::Fill ( int  hits,
double  eta,
double  phi 
)
inline

Definition at line 596 of file Histograms.h.

References hMuonNumber, hMuonVsEta, and hMuonVsPhi.

596  {
597  hMuonNumber->Fill(hits);
598  hMuonVsEta->Fill(eta, hits);
599  hMuonVsPhi->Fill(phi, hits);
600  }
std::shared_ptr< TH1F > hMuonNumber
Definition: Histograms.h:603
std::shared_ptr< TH1F > hMuonVsEta
Definition: Histograms.h:604
std::shared_ptr< TH1F > hMuonVsPhi
Definition: Histograms.h:605
void hMuonStat::Write ( )
inline

Definition at line 590 of file Histograms.h.

References hMuonNumber, hMuonVsEta, and hMuonVsPhi.

590  {
591  hMuonNumber->Write();
592  hMuonVsEta->Write();
593  hMuonVsPhi->Write();
594  }
std::shared_ptr< TH1F > hMuonNumber
Definition: Histograms.h:603
std::shared_ptr< TH1F > hMuonVsEta
Definition: Histograms.h:604
std::shared_ptr< TH1F > hMuonVsPhi
Definition: Histograms.h:605

Member Data Documentation

std::shared_ptr<TH1F> hMuonStat::hMuonNumber

Definition at line 603 of file Histograms.h.

Referenced by Fill(), hMuonStat(), and Write().

std::shared_ptr<TH1F> hMuonStat::hMuonVsEta

Definition at line 604 of file Histograms.h.

Referenced by Fill(), hMuonStat(), and Write().

std::shared_ptr<TH1F> hMuonStat::hMuonVsPhi

Definition at line 605 of file Histograms.h.

Referenced by Fill(), hMuonStat(), and Write().

TString hMuonStat::name
private