![]() |
![]() |
#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 |
Usage: Sets up histograms and stores in a file
Definition at line 31 of file HcalTB02Histo.h.
HcalTB02Histo::HcalTB02Histo | ( | const edm::ParameterSet & | ps | ) |
Definition at line 26 of file HcalTB02Histo.cc.
References fileName, edm::ParameterSet::getUntrackedParameter(), h, edm::Service< T >::isAvailable(), rt_histoProf, rt_tbTimes, rt_TransProf, and indexGen::title.
00026 : 00027 rt_tbTimes(0), rt_TransProf(0) { 00028 00029 verbose = ps.getUntrackedParameter<bool>("Verbose", false); 00030 edm::LogInfo("HcalTBSim") << "HcalTB02Histo:: initialised with o/p file " 00031 << fileName << " verbosity " << verbose; 00032 00033 // Book histograms 00034 edm::Service<TFileService> tfile; 00035 00036 if ( !tfile.isAvailable() ) 00037 throw cms::Exception("BadConfig") << "TFileService unavailable: " 00038 << "please add it to config file"; 00039 00040 char title[80]; 00041 for (int ilayer=0; ilayer<19; ilayer++) { 00042 sprintf(title, "Scint. Energy in Layer %d ", ilayer); 00043 TH1D *h = tfile->make<TH1D>(title, title, 500, 0., 1.5); 00044 rt_histoProf.push_back(h); 00045 edm::LogInfo("HcalTBSim") << "HcalTB02Histo:: Initialise Histo " <<title; 00046 } 00047 sprintf(title, "All Hit Time slices"); 00048 rt_tbTimes = tfile->make<TH1D>(title, title, 100, 0., 100.); 00049 edm::LogInfo("HcalTBSim") << "HcalTB02Histo:: Initialise Histo " << title; 00050 sprintf(title, "Transv. Shower Profile"); 00051 rt_TransProf = tfile->make<TH2D>(title, title, 100, 0., 1., 1000, 0., 0.5); 00052 edm::LogInfo("HcalTBSim") << "HcalTB02Histo:: Initialise Histo " << title; 00053 }
HcalTB02Histo::~HcalTB02Histo | ( | ) | [virtual] |
Definition at line 55 of file HcalTB02Histo.cc.
00055 { 00056 edm::LogInfo("HcalTBSim") << " Deleting HcalTB02Histo"; 00057 }
void HcalTB02Histo::fillAllTime | ( | float | v | ) |
Definition at line 63 of file HcalTB02Histo.cc.
References LogDebug, and rt_tbTimes.
Referenced by HcalTB02Analysis::update().
00063 { 00064 00065 LogDebug("HcalTBSim") << "HcalTB02Histo::Fill Time histo with " << v; 00066 if (rt_tbTimes) { 00067 rt_tbTimes->Fill(v); 00068 } 00069 }
Definition at line 80 of file HcalTB02Histo.cc.
References LogDebug, and rt_histoProf.
Referenced by HcalTB02Analysis::update().
00080 { 00081 00082 if (ilayer < (int)(rt_histoProf.size())) { 00083 rt_histoProf[ilayer]->Fill(value); 00084 LogDebug("HcalTBSim") << "HcalTB02Histo::Fill profile " << ilayer 00085 << " with " << value; 00086 } 00087 }
void HcalTB02Histo::fillTransProf | ( | float | u, | |
float | v | |||
) |
Definition at line 71 of file HcalTB02Histo.cc.
References LogDebug, and rt_TransProf.
Referenced by HcalTB02Analysis::update().
00071 { 00072 00073 LogDebug("HcalTBSim") << "HcalTB02Histo:::Fill Shower Transv. Profile histo" 00074 << " with " << u << " and " << v; 00075 if (rt_TransProf) { 00076 rt_TransProf->Fill(u,v); 00077 } 00078 }
float HcalTB02Histo::getMean | ( | int | ilayer | ) |
Definition at line 89 of file HcalTB02Histo.cc.
References rt_histoProf.
00089 { 00090 00091 if (ilayer < (int)(rt_histoProf.size())) { 00092 return rt_histoProf[ilayer]->GetMean(); 00093 } else { 00094 return 0; 00095 } 00096 }
float HcalTB02Histo::getRMS | ( | int | ilayer | ) |
Definition at line 98 of file HcalTB02Histo.cc.
References rt_histoProf.
00098 { 00099 00100 if (ilayer < (int)(rt_histoProf.size())) { 00101 return rt_histoProf[ilayer]->GetRMS(); 00102 } else { 00103 return 0; 00104 } 00105 }
std::string HcalTB02Histo::fileName [private] |
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] |
TH2D* HcalTB02Histo::rt_TransProf [private] |
bool HcalTB02Histo::verbose [private] |
Definition at line 50 of file HcalTB02Histo.h.