CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
CTPPSTrackDistributionPlotter::RPPlots Struct Reference

Public Member Functions

void fill (double x, double y)
 
void init (bool pixel, double pitch)
 
 RPPlots ()
 
void write () const
 

Public Attributes

std::unique_ptr< TH2D > h2_y_vs_x
 
std::unique_ptr< TH1D > h_x
 
std::unique_ptr< TH1D > h_y
 
bool initialized
 
std::unique_ptr< TProfile > p_y_vs_x
 

Detailed Description

Definition at line 47 of file CTPPSTrackDistributionPlotter.cc.

Constructor & Destructor Documentation

CTPPSTrackDistributionPlotter::RPPlots::RPPlots ( )
inline

Member Function Documentation

void CTPPSTrackDistributionPlotter::RPPlots::fill ( double  x,
double  y 
)
inline

Definition at line 73 of file CTPPSTrackDistributionPlotter.cc.

73  {
74  h2_y_vs_x->Fill(x, y);
75  p_y_vs_x->Fill(x, y);
76  h_x->Fill(x);
77  h_y->Fill(y);
78  }
void CTPPSTrackDistributionPlotter::RPPlots::init ( bool  pixel,
double  pitch 
)
inline

Definition at line 57 of file CTPPSTrackDistributionPlotter.cc.

References funct::cos(), M_PI, and digitizers_cfi::pixel.

57  {
58  const double bin_size_x = (pixel) ? pitch * cos(18.4 / 180. * M_PI) : 100E-3;
59 
60  h2_y_vs_x.reset(new TH2D("", "", 300, -10., +70., 300, -30., +30.));
61  p_y_vs_x.reset(new TProfile("", "", 300, -10., +70.));
62 
63  int n_mi = ceil(10. / bin_size_x);
64  int n_pl = ceil(70. / bin_size_x);
65 
66  h_x.reset(new TH1D("", "", n_mi + n_pl, -n_mi * bin_size_x, +n_pl * bin_size_x));
67 
68  h_y.reset(new TH1D("", "", 300, -15., +15.));
69 
70  initialized = true;
71  }
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
#define M_PI
void CTPPSTrackDistributionPlotter::RPPlots::write ( ) const
inline

Definition at line 80 of file CTPPSTrackDistributionPlotter.cc.

80  {
81  h2_y_vs_x->Write("h2_y_vs_x");
82  p_y_vs_x->Write("p_y_vs_x");
83  h_x->Write("h_x");
84  h_y->Write("h_y");
85  }

Member Data Documentation

std::unique_ptr<TH2D> CTPPSTrackDistributionPlotter::RPPlots::h2_y_vs_x

Definition at line 50 of file CTPPSTrackDistributionPlotter.cc.

std::unique_ptr<TH1D> CTPPSTrackDistributionPlotter::RPPlots::h_x

Definition at line 52 of file CTPPSTrackDistributionPlotter.cc.

std::unique_ptr<TH1D> CTPPSTrackDistributionPlotter::RPPlots::h_y

Definition at line 53 of file CTPPSTrackDistributionPlotter.cc.

bool CTPPSTrackDistributionPlotter::RPPlots::initialized

Definition at line 48 of file CTPPSTrackDistributionPlotter.cc.

std::unique_ptr<TProfile> CTPPSTrackDistributionPlotter::RPPlots::p_y_vs_x

Definition at line 51 of file CTPPSTrackDistributionPlotter.cc.