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 | Private Attributes
HcalTB02Histo Class Reference

#include <SimG4CMS/HcalTestBeam/interface/HcalTB02Histo.h>

Public Member Functions

void fillAllTime (float v)
 
void fillProfile (int ilayer, float value)
 
void fillTransProf (float u, float v)
 
float getMean (int ilayer)
 
float getRMS (int ilayer)
 
 HcalTB02Histo (const edm::ParameterSet &ps)
 
virtual ~HcalTB02Histo ()
 

Private Attributes

std::string fileName
 
std::vector< TH1D * > rt_histoProf
 
TH1D * rt_tbTimes
 
TH2D * rt_TransProf
 
bool verbose
 

Detailed Description

Description: Histogram handling for Hcal Test Beam 2002 studies

Usage: Sets up histograms and stores in a file

Definition at line 30 of file HcalTB02Histo.h.

Constructor & Destructor Documentation

HcalTB02Histo::HcalTB02Histo ( const edm::ParameterSet ps)

Definition at line 26 of file HcalTB02Histo.cc.

References fileName, edm::ParameterSet::getUntrackedParameter(), h, edm::Service< T >::isAvailable(), TFileService::make(), rt_histoProf, rt_tbTimes, rt_TransProf, compare::tfile, runGCPTkAlMap::title, and verbose.

26  : rt_tbTimes(nullptr), rt_TransProf(nullptr) {
27  verbose = ps.getUntrackedParameter<bool>("Verbose", false);
28  edm::LogVerbatim("HcalTBSim") << "HcalTB02Histo:: initialised with o/p file " << fileName << " verbosity " << verbose;
29 
30  // Book histograms
32 
33  if (!tfile.isAvailable())
34  throw cms::Exception("BadConfig") << "TFileService unavailable: "
35  << "please add it to config file";
36 
37  char title[80];
38  for (int ilayer = 0; ilayer < 19; ilayer++) {
39  sprintf(title, "Scint. Energy in Layer %d ", ilayer);
40  TH1D* h = tfile->make<TH1D>(title, title, 500, 0., 1.5);
41  rt_histoProf.push_back(h);
42 #ifdef EDM_ML_DEBUG
43  edm::LogVerbatim("HcalTBSim") << "HcalTB02Histo:: Initialise Histo " << title;
44 #endif
45  }
46  sprintf(title, "All Hit Time slices");
47  rt_tbTimes = tfile->make<TH1D>(title, title, 100, 0., 100.);
48 #ifdef EDM_ML_DEBUG
49  edm::LogVerbatim("HcalTBSim") << "HcalTB02Histo:: Initialise Histo " << title;
50 #endif
51  sprintf(title, "Transv. Shower Profile");
52  rt_TransProf = tfile->make<TH2D>(title, title, 100, 0., 1., 1000, 0., 0.5);
53 #ifdef EDM_ML_DEBUG
54  edm::LogVerbatim("HcalTBSim") << "HcalTB02Histo:: Initialise Histo " << title;
55 #endif
56 }
Log< level::Info, true > LogVerbatim
T getUntrackedParameter(std::string const &, T const &) const
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
std::vector< TH1D * > rt_histoProf
Definition: HcalTB02Histo.h:50
bool isAvailable() const
Definition: Service.h:40
TH2D * rt_TransProf
Definition: HcalTB02Histo.h:49
TH1D * rt_tbTimes
Definition: HcalTB02Histo.h:48
tuple tfile
Definition: compare.py:324
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
std::string fileName
Definition: HcalTB02Histo.h:45
HcalTB02Histo::~HcalTB02Histo ( )
virtual

Definition at line 58 of file HcalTB02Histo.cc.

58  {
59 #ifdef EDM_ML_DEBUG
60  edm::LogVerbatim("HcalTBSim") << " Deleting HcalTB02Histo";
61 #endif
62 }
Log< level::Info, true > LogVerbatim

Member Function Documentation

void HcalTB02Histo::fillAllTime ( float  v)

Definition at line 68 of file HcalTB02Histo.cc.

References LogDebug, rt_tbTimes, and findQualityFiles::v.

68  {
69  LogDebug("HcalTBSim") << "HcalTB02Histo::Fill Time histo with " << v;
70  if (rt_tbTimes) {
71  rt_tbTimes->Fill(v);
72  }
73 }
TH1D * rt_tbTimes
Definition: HcalTB02Histo.h:48
#define LogDebug(id)
void HcalTB02Histo::fillProfile ( int  ilayer,
float  value 
)

Definition at line 83 of file HcalTB02Histo.cc.

References LogDebug, rt_histoProf, and relativeConstraints::value.

83  {
84  if (ilayer < (int)(rt_histoProf.size())) {
85  rt_histoProf[ilayer]->Fill(value);
86  LogDebug("HcalTBSim") << "HcalTB02Histo::Fill profile " << ilayer << " with " << value;
87  }
88 }
std::vector< TH1D * > rt_histoProf
Definition: HcalTB02Histo.h:50
#define LogDebug(id)
void HcalTB02Histo::fillTransProf ( float  u,
float  v 
)

Definition at line 75 of file HcalTB02Histo.cc.

References LogDebug, rt_TransProf, and findQualityFiles::v.

75  {
76  LogDebug("HcalTBSim") << "HcalTB02Histo:::Fill Shower Transv. Profile histo"
77  << " with " << u << " and " << v;
78  if (rt_TransProf) {
79  rt_TransProf->Fill(u, v);
80  }
81 }
TH2D * rt_TransProf
Definition: HcalTB02Histo.h:49
#define LogDebug(id)
float HcalTB02Histo::getMean ( int  ilayer)

Definition at line 90 of file HcalTB02Histo.cc.

References rt_histoProf.

90  {
91  if (ilayer < (int)(rt_histoProf.size())) {
92  return rt_histoProf[ilayer]->GetMean();
93  } else {
94  return 0;
95  }
96 }
std::vector< TH1D * > rt_histoProf
Definition: HcalTB02Histo.h:50
float HcalTB02Histo::getRMS ( int  ilayer)

Definition at line 98 of file HcalTB02Histo.cc.

References rt_histoProf.

98  {
99  if (ilayer < (int)(rt_histoProf.size())) {
100  return rt_histoProf[ilayer]->GetRMS();
101  } else {
102  return 0;
103  }
104 }
std::vector< TH1D * > rt_histoProf
Definition: HcalTB02Histo.h:50

Member Data Documentation

std::string HcalTB02Histo::fileName
private

Definition at line 45 of file HcalTB02Histo.h.

Referenced by HcalTB02Histo().

std::vector<TH1D *> HcalTB02Histo::rt_histoProf
private

Definition at line 50 of file HcalTB02Histo.h.

Referenced by fillProfile(), getMean(), getRMS(), and HcalTB02Histo().

TH1D* HcalTB02Histo::rt_tbTimes
private

Definition at line 48 of file HcalTB02Histo.h.

Referenced by fillAllTime(), and HcalTB02Histo().

TH2D* HcalTB02Histo::rt_TransProf
private

Definition at line 49 of file HcalTB02Histo.h.

Referenced by fillTransProf(), and HcalTB02Histo().

bool HcalTB02Histo::verbose
private

Definition at line 46 of file HcalTB02Histo.h.

Referenced by HcalTB02Histo().