BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcAliRecTrk.cxx
Go to the documentation of this file.
1#include "MdcAlignAlg/MdcAliRecTrk.h"
2
3#include "GaudiKernel/MsgStream.h"
4#include "GaudiKernel/IMessageSvc.h"
5#include "GaudiKernel/StatusCode.h"
6#include "GaudiKernel/ISvcLocator.h"
7#include "GaudiKernel/Bootstrap.h"
8#include "GaudiKernel/SmartDataPtr.h"
9#include "GaudiKernel/IDataProviderSvc.h"
10
11const double MdcAliRecTrk::m_df = 10.0;
12
14 unsigned int i;
15 for(i=0; i<m_rechit.size(); i++){
16 delete m_rechit[i];
17 }
18 m_rechit.clear();
19}
20
21void MdcAliRecTrk::setRecTrk(RecMdcTrackCol::iterator it_trk){
22 IMessageSvc *msgSvc;
23 Gaudi::svcLocator()->service("MessageSvc", msgSvc);
24 MsgStream log(msgSvc, "MdcAliRecTrk");
25 log << MSG::DEBUG << "MdcAliRecTrk::setRecTrk()" << endreq;
26
27 m_stat = (*it_trk)->stat();
28 m_dr = (*it_trk) -> helix(0);
29 m_phi0 = (*it_trk) -> helix(1);
30 m_kappa = (*it_trk) -> helix(2);
31 m_dz = (*it_trk) -> helix(3);
32 m_tanl = (*it_trk) -> helix(4);
33
34 m_helix = (*it_trk)->helix();
35 m_helixerr = (*it_trk)->err();
36
37 m_chisq = (*it_trk) -> chi2();
38 m_nhits = (*it_trk) -> getNhits();
39
40 m_dr *= m_df; // cm -> mm
41 m_dz *= m_df; // cm -> mm
42
43 if(m_kappa < 0.01){ // no magnetic field
44 m_pt = 0.0;
45 m_p = 0.0;
46 }else{
47 m_pt = 1.0 / m_kappa;
48 m_p = m_pt * sqrt(m_tanl * m_tanl + 1.0);
49 }
50
51 HitRefVec gothits = (*it_trk) -> getVecHits();
52 HitRefVec::iterator it_hit = gothits.begin();
53 MdcAliRecHit* rechit;
54 for(; it_hit != gothits.end(); it_hit++){
55 rechit = new MdcAliRecHit();
56 rechit->setRecHit(it_hit);
57 m_rechit.push_back(rechit);
58 }
59}
60
61void MdcAliRecTrk::setKalTrk(RecMdcKalTrackCol::iterator it_trk){
62 IMessageSvc *msgSvc;
63 Gaudi::svcLocator()->service("MessageSvc", msgSvc);
64 MsgStream log(msgSvc, "MdcAliRecTrk");
65 log << MSG::DEBUG << "MdcAliRecTrk::setKalTrk()" << endreq;
66
67 int m_pid = 1;
71
72 m_stat = 0;
73 m_dr = (*it_trk)->dr();
74 m_phi0 = (*it_trk)->fi0();
75 m_kappa = (*it_trk)->kappa();
76 m_dz = (*it_trk)->dz();
77 m_tanl = (*it_trk)->tanl();
78 m_chisq = (*it_trk)->chi2();
79
80 m_dr *= 10.0; // cm -> mm
81 m_dz *= 10.0; // cm -> mm
82
83 m_pt = 1.0 / fabs(m_kappa);
84 m_p = m_pt * sqrt( m_tanl * m_tanl + 1.0 );
85
86 HelixSegRefVec gothelixsegs = (*it_trk)->getVecHelixSegs();
87 HelixSegRefVec::iterator it_hit = gothelixsegs.begin();
88 MdcAliRecHit* rechit;
89
90 int k = 0;
91 for(; it_hit != gothelixsegs.end(); it_hit++){
92 rechit = new MdcAliRecHit();
93 rechit->setKalHit(it_hit);
94 m_rechit.push_back(rechit);
95
96 k++;
97 }
98 m_nhits = k;
99}
SmartRefVector< RecMdcKalHelixSeg > HelixSegRefVec
SmartRefVector< RecMdcHit > HitRefVec
void setKalHit(HelixSegRefVec::iterator it_hit)
void setRecHit(HitRefVec::iterator it_hit)
void setKalTrk(RecMdcKalTrackCol::iterator it_trk)
void setRecTrk(RecMdcTrackCol::iterator it_trk)