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 Member Functions | Private Attributes
MaterialBudgetEcalHistos Class Reference

#include <MaterialBudgetEcalHistos.h>

Inheritance diagram for MaterialBudgetEcalHistos:
MaterialBudgetFormat

Public Member Functions

virtual void fillEndTrack ()
 
virtual void fillPerStep ()
 
virtual void fillStartTrack ()
 
 MaterialBudgetEcalHistos (MaterialBudgetData *data, TestHistoMgr *mgr, const std::string &fileName)
 
virtual ~MaterialBudgetEcalHistos ()
 
- Public Member Functions inherited from MaterialBudgetFormat
 MaterialBudgetFormat (MaterialBudgetData *data)
 
virtual ~MaterialBudgetFormat ()
 

Private Member Functions

virtual void book ()
 
virtual void hend ()
 

Private Attributes

TestHistoMgrhmgr
 
int MAXNUMBERSTEPS
 
double * theDmb
 
double * theMateId
 
double * theVoluId
 
double * theX
 
double * theY
 
double * theZ
 

Additional Inherited Members

- Protected Attributes inherited from MaterialBudgetFormat
MaterialBudgetDatatheData
 
std::string theFileName
 

Detailed Description

Definition at line 9 of file MaterialBudgetEcalHistos.h.

Constructor & Destructor Documentation

MaterialBudgetEcalHistos::MaterialBudgetEcalHistos ( MaterialBudgetData data,
TestHistoMgr mgr,
const std::string &  fileName 
)
virtual MaterialBudgetEcalHistos::~MaterialBudgetEcalHistos ( )
inlinevirtual

Definition at line 16 of file MaterialBudgetEcalHistos.h.

References hend().

16 { hend(); }

Member Function Documentation

void MaterialBudgetEcalHistos::book ( )
privatevirtual

Definition at line 17 of file MaterialBudgetEcalHistos.cc.

References TestHistoMgr::addHisto1(), TestHistoMgr::addHisto2(), TestHistoMgr::addHistoProf1(), TestHistoMgr::addHistoProf2(), gather_cfg::cout, and hmgr.

Referenced by MaterialBudgetEcalHistos().

18 {
19  std::cout << "=== booking user histos ===" << std::endl;
20 
21  // total X0
22  hmgr->addHistoProf1( new TProfile("10", "MB prof Eta ", 250, -5., 5. ) );
23  hmgr->addHisto1( new TH1F("11", "Eta " , 501, -5., 5. ) );
24  hmgr->addHistoProf1( new TProfile("20", "MB prof Phi ", 180, -3.1416, 3.1416 ) );
25  hmgr->addHisto1( new TH1F("21", "Phi " , 180, -3.1416, 3.1416 ) );
26  hmgr->addHistoProf2( new TProfile2D("30", "MB prof Eta Phi ", 250, -5., 5., 180, -3.1416, 3.1416 ) );
27  hmgr->addHisto2( new TH2F("31", "Eta vs Phi " , 501, -5., 5., 180, -3.1416, 3.1416 ) );
28 
29  // rr
30 
31  // Support
32  hmgr->addHistoProf1( new TProfile("110", "MB prof Eta [Support]", 250, -5.0, 5.0 ) );
33  hmgr->addHisto1( new TH1F("111", "Eta [Support]" , 501, -5., 5. ) );
34  hmgr->addHistoProf1( new TProfile("120", "MB prof Phi [Support]", 180, -3.1416, 3.1416 ) );
35  hmgr->addHisto1( new TH1F("121", "Phi [Support]" , 180, -3.1416, 3.1416 ) );
36  hmgr->addHistoProf2( new TProfile2D("130", "MB prof Eta Phi [Support]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
37  hmgr->addHisto2( new TH2F("131", "Eta vs Phi [Support]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
38  // Sensitive
39  hmgr->addHistoProf1( new TProfile("210", "MB prof Eta [Sensitive]", 250, -5.0, 5.0 ) );
40  hmgr->addHisto1( new TH1F("211", "Eta [Sensitive]" , 501, -5., 5. ) );
41  hmgr->addHistoProf1( new TProfile("220", "MB prof Phi [Sensitive]", 180, -3.1416, 3.1416 ) );
42  hmgr->addHisto1( new TH1F("221", "Phi [Sensitive]" , 180, -3.1416, 3.1416 ) );
43  hmgr->addHistoProf2( new TProfile2D("230", "MB prof Eta Phi [Sensitive]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
44  hmgr->addHisto2( new TH2F("231", "Eta vs Phi [Sensitive]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
45  // Cables
46  hmgr->addHistoProf1( new TProfile("310", "MB prof Eta [Cables]", 250, -5.0, 5.0 ) );
47  hmgr->addHisto1( new TH1F("311", "Eta [Cables]" , 501, -5., 5. ) );
48  hmgr->addHistoProf1( new TProfile("320", "MB prof Phi [Cables]", 180, -3.1416, 3.1416 ) );
49  hmgr->addHisto1( new TH1F("321", "Phi [Cables]" , 180, -3.1416, 3.1416 ) );
50  hmgr->addHistoProf2( new TProfile2D("330", "MB prof Eta Phi [Cables]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
51  hmgr->addHisto2( new TH2F("331", "Eta vs Phi [Cables]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
52  // Cooling
53  hmgr->addHistoProf1( new TProfile("410", "MB prof Eta [Cooling]", 250, -5.0, 5.0 ) );
54  hmgr->addHisto1( new TH1F("411", "Eta [Cooling]" , 501, -5., 5. ) );
55  hmgr->addHistoProf1( new TProfile("420", "MB prof Phi [Cooling]", 180, -3.1416, 3.1416 ) );
56  hmgr->addHisto1( new TH1F("421", "Phi [Cooling]" , 180, -3.1416, 3.1416 ) );
57  hmgr->addHistoProf2( new TProfile2D("430", "MB prof Eta Phi [Cooling]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
58  hmgr->addHisto2( new TH2F("431", "Eta vs Phi [Cooling]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
59  // Electronics
60  hmgr->addHistoProf1( new TProfile("510", "MB prof Eta [Electronics]", 250, -5.0, 5.0 ) );
61  hmgr->addHisto1( new TH1F("511", "Eta [Electronics]" , 501, -5., 5. ) );
62  hmgr->addHistoProf1( new TProfile("520", "MB prof Phi [Electronics]", 180, -3.1416, 3.1416 ) );
63  hmgr->addHisto1( new TH1F("521", "Phi [Electronics]" , 180, -3.1416, 3.1416 ) );
64  hmgr->addHistoProf2( new TProfile2D("530", "MB prof Eta Phi [Electronics]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
65  hmgr->addHisto2( new TH2F("531", "Eta vs Phi [Electronics]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
66  // Other
67  hmgr->addHistoProf1( new TProfile("610", "MB prof Eta [Other]", 250, -5.0, 5.0 ) );
68  hmgr->addHisto1( new TH1F("611", "Eta [Other]" , 501, -5., 5. ) );
69  hmgr->addHistoProf1( new TProfile("620", "MB prof Phi [Other]", 180, -3.1416, 3.1416 ) );
70  hmgr->addHisto1( new TH1F("621", "Phi [Other]" , 180, -3.1416, 3.1416 ) );
71  hmgr->addHistoProf2( new TProfile2D("630", "MB prof Eta Phi [Other]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
72  hmgr->addHisto2( new TH2F("631", "Eta vs Phi [Other]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
73  // Air
74  hmgr->addHistoProf1( new TProfile("710", "MB prof Eta [Air]", 250, -5.0, 5.0 ) );
75  hmgr->addHisto1( new TH1F("711", "Eta [Air]" , 501, -5., 5. ) );
76  hmgr->addHistoProf1( new TProfile("720", "MB prof Phi [Air]", 180, -3.1416, 3.1416 ) );
77  hmgr->addHisto1( new TH1F("721", "Phi [Air]" , 180, -3.1416, 3.1416 ) );
78  hmgr->addHistoProf2( new TProfile2D("730", "MB prof Eta Phi [Air]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
79  hmgr->addHisto2( new TH2F("731", "Eta vs Phi [Air]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
80  //
81 
82  // ECAL specific
83 
84  hmgr->addHistoProf1( new TProfile("1001", "MB prof Eta ECAL Barrel", 340, -1.5, 1.5 ) );
85  hmgr->addHistoProf1( new TProfile("1002", "MB prof Phi ECAL Barrel", 180, -3.1416, 3.1416 ) );
86  hmgr->addHistoProf1( new TProfile("1003", "MB prof Phi ECAL Barrel SM", 20, 0., 20. ) );
87  hmgr->addHistoProf1( new TProfile("2003", "MB prof Phi ECAL Barrel SM", 10, 0., 20. ) );
88  hmgr->addHistoProf1( new TProfile("1004", "MB prof Phi ECAL Barrel SM module 1", 20, 0., 20. ) );
89  hmgr->addHistoProf1( new TProfile("1005", "MB prof Phi ECAL Barrel SM module 2", 20, 0., 20. ) );
90  hmgr->addHistoProf1( new TProfile("1006", "MB prof Phi ECAL Barrel SM module 3", 20, 0., 20. ) );
91  hmgr->addHistoProf1( new TProfile("1007", "MB prof Phi ECAL Barrel SM module 4", 20, 0., 20. ) );
92 
93  hmgr->addHistoProf1( new TProfile("1011", "MB prof Eta ECAL Preshower +", 100, 1.65, 2.6 ) );
94  hmgr->addHistoProf1( new TProfile("1012", "MB prof Phi ECAL Preshower +", 180, -3.1416, 3.1416 ) );
95 
96  hmgr->addHistoProf1( new TProfile("1013", "MB prof Eta ECAL Preshower -", 100, -2.6, -1.65 ) );
97  hmgr->addHistoProf1( new TProfile("1014", "MB prof Phi ECAL Preshower -", 180, -3.1416, 3.1416 ) );
98 
99 
100  // rr
101 
102  std::cout << "=== booking user histos done ===" << std::endl;
103 
104 }
bool addHistoProf2(TProfile2D *ih)
bool addHisto1(TH1F *ih)
bool addHistoProf1(TProfile *ih)
tuple cout
Definition: gather_cfg.py:121
bool addHisto2(TH2F *ih)
void MaterialBudgetEcalHistos::fillEndTrack ( )
virtual

Implements MaterialBudgetFormat.

Definition at line 119 of file MaterialBudgetEcalHistos.cc.

References MaterialBudgetData::getEta(), TestHistoMgr::getHisto1(), TestHistoMgr::getHisto2(), TestHistoMgr::getHistoProf1(), TestHistoMgr::getHistoProf2(), MaterialBudgetData::getPhi(), MaterialBudgetData::getTotalMB(), hmgr, M_PI, phi, and MaterialBudgetFormat::theData.

120 {
121  // Total X0
122  hmgr->getHisto1(11)->Fill(theData->getEta());
123  hmgr->getHisto1(21)->Fill(theData->getPhi());
124  hmgr->getHisto2(31)->Fill(theData->getEta(),theData->getPhi());
125 
129 
130 
131  // ECAL specific
132 
133  if (fabs(theData->getEta()) <= 1.479 ) {
134  static const double twenty ( 20.*degree ) ;
135  const double phi ( theData->getPhi()+M_PI ) ;
136  const double phiModTwenty (( phi - floor(phi/twenty)*twenty )/degree) ;
137  hmgr->getHistoProf1(1001)->Fill(theData->getEta(),theData->getTotalMB());
138  hmgr->getHistoProf1(1002)->Fill(theData->getPhi(),theData->getTotalMB());
139  hmgr->getHistoProf1(1003)->Fill(phiModTwenty,theData->getTotalMB());
140  hmgr->getHistoProf1(2003)->Fill(phiModTwenty,theData->getTotalMB());
141  if (fabs(theData->getEta()) >= 0. && fabs(theData->getEta()) < 0.435 ) {
142  hmgr->getHistoProf1(1004)->Fill(phiModTwenty,theData->getTotalMB());
143  }
144  if (fabs(theData->getEta()) >= 0.435 && fabs(theData->getEta()) < 0.783 ) {
145  hmgr->getHistoProf1(1005)->Fill(phiModTwenty,theData->getTotalMB());
146  }
147  if (fabs(theData->getEta()) > 0.783 && fabs(theData->getEta()) <= 1.131 ) {
148  hmgr->getHistoProf1(1006)->Fill(phiModTwenty,theData->getTotalMB());
149  }
150  if (fabs(theData->getEta()) > 1.131 && fabs(theData->getEta()) <= 1.479 ) {
151  hmgr->getHistoProf1(1007)->Fill(phiModTwenty,theData->getTotalMB());
152  }
153 
154  }
155 
156  if (theData->getEta() >= 1.653 && theData->getEta() <= 2.6 ) {
157  hmgr->getHistoProf1(1011)->Fill(theData->getEta(),theData->getTotalMB());
158  hmgr->getHistoProf1(1012)->Fill(theData->getPhi(),theData->getTotalMB());
159  }
160 
161  if (theData->getEta() >= -2.6 && theData->getEta() <= -1.653 ) {
162  hmgr->getHistoProf1(1013)->Fill(theData->getEta(),theData->getTotalMB());
163  hmgr->getHistoProf1(1014)->Fill(theData->getPhi(),theData->getTotalMB());
164  }
165 
166 
167  // rr
168 }
float getTotalMB() const
TProfile2D * getHistoProf2(int ih)
TProfile * getHistoProf1(int ih)
MaterialBudgetData * theData
float getEta() const
TH2F * getHisto2(int ih)
#define M_PI
float getPhi() const
TH1F * getHisto1(int ih)
void MaterialBudgetEcalHistos::fillPerStep ( )
virtual

Implements MaterialBudgetFormat.

Definition at line 113 of file MaterialBudgetEcalHistos.cc.

114 {
115 
116 }
void MaterialBudgetEcalHistos::fillStartTrack ( )
virtual

Implements MaterialBudgetFormat.

Definition at line 107 of file MaterialBudgetEcalHistos.cc.

108 {
109 
110 }
void MaterialBudgetEcalHistos::hend ( )
privatevirtual

Definition at line 171 of file MaterialBudgetEcalHistos.cc.

References gather_cfg::cout, hmgr, TestHistoMgr::save(), and MaterialBudgetFormat::theFileName.

Referenced by ~MaterialBudgetEcalHistos().

172 {
173  std::cout << "=== save user histos ===" << std::endl;
174  hmgr->save( theFileName );
175 
176 }
void save(const std::string &name)
Definition: TestHistoMgr.cc:50
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

TestHistoMgr* MaterialBudgetEcalHistos::hmgr
private

Definition at line 37 of file MaterialBudgetEcalHistos.h.

Referenced by book(), fillEndTrack(), and hend().

int MaterialBudgetEcalHistos::MAXNUMBERSTEPS
private

Definition at line 29 of file MaterialBudgetEcalHistos.h.

double* MaterialBudgetEcalHistos::theDmb
private

Definition at line 30 of file MaterialBudgetEcalHistos.h.

double* MaterialBudgetEcalHistos::theMateId
private

Definition at line 35 of file MaterialBudgetEcalHistos.h.

double* MaterialBudgetEcalHistos::theVoluId
private

Definition at line 34 of file MaterialBudgetEcalHistos.h.

double* MaterialBudgetEcalHistos::theX
private

Definition at line 31 of file MaterialBudgetEcalHistos.h.

double* MaterialBudgetEcalHistos::theY
private

Definition at line 32 of file MaterialBudgetEcalHistos.h.

double* MaterialBudgetEcalHistos::theZ
private

Definition at line 33 of file MaterialBudgetEcalHistos.h.