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 30 of file HcalTB02Histo.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file HcalTB02Histo.cc.

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

25  :
26  rt_tbTimes(0), rt_TransProf(0) {
27 
28  verbose = ps.getUntrackedParameter<bool>("Verbose", false);
29  edm::LogInfo("HcalTBSim") << "HcalTB02Histo:: initialised with o/p file "
30  << fileName << " verbosity " << verbose;
31 
32  // Book histograms
34 
35  if ( !tfile.isAvailable() )
36  throw cms::Exception("BadConfig") << "TFileService unavailable: "
37  << "please add it to config file";
38 
39  char title[80];
40  for (int ilayer=0; ilayer<19; ilayer++) {
41  sprintf(title, "Scint. Energy in Layer %d ", ilayer);
42  TH1D *h = tfile->make<TH1D>(title, title, 500, 0., 1.5);
43  rt_histoProf.push_back(h);
44  edm::LogInfo("HcalTBSim") << "HcalTB02Histo:: Initialise Histo " <<title;
45  }
46  sprintf(title, "All Hit Time slices");
47  rt_tbTimes = tfile->make<TH1D>(title, title, 100, 0., 100.);
48  edm::LogInfo("HcalTBSim") << "HcalTB02Histo:: Initialise Histo " << title;
49  sprintf(title, "Transv. Shower Profile");
50  rt_TransProf = tfile->make<TH2D>(title, title, 100, 0., 1., 1000, 0., 0.5);
51  edm::LogInfo("HcalTBSim") << "HcalTB02Histo:: Initialise Histo " << title;
52 }
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:53
bool isAvailable() const
Definition: Service.h:46
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:52
TH1D * rt_tbTimes
Definition: HcalTB02Histo.h:51
std::string fileName
Definition: HcalTB02Histo.h:48
HcalTB02Histo::~HcalTB02Histo ( )
virtual

Definition at line 54 of file HcalTB02Histo.cc.

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

Member Function Documentation

void HcalTB02Histo::fillAllTime ( float  v)

Definition at line 62 of file HcalTB02Histo.cc.

References LogDebug, rt_tbTimes, and findQualityFiles::v.

Referenced by HcalTB02Analysis::update().

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

Definition at line 79 of file HcalTB02Histo.cc.

References LogDebug, rt_histoProf, and relativeConstraints::value.

Referenced by HcalTB02Analysis::update().

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

Definition at line 70 of file HcalTB02Histo.cc.

References LogDebug, rt_TransProf, and findQualityFiles::v.

Referenced by HcalTB02Analysis::update().

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

Definition at line 88 of file HcalTB02Histo.cc.

References rt_histoProf.

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

Definition at line 97 of file HcalTB02Histo.cc.

References rt_histoProf.

97  {
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:53

Member Data Documentation

std::string HcalTB02Histo::fileName
private

Definition at line 48 of file HcalTB02Histo.h.

Referenced by HcalTB02Histo().

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

Definition at line 53 of file HcalTB02Histo.h.

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

TH1D* HcalTB02Histo::rt_tbTimes
private

Definition at line 51 of file HcalTB02Histo.h.

Referenced by fillAllTime(), and HcalTB02Histo().

TH2D* HcalTB02Histo::rt_TransProf
private

Definition at line 52 of file HcalTB02Histo.h.

Referenced by fillTransProf(), and HcalTB02Histo().

bool HcalTB02Histo::verbose
private

Definition at line 49 of file HcalTB02Histo.h.

Referenced by HcalTB02Histo().