46 {
47 MsgStream log(
msgSvc(), name());
48
49 log << MSG::INFO << "in initialize()" << endmsg;
50 StatusCode status;
51
52
53
54
55
57 if ( nt ) m_tuple = nt;
58 else {
59 m_tuple =
ntupleSvc()->book(
"DQAFILE/EMC", CLID_ColumnWiseTuple,
"EMC ntuple");
60 if( m_tuple ) {
61 status = m_tuple->addItem("ixtal", m_ixtal);
62 status = m_tuple->addItem("npart", m_npart);
63 status = m_tuple->addItem("ntheta",m_ntheta);
64 status = m_tuple->addItem("nphi", m_nphi);
65 status = m_tuple->addItem("theta", m_theta);
66 status = m_tuple->addItem("phi", m_phi);
67 status = m_tuple->addItem("emcX", m_emcX);
68 status = m_tuple->addItem("emcY", m_emcY);
69 status = m_tuple->addItem("eSeed", m_eSeed);
70 status = m_tuple->addItem("e5x5", m_e5x5);
71 status = m_tuple->addItem("energy",m_energy);
72 status = m_tuple->addItem("time", m_time);
73
74 } else {
75 log << MSG::ERROR << "Can not book N-tuple:" << long(m_tuple) << endreq;
76 }
77 }
78
79 if(service("THistSvc", m_thistsvc).isFailure()) {
80 log << MSG::ERROR << "Couldn't get THistSvc" << endreq;
81 return StatusCode::FAILURE;
82 }
83
84 char name[60];
86
87 std::string HistName0, HistName;
88 HistName0="/DQAHist/EMC/";
89
90 sprintf( name,
"EMC_Bhabha_ShowerEneBarrelVsEvent");
92
93 m_HistEnergyB =
new TH1F(name,
title,200,0.,2.0);
94 m_HistEnergyB->GetXaxis()->SetTitle("shower energy(GeV)");
95 m_HistEnergyB->GetXaxis()->CenterTitle();
96 m_HistEnergyB->GetYaxis()->SetTitle("Number of event");
97 m_HistEnergyB->GetYaxis()->CenterTitle();
98
99 HistName=HistName0+name;
100 if(m_thistsvc->regHist(HistName, m_HistEnergyB).isFailure()){
101 log << MSG::ERROR << "Couldn't register " <<name<< endreq;
102 }
103
104 sprintf( name,
"EMC_Bhabha_ShowerEneEastVsEvent");
106 m_HistEnergyEast =
new TH1F(name,
title,200,0.,2.0);
107 m_HistEnergyEast->GetXaxis()->SetTitle("shower energy(GeV)");
108 m_HistEnergyEast->GetXaxis()->CenterTitle();
109 m_HistEnergyEast->GetYaxis()->SetTitle("Number of event");
110 m_HistEnergyEast->GetYaxis()->CenterTitle();
111
112 HistName=HistName0+name;
113 if(m_thistsvc->regHist(HistName, m_HistEnergyEast).isFailure()){
114 log << MSG::ERROR << "Couldn't register "<<name << endreq;
115 }
116
117
118 sprintf( name,
"EMC_Bhabha_ShowerEneWestVsEvent");
120 m_HistEnergyWest =
new TH1F(name,
title,200,0.,2.0);
121 m_HistEnergyWest->GetXaxis()->SetTitle("shower energy(GeV)");
122 m_HistEnergyWest->GetXaxis()->CenterTitle();
123 m_HistEnergyWest->GetYaxis()->SetTitle("Number of event");
124 m_HistEnergyWest->GetYaxis()->CenterTitle();
125
126
127 HistName=HistName0+name;
128 if( m_thistsvc->regHist(HistName, m_HistEnergyWest).isFailure()){
129 log << MSG::ERROR << "Couldn't register "<<name << endreq;
130 }
131
132
133 sprintf( name,
"EMC_Bhabha_ShowerThetaVsvent");
135 m_HistTheta =
new TH1F(name,
title,56, 0, 56);
136 m_HistTheta->GetXaxis()->SetTitle("shower ID(theta)");
137 m_HistTheta->GetXaxis()->CenterTitle();
138 m_HistTheta->GetYaxis()->SetTitle("Number of event");
139 m_HistTheta->GetYaxis()->CenterTitle();
140
141 HistName=HistName0+name;
142 if( m_thistsvc->regHist(HistName, m_HistTheta).isFailure()){
143 log << MSG::ERROR << "Couldn't register" <<name<< endreq;
144 }
145
146 sprintf(name,
"EMC_Bhabha_ShowerCosTheta");
148 m_HistCosTheta =
new TH1F(name,
title,200, -1.0, 1.0);
149 m_HistCosTheta->GetXaxis()->SetTitle("shower cos(theta)");
150 m_HistCosTheta->GetXaxis()->CenterTitle();
151 m_HistCosTheta->GetYaxis()->SetTitle("Number of event");
152 m_HistCosTheta->GetYaxis()->CenterTitle();
153
154 HistName=HistName0+name;
155 if(m_thistsvc->regHist(HistName, m_HistCosTheta).isFailure()){
156 log << MSG::ERROR << "Couldn't register "<<name << endreq;
157 }
158
159
160 sprintf( name,
"EMC_Bhabha_ShowerPhiBarrelVsEvent");
162 m_HistPhiB =
new TH1F(name,
title,120, 0, 120);
163 m_HistPhiB->GetXaxis()->SetTitle("shower ID(phi)");
164 m_HistPhiB->GetXaxis()->CenterTitle();
165 m_HistPhiB->GetYaxis()->SetTitle("Number of event");
166 m_HistPhiB->GetYaxis()->CenterTitle();
167
168
169 HistName=HistName0+name;
170 if( m_thistsvc->regHist(HistName, m_HistPhiB).isFailure()){
171 log << MSG::ERROR << "Couldn't register "<<name << endreq;
172 }
173
174 sprintf( name,
"EMC_Bhabha_ShowerPhiEastVsEvent");
176 m_HistPhiEast =
new TH1F(name,
title,256, -3.14, 3.14);
177 m_HistPhiEast->GetXaxis()->SetTitle("shower phi(radian)");
178 m_HistPhiEast->GetXaxis()->CenterTitle();
179 m_HistPhiEast->GetYaxis()->SetTitle("Number of event");
180 m_HistPhiEast->GetYaxis()->CenterTitle();
181
182 HistName=HistName0+name;
183 if(m_thistsvc->regHist(HistName, m_HistPhiEast).isFailure()){
184 log << MSG::ERROR << "Couldn't register"<<name << endreq;
185 }
186
187 sprintf( name,
"EMC_Bhabha_ShowerPhiWestVsEvent");
189 m_HistPhiWest =
new TH1F(name,
title,256, -3.14, 3.14);
190 m_HistPhiWest->GetXaxis()->SetTitle("shower phi(radian)");
191 m_HistPhiWest->GetXaxis()->CenterTitle();
192 m_HistPhiWest->GetYaxis()->SetTitle("Number of event");
193 m_HistPhiWest->GetYaxis()->CenterTitle();
194
195 HistName=HistName0+name;
196 if(m_thistsvc->regHist(HistName, m_HistPhiWest).isFailure()){
197 log << MSG::ERROR << "Couldn't register" <<name<<endreq;
198 }
199
200 sprintf( name,
"EMC_Bhabha_ShowerThetaPhi");
202 m_ThetaPhi =new TH2F(name,"Theta versus Phi",
203 2000, -3.15, 3.15, 2000, 0.1, 3.0);
204 m_ThetaPhi->GetXaxis()->SetTitle("shower phi(radian)");
205 m_ThetaPhi->GetXaxis()->CenterTitle();
206 m_ThetaPhi->GetYaxis()->SetTitle("shower theta(radian)");
207 m_ThetaPhi->GetYaxis()->CenterTitle();
208
209 HistName=HistName0+name;
210 if(m_thistsvc->regHist(HistName, m_ThetaPhi).isFailure()){
211 log << MSG::ERROR << "Couldn't register" <<name<< endreq;
212 }
213
214
215
216 sprintf( name,
"EMC_Bhabha_Time-T0");
218 m_HistTime =
new TH1F(name,
title,100, -40, 60);
219 m_HistTime->GetXaxis()->SetTitle("EmcTime-T0 (50ns)");
220 m_HistTime->GetXaxis()->CenterTitle();
221 m_HistTime->GetYaxis()->SetTitle("Number of event");
222 m_HistTime->GetYaxis()->CenterTitle();
223
224 HistName=HistName0+name;
225 if(m_thistsvc->regHist(HistName, m_HistTime).isFailure()){
226 log << MSG::ERROR << "Couldn't register" <<name<<endreq;
227 }
228
229 sprintf( name,
"EMC_Bhabha_ixtal");
231 m_HistHitMap =
new TH1F(name,
title,6240, 0, 6240);
232 m_HistHitMap->GetXaxis()->SetTitle("ixtalNumber");
233 m_HistHitMap->GetXaxis()->CenterTitle();
234 m_HistHitMap->GetYaxis()->SetTitle("Number of event");
235 m_HistHitMap->GetYaxis()->CenterTitle();
236
237 HistName=HistName0+name;
238 if(m_thistsvc->regHist(HistName, m_HistHitMap).isFailure()){
239 log << MSG::ERROR << "Couldn't register" <<name<<endreq;
240 }
241
242 sprintf( name,
"EMC_Bhabha_eSeedvsIxtal ");
244 m_eSeedIxtal =new TH2F(name,"eSeed:Ixtal",
245 6240, 0, 6240, 2000, 0, 1.8);
246 m_eSeedIxtal->GetXaxis()->SetTitle("Ixtal)");
247 m_eSeedIxtal->GetXaxis()->CenterTitle();
248 m_eSeedIxtal->GetYaxis()->SetTitle("eSeed(GeV)");
249 m_eSeedIxtal->GetYaxis()->CenterTitle();
250
251 HistName=HistName0+name;
252 if(m_thistsvc->regHist(HistName, m_eSeedIxtal).isFailure()){
253 log << MSG::ERROR << "Couldn't register" <<name<< endreq;
254 }
255
256 sprintf( name,
"EMC_Bhabha_emcX:emcYeast ");
257 sprintf(
title,
"EMC Bhabha emcX vs emcY of east endcap");
258 m_XYeast =new TH2F(name,"emcX:emcY",
259 2000, -100, 100, 2000, -100, 100);
260 m_XYeast->GetXaxis()->SetTitle("emcX");
261 m_XYeast->GetXaxis()->CenterTitle();
262 m_XYeast->GetYaxis()->SetTitle("emcY");
263 m_XYeast->GetYaxis()->CenterTitle();
264
265 HistName=HistName0+name;
266 if(m_thistsvc->regHist(HistName, m_XYeast).isFailure()){
267 log << MSG::ERROR << "Couldn't register" <<name<< endreq;
268 }
269
270 sprintf( name,
"EMC_Bhabha_emcX:emcYwest ");
271 sprintf(
title,
"EMC Bhabha emcX vs emcY of west endcap");
272 m_XYwest =new TH2F(name,"emcX:emcY",
273 2000, -100, 100, 2000, -100, 100);
274 m_XYwest->GetXaxis()->SetTitle("emcX");
275 m_XYwest->GetXaxis()->CenterTitle();
276 m_XYwest->GetYaxis()->SetTitle("emcY");
277 m_XYwest->GetYaxis()->CenterTitle();
278
279 HistName=HistName0+name;
280 if(m_thistsvc->regHist(HistName, m_XYwest).isFailure()){
281 log << MSG::ERROR << "Couldn't register" <<name<< endreq;
282 }
283
284
285 StatusCode scCalib;
286 scCalib = Gaudi::svcLocator() -> service("EmcCalibConstSvc", m_emcCalibConstSvc);
287 if( scCalib != StatusCode::SUCCESS){
288 log << MSG::ERROR << "can not use EmcCalibConstSvc" << endreq;
289 }
290
291
292 log << MSG::INFO << "successfully return from initialize()" <<endmsg;
293 return StatusCode::SUCCESS;
294
295
296}