CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 31 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(), TFileDirectory::make(), rt_histoProf, rt_tbTimes, rt_TransProf, indexGen::title, and verbose.

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

Definition at line 55 of file HcalTB02Histo.cc.

55  {
56  edm::LogInfo("HcalTBSim") << " Deleting HcalTB02Histo";
57 }

Member Function Documentation

void HcalTB02Histo::fillAllTime ( float  v)

Definition at line 63 of file HcalTB02Histo.cc.

References LogDebug, rt_tbTimes, and findQualityFiles::v.

Referenced by HcalTB02Analysis::update().

63  {
64 
65  LogDebug("HcalTBSim") << "HcalTB02Histo::Fill Time histo with " << v;
66  if (rt_tbTimes) {
67  rt_tbTimes->Fill(v);
68  }
69 }
#define LogDebug(id)
TH1D * rt_tbTimes
Definition: HcalTB02Histo.h:52
void HcalTB02Histo::fillProfile ( int  ilayer,
float  value 
)

Definition at line 80 of file HcalTB02Histo.cc.

References LogDebug, rt_histoProf, and relativeConstraints::value.

Referenced by HcalTB02Analysis::update().

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

Definition at line 71 of file HcalTB02Histo.cc.

References LogDebug, rt_TransProf, and findQualityFiles::v.

Referenced by HcalTB02Analysis::update().

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

Definition at line 89 of file HcalTB02Histo.cc.

References rt_histoProf.

89  {
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:54
float HcalTB02Histo::getRMS ( int  ilayer)

Definition at line 98 of file HcalTB02Histo.cc.

References rt_histoProf.

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

Member Data Documentation

std::string HcalTB02Histo::fileName
private

Definition at line 49 of file HcalTB02Histo.h.

Referenced by HcalTB02Histo().

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

Definition at line 54 of file HcalTB02Histo.h.

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

TH1D* HcalTB02Histo::rt_tbTimes
private

Definition at line 52 of file HcalTB02Histo.h.

Referenced by fillAllTime(), and HcalTB02Histo().

TH2D* HcalTB02Histo::rt_TransProf
private

Definition at line 53 of file HcalTB02Histo.h.

Referenced by fillTransProf(), and HcalTB02Histo().

bool HcalTB02Histo::verbose
private

Definition at line 50 of file HcalTB02Histo.h.

Referenced by HcalTB02Histo().