CMS 3D CMS Logo

MaterialBudgetEcalHistos.cc
Go to the documentation of this file.
3 
4 
5 #include "CLHEP/Units/GlobalSystemOfUnits.h"
6 
7 MaterialBudgetEcalHistos::MaterialBudgetEcalHistos(std::shared_ptr<MaterialBudgetData> data,
8  std::shared_ptr<TestHistoMgr> mgr,
9  const std::string& fileName ): MaterialBudgetFormat( data ), hmgr(mgr)
10 {
12  book();
13 }
14 
15 
17 {
18  edm::LogInfo("MaterialBudget") << "MaterialBudgetEcalHistos: Booking user histos";
19 
20  // total X0
21  hmgr->addHistoProf1( new TProfile("10", "MB prof Eta ", 250, -5., 5. ) );
22  hmgr->addHisto1( new TH1F("11", "Eta " , 501, -5., 5. ) );
23  hmgr->addHistoProf1( new TProfile("20", "MB prof Phi ", 180, -3.1416, 3.1416 ) );
24  hmgr->addHisto1( new TH1F("21", "Phi " , 180, -3.1416, 3.1416 ) );
25  hmgr->addHistoProf2( new TProfile2D("30", "MB prof Eta Phi ", 250, -5., 5., 180, -3.1416, 3.1416 ) );
26  hmgr->addHisto2( new TH2F("31", "Eta vs Phi " , 501, -5., 5., 180, -3.1416, 3.1416 ) );
27 
28  // Support
29  hmgr->addHistoProf1( new TProfile("110", "MB prof Eta [Support]", 250, -5.0, 5.0 ) );
30  hmgr->addHisto1( new TH1F("111", "Eta [Support]" , 501, -5., 5. ) );
31  hmgr->addHistoProf1( new TProfile("120", "MB prof Phi [Support]", 180, -3.1416, 3.1416 ) );
32  hmgr->addHisto1( new TH1F("121", "Phi [Support]" , 180, -3.1416, 3.1416 ) );
33  hmgr->addHistoProf2( new TProfile2D("130", "MB prof Eta Phi [Support]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
34  hmgr->addHisto2( new TH2F("131", "Eta vs Phi [Support]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
35 
36  // Sensitive
37  hmgr->addHistoProf1( new TProfile("210", "MB prof Eta [Sensitive]", 250, -5.0, 5.0 ) );
38  hmgr->addHisto1( new TH1F("211", "Eta [Sensitive]" , 501, -5., 5. ) );
39  hmgr->addHistoProf1( new TProfile("220", "MB prof Phi [Sensitive]", 180, -3.1416, 3.1416 ) );
40  hmgr->addHisto1( new TH1F("221", "Phi [Sensitive]" , 180, -3.1416, 3.1416 ) );
41  hmgr->addHistoProf2( new TProfile2D("230", "MB prof Eta Phi [Sensitive]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
42  hmgr->addHisto2( new TH2F("231", "Eta vs Phi [Sensitive]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
43 
44  // Cables
45  hmgr->addHistoProf1( new TProfile("310", "MB prof Eta [Cables]", 250, -5.0, 5.0 ) );
46  hmgr->addHisto1( new TH1F("311", "Eta [Cables]" , 501, -5., 5. ) );
47  hmgr->addHistoProf1( new TProfile("320", "MB prof Phi [Cables]", 180, -3.1416, 3.1416 ) );
48  hmgr->addHisto1( new TH1F("321", "Phi [Cables]" , 180, -3.1416, 3.1416 ) );
49  hmgr->addHistoProf2( new TProfile2D("330", "MB prof Eta Phi [Cables]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
50  hmgr->addHisto2( new TH2F("331", "Eta vs Phi [Cables]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
51 
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 
60  // Electronics
61  hmgr->addHistoProf1( new TProfile("510", "MB prof Eta [Electronics]", 250, -5.0, 5.0 ) );
62  hmgr->addHisto1( new TH1F("511", "Eta [Electronics]" , 501, -5., 5. ) );
63  hmgr->addHistoProf1( new TProfile("520", "MB prof Phi [Electronics]", 180, -3.1416, 3.1416 ) );
64  hmgr->addHisto1( new TH1F("521", "Phi [Electronics]" , 180, -3.1416, 3.1416 ) );
65  hmgr->addHistoProf2( new TProfile2D("530", "MB prof Eta Phi [Electronics]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
66  hmgr->addHisto2( new TH2F("531", "Eta vs Phi [Electronics]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
67 
68  // Other
69  hmgr->addHistoProf1( new TProfile("610", "MB prof Eta [Other]", 250, -5.0, 5.0 ) );
70  hmgr->addHisto1( new TH1F("611", "Eta [Other]" , 501, -5., 5. ) );
71  hmgr->addHistoProf1( new TProfile("620", "MB prof Phi [Other]", 180, -3.1416, 3.1416 ) );
72  hmgr->addHisto1( new TH1F("621", "Phi [Other]" , 180, -3.1416, 3.1416 ) );
73  hmgr->addHistoProf2( new TProfile2D("630", "MB prof Eta Phi [Other]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
74  hmgr->addHisto2( new TH2F("631", "Eta vs Phi [Other]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
75 
76  // Air
77  hmgr->addHistoProf1( new TProfile("710", "MB prof Eta [Air]", 250, -5.0, 5.0 ) );
78  hmgr->addHisto1( new TH1F("711", "Eta [Air]" , 501, -5., 5. ) );
79  hmgr->addHistoProf1( new TProfile("720", "MB prof Phi [Air]", 180, -3.1416, 3.1416 ) );
80  hmgr->addHisto1( new TH1F("721", "Phi [Air]" , 180, -3.1416, 3.1416 ) );
81  hmgr->addHistoProf2( new TProfile2D("730", "MB prof Eta Phi [Air]", 250, -5., 5., 180, -3.1416, 3.1416 ) );
82  hmgr->addHisto2( new TH2F("731", "Eta vs Phi [Air]" , 501, -5., 5., 180, -3.1416, 3.1416 ) );
83 
84  // ECAL specific
85  hmgr->addHistoProf1( new TProfile("1001", "MB prof Eta ECAL Barrel", 340, -1.5, 1.5 ) );
86  hmgr->addHistoProf1( new TProfile("1002", "MB prof Phi ECAL Barrel", 180, -3.1416, 3.1416 ) );
87  hmgr->addHistoProf1( new TProfile("1003", "MB prof Phi ECAL Barrel SM", 20, 0., 20. ) );
88  hmgr->addHistoProf1( new TProfile("2003", "MB prof Phi ECAL Barrel SM", 10, 0., 20. ) );
89  hmgr->addHistoProf1( new TProfile("1004", "MB prof Phi ECAL Barrel SM module 1", 20, 0., 20. ) );
90  hmgr->addHistoProf1( new TProfile("1005", "MB prof Phi ECAL Barrel SM module 2", 20, 0., 20. ) );
91  hmgr->addHistoProf1( new TProfile("1006", "MB prof Phi ECAL Barrel SM module 3", 20, 0., 20. ) );
92  hmgr->addHistoProf1( new TProfile("1007", "MB prof Phi ECAL Barrel SM module 4", 20, 0., 20. ) );
93 
94  hmgr->addHistoProf1( new TProfile("1011", "MB prof Eta ECAL Preshower +", 100, 1.65, 2.6 ) );
95  hmgr->addHistoProf1( new TProfile("1012", "MB prof Phi ECAL Preshower +", 180, -3.1416, 3.1416 ) );
96 
97  hmgr->addHistoProf1( new TProfile("1013", "MB prof Eta ECAL Preshower -", 100, -2.6, -1.65 ) );
98  hmgr->addHistoProf1( new TProfile("1014", "MB prof Phi ECAL Preshower -", 180, -3.1416, 3.1416 ) );
99 
100  edm::LogInfo("MaterialBudget") << "MaterialBudgetEcalHistos: booking user histos done";
101 
102 }
103 
104 
106 {
107 
108 }
109 
110 
112 {
113 
114 }
115 
116 
118 {
119  // Total X0
120  hmgr->getHisto1(11)->Fill(theData->getEta());
121  hmgr->getHisto1(21)->Fill(theData->getPhi());
122  hmgr->getHisto2(31)->Fill(theData->getEta(),theData->getPhi());
123 
124  hmgr->getHistoProf1(10)->Fill(theData->getEta(),theData->getTotalMB());
125  hmgr->getHistoProf1(20)->Fill(theData->getPhi(),theData->getTotalMB());
126  hmgr->getHistoProf2(30)->Fill(theData->getEta(),theData->getPhi(),theData->getTotalMB());
127 
128 
129  // ECAL specific
130  if (fabs(theData->getEta()) <= 1.479 ) {
131  static const double twenty ( 20.*degree ) ;
132  const double phi ( theData->getPhi()+M_PI ) ;
133  const double phiModTwenty (( phi - floor(phi/twenty)*twenty )/degree) ;
134  hmgr->getHistoProf1(1001)->Fill(theData->getEta(),theData->getTotalMB());
135  hmgr->getHistoProf1(1002)->Fill(theData->getPhi(),theData->getTotalMB());
136  hmgr->getHistoProf1(1003)->Fill(phiModTwenty,theData->getTotalMB());
137  hmgr->getHistoProf1(2003)->Fill(phiModTwenty,theData->getTotalMB());
138  if (fabs(theData->getEta()) >= 0. && fabs(theData->getEta()) < 0.435 ) {
139  hmgr->getHistoProf1(1004)->Fill(phiModTwenty,theData->getTotalMB());
140  }
141  if (fabs(theData->getEta()) >= 0.435 && fabs(theData->getEta()) < 0.783 ) {
142  hmgr->getHistoProf1(1005)->Fill(phiModTwenty,theData->getTotalMB());
143  }
144  if (fabs(theData->getEta()) > 0.783 && fabs(theData->getEta()) <= 1.131 ) {
145  hmgr->getHistoProf1(1006)->Fill(phiModTwenty,theData->getTotalMB());
146  }
147  if (fabs(theData->getEta()) > 1.131 && fabs(theData->getEta()) <= 1.479 ) {
148  hmgr->getHistoProf1(1007)->Fill(phiModTwenty,theData->getTotalMB());
149  }
150  }
151 
152  if (theData->getEta() >= 1.653 && theData->getEta() <= 2.6 ) {
153  hmgr->getHistoProf1(1011)->Fill(theData->getEta(),theData->getTotalMB());
154  hmgr->getHistoProf1(1012)->Fill(theData->getPhi(),theData->getTotalMB());
155  }
156 
157  if (theData->getEta() >= -2.6 && theData->getEta() <= -1.653 ) {
158  hmgr->getHistoProf1(1013)->Fill(theData->getEta(),theData->getTotalMB());
159  hmgr->getHistoProf1(1014)->Fill(theData->getPhi(),theData->getTotalMB());
160  }
161 }
162 
163 
165 {
166  edm::LogInfo("MaterialBudget") << "MaterialBudgetEcalHistos: Writing histos ROOT file to:" << theFileName;
167  hmgr->save( theFileName );
168 
169 }
170 
std::shared_ptr< TestHistoMgr > hmgr
#define M_PI
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
MaterialBudgetEcalHistos(std::shared_ptr< MaterialBudgetData > data, std::shared_ptr< TestHistoMgr > mgr, const std::string &fileName)
std::shared_ptr< MaterialBudgetData > theData