CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
hDigis Class Reference

#include <Histograms.h>

Public Member Functions

void Asymmetry ()
 
void Fill (double time, double theta, int sltype)
 
void FillnDigis (int nDigis)
 
 hDigis (std::string name_)
 
 hDigis (std::string name_, TFile *file)
 
void Write ()
 
virtual ~hDigis ()
 

Public Attributes

std::shared_ptr< TH1F > hMuonDigis
 
std::shared_ptr< TH1F > hMuonTimeDigis
 
std::shared_ptr< TH2F > hMuonTimeDigis_vs_theta
 
std::shared_ptr< TH2F > hMuonTimeDigis_vs_theta_RPhi
 
std::shared_ptr< TH2F > hMuonTimeDigis_vs_theta_RZ
 

Private Member Functions

double TH2asymmetry (TH2F *H)
 

Private Attributes

TString name
 

Detailed Description

Definition at line 35 of file Histograms.h.

Constructor & Destructor Documentation

◆ hDigis() [1/2]

hDigis::hDigis ( std::string  name_)
inline

Definition at line 37 of file Histograms.h.

References hMuonDigis, hMuonTimeDigis, hMuonTimeDigis_vs_theta, hMuonTimeDigis_vs_theta_RPhi, hMuonTimeDigis_vs_theta_RZ, N, and name.

37  {
38  TString N = name_.c_str();
39  name = N;
40  // booking degli istogrammi unidimensionali
41  hMuonDigis = std::make_shared<TH1F>(N + "_hMuonDigis", "number of muon digis", 20, 0., 20.);
42  hMuonTimeDigis = std::make_shared<TH1F>(N + "_hMuonTimeDigis", "Muon digis time box", 2048, 0., 1600.);
43  // control = std::make_shared<TH1F> (N+"_control", "control", 2048, 0.,
44  // 1600.);
45  // 2D
46  hMuonTimeDigis_vs_theta = std::make_shared<TH2F>(
47  N + "_hMuonTimeDigis_vs_theta", "Muon digis time box vs theta", 120, -60, 60, 960, 0., 1500.);
48  hMuonTimeDigis_vs_theta_RZ = std::make_shared<TH2F>(
49  N + "_hMuonTimeDigis_vs_theta_RZ", "Muon digis time box vs theta only RZ SL", 120, -60, 60, 960, 0., 1500.);
50  hMuonTimeDigis_vs_theta_RPhi = std::make_shared<TH2F>(
51  N + "_hMuonTimeDigis_vs_theta_RPhi", "Muon digis time box vs theta only RPhi SL", 120, -60, 60, 960, 0., 1500.);
52  }
TString name
Definition: Histograms.h:126
std::shared_ptr< TH2F > hMuonTimeDigis_vs_theta
Definition: Histograms.h:121
std::shared_ptr< TH2F > hMuonTimeDigis_vs_theta_RPhi
Definition: Histograms.h:123
std::shared_ptr< TH2F > hMuonTimeDigis_vs_theta_RZ
Definition: Histograms.h:122
#define N
Definition: blowfish.cc:9
std::shared_ptr< TH1F > hMuonDigis
Definition: Histograms.h:118
std::shared_ptr< TH1F > hMuonTimeDigis
Definition: Histograms.h:119

◆ ~hDigis()

virtual hDigis::~hDigis ( )
inlinevirtual

Definition at line 54 of file Histograms.h.

54  {
55  // delete hMuonDigis;
56  // delete hMuonTimeDigis;
57  // delete hMuonTimeDigis_vs_theta;
58  // delete hMuonTimeDigis_vs_theta_RZ;
59  // delete hMuonTimeDigis_vs_theta_RPhi;
60  }

◆ hDigis() [2/2]

hDigis::hDigis ( std::string  name_,
TFile *  file 
)
inline

Definition at line 62 of file Histograms.h.

References geometryDiff::file, hMuonDigis, hMuonTimeDigis, hMuonTimeDigis_vs_theta, hMuonTimeDigis_vs_theta_RPhi, hMuonTimeDigis_vs_theta_RZ, hist_helper::make_non_owning_cast(), and name.

62  {
63  name = name_.c_str();
64  // per lettura da file degli istogrammi
65  // 1D
66  hMuonDigis = hist_helper::make_non_owning_cast<TH1F>(file->Get(name + "_MuonDigis"));
67  hMuonTimeDigis = hist_helper::make_non_owning_cast<TH1F>(file->Get(name + "_MuonTimeDigis"));
68  // control = hist_helper::make_non_owning_cast<TH1F>(
69  // file->Get(name+"_control"));
70  // 2D
71  hMuonTimeDigis_vs_theta = hist_helper::make_non_owning_cast<TH2F>(file->Get(name + "_MuonTimeDigis_vs_theta"));
73  hist_helper::make_non_owning_cast<TH2F>(file->Get(name + "_MuonTimeDigis_vs_theta_RZ"));
75  hist_helper::make_non_owning_cast<TH2F>(file->Get(name + "_MuonTimeDigis_vs_theta_RPhi"));
76  }
TString name
Definition: Histograms.h:126
std::shared_ptr< T > make_non_owning_cast(TObject *iT)
Definition: Histograms.h:30
std::shared_ptr< TH2F > hMuonTimeDigis_vs_theta
Definition: Histograms.h:121
std::shared_ptr< TH2F > hMuonTimeDigis_vs_theta_RPhi
Definition: Histograms.h:123
std::shared_ptr< TH2F > hMuonTimeDigis_vs_theta_RZ
Definition: Histograms.h:122
std::shared_ptr< TH1F > hMuonDigis
Definition: Histograms.h:118
std::shared_ptr< TH1F > hMuonTimeDigis
Definition: Histograms.h:119

Member Function Documentation

◆ Asymmetry()

void hDigis::Asymmetry ( )
inline

Definition at line 101 of file Histograms.h.

References gather_cfg::cout, hMuonTimeDigis_vs_theta, hMuonTimeDigis_vs_theta_RPhi, hMuonTimeDigis_vs_theta_RZ, name, and TH2asymmetry().

101  {
102  std::cout << "[" << name << "] theta asymmetry: " << TH2asymmetry(hMuonTimeDigis_vs_theta.get()) << std::endl;
103  std::cout << "[" << name << "] theta_RZ asymmetry: " << TH2asymmetry(hMuonTimeDigis_vs_theta_RZ.get()) << std::endl;
104  std::cout << "[" << name << "] theta_RPhi asymmetry: " << TH2asymmetry(hMuonTimeDigis_vs_theta_RPhi.get())
105  << std::endl;
106  }
TString name
Definition: Histograms.h:126
std::shared_ptr< TH2F > hMuonTimeDigis_vs_theta
Definition: Histograms.h:121
std::shared_ptr< TH2F > hMuonTimeDigis_vs_theta_RPhi
Definition: Histograms.h:123
std::shared_ptr< TH2F > hMuonTimeDigis_vs_theta_RZ
Definition: Histograms.h:122
double TH2asymmetry(TH2F *H)
Definition: Histograms.h:109

◆ Fill()

void hDigis::Fill ( double  time,
double  theta,
int  sltype 
)
inline

Definition at line 90 of file Histograms.h.

References hMuonTimeDigis, hMuonTimeDigis_vs_theta, hMuonTimeDigis_vs_theta_RPhi, hMuonTimeDigis_vs_theta_RZ, theta(), and hcalRecHitTable_cff::time.

Referenced by MuonDTDigis::analyze().

90  {
91  hMuonTimeDigis->Fill(time);
93  if (sltype == 2)
95  else
97  }
std::shared_ptr< TH2F > hMuonTimeDigis_vs_theta
Definition: Histograms.h:121
std::shared_ptr< TH2F > hMuonTimeDigis_vs_theta_RPhi
Definition: Histograms.h:123
std::shared_ptr< TH2F > hMuonTimeDigis_vs_theta_RZ
Definition: Histograms.h:122
std::shared_ptr< TH1F > hMuonTimeDigis
Definition: Histograms.h:119
Geom::Theta< T > theta() const

◆ FillnDigis()

void hDigis::FillnDigis ( int  nDigis)
inline

Definition at line 99 of file Histograms.h.

References hMuonDigis.

99 { hMuonDigis->Fill(nDigis); }
std::shared_ptr< TH1F > hMuonDigis
Definition: Histograms.h:118

◆ TH2asymmetry()

double hDigis::TH2asymmetry ( TH2F *  H)
inlineprivate

Definition at line 109 of file Histograms.h.

References PVValHelper::dx, data-class-funcs::H, and fftjetcommon_cfi::sx.

Referenced by Asymmetry().

109  {
110  double sx = H->Integral(0, 60, 0, 960);
111  double dx = H->Integral(60, 120, 0, 960);
112  double asym = (sx - dx) / (sx + dx);
113  return asym;
114  }

◆ Write()

void hDigis::Write ( )
inline

Definition at line 78 of file Histograms.h.

References hMuonDigis, hMuonTimeDigis, hMuonTimeDigis_vs_theta, hMuonTimeDigis_vs_theta_RPhi, and hMuonTimeDigis_vs_theta_RZ.

78  {
79  // 1D
80  hMuonDigis->Write();
81  hMuonTimeDigis->Write();
82 
83  // 2D
84  hMuonTimeDigis_vs_theta->Write();
87  }
std::shared_ptr< TH2F > hMuonTimeDigis_vs_theta
Definition: Histograms.h:121
std::shared_ptr< TH2F > hMuonTimeDigis_vs_theta_RPhi
Definition: Histograms.h:123
std::shared_ptr< TH2F > hMuonTimeDigis_vs_theta_RZ
Definition: Histograms.h:122
std::shared_ptr< TH1F > hMuonDigis
Definition: Histograms.h:118
std::shared_ptr< TH1F > hMuonTimeDigis
Definition: Histograms.h:119

Member Data Documentation

◆ hMuonDigis

std::shared_ptr<TH1F> hDigis::hMuonDigis

Definition at line 118 of file Histograms.h.

Referenced by FillnDigis(), hDigis(), and Write().

◆ hMuonTimeDigis

std::shared_ptr<TH1F> hDigis::hMuonTimeDigis

Definition at line 119 of file Histograms.h.

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

◆ hMuonTimeDigis_vs_theta

std::shared_ptr<TH2F> hDigis::hMuonTimeDigis_vs_theta

Definition at line 121 of file Histograms.h.

Referenced by Asymmetry(), Fill(), hDigis(), and Write().

◆ hMuonTimeDigis_vs_theta_RPhi

std::shared_ptr<TH2F> hDigis::hMuonTimeDigis_vs_theta_RPhi

Definition at line 123 of file Histograms.h.

Referenced by Asymmetry(), Fill(), hDigis(), and Write().

◆ hMuonTimeDigis_vs_theta_RZ

std::shared_ptr<TH2F> hDigis::hMuonTimeDigis_vs_theta_RZ

Definition at line 122 of file Histograms.h.

Referenced by Asymmetry(), Fill(), hDigis(), and Write().

◆ name

TString hDigis::name
private