BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
DQA_Dedx.cxx
Go to the documentation of this file.
1#include <vector>
2
3#include "GaudiKernel/MsgStream.h"
4#include "GaudiKernel/SmartDataPtr.h"
5#include "GaudiKernel/PropertyMgr.h"
6#include "GaudiKernel/Bootstrap.h"
7
8#include "GaudiKernel/INTupleSvc.h"
9#include "GaudiKernel/NTuple.h"
10#include "GaudiKernel/ITHistSvc.h"
11
12#include "CLHEP/Vector/ThreeVector.h"
13#include "CLHEP/Vector/LorentzVector.h"
14
16#include "EventModel/Event.h"
17
23
24//#include "VertexFit/VertexDbSvc.h"
26//
27#include "DQAEvent/DQAEvent.h"
28#include "DQA_Dedx/DQA_Dedx.h"
29
30#include "TH2F.h"
31
32#ifndef ENABLE_BACKWARDS_COMPATIBILITY
34#endif
35using CLHEP::HepLorentzVector;
36
37
38/////////////////////////////////////////////////////////////////////////////
39
40DQA_Dedx::DQA_Dedx(const std::string& name, ISvcLocator* pSvcLocator) :
41 Algorithm(name, pSvcLocator) {
42
43 //Declare the properties
44 declareProperty("GetNtuple",m_getntuple=false);
45 declareProperty("DstFileOnly", m_dstfile=false);
46
47}
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
51 MsgStream log(msgSvc(), name());
52
53 log << MSG::INFO << "in initialize()" << endmsg;
54 StatusCode status;
55
56 // DQA
57 // The first directory specifier must be "DQAFILE"
58 // The second is the sub-system name: MDC, DEDX, TOF, EMC, MUC, TRG
59 // user can define more directory, such as DAQFILE/MDC/Bhabha.
60
61
62 if(service("THistSvc", m_thsvc).isFailure()) {
63 log << MSG::ERROR << "Couldn't get THistSvc" << endreq;
64 return StatusCode::FAILURE;
65 }
66
67
68
69 NTuplePtr nt_bb(ntupleSvc(), "DQAFILE/DEDX");
70 if ( nt_bb ) m_bb_tuple = nt_bb;
71 else {
72 m_bb_tuple = ntupleSvc()->book("DQAFILE/DEDX/Bhabha", CLID_ColumnWiseTuple, "Dedx ntuple");
73 if( m_bb_tuple ) {
74 status = m_bb_tuple->addItem("runNo", m_bb_runNo);
75 status = m_bb_tuple->addItem("event", m_bb_event);
76 status = m_bb_tuple->addItem("p", m_bb_p);
77 status = m_bb_tuple->addItem("costh", m_bb_costh);
78 status = m_bb_tuple->addItem("t0", m_bb_t0);
79 status = m_bb_tuple->addItem("chiE",m_bb_chiE);
80 status = m_bb_tuple->addItem("chiMu",m_bb_chiMu);
81 status = m_bb_tuple->addItem("chiPi",m_bb_chiPi);
82 status = m_bb_tuple->addItem("chiK",m_bb_chiK);
83 status = m_bb_tuple->addItem("chiP",m_bb_chiP);
84 status = m_bb_tuple->addItem("nhit", m_bb_nhit);
85 status = m_bb_tuple->addItem("ndedxhit", m_bb_ndedxhit);
86 status = m_bb_tuple->addItem("dEdx", m_bb_dEdx);
87 } else {
88 log << MSG::ERROR << "Can not book N-tuple:" << long(m_bb_tuple) << endreq;
89 }
90 }
91
92 TH1F* h_dedx_bb = new TH1F("Dedx_bhabha", "dEdx distribution of bhabha samples", 150, 0., 1500.);
93 if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/dedx", h_dedx_bb).isFailure()) {
94 log << MSG::ERROR << "Couldn't register Dedx_bhabha" << endreq;
95 }
96 TH1F* h_dedxbarrel_bb = new TH1F("Dedx_Barrel_bhabha", "dEdx distribution of barrel bhabha samples", 150, 0., 1500.);
97 if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/dedx_barrel", h_dedxbarrel_bb).isFailure()) {
98 log << MSG::ERROR << "Couldn't register Dedx_Barrel_bhabha" << endreq;
99 }
100 TH1F* h_chie_bb = new TH1F("ChiE_bhabha", "ChiE distribution of bhabha samples", 200, -20., 20.);
101 if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/chiE", h_chie_bb).isFailure()) {
102 log << MSG::ERROR << "Couldn't register chiE_bhabha" << endreq;
103 }
104 TH1F* h_nhitdedx_bb = new TH1F("Nhitdedx", "dEdx used hits", 40, 0., 60.);
105 if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/nhitdedx", h_nhitdedx_bb).isFailure()) {
106 log << MSG::ERROR << "Couldn't register Nhitdedx" << endreq;
107 }
108 TH1F* h_nhit_bb = new TH1F("Nhit", "Total hits", 40, 0., 60.);
109 if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/nhit", h_nhit_bb).isFailure()) {
110 log << MSG::ERROR << "Couldn't register Nhit" << endreq;
111 }
112 TH2F* h_dedxvsp_bb=new TH2F("dEdx vs momentume","dEdx vs momentume", 200,0,2.5,200,0,2000);
113 if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/dedx_p", h_dedxvsp_bb).isFailure()) {
114 log << MSG::ERROR << "Couldn't register dedx vs p" << endreq;
115 }
116 TH2F* h_dedxvscos_bb=new TH2F("dEdx vs costheta","dEdx vs costheta", 100,-1,1,150,0,1500);
117 if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/dedx_costh", h_dedxvscos_bb).isFailure()) {
118 log << MSG::ERROR << "Couldn't register dedx vs costh" << endreq;
119 }
120 TH2F* h_dedxvst0_bb=new TH2F("dEdx vs t0","dEdx vs t0", 250,0,2500,150,0,1500);
121 if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/dedx_t0", h_dedxvst0_bb).isFailure()) {
122 log << MSG::ERROR << "Couldn't register dedx vs t0" << endreq;
123 }
124
125
126 NTuplePtr nt_du(ntupleSvc(), "DQAFILE/DEDX");
127 if ( nt_du ) m_bb_tuple = nt_du;
128 else {
129 m_du_tuple = ntupleSvc()->book("DQAFILE/DEDX/Dimu", CLID_ColumnWiseTuple, "Dedx ntuple");
130 if( m_du_tuple ) {
131 status = m_du_tuple->addItem("runNo", m_du_runNo);
132 status = m_du_tuple->addItem("event", m_du_event);
133 status = m_du_tuple->addItem("p", m_du_p);
134 status = m_du_tuple->addItem("costh", m_du_costh);
135 status = m_du_tuple->addItem("t0", m_du_t0);
136 status = m_du_tuple->addItem("chiE",m_du_chiE);
137 status = m_du_tuple->addItem("chiMu",m_du_chiMu);
138 status = m_du_tuple->addItem("chiPi",m_du_chiPi);
139 status = m_du_tuple->addItem("chiK",m_du_chiK);
140 status = m_du_tuple->addItem("chiP",m_du_chiP);
141 status = m_du_tuple->addItem("nhit", m_du_nhit);
142 status = m_du_tuple->addItem("ndedxhit", m_du_ndedxhit);
143 status = m_du_tuple->addItem("dEdx", m_du_dEdx);
144 } else {
145 log << MSG::ERROR << "Can not book N-tuple:" << long(m_du_tuple) << endreq;
146 }
147 }
148
149
150 TH1F* h_dedx_du = new TH1F("Dedx_dimu", "dEdx distribution of bhabha samples", 150, 0., 1500.);
151 if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/dedx", h_dedx_du).isFailure()) {
152 log << MSG::ERROR << "Couldn't register Dedx_dimu" << endreq;
153 }
154 TH1F* h_dedxbarrel_du = new TH1F("Dedx_Barrel_dimu", "dEdx distribution of barrel bhabha samples", 150, 0., 1500.);
155 if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/dedx_barrel", h_dedxbarrel_du).isFailure()) {
156 log << MSG::ERROR << "Couldn't register Dedx_Barrel_dimu" << endreq;
157 }
158 TH1F* h_chimu_du = new TH1F("ChiE_dimu", "ChiE distribution of bhabha samples", 200, -20., 20.);
159 if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/chiMu", h_chimu_du).isFailure()) {
160 log << MSG::ERROR << "Couldn't register chiMu_dimu" << endreq;
161 }
162 TH1F* h_nhitdedx_du = new TH1F("Nhitdedx", "dEdx used hits", 40, 0., 60.);
163 if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/nhitdedx", h_nhitdedx_du).isFailure()) {
164 log << MSG::ERROR << "Couldn't register Nhitdedx" << endreq;
165 }
166 TH1F* h_nhit_du = new TH1F("Nhit", "Total hits", 40, 0., 60.);
167 if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/nhit", h_nhit_du).isFailure()) {
168 log << MSG::ERROR << "Couldn't register Nhit" << endreq;
169 }
170 TH2F* h_dedxvsp_du=new TH2F("dEdx vs momentume","dEdx vs momentume", 200,0,2.5,200,0,2000);
171 if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/dedx_p", h_dedxvsp_du).isFailure()) {
172 log << MSG::ERROR << "Couldn't register dedx vs p" << endreq;
173 }
174 TH2F* h_dedxvscos_du=new TH2F("dEdx vs costheta","dEdx vs costheta", 100,-1,1,150,0,1500);
175 if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/dedx_costh", h_dedxvscos_du).isFailure()) {
176 log << MSG::ERROR << "Couldn't register dedx vs costh" << endreq;
177 }
178 TH2F* h_dedxvst0_du=new TH2F("dEdx vs t0","dEdx vs t0", 200,0,2500,150,0,1500);
179 if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/dedx_t0", h_dedxvst0_du).isFailure()) {
180 log << MSG::ERROR << "Couldn't register dedx vs t0" << endreq;
181 }
182
183
184
185
186 log << MSG::INFO << "successfully return from initialize()" <<endmsg;
187 return StatusCode::SUCCESS;
188
189
190}
191
192// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
193StatusCode DQA_Dedx::execute() {
194
195 MsgStream log(msgSvc(), name());
196 log << MSG::INFO << "in execute()" << endreq;
197
198 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
199 m_bb_runNo=eventHeader->runNumber();
200 m_bb_event=eventHeader->eventNumber();
201
202 m_du_runNo=eventHeader->runNumber();
203 m_du_event=eventHeader->eventNumber();
204
205 log << MSG::DEBUG <<"run, evt num = "
206 << m_bb_runNo << " , "
207 << m_bb_event <<endreq;
208
209
210 SmartDataPtr<EvtRecEvent> evtRecEvent(eventSvc(), EventModel::EvtRec::EvtRecEvent);
211
212 SmartDataPtr<DQAEvent::DQAEvent> dqaevt(eventSvc(), "/Event/DQATag");
213 if ( dqaevt ) {
214 log << MSG::INFO << "success get DQAEvent" << endreq;
215 } else {
216 log << MSG::ERROR << "Error accessing DQAEvent" << endreq;
217 return StatusCode::FAILURE;
218 }
219
220 log << MSG::DEBUG << "event tag = " << dqaevt->EventTag() << endreq;
221
222 // get the required control sample with DQA tag
223 if ( dqaevt->Bhabha() ) {
224 log << MSG::INFO << "Bhabha event" << endreq;
225 SmartDataPtr<EvtRecTrackCol> evtRecTrkCol(eventSvc(), EventModel::EvtRec::EvtRecTrackCol);
226 for(int i = 0; i < evtRecEvent->totalCharged(); i++){
227 EvtRecTrackIterator itTrk=evtRecTrkCol->begin() + i;
228 log << MSG::DEBUG << i << " " << (*itTrk)->quality() << endreq;
229 // get the: required particle through the track's PID
230 // Pid: 1 - electron, 2 - muon, 3 - pion, 4 - kaon, 5 - proton
231 // if ( (*itTrk)->partId() != 1 ) continue; // only e+, e-
232 if ( !(*itTrk)->isElectron() ) continue; // only e+, e-
233 // if you want to do dE/dx or TOF study, select track with no bias
234 // Quality: defined by whether dE/dx or TOF is used to identify particle
235 // 0 - no dE/dx, no TOF (can be used for dE/dx and TOF calibration)
236 // 1 - only dE/dx (can be used for TOF calibration)
237 // 2 - only TOF (can be used for dE/dx calibration)
238 // 3 - Both dE/dx and TOF
239 int qual = (*itTrk)->quality();
240 if ( qual != 0 && qual != 2) continue; // no dE/dx PID is used in selection
241 // if ( qual != 0 && qual != 1) continue; // no TOF PID is used in the selection
242
243
244 TH1 *h(0);
245 TH2 *h2(0);
246 //initinalize all values
247 m_bb_runNo=-999;
248 m_bb_event=-999;
249 m_bb_p=-999;
250 m_bb_costh=-999;
251 m_bb_t0=-999;
252 m_bb_chiE=-999;
253 m_bb_chiMu=-999;
254 m_bb_chiPi=-999;
255 m_bb_chiK=-999;
256 m_bb_chiP=-999;
257 m_bb_nhit=-999;
258 m_bb_ndedxhit=-999;
259 m_bb_dEdx=-999;
260
261
262 if((*itTrk)->isMdcKalTrackValid()){
263 RecMdcKalTrack *mdcTrk = (*itTrk)->mdcKalTrack();
265 if ( mdcTrk->charge() > 0 ) {
266 log << MSG::DEBUG << "is electron" << endreq;
267 } else {
268 log << MSG::DEBUG << "is positron" << endreq;
269 }
270 double x0 =mdcTrk->x();
271 double y0 =mdcTrk->y();
272 double z0 =mdcTrk->z();
273 double Rxy=sqrt(x0*x0+y0*y0);
274
275 m_bb_p=mdcTrk->p()*mdcTrk->charge();
276 m_bb_costh=cos(mdcTrk->theta());
277
278
279 double tes=-999;
280 if (!m_dstfile) {
281
282 //get event start time
283 SmartDataPtr<RecEsTimeCol> aevtimeCol(eventSvc(),"/Event/Recon/RecEsTimeCol");
284 if( aevtimeCol && aevtimeCol->size()>0 ){
285 RecEsTimeCol::iterator iter_evt = aevtimeCol->begin();
286 for(; iter_evt!=aevtimeCol->end(); iter_evt++){
287 tes = (*iter_evt)->getTest();
288 //esTimeflag = (*iter_evt)->getStat();
289 }
290 }
291 m_bb_t0=tes;
292 }
293
294 //get dedx information
295 if((*itTrk)->isMdcDedxValid()){
296 RecMdcDedx* dedxTrk = (*itTrk)->mdcDedx();
297 m_bb_chiE = dedxTrk->chi(0);
298 m_bb_chiMu = dedxTrk->chi(1);
299 m_bb_chiPi = dedxTrk->chi(2);
300 m_bb_chiK = dedxTrk->chi(3);
301 m_bb_chiP = dedxTrk->chi(4);
302 m_bb_ndedxhit = dedxTrk->numGoodHits();
303 m_bb_nhit = dedxTrk->numTotalHits();
304 m_bb_dEdx = dedxTrk->probPH();
305
306 //fill histograms
307 if (m_thsvc->getHist("/DQAHist/Dedx/Bhabha/dedx", h).isSuccess()) {
308 h->Fill(dedxTrk->probPH());
309 }
310 else {
311 log << MSG::ERROR << "Couldn't retrieve dedx" << endreq;
312 }
313 if(fabs(cos(mdcTrk->theta()))<0.83){
314 if (m_thsvc->getHist("/DQAHist/Dedx/Bhabha/dedx_barrel", h).isSuccess()) {
315 h->Fill(dedxTrk->probPH());
316 }
317 else {
318 log << MSG::ERROR << "Couldn't retrieve dedx_barrel" << endreq;
319 }
320 }
321 if (m_thsvc->getHist("/DQAHist/Dedx/Bhabha/chiE", h).isSuccess()) {
322 h->Fill(dedxTrk->chiE());
323 }
324 else {
325 log << MSG::ERROR << "Couldn't retrieve chiE" << endreq;
326 }
327 if (m_thsvc->getHist("/DQAHist/Dedx/Bhabha/nhitdedx", h).isSuccess()) {
328 h->Fill( dedxTrk->numGoodHits());
329 }
330 else {
331 log << MSG::ERROR << "Couldn't retrieve nhitdedx" << endreq;
332 }
333 if (m_thsvc->getHist("/DQAHist/Dedx/Bhabha/nhit", h).isSuccess()) {
334 h->Fill( dedxTrk->numTotalHits());
335 }
336 else {
337 log << MSG::ERROR << "Couldn't retrieve nhit" << endreq;
338 }
339 if (m_thsvc->getHist("/DQAHist/Dedx/Bhabha/dedx_p", h2).isSuccess()) {
340 h2->Fill(mdcTrk->p(), dedxTrk->probPH());
341 }
342 else {
343 log << MSG::ERROR << "Couldn't retrieve dedx_p" << endreq;
344 }
345 if (m_thsvc->getHist("/DQAHist/Dedx/Bhabha/dedx_costh", h2).isSuccess()) {
346 h2->Fill(cos(mdcTrk->theta()), dedxTrk->probPH());
347 }
348 else {
349 log << MSG::ERROR << "Couldn't retrieve dedx_costh" << endreq;
350 }
351 if (!m_dstfile) {
352 if (m_thsvc->getHist("/DQAHist/Dedx/Bhabha/dedx_t0", h2).isSuccess()) {
353 h2->Fill(tes, dedxTrk->probPH());
354 }
355 else {
356 log << MSG::ERROR << "Couldn't retrieve dedx_t0" << endreq;
357 }
358 }
359
360 }//end of valid dedx track
361 }//end of valid mdc track
362 }//end of looping track
363 }//end of bhabha tag event
364
365
366 if ( dqaevt->Dimu() ) {
367 log << MSG::INFO << "Dimu event" << endreq;
368 SmartDataPtr<EvtRecTrackCol> evtRecTrkCol(eventSvc(), EventModel::EvtRec::EvtRecTrackCol);
369 for(int i = 0; i < evtRecEvent->totalCharged(); i++){
370 EvtRecTrackIterator itTrk=evtRecTrkCol->begin() + i;
371 log << MSG::DEBUG << i << " " << (*itTrk)->quality() << endreq;
372 // get the: required particle through the track's PID
373 // Pid: 1 - electron, 2 - muon, 3 - pion, 4 - kaon, 5 - proton
374 //if ( (*itTrk)->partId() != 2 ) continue; // only mu+, mu-
375 if ( !(*itTrk)->isMuon() ) continue; // only mu+, mu-
376 // if you want to do dE/dx or TOF study, select track with no bias
377 // Quality: defined by whether dE/dx or TOF is used to identify particle
378 // 0 - no dE/dx, no TOF (can be used for dE/dx and TOF calibration)
379 // 1 - only dE/dx (can be used for TOF calibration)
380 // 2 - only TOF (can be used for dE/dx calibration)
381 // 3 - Both dE/dx and TOF
382 int qual = (*itTrk)->quality();
383 if ( qual != 0 && qual != 2) continue; // no dE/dx PID is used in selection
384 // if ( qual != 0 && qual != 1) continue; // no TOF PID is used in the selection
385
386 TH1 *h(0);
387 TH2 *h2(0);
388 //initinalize all values
389 m_du_runNo=-999;
390 m_du_event=-999;
391 m_du_p=-999;
392 m_du_costh=-999;
393 m_du_t0=-999;
394 m_du_chiE=-999;
395 m_du_chiMu=-999;
396 m_du_chiPi=-999;
397 m_du_chiK=-999;
398 m_du_chiP=-999;
399 m_du_nhit=-999;
400 m_du_ndedxhit=-999;
401 m_du_dEdx=-999;
402
403
404 if((*itTrk)->isMdcKalTrackValid()){
405 RecMdcKalTrack *mdcTrk = (*itTrk)->mdcKalTrack();
407 if ( mdcTrk->charge() > 0 ) {
408 log << MSG::DEBUG << "is muon+" << endreq;
409 } else {
410 log << MSG::DEBUG << "is muon-" << endreq;
411 }
412 double x0 =mdcTrk->x();
413 double y0 =mdcTrk->y();
414 double z0 =mdcTrk->z();
415 double Rxy=sqrt(x0*x0+y0*y0);
416
417 m_du_p=mdcTrk->p()*mdcTrk->charge();
418 m_du_costh=cos(mdcTrk->theta());
419
420
421 double tes=-999;
422 if (!m_dstfile) {
423 //get event start time
424 SmartDataPtr<RecEsTimeCol> aevtimeCol(eventSvc(),"/Event/Recon/RecEsTimeCol");
425 if( aevtimeCol && aevtimeCol->size()>0 ){
426 RecEsTimeCol::iterator iter_evt = aevtimeCol->begin();
427 for(; iter_evt!=aevtimeCol->end(); iter_evt++){
428 tes = (*iter_evt)->getTest();
429 //esTimeflag = (*iter_evt)->getStat();
430 }
431 }
432 m_du_t0=tes;
433 }
434
435 //get dedx information
436 if((*itTrk)->isMdcDedxValid()){
437 RecMdcDedx* dedxTrk = (*itTrk)->mdcDedx();
438 m_du_chiE = dedxTrk->chi(0);
439 m_du_chiMu = dedxTrk->chi(1);
440 m_du_chiPi = dedxTrk->chi(2);
441 m_du_chiK = dedxTrk->chi(3);
442 m_du_chiP = dedxTrk->chi(4);
443 m_du_ndedxhit = dedxTrk->numGoodHits();
444 m_du_nhit = dedxTrk->numTotalHits();
445 m_du_dEdx = dedxTrk->probPH();
446
447 //fill histograms
448 if (m_thsvc->getHist("/DQAHist/Dedx/Dimu/dedx", h).isSuccess()) {
449 h->Fill(dedxTrk->probPH());
450 }
451 else {
452 log << MSG::ERROR << "Couldn't retrieve dedx" << endreq;
453 }
454 if(fabs(cos(mdcTrk->theta()))<0.83){
455 if (m_thsvc->getHist("/DQAHist/Dedx/Dimu/dedx_barrel", h).isSuccess()) {
456 h->Fill(dedxTrk->probPH());
457 }
458 else {
459 log << MSG::ERROR << "Couldn't retrieve dedx_barrel" << endreq;
460 }
461 }
462 if (m_thsvc->getHist("/DQAHist/Dedx/Dimu/chiMu", h).isSuccess()) {
463 h->Fill(dedxTrk->chiE());
464 }
465 else {
466 log << MSG::ERROR << "Couldn't retrieve chiMu" << endreq;
467 }
468 if (m_thsvc->getHist("/DQAHist/Dedx/Dimu/nhitdedx", h).isSuccess()) {
469 h->Fill( dedxTrk->numGoodHits());
470 }
471 else {
472 log << MSG::ERROR << "Couldn't retrieve nhitdedx" << endreq;
473 }
474 if (m_thsvc->getHist("/DQAHist/Dedx/Dimu/nhit", h).isSuccess()) {
475 h->Fill( dedxTrk->numTotalHits());
476 }
477 else {
478 log << MSG::ERROR << "Couldn't retrieve nhit" << endreq;
479 }
480 if (m_thsvc->getHist("/DQAHist/Dedx/Dimu/dedx_p", h2).isSuccess()) {
481 h2->Fill(mdcTrk->p(), dedxTrk->probPH());
482 }
483 else {
484 log << MSG::ERROR << "Couldn't retrieve dedx_p" << endreq;
485 }
486 if (m_thsvc->getHist("/DQAHist/Dedx/Dimu/dedx_costh", h2).isSuccess()) {
487 h2->Fill(cos(mdcTrk->theta()), dedxTrk->probPH());
488 }
489 else {
490 log << MSG::ERROR << "Couldn't retrieve dedx_costh" << endreq;
491 }
492 if (!m_dstfile) {
493 if (m_thsvc->getHist("/DQAHist/Dedx/Dimu/dedx_t0", h2).isSuccess()) {
494 h2->Fill(tes, dedxTrk->probPH());
495 }
496 else {
497 log << MSG::ERROR << "Couldn't retrieve dedx_t0" << endreq;
498 }
499 }
500
501 }//end of valide dedx track
502 }//end of valide mdc track
503 }//end of looping track
504 }//end of dimu tag event
505
506 if(m_getntuple){
507 m_bb_tuple->write();
508 m_du_tuple->write();
509 }
510
511 return StatusCode::SUCCESS;
512
513}
514
515// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
516StatusCode DQA_Dedx::finalize() {
517
518 MsgStream log(msgSvc(), name());
519 log << MSG::INFO << "in finalize()" << endmsg;
520 return StatusCode::SUCCESS;
521}
522
523
double cos(const BesAngle a)
Definition: BesAngle.h:213
HepGeom::Point3D< double > HepPoint3D
Definition: DQA_Dedx.cxx:33
EvtRecTrackCol::iterator EvtRecTrackIterator
Definition: EvtRecTrack.h:111
INTupleSvc * ntupleSvc()
IMessageSvc * msgSvc()
StatusCode initialize()
Definition: DQA_Dedx.cxx:50
StatusCode execute()
Definition: DQA_Dedx.cxx:193
StatusCode finalize()
Definition: DQA_Dedx.cxx:516
DQA_Dedx(const std::string &name, ISvcLocator *pSvcLocator)
Definition: DQA_Dedx.cxx:40
double probPH() const
Definition: DstMdcDedx.h:66
double chiE() const
Definition: DstMdcDedx.h:59
int numTotalHits() const
Definition: DstMdcDedx.h:65
int numGoodHits() const
Definition: DstMdcDedx.h:64
double chi(int i) const
Definition: DstMdcDedx.h:58
const double y() const
const double theta() const
const double z() const
static void setPidType(PidType pidType)
const double p() const
const int charge() const
const double x() const
_EXTERN_ std::string EvtRecEvent
Definition: EventModel.h:116
_EXTERN_ std::string EvtRecTrackCol
Definition: EventModel.h:117