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
 
double etaBeam_
 
TH1D * iEta
 
TH1D * iniE
 
TH1D * iPhi
 
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 25 of file HcalTB06Histo.cc.

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

25  {
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 
33  // Book histograms
35 
36  if ( !tfile.isAvailable() )
37  throw cms::Exception("BadConfig") << "TFileService unavailable: "
38  << "please add it to config file";
39  iniE = tfile->make<TH1D>("iniE", "Incident Energy (GeV)", 4000, 0., em1);
40  iEta = tfile->make<TH1D>("iEta", "Eta at incidence ", 300, 0., 3.);
41  iPhi = tfile->make<TH1D>("iPhi", "Phi at incidence ", 300, -1., 1.);
42  edepS= tfile->make<TH1D>("edepS", "Energy deposit == Total",4000, 0., em1);
43  edecS= tfile->make<TH1D>("edecS", "Energy deposit == ECal ",300, -2., 28.);
44  edhcS= tfile->make<TH1D>("edhcS", "Energy deposit == HCal ",4000, 0., em2);
45  edepN= tfile->make<TH1D>("edepN", "Etot/Ebeam ", 200, -2.5, 2.5);
46  edecN= tfile->make<TH1D>("edecN", "Eecal/Ebeam ", 200, -2.5, 2.5);
47  edhcN= tfile->make<TH1D>("edhcN", "Ehcal/Ebeam ", 200, -2.5, 2.5);
48  edehS= tfile->make<TH2D>("edehS", "Hcal vs Ecal", 100,0.,em1, 100, 0.,em2);
49 
50  if (mkTree_) {
51  tree_ = tfile->make<TTree>("TB06Sim", "TB06Sim");
52  tree_->Branch("eBeam_", &eBeam_, "eBeam_/D");
53  tree_->Branch("etaBeam_", &etaBeam_, "etaBeam_/D");
54  tree_->Branch("phiBeam_", &phiBeam_, "phiBeam_/D");
55  tree_->Branch("edepEC_", &edepEC_, "edepEC_/D");
56  tree_->Branch("edepHB_", &edepHB_, "edepHB_/D");
57  tree_->Branch("edepHO_", &edepHO_, "edepHO_/D");
58  tree_->Branch("noiseEC_", &noiseEC_, "noiseEC_/D");
59  tree_->Branch("noiseHB_", &noiseHB_, "noiseHB_/D");
60  tree_->Branch("noiseHO_", &noiseHO_, "noiseHO_/D");
61  tree_->Branch("edepS1_", &edepS1_, "edepS1_/D");
62  tree_->Branch("edepS2_", &edepS2_, "edepS2_/D");
63  tree_->Branch("edepS3_", &edepS3_, "edepS3_/D");
64  tree_->Branch("edepS4_", &edepS4_, "edepS4_/D");
65  tree_->Branch("edepVC_", &edepVC_, "edepVC_/D");
66  tree_->Branch("edepS7_", &edepS7_, "edepS7_/D");
67  tree_->Branch("edepS8_", &edepS8_, "edepS8_/D");
68  }
69 }
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:46
HcalTB06Histo::~HcalTB06Histo ( )
virtual

Definition at line 71 of file HcalTB06Histo.cc.

71 {}

Member Function Documentation

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

Definition at line 90 of file HcalTB06Histo.cc.

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

Referenced by HcalTB06Analysis::analyze().

90  {
91 
92  if (verbose_)
93  edm::LogInfo("HcalTBSim") << "HcalTB06Histo:::fillEdep: Simulated Total "
94  << 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  edehS->Fill(eecals, ehcals);
103 }
void HcalTB06Histo::fillPrimary ( double  energy,
double  eta,
double  phi 
)

Definition at line 77 of file HcalTB06Histo.cc.

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

Referenced by HcalTB06Analysis::analyze().

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

Definition at line 105 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().

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

Member Data Documentation

double HcalTB06Histo::eBeam_
private

Definition at line 54 of file HcalTB06Histo.h.

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

TH1D * HcalTB06Histo::edecN
private

Definition at line 51 of file HcalTB06Histo.h.

Referenced by fillEdep(), and HcalTB06Histo().

TH1D * HcalTB06Histo::edecS
private

Definition at line 50 of file HcalTB06Histo.h.

Referenced by fillEdep(), and HcalTB06Histo().

TH2D* HcalTB06Histo::edehS
private

Definition at line 52 of file HcalTB06Histo.h.

Referenced by fillEdep(), and HcalTB06Histo().

double HcalTB06Histo::edepEC_
private

Definition at line 55 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::edepHB_
private

Definition at line 55 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::edepHO_
private

Definition at line 55 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

TH1D* HcalTB06Histo::edepN
private

Definition at line 51 of file HcalTB06Histo.h.

Referenced by fillEdep(), and HcalTB06Histo().

TH1D* HcalTB06Histo::edepS
private

Definition at line 50 of file HcalTB06Histo.h.

Referenced by fillEdep(), and HcalTB06Histo().

double HcalTB06Histo::edepS1_
private

Definition at line 57 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::edepS2_
private

Definition at line 57 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::edepS3_
private

Definition at line 57 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::edepS4_
private

Definition at line 57 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::edepS7_
private

Definition at line 57 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::edepS8_
private

Definition at line 57 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::edepVC_
private

Definition at line 57 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

TH1D * HcalTB06Histo::edhcN
private

Definition at line 51 of file HcalTB06Histo.h.

Referenced by fillEdep(), and HcalTB06Histo().

TH1D * HcalTB06Histo::edhcS
private

Definition at line 50 of file HcalTB06Histo.h.

Referenced by fillEdep(), and HcalTB06Histo().

double HcalTB06Histo::etaBeam_
private

Definition at line 54 of file HcalTB06Histo.h.

Referenced by fillPrimary(), and HcalTB06Histo().

TH1D * HcalTB06Histo::iEta
private

Definition at line 49 of file HcalTB06Histo.h.

Referenced by fillPrimary(), and HcalTB06Histo().

TH1D* HcalTB06Histo::iniE
private

Definition at line 49 of file HcalTB06Histo.h.

Referenced by fillPrimary(), and HcalTB06Histo().

TH1D * HcalTB06Histo::iPhi
private

Definition at line 49 of file HcalTB06Histo.h.

Referenced by fillPrimary(), and HcalTB06Histo().

bool HcalTB06Histo::mkTree_
private

Definition at line 47 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::noiseEC_
private

Definition at line 56 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::noiseHB_
private

Definition at line 56 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::noiseHO_
private

Definition at line 56 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

double HcalTB06Histo::phiBeam_
private

Definition at line 54 of file HcalTB06Histo.h.

Referenced by fillPrimary(), and HcalTB06Histo().

TTree* HcalTB06Histo::tree_
private

Definition at line 53 of file HcalTB06Histo.h.

Referenced by fillTree(), and HcalTB06Histo().

bool HcalTB06Histo::verbose_
private

Definition at line 47 of file HcalTB06Histo.h.

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