CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HcalTB06Histo Class Reference

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

Public Member Functions

void fillEdep (double etots, double eecals, double ehcals)
 
void fillPrimary (double energy, double eta, double phi)
 
void fillTree (std::vector< double > &ecalo, std::vector< double > &etrig)
 
 HcalTB06Histo (const edm::ParameterSet &ps)
 
virtual ~HcalTB06Histo ()
 

Private Attributes

double eBeam_
 
TH1D * edecN
 
TH1D * edecS
 
TH2D * edehS
 
double edepEC_
 
double edepHB_
 
double edepHO_
 
TH1D * edepN
 
TH1D * edepS
 
double edepS1_
 
double edepS2_
 
double edepS3_
 
double edepS4_
 
double edepS7_
 
double edepS8_
 
double edepVC_
 
TH1D * edhcN
 
TH1D * edhcS
 
TH1D * emhcN
 
double etaBeam_
 
TH1D * iEta
 
TH1D * iniE
 
TH1D * iPhi
 
double mip_
 
bool mkTree_
 
double noiseEC_
 
double noiseHB_
 
double noiseHO_
 
double phiBeam_
 
TTree * tree_
 
bool verbose_
 

Detailed Description

Description: Histogram handling for Hcal Test Beam 2006 studies

Usage: Sets up histograms and stores in a file

Definition at line 31 of file HcalTB06Histo.h.

Constructor & Destructor Documentation

HcalTB06Histo::HcalTB06Histo ( const edm::ParameterSet ps)

Definition at line 26 of file HcalTB06Histo.cc.

References eBeam_, edecN, edecS, edehS, edepEC_, edepHB_, edepHO_, edepN, edepS, edepS1_, edepS2_, edepS3_, edepS4_, edepS7_, edepS8_, edepVC_, edhcN, edhcS, emhcN, etaBeam_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), iEta, iniE, iPhi, edm::Service< T >::isAvailable(), TFileService::make(), mip_, mkTree_, noiseEC_, noiseHB_, noiseHO_, phiBeam_, compare::tfile, tree_, and verbose_.

26  {
27  verbose_ = ps.getUntrackedParameter<bool>("Verbose", false);
28  double em1 = ps.getUntrackedParameter<double>("ETtotMax", 400.);
29  double em2 = ps.getUntrackedParameter<double>("EHCalMax", 4.0);
30  mkTree_ = ps.getUntrackedParameter<bool>("MakeTree", false);
31  eBeam_ = 50.;
32  mip_ = ps.getParameter<double>("MIP");
33  edm::LogInfo("HcalTBSim") << "Verbose :" << verbose_ << " MakeTree: " << mkTree_ << " EMax: " << em1 << ":" << em2
34  << " MIP " << mip_;
35 
36  // Book histograms
38 
39  if (!tfile.isAvailable())
40  throw cms::Exception("BadConfig") << "TFileService unavailable: "
41  << "please add it to config file";
42  iniE = tfile->make<TH1D>("iniE", "Incident Energy (GeV)", 4000, 0., em1);
43  iEta = tfile->make<TH1D>("iEta", "Eta at incidence ", 300, 0., 3.);
44  iPhi = tfile->make<TH1D>("iPhi", "Phi at incidence ", 300, -1., 1.);
45  edepS = tfile->make<TH1D>("edepS", "Energy deposit == Total", 4000, 0., em1);
46  edecS = tfile->make<TH1D>("edecS", "Energy deposit == ECal ", 300, -2., 28.);
47  edhcS = tfile->make<TH1D>("edhcS", "Energy deposit == HCal ", 4000, 0., em2);
48  edepN = tfile->make<TH1D>("edepN", "Etot/Ebeam ", 200, -2.5, 2.5);
49  edecN = tfile->make<TH1D>("edecN", "Eecal/Ebeam ", 200, -2.5, 2.5);
50  edhcN = tfile->make<TH1D>("edhcN", "Ehcal/Ebeam ", 200, -2.5, 2.5);
51  emhcN = tfile->make<TH1D>("emhcN", "Ehcal/Ebeam MIP in Ecal", 200, -2.5, 2.5);
52  edehS = tfile->make<TH2D>("edehS", "Hcal vs Ecal", 100, 0., em1, 100, 0., em2);
53 
54  if (mkTree_) {
55  tree_ = tfile->make<TTree>("TB06Sim", "TB06Sim");
56  tree_->Branch("eBeam_", &eBeam_, "eBeam_/D");
57  tree_->Branch("etaBeam_", &etaBeam_, "etaBeam_/D");
58  tree_->Branch("phiBeam_", &phiBeam_, "phiBeam_/D");
59  tree_->Branch("edepEC_", &edepEC_, "edepEC_/D");
60  tree_->Branch("edepHB_", &edepHB_, "edepHB_/D");
61  tree_->Branch("edepHO_", &edepHO_, "edepHO_/D");
62  tree_->Branch("noiseEC_", &noiseEC_, "noiseEC_/D");
63  tree_->Branch("noiseHB_", &noiseHB_, "noiseHB_/D");
64  tree_->Branch("noiseHO_", &noiseHO_, "noiseHO_/D");
65  tree_->Branch("edepS1_", &edepS1_, "edepS1_/D");
66  tree_->Branch("edepS2_", &edepS2_, "edepS2_/D");
67  tree_->Branch("edepS3_", &edepS3_, "edepS3_/D");
68  tree_->Branch("edepS4_", &edepS4_, "edepS4_/D");
69  tree_->Branch("edepVC_", &edepVC_, "edepVC_/D");
70  tree_->Branch("edepS7_", &edepS7_, "edepS7_/D");
71  tree_->Branch("edepS8_", &edepS8_, "edepS8_/D");
72  }
73 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
bool isAvailable() const
Definition: Service.h:40
HcalTB06Histo::~HcalTB06Histo ( )
virtual

Definition at line 75 of file HcalTB06Histo.cc.

75 {}

Member Function Documentation

void HcalTB06Histo::fillEdep ( double  etots,
double  eecals,
double  ehcals 
)

Definition at line 92 of file HcalTB06Histo.cc.

References eBeam_, edecN, edecS, edehS, edepN, edepS, edhcN, edhcS, emhcN, mip_, and verbose_.

Referenced by HcalTB06Analysis::analyze().

92  {
93  if (verbose_)
94  edm::LogInfo("HcalTBSim") << "HcalTB06Histo:::fillEdep: Simulated Total " << etots << " ECal " << eecals << " HCal "
95  << ehcals;
96  edepS->Fill(etots);
97  edecS->Fill(eecals);
98  edhcS->Fill(ehcals);
99  edepN->Fill(etots / eBeam_);
100  edecN->Fill(eecals / eBeam_);
101  edhcN->Fill(ehcals / eBeam_);
102  if (eecals <= mip_) {
103  emhcN->Fill(etots / eBeam_);
104  }
105  edehS->Fill(eecals, ehcals);
106 }
void HcalTB06Histo::fillPrimary ( double  energy,
double  eta,
double  phi 
)

Definition at line 81 of file HcalTB06Histo.cc.

References eBeam_, HCALHighEnergyHPDFilter_cfi::energy, PVValHelper::eta, etaBeam_, iEta, iniE, iPhi, phi, phiBeam_, and verbose_.

Referenced by HcalTB06Analysis::analyze().

81  {
82  if (verbose_)
83  edm::LogInfo("HcalTBSim") << "HcalTB06Histo::fillPrimary: Energy " << energy << " Eta " << eta << " Phi " << phi;
84  eBeam_ = energy;
85  etaBeam_ = eta;
86  phiBeam_ = phi;
87  iniE->Fill(energy);
88  iEta->Fill(eta);
89  iPhi->Fill(phi);
90 }
void HcalTB06Histo::fillTree ( std::vector< double > &  ecalo,
std::vector< double > &  etrig 
)

Definition at line 108 of file HcalTB06Histo.cc.

References edepEC_, edepHB_, edepHO_, edepS1_, edepS2_, edepS3_, edepS4_, edepS7_, edepS8_, edepVC_, mkTree_, noiseEC_, noiseHB_, noiseHO_, tree_, and verbose_.

Referenced by HcalTB06Analysis::analyze().

108  {
109  if (mkTree_) {
110  edepEC_ = ecalo[0];
111  noiseEC_ = ecalo[1];
112  edepHB_ = ecalo[2];
113  noiseHB_ = ecalo[3];
114  edepHO_ = ecalo[4];
115  noiseHO_ = ecalo[5];
116  edepS1_ = etrig[0];
117  edepS2_ = etrig[1];
118  edepS3_ = etrig[2];
119  edepS4_ = etrig[3];
120  edepVC_ = etrig[4];
121  edepS7_ = etrig[5];
122  edepS8_ = etrig[6];
123  tree_->Fill();
124  if (verbose_)
125  edm::LogInfo("HcalTBSim") << "HcalTB06Histo:::fillTree: Energies " << edepEC_ << ":" << noiseEC_ << ":" << edepHB_
126  << ":" << noiseHB_ << ":" << edepHO_ << ":" << noiseHO_ << " Trigger counters "
127  << edepS1_ << ":" << edepS2_ << ":" << edepS3_ << ":" << edepS4_ << ":" << edepVC_
128  << ":" << edepS7_ << ":" << edepS8_;
129  }
130 }

Member Data Documentation

double HcalTB06Histo::eBeam_
private

Definition at line 51 of file HcalTB06Histo.h.

Referenced by fillEdep(), fillPrimary(), and HcalTB06Histo().

TH1D * HcalTB06Histo::edecN
private

Definition at line 48 of file HcalTB06Histo.h.

Referenced by fillEdep(), and HcalTB06Histo().

TH1D * HcalTB06Histo::edecS
private

Definition at line 47 of file HcalTB06Histo.h.

Referenced by fillEdep(), and HcalTB06Histo().

TH2D* HcalTB06Histo::edehS
private

Definition at line 49 of file HcalTB06Histo.h.

Referenced by fillEdep(), and HcalTB06Histo().

double HcalTB06Histo::edepEC_
private

Definition at line 52 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::edepHB_
private

Definition at line 52 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::edepHO_
private

Definition at line 52 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

TH1D* HcalTB06Histo::edepN
private

Definition at line 48 of file HcalTB06Histo.h.

Referenced by fillEdep(), and HcalTB06Histo().

TH1D* HcalTB06Histo::edepS
private

Definition at line 47 of file HcalTB06Histo.h.

Referenced by fillEdep(), and HcalTB06Histo().

double HcalTB06Histo::edepS1_
private

Definition at line 54 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::edepS2_
private

Definition at line 54 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::edepS3_
private

Definition at line 54 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::edepS4_
private

Definition at line 54 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::edepS7_
private

Definition at line 54 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::edepS8_
private

Definition at line 54 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::edepVC_
private

Definition at line 54 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

TH1D * HcalTB06Histo::edhcN
private

Definition at line 48 of file HcalTB06Histo.h.

Referenced by fillEdep(), and HcalTB06Histo().

TH1D * HcalTB06Histo::edhcS
private

Definition at line 47 of file HcalTB06Histo.h.

Referenced by fillEdep(), and HcalTB06Histo().

TH1D * HcalTB06Histo::emhcN
private

Definition at line 48 of file HcalTB06Histo.h.

Referenced by fillEdep(), and HcalTB06Histo().

double HcalTB06Histo::etaBeam_
private

Definition at line 51 of file HcalTB06Histo.h.

Referenced by fillPrimary(), and HcalTB06Histo().

TH1D * HcalTB06Histo::iEta
private

Definition at line 46 of file HcalTB06Histo.h.

Referenced by fillPrimary(), and HcalTB06Histo().

TH1D* HcalTB06Histo::iniE
private

Definition at line 46 of file HcalTB06Histo.h.

Referenced by fillPrimary(), and HcalTB06Histo().

TH1D * HcalTB06Histo::iPhi
private

Definition at line 46 of file HcalTB06Histo.h.

Referenced by fillPrimary(), and HcalTB06Histo().

double HcalTB06Histo::mip_
private

Definition at line 55 of file HcalTB06Histo.h.

Referenced by fillEdep(), and HcalTB06Histo().

bool HcalTB06Histo::mkTree_
private

Definition at line 44 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::noiseEC_
private

Definition at line 53 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::noiseHB_
private

Definition at line 53 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::noiseHO_
private

Definition at line 53 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::phiBeam_
private

Definition at line 51 of file HcalTB06Histo.h.

Referenced by fillPrimary(), and HcalTB06Histo().

TTree* HcalTB06Histo::tree_
private

Definition at line 50 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

bool HcalTB06Histo::verbose_
private

Definition at line 44 of file HcalTB06Histo.h.

Referenced by fillEdep(), fillPrimary(), fillTree(), and HcalTB06Histo().