CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
TrkExtAlg.cxx
Go to the documentation of this file.
1//
2// File: TrkExtAlg.cxx
3// Author: Wang Liangliang
4// Date: 2005.4.4
5//
6#include "GaudiKernel/MsgStream.h"
7#include "GaudiKernel/AlgFactory.h"
8#include "GaudiKernel/ISvcLocator.h"
9#include "GaudiKernel/SmartDataPtr.h"
10#include "GaudiKernel/IDataProviderSvc.h"
11#include "GaudiKernel/IDataManagerSvc.h"
12#include "GaudiKernel/PropertyMgr.h"
14
15#include "CLHEP/Matrix/SymMatrix.h"
16#include "CLHEP/Vector/ThreeVector.h"
17
19#include "TrkExtAlg/TrkExtAlg.h"
21/////////////////////////////////change
22//#include "TrkExtAlg/Helix.h"
23#include "TrackUtil/Helix.h"
24//////////////////////////////////
26
27using namespace Event;
28
29string parName[5]={"e","mu","pi","kaon","proton"};
30
31//Constructor
32TrkExtAlg::TrkExtAlg(const string& name, ISvcLocator* pSvcLocator):Algorithm(name, pSvcLocator)
33{
34 myParticleName = "pi";
35 msgFlag = false;
36 myResultFlag = false;
37 myInputTrk= "Kal";
38
39 declareProperty("ParticleName",myParticleName);
40 declareProperty("GeantGeomOptimization",myGeomOptimization=true);
41 declareProperty("MessageFlag",msgFlag);
42 declareProperty("ResultMessageFlag",myResultFlag);
43 declareProperty("BFieldOn",myBFieldOn=true);
44 declareProperty("InputTrk",myInputTrk);
45 declareProperty("Tof",m_tof=2);
46 declareProperty("UseMucKalFilter",myUseMucKal=true);
47 declareProperty("MucWindow",myMucWindow=6);
48}
49
50//Destructor
52{
53 if(myExtTrack) delete myExtTrack;
54}
55
56//////////////////////
58{
59 MsgStream log(msgSvc(), name());
60 log << MSG::INFO << "initialize()" << endreq;
61
62 myExtTrack = new Ext_track(msgFlag,myBFieldOn,myGeomOptimization,m_tof,myUseMucKal,myMucWindow);
63 myExtTrack->Initialization(msgFlag,myBFieldOn,myGeomOptimization,myUseMucKal,myMucWindow);
64// myFile = new ofstream("ExtData.txt");
65
66 /*
67 //--------- For Ext Test ----------------
68 NTuplePtr nt(ntupleSvc(),"FILE501/ext");
69 if ( nt ) myNtuple = nt;
70 else {
71 myNtuple=ntupleSvc()->book("FILE501/ext",CLID_ColumnWiseTuple,"TrkExt");
72 if(myNtuple) {
73 myNtuple->addItem("charge",myCharge);
74 myNtuple->addItem("emcHitFlag",myEmcHitFlag);
75 myNtuple->addItem("emcHitTheta",myEmcHitTheta);
76 myNtuple->addItem("emcHitPhi",myEmcHitPhi);
77 myNtuple->addItem("emcVolNum",myEmcVolNum);
78 myNtuple->addItem("emcExtTheta",myEmcExtTheta);
79 myNtuple->addItem("emcExtPhi",myEmcExtPhi);
80 myNtuple->addItem("dTheta",myDTheta);
81 myNtuple->addItem("dPhi",myDPhi);
82 }
83 else { // did not manage to book the N tuple....
84 log << MSG::ERROR <<"Cannot book N-tuple:" << long(myNtuple) << endmsg;
85 return StatusCode::FAILURE;
86 }
87 }
88 //-------- end Ext Test -----------------
89 */
90 return StatusCode::SUCCESS;
91}
92
93
94//////////////////////
96{
97 //cout<<"a new event "<<endl;
98 MsgStream log(msgSvc(), name());
99 log << MSG::INFO << "execute()" << endreq;
100 int eventNumber, runNumber;
101
102 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
103 if (!eventHeader)
104 {
105 log << MSG::FATAL << "Could not find Event Header" << endreq;
106 return( StatusCode::FAILURE);
107 }
108 runNumber = eventHeader->runNumber();
109 eventNumber = eventHeader->eventNumber();
110// if(eventNumber!=5&&eventNumber!=8&&eventNumber!=142) return( StatusCode::SUCCESS);//1900736 //839313
111 if(msgFlag)
112 {
113 cout<<"TrackExt: ******************* Start a event *******************"<<endl;
114 cout<<"run= "<<runNumber<<"; event= "<<eventNumber<<endl;
115 }
116// cout<<"run= "<<runNumber<<"; event= "<<eventNumber<<endl;
117 /////
118 SmartDataPtr<MucDigiCol> mucDigiCol(eventSvc(),"/Event/Digi/MucDigiCol");
119 if(!mucDigiCol) {
120 log << MSG::FATAL << "Could not find MUC digi" << endreq;
121 return( StatusCode::SUCCESS);
122 }
123 //cout<<"digi col is "<<mucDigiCol->size()<<endl;
124 ////
125 ExtMdcTrack aExtMdcTrack;
126 aExtMdcTrack.SetMsgFlag(msgFlag);
127
128 bool setTrk=false;
129
130 int parID;
131 if(myParticleName=="e") parID=0;
132 else if(myParticleName=="mu") parID=1;
133 else if(myParticleName=="pi") parID=2;
134 else if(myParticleName=="kaon") parID=3;
135 else if(myParticleName=="proton"||myParticleName=="anti_proton") parID=4;
136
137 if(myInputTrk=="Mdc")
138 {
139 SmartDataPtr<RecMdcTrackCol> aMdcTrackCol(eventSvc(),"/Event/Recon/RecMdcTrackCol");
140 if(!aMdcTrackCol)
141 {
142 log << MSG::WARNING << "Can't find RecMdcTrackCol in TDS!" << endreq;
143 return( StatusCode::SUCCESS);
144 }
145 setTrk=aExtMdcTrack.SetMdcRecTrkCol(aMdcTrackCol);
146
147 }
148 else if(myInputTrk=="Kal")
149 {
150 SmartDataPtr<RecMdcKalTrackCol> aMdcKalTrackCol(eventSvc(),"/Event/Recon/RecMdcKalTrackCol");
151 if(!aMdcKalTrackCol)
152 {
153 log << MSG::WARNING << "Can't find RecMdcKalTrackCol in TDS!" << endreq;
154 return( StatusCode::SUCCESS);
155 }
156 setTrk=aExtMdcTrack.SetMdcKalTrkCol(aMdcKalTrackCol);
157 }
158 else
159 {
160 log << MSG::WARNING << "Wrong type of inputTrk:" << myInputTrk << endreq;
161 return( StatusCode::SUCCESS);
162 }
163
164 RecExtTrackCol *aExtTrackCol = new RecExtTrackCol;
165 if(setTrk)
166 {
167 while(aExtMdcTrack.GetOneGoodTrk())
168 {
169 //cout<<"start a track........................"<<endl;
170 RecExtTrack *aExtTrack = new RecExtTrack;
171
172 for(int i=0; i<5; i++)// extrapolate one track with all 5 hypotheses
173 {
174 if(aExtMdcTrack.ReadTrk(i))
175 {
176 aExtTrack->SetParType(i);
177
178 int trackID = aExtMdcTrack.GetTrackID();
179 aExtTrack->SetTrackId(trackID);
180 Hep3Vector position = aExtMdcTrack.GetPosition();
181 Hep3Vector momentum = aExtMdcTrack.GetMomentum();
182 HepSymMatrix error = aExtMdcTrack.GetErrorMatrix();
183 double pathInMDC = aExtMdcTrack.GetTrackLength();
184 double tofInMdc = aExtMdcTrack.GetTrkTof();
185
186 if(msgFlag)
187 {
188 cout<<"Start From:"<<position.x()<<' '<<position.y()<<' '
189 <<position.z()<<endl;
190 cout<<"Start Momentum:"<<momentum.x()<<' '<<momentum.y()<<' '<<momentum.z()<<endl;
191 cout<<"Start Error matrix:"<<error<<endl;
192 cout<<"Path before start:"<< pathInMDC << endl;
193 }
194
195 G4String aParticleName(parName[i]);
196 double charge = aExtMdcTrack.GetParticleCharge();
197 if(!aParticleName.contains("proton"))
198 {
199 if(charge>0) aParticleName += "+";
200 else aParticleName += "-";
201 }
202 else
203 {
204 if(charge>0) aParticleName = "proton";
205 else aParticleName = "anti_proton";
206 }
207
208 if(msgFlag)
209 {
210 cout<<"Charge: "<<charge<<endl;
211 cout<<"Particle: "<<aParticleName<<endl;
212 }
213
214 ExtSteppingAction *extSteppingAction;
215 extSteppingAction = myExtTrack->GetStepAction();
216 extSteppingAction->Set_which_tof_version(m_tof);//Set the ToFversionnumber. Required for the MRPC
217
218 extSteppingAction->Reset();
219 extSteppingAction->SetMucDigiColPointer(mucDigiCol);
220 extSteppingAction->SetExtTrackPointer(aExtTrack);
221 bool m_trackstatus = false;
222 int trk_startpart = 0;
223 while(!m_trackstatus)
224 {
225
226 trk_startpart++;//just for protection
227 if(trk_startpart>20)
228 {cout<<"-------has modified more than 20 times---------"<<endl;break;}
229 if(myExtTrack->Set(position,momentum,error,aParticleName,pathInMDC,tofInMdc))
230 {
231 myExtTrack->TrackExtrapotation();
232 extSteppingAction->InfmodMuc(position,momentum,error);
233 m_trackstatus = extSteppingAction->TrackStop();
234 }
235 else
236 m_trackstatus = true;
237 }
238 }
239
240 }
241
242 aExtTrack->SetParType(parID);
243
244 if(msgFlag) cout<<"will add aExtTrack!"<<endl;
245 if(aExtTrackCol)
246 {
247 if(aExtTrack) aExtTrackCol->add(aExtTrack);
248 else if(msgFlag) cout<<"No aExtTrack!"<<endl;
249 }
250 else
251 {
252 if(msgFlag) cout<<"No aExtTrackCol!"<<endl;
253 }
254 if(msgFlag) cout<<"add a aExtTrack!"<<endl;
255
256 /*
257 //For Test
258 if(myFile)
259 {
260 (*myFile)<<endPoint.x()<<' '<<endPoint.y()<<' '
261 <<endPoint.z()<<' '<<endMomentum.x()
262 <<' '<<endMomentum.y()<<' '<<endMomentum.z()
263 <<' '<<endErrorMatrix(1,1)<<' '<<endErrorMatrix(2,2)
264 <<' '<<endErrorMatrix(3,3)<<' '<<endErrorMatrix(4,4)
265 <<' '<<endErrorMatrix(5,5)<<' '<<endErrorMatrix(6,6)
266 <<endl;
267 }
268 else {
269 log << MSG::ERROR <<"can't open file" << endreq;
270
271 }
272 */
273 }//while
274 }//if
275
276 //Register ExtTrackCol to TDS.
277 /* ReconEvent *aReconEvent = new ReconEvent();
278 StatusCode sc = eventSvc()->registerObject("/Event/Recon",aReconEvent);
279 if(sc!=StatusCode::SUCCESS) {
280 log << MSG::FATAL << "Could not register ReconEvent" <<endreq;
281 return( StatusCode::FAILURE);
282 }
283 */
284
285 //cout<<"will write in to service "<<endl;
286 SmartIF<IDataManagerSvc> dataManSvc(eventSvc());
287 //IDataManagerSvc *dataManSvc = dynamic_cast<IDataManagerSvc*> (eventSvc());
288
289 DataObject *extTrackCol;
290 eventSvc()->findObject("/Event/Recon/RecExtTrackCol",extTrackCol);
291 if(extTrackCol != NULL) {
292 dataManSvc->clearSubTree("/Event/Recon/RecExtTrackCol");
293 eventSvc()->unregisterObject("/Event/Recon/RecExtTrackCol");
294 }
295
296 // cout<<"write register object "<<endl;
297
298 StatusCode sc = eventSvc()->registerObject("/Event/Recon/RecExtTrackCol", aExtTrackCol);
299 if(sc!=StatusCode::SUCCESS) {
300 log << MSG::FATAL << "Could not register RecExtTrackCol in TDS!" << endreq;
301 return( StatusCode::FAILURE);
302 }
303
304 //Check ExtTrackCol in TDS.
305 //cout<<"Check ExtTrackCol in TDS."<<endl;
306 SmartDataPtr<RecExtTrackCol> aExtTrkCol(eventSvc(),"/Event/Recon/RecExtTrackCol");
307 if (!aExtTrkCol) {
308 log << MSG::FATAL << "Can't find RecExtTrackCol in TDS!" << endreq;
309 return( StatusCode::FAILURE);
310 }
311
312 RecExtTrackCol::iterator iterOfExtTrk;
313 int j=1;
314 //cout<<"aExtTrkCol->size is "<<aExtTrkCol->size()<<" --------------"<<endl;
315 for(iterOfExtTrk = aExtTrkCol->begin();iterOfExtTrk!=aExtTrkCol->end();iterOfExtTrk++)
316 {
317 if(myResultFlag)
318 {
319 for(int i=0; i<5; i++)
320 {
321 //TOF information.
322 cout<<"##########track"<<j<<": "<<"("<<i<<")"<<endl;
323 cout<<"******TOF1:******"<<endl;
324 cout<<"VolumeName: "<<(*iterOfExtTrk)->tof1VolumeName(i)<<"\t"
325 <<"VolumeNumber: "<<(*iterOfExtTrk)->tof1VolumeNumber(i)<<"\t"<<endl
326 <<"Position: "<<(*iterOfExtTrk)->tof1Position(i)<<"\t"
327 <<"Momentum: "<<(*iterOfExtTrk)->tof1Momentum(i)<<"\t"<<endl
328 <<"Error matrix: "<<(*iterOfExtTrk)->tof1ErrorMatrix(i)
329 <<"Error z: "<<(*iterOfExtTrk)->tof1PosSigmaAlongZ(i)<<"\t"
330 <<"Error Tz: "<<(*iterOfExtTrk)->tof1PosSigmaAlongT(i)<<"\t"
331 <<"Error x: "<<(*iterOfExtTrk)->tof1PosSigmaAlongX(i)<<"\t"
332 <<"Error y: "<<(*iterOfExtTrk)->tof1PosSigmaAlongY(i)<<endl
333 <<"Tof: "<<(*iterOfExtTrk)->tof1(i)<<"\t"
334 <<"PathOF: "<<(*iterOfExtTrk)->tof1Path(i)
335 <<endl;
336 cout<<"******TOF2:******"<<endl;
337 cout<<"VolumeName: "<<(*iterOfExtTrk)->tof2VolumeName(i)<<"\t"
338 <<"VolumeNumber: "<<(*iterOfExtTrk)->tof2VolumeNumber(i)<<"\t"<<endl
339 <<"Position: "<<(*iterOfExtTrk)->tof2Position(i)<<"\t"
340 <<"Momentum: "<<(*iterOfExtTrk)->tof2Momentum(i)<<"\t"<<endl
341 <<"Error matrix: "<<(*iterOfExtTrk)->tof2ErrorMatrix(i)
342 <<"Error z: "<<(*iterOfExtTrk)->tof2PosSigmaAlongZ(i)<<"\t"
343 <<"Error Tz: "<<(*iterOfExtTrk)->tof2PosSigmaAlongT(i)<<"\t"
344 <<"Error x: "<<(*iterOfExtTrk)->tof2PosSigmaAlongX(i)<<"\t"
345 <<"Error y: "<<(*iterOfExtTrk)->tof2PosSigmaAlongY(i)<<endl
346 <<"Tof: "<<(*iterOfExtTrk)->tof2(i)<<"\t"
347 <<"PathOF: "<<(*iterOfExtTrk)->tof2Path(i)
348 <<endl;
349
350 //EMC information.
351 cout<<"******EMC:******"<<endl
352 <<"VolumeName: "<<(*iterOfExtTrk)->emcVolumeName(i)<<"\t"
353 <<"VolumeNumber: "<<(*iterOfExtTrk)->emcVolumeNumber(i)<<"\t"<<endl
354 <<"Position: "<<(*iterOfExtTrk)->emcPosition(i)<<"\t"
355 <<"Momentum: "<<(*iterOfExtTrk)->emcMomentum(i)<<"\t"<<endl
356 <<"Error matrix: "<<(*iterOfExtTrk)->emcErrorMatrix(i)
357 <<"Error theta: "<<(*iterOfExtTrk)->emcPosSigmaAlongTheta(i)<<"\t"
358 <<"Error phi: "<<(*iterOfExtTrk)->emcPosSigmaAlongPhi(i)<<"\t"
359 <<"EMC path: "<<(*iterOfExtTrk)->emcPath(i)
360 <<endl;
361
362 //MUC information
363 cout<<"******MUC:******"<<endl
364 <<"VolumeName: "<<(*iterOfExtTrk)->mucVolumeName(i)<<"\t"
365 <<"VolumeNumber: "<<(*iterOfExtTrk)->mucVolumeNumber(i)<<endl
366 <<"Position: "<<(*iterOfExtTrk)->mucPosition(i)<<"\t"
367 <<"Momentum: "<<(*iterOfExtTrk)->mucMomentum(i)<<"\t"<<endl
368 <<"Error matrix: "<<(*iterOfExtTrk)->mucErrorMatrix(i)
369 <<"Error z: "<<(*iterOfExtTrk)->mucPosSigmaAlongZ(i)<<"\t"
370 <<"Error Tz: "<<(*iterOfExtTrk)->mucPosSigmaAlongT(i)<<"\t"
371 <<"Error x: "<<(*iterOfExtTrk)->mucPosSigmaAlongX(i)<<"\t"
372 <<"Error y: "<<(*iterOfExtTrk)->mucPosSigmaAlongY(i)
373 <<endl;
374
375 cout<<"*******MUC KALMANFILTER***********"<<endl;
376 cout<<"Chisq is "<<(*iterOfExtTrk)->MucKalchi2(i)<<endl;
377 cout<<"Nfit is "<<(*iterOfExtTrk)->MucKaldof(i)<<endl;
378 cout<<"chiL "<<(*iterOfExtTrk)->MucKalchi2()<<endl;
379 // cout<<"Pull is "<<(*iterOfExtTrk)->mucKalPull()<<endl;
380
381 // cout<<"Residual is "<<(*iterOfExtTrk)->mucKalResidual()<<endl;
382 //Muc Ext hits information
383 /* ExtMucHitVec aExtMucHitVec = (*iterOfExtTrk)->GetExtMucHitVec();
384 int numOfMucHits = aExtMucHitVec.size();
385 cout<<"******MUC hits:"<<numOfMucHits<<"******"<<endl;
386 for(int j=0;j<numOfMucHits;j++)
387 {
388 cout<<"###Muc Hit "<<j<<":###"<<endl
389 <<"VolumeName: "<<aExtMucHitVec[j].GetVolumeName()<<"\t"
390 <<"VolumeNumber: "<<aExtMucHitVec[j].GetVolumeNumber()<<"\t"<<endl
391 <<"Position: "<<aExtMucHitVec[j].GetPosition()<<"\t"
392 <<"Momentum: "<<aExtMucHitVec[j].GetMomentum()<<"\t"<<endl
393 <<"Error z: "<<aExtMucHitVec[j].GetPosSigmaAlongZ()<<"\t"
394 <<"Error Tz: "<<aExtMucHitVec[j].GetPosSigmaAlongT()<<"\t"
395 <<"Error x: "<<aExtMucHitVec[j].GetPosSigmaAlongX()<<"\t"
396 <<"Error y: "<<aExtMucHitVec[j].GetPosSigmaAlongY()<<"\t"
397 <<endl;
398 }
399 */
400 }
401 }
402 j++;
403
404 } // loop ExtTrkCol
405
406 if(msgFlag) cout<<"****************** End a event! ****************"<<endl<<endl;
407
408 /*
409 //--------- For Ext Test ----------------
410 // Retrieve mc truth
411 SmartDataPtr<McParticleCol> mcParticleCol(eventSvc(),"/Event/MC/McParticleCol");
412 if (!mcParticleCol) {
413 log << MSG::FATAL << "Could not find McParticle" << endreq;
414 return( StatusCode::FAILURE);
415 }
416
417 int numOfTrack = mcParticleCol->size();
418 if(msgFlag) cout<< "numOfMcTrack: " << numOfTrack << endl;
419 if(numOfTrack!=2) return StatusCode::SUCCESS;
420
421 // Retrieve Emc Mc Hits
422 SmartDataPtr<EmcMcHitCol> emcMcHitCol(eventSvc(),"/Event/MC/EmcMcHitCol");
423 if (!emcMcHitCol) {
424 log << MSG::FATAL << "Could not find EMC truth" << endreq;
425 return( StatusCode::FAILURE);
426 }
427
428 McParticleCol::iterator iter_mc = mcParticleCol->begin();
429 EmcMcHitCol::iterator iterEmcBegin = emcMcHitCol->begin();
430 int numOfEmcHits = emcMcHitCol->size();
431
432 // ExtTrackCol *aExtTrackCol = new ExtTrackCol;
433
434 for (int i = 1;iter_mc != mcParticleCol->end(); iter_mc++, i++) {
435 bool flag = (*iter_mc)->primaryParticle();
436 if(!flag) continue;
437 int particleId = (*iter_mc)->particleProperty();
438 double charge = particleId/abs(particleId);
439 unsigned int sFlag = (*iter_mc)->statusFlags();
440 int trackIdx = (*iter_mc)->getTrackIndex();
441 HepPoint3D iPos = (*iter_mc)->initialPosition();
442 HepPoint3D fPos = (*iter_mc)->finalPosition();
443 HepLorentzVector iFMomentum = (*iter_mc)->initialFourMomentum();
444 HepLorentzVector fFMomentum = (*iter_mc)->finalFourMomentum();
445
446
447 bool emcHitFlag = false;
448 double thetaOfEmcHit = 0;
449 double phiOfEmcHit = 0;
450 Hep3Vector posOfEmcHit(0,0,0);
451 //Get Emc Truth
452 for(int j=0;j<numOfEmcHits;j++)
453 {
454 if(trackIdx==(*(iterEmcBegin+j))->getTrackIndex())
455 {
456 emcHitFlag = true;
457 double x = (*(iterEmcBegin+j))->getPositionX();
458 double y = (*(iterEmcBegin+j))->getPositionY();
459 double z = (*(iterEmcBegin+j))->getPositionZ();
460 Hep3Vector vec(x,y,z);
461 posOfEmcHit = vec;
462 thetaOfEmcHit = posOfEmcHit.theta();
463 phiOfEmcHit = posOfEmcHit.phi();
464 break;
465 }
466 }
467
468 ExtSteppingAction *extSteppingAction;
469 extSteppingAction = myExtTrack->GetStepAction();
470
471 G4String aParticleName(myParticleName);
472 if(!aParticleName.contains("proton"))
473 {
474 if(charge>0) aParticleName += "+";
475 else aParticleName += "-";
476 }
477 else
478 {
479 if(charge>0) aParticleName = "proton";
480 else aParticleName = "anti_proton";
481}
482
483ExtTrack *aExtTrack = new ExtTrack;
484aExtTrack->SetTrackID(trackIdx);
485
486Hep3Vector position(iPos);
487Hep3Vector momentum(iFMomentum.x(),iFMomentum.y(),iFMomentum.z());
488HepSymMatrix error(6,0);
489
490if(myExtTrack->Set(position,momentum,error,aParticleName,0))
491{
492 extSteppingAction->SetExtTrackPointer(aExtTrack);
493 myExtTrack->TrackExtrapotation();
494}
495
496Hep3Vector extEmcPos = aExtTrack->GetEmcPosition();
497double volumeNum = aExtTrack->GetEmcVolumeNumber();
498double thetaExt = extEmcPos.theta();
499double phiExt = extEmcPos.phi();
500
501if(myResultFlag)
502{
503 cout<< "*******Mc Track " << i <<" :******"<<endl;
504 cout<< "Parimary particle :" << flag <<" particleId = " << (*iter_mc)->particleProperty() << endl;
505 cout<< "Track Index: " << trackIdx << endl;
506 cout<< "initialPosition: "<< iPos.x() << "," << iPos.y() << "," << iPos.z() << endl;
507 cout<< "initialFourMomentum: " <<iFMomentum.x()<<","<<iFMomentum.y()<<","<<iFMomentum.z() << endl;
508 cout<<"Emc Truth:"<<emcHitFlag<<"!"<<posOfEmcHit<<endl;
509
510 cout<<"Ext Emc: "<<aExtTrack->GetEmcVolumeName()<<aExtTrack->GetEmcPosition()<<endl;
511}
512
513myCharge = charge;
514myEmcHitFlag = (emcHitFlag)? 1.:-1.;
515myEmcHitTheta = thetaOfEmcHit;
516myEmcHitPhi = phiOfEmcHit;
517myEmcVolNum = volumeNum;
518myEmcExtTheta = thetaExt;
519myEmcExtPhi = phiExt;
520myDTheta = myEmcHitTheta-myEmcExtTheta;
521myDPhi = myEmcHitPhi-myEmcExtPhi;
522while(myDTheta<-1*M_PI) myDTheta+=2.0*M_PI;
523while(myDPhi<-1*M_PI) myDPhi+=2.0*M_PI;
524while(myDPhi>M_PI) myDPhi-=2.0*M_PI;
525while(myDTheta>M_PI) myDTheta-=2.0*M_PI;
526myNtuple->write();
527
528if(aExtTrack) delete aExtTrack;
529}
530
531//--------- end Ext Test ----------------
532*/
533
534return StatusCode::SUCCESS;
535}
536
537/////////////////////
539{
540 MsgStream log(msgSvc(), name());
541 log << MSG::INFO << "finalize()" << endreq;
542
543 // delete myExtTrack;
544 // myFile->close();
545
546 return StatusCode::SUCCESS;
547}
**********INTEGER nmxhep !maximum number of particles DOUBLE PRECISION vhep INTEGER jdahep COMMON hepevt $ !serial number $ !number of particles $ !status code $ !particle ident KF $ !parent particles $ !childreen particles $ !four momentum
ObjectVector< RecExtTrack > RecExtTrackCol
Definition: RecExtTrack.h:209
IMessageSvc * msgSvc()
string parName[5]
Definition: TrkExtAlg.cxx:29
void SetTrackId(int trackId)
Definition: DstExtTrack.h:193
void SetParType(int aParType=2)
Definition: DstExtTrack.h:194
bool GetOneGoodTrk()
Definition: ExtMdcTrack.cxx:51
double GetParticleCharge() const
double GetTrackLength() const
double GetTrkTof() const
Definition: ExtMdcTrack.h:56
int GetTrackID()
Definition: ExtMdcTrack.h:50
bool SetMdcKalTrkCol(RecMdcKalTrackCol *aPointer)
Definition: ExtMdcTrack.cxx:42
bool SetMdcRecTrkCol(RecMdcTrackCol *aPointer)
Definition: ExtMdcTrack.cxx:33
const Hep3Vector GetPosition() const
bool ReadTrk(int pid)
Definition: ExtMdcTrack.cxx:77
const HepSymMatrix GetErrorMatrix() const
const Hep3Vector GetMomentum() const
void SetMsgFlag(bool aFlag)
Definition: ExtMdcTrack.h:44
void SetExtTrackPointer(RecExtTrack *aExtTrack)
void InfmodMuc(Hep3Vector &pos, Hep3Vector &mom, HepSymMatrix &err)
void Set_which_tof_version(int version)
void SetMucDigiColPointer(MucDigiCol *rawdigicol)
void TrackExtrapotation()
Definition: Ext_track.cxx:342
void Initialization(const bool aMsgFlag, const bool Bfield, const bool GeomOptimization, const bool aUseMucKal, const int aMucWindow)
Definition: Ext_track.cxx:89
ExtSteppingAction * GetStepAction()
Definition: Ext_track.h:90
bool Set(const Hep3Vector &xv3, const Hep3Vector &pv3, const HepSymMatrix &err, const std::string &particleName, const double pathInMDC, const double tofInMdc)
Definition: Ext_track.cxx:234
StatusCode finalize()
Definition: TrkExtAlg.cxx:538
StatusCode execute()
Definition: TrkExtAlg.cxx:95
TrkExtAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TrkExtAlg.cxx:32
StatusCode initialize()
Definition: TrkExtAlg.cxx:57
Definition: Event.h:21