CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalTB06Histo.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HcalTestBeam
4 // Class : HcalTB06Histo
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author:
10 // Created: Tue Oct 10 10:14:34 CEST 2006
11 //
12 
13 // system include files
14 #include <iostream>
15 #include <cmath>
16 
17 // user include files
22 
23 //
24 // constructors and destructor
26  iniE(0), iEta(0), iPhi(0), edepS(0), edecS(0), edhcS(0), edehS(0) {
27 
28  verbose = ps.getUntrackedParameter<bool>("Verbose", false);
29  double em1 = ps.getUntrackedParameter<double>("ETtotMax", 400.);
30  double em2 = ps.getUntrackedParameter<double>("EHCalMax", 4.0);
31 
32  // Book histograms
34 
35  if ( !tfile.isAvailable() )
36  throw cms::Exception("BadConfig") << "TFileService unavailable: "
37  << "please add it to config file";
38  iniE = tfile->make<TH1D>("iniE", "Incident Energy (GeV)", 4000, 0., em1);
39  iEta = tfile->make<TH1D>("iEta", "Eta at incidence ", 300, 0., 3.);
40  iPhi = tfile->make<TH1D>("iPhi", "Phi at incidence ", 300, -1., 1.);
41  edepS= tfile->make<TH1D>("edepS", "Energy deposit == Total",4000, 0., em1);
42  edecS= tfile->make<TH1D>("edecS", "Energy deposit == ECal ",4000, 0., em1);
43  edhcS= tfile->make<TH1D>("edhcS", "Energy deposit == HCal ",4000, 0., em2);
44  edehS= tfile->make<TH2D>("edehS", "Hcal vs Ecal", 100,0.,em1, 100, 0.,em2);
45 }
46 
48 
49 //
50 // member functions
51 //
52 
53 void HcalTB06Histo::fillPrimary(double energy, double eta, double phi) {
54 
55  LogDebug("HcalTBSim") << "HcalTB06Histo::fillPrimary: Energy "
56  << energy << " Eta " << eta << " Phi " << phi;
57  iniE->Fill(energy);
58  iEta->Fill(eta);
59  iPhi->Fill(phi);
60 }
61 
62 void HcalTB06Histo::fillEdep(double etots, double eecals, double ehcals) {
63 
64  LogDebug("HcalTBSim") << "HcalTB06Histo:::fillEdep: Simulated Total "
65  << etots << " ECal " << eecals << " HCal " << ehcals;
66  edepS->Fill(etots);
67  edecS->Fill(eecals);
68  edhcS->Fill(ehcals);
69  edehS->Fill(eecals, ehcals);
70 }
#define LogDebug(id)
T getUntrackedParameter(std::string const &, T const &) const
virtual ~HcalTB06Histo()
void fillEdep(double etots, double eecals, double ehcals)
T eta() const
bool isAvailable() const
Definition: Service.h:47
T * make() const
make new ROOT object
void fillPrimary(double energy, double eta, double phi)
HcalTB06Histo(const edm::ParameterSet &ps)
Definition: DDAxes.h:10