BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
KShortReconstruction Class Reference

#include <KShortReconstruction.h>

+ Inheritance diagram for KShortReconstruction:

Public Member Functions

 KShortReconstruction (const std::string &name, ISvcLocator *pSvcLocator)
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 

Detailed Description

Definition at line 10 of file KShortReconstruction.h.

Constructor & Destructor Documentation

◆ KShortReconstruction()

KShortReconstruction::KShortReconstruction ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 29 of file KShortReconstruction.cxx.

29 :
30Algorithm(name, pSvcLocator) {
31 //Declare the properties
32
33 declareProperty("Vz0Cut", m_vzCut = 20.0);
34 declareProperty("CosThetaCut", m_cosThetaCut=0.93);
35 declareProperty("ChisqCut", m_chisqCut = 100.0);
36 /*
37 declareProperty("PidUseDedx", m_useDedx = true);
38 declareProperty("PidUseTof1", m_useTof1 = true);
39 declareProperty("PidUseTof2", m_useTof2 = true);
40 declareProperty("PidUseTofE", m_useTofE = false);
41 declareProperty("PidUseTofQ", m_useTofQ = false);
42 declareProperty("PidUseEmc", m_useEmc = false);
43 declareProperty("PidProbCut", m_PidProbCut= 0.001);
44 declareProperty("MassRangeLower", m_massRangeLower = 0.45);
45 declareProperty("MassRangeHigher", m_massRangeHigher = 0.55);
46 */
47}

Member Function Documentation

◆ execute()

StatusCode KShortReconstruction::execute ( )

Definition at line 76 of file KShortReconstruction.cxx.

76 {
77 MsgStream log(msgSvc(), name());
78 log << MSG::INFO << "in execute()" << endreq;
79
80 StatusCode sc;
81
82 //////////////////
83 // Read REC data
84 /////////////////
85 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
86 SmartDataPtr<EvtRecEvent> recEvent(eventSvc(), EventModel::EvtRec::EvtRecEvent);
87 SmartDataPtr<EvtRecTrackCol> recTrackCol(eventSvc(), EventModel::EvtRec::EvtRecTrackCol);
88 log << MSG::DEBUG << "run and event = " << eventHeader->runNumber()
89 << " " << eventHeader->eventNumber() << endreq;
90 log << MSG::DEBUG <<"ncharg, nneu, tottks = "
91 << recEvent->totalCharged() << " , "
92 << recEvent->totalNeutral() << " , "
93 << recEvent->totalTracks() <<endreq;
94 int evtNo = eventHeader->eventNumber();
95 //if (eventHeader->eventNumber() % 1000 == 0) {
96 // cout << "Event number = " << evtNo << endl;
97 //}
98
99 SmartDataPtr<EvtRecVeeVertexCol> veeVertexCol(eventSvc(),
101 if (!veeVertexCol) {
102 veeVertexCol = new EvtRecVeeVertexCol;
103 sc = registerEvtRecVeeVertexCol(veeVertexCol, log);
104 if (sc != StatusCode::SUCCESS) {
105 return sc;
106 }
107 }
108
109 //////////////////////////////////////////////
110 // No PID : identify positive and negative
111 ///////////////////////////////////////////////
112 Vint ipip, ipim, iGood;
113 for (unsigned int i = 0; i < recEvent->totalCharged(); i++) {
114 EvtRecTrackIterator itTrk = recTrackCol->begin() + i;
115// EvtRecTrack* track = *itTrk;
116 if(!(*itTrk)->isMdcTrackValid()) continue;
117 if(!(*itTrk)->isMdcKalTrackValid()) continue;
118 RecMdcTrack* mdcTrk = (*itTrk)->mdcTrack();
119 if (fabs(cos(mdcTrk->theta())) >= m_cosThetaCut) continue;
120 if (fabs(mdcTrk->z()) >= m_vzCut) continue;
121 iGood.push_back(i);
122 if (mdcTrk->charge() > 0) ipip.push_back(i);
123 if (mdcTrk->charge() < 0) ipim.push_back(i);
124 }
125 // Cut on good charged tracks
126 //if (iGood.size() < 2) return StatusCode::SUCCESS;
127 if (ipip.size() < 1 || ipim.size() < 1) return StatusCode::SUCCESS;
128
129 ///////////////////////////////////
130 // Vertex Fit
131 //////////////////////////////////
132 HepPoint3D vx(0., 0., 0.);
133 HepSymMatrix Evx(3, 0);
134 double bx = 1E+6;
135 double by = 1E+6;
136 double bz = 1E+6;
137 Evx[0][0] = bx*bx;
138 Evx[1][1] = by*by;
139 Evx[2][2] = bz*bz;
140 VertexParameter vxpar;
141 vxpar.setVx(vx);
142 vxpar.setEvx(Evx);
143
144 VertexFit *vtxfit0 = VertexFit::instance();
145
146 for(unsigned int i1 = 0; i1 < ipip.size(); i1++) {
147 int ip1 = ipip[i1];
148 RecMdcKalTrack *pipKalTrk = (*(recTrackCol->begin()+ip1))->mdcKalTrack();
150 WTrackParameter wpiptrk(mpi, pipKalTrk->helix(), pipKalTrk->err());
151
152 for(unsigned int i2 = 0; i2 < ipim.size(); i2++) {
153 int ip2 = ipim[i2];
154 RecMdcKalTrack *pimKalTrk = (*(recTrackCol->begin()+ip2))->mdcKalTrack();
156 WTrackParameter wpimtrk(mpi, pimKalTrk->helix(), pimKalTrk->err());
157
158 vtxfit0->init();
159 vtxfit0->AddTrack(0, wpiptrk);
160 vtxfit0->AddTrack(1, wpimtrk);
161 vtxfit0->AddVertex(0, vxpar, 0, 1);
162 if(!(vtxfit0->Fit(0))) continue;
163 vtxfit0->BuildVirtualParticle(0);
164 if(vtxfit0->chisq(0) > m_chisqCut) continue;
165 WTrackParameter wKshort = vtxfit0->wVirtualTrack(0); //FIXME
166 std::pair<int, int> pair;
167 pair.first = 3;
168 pair.second = 3;
169
170 EvtRecTrack* track0 = *(recTrackCol->begin() + ip1);
171 EvtRecTrack* track1 = *(recTrackCol->begin() + ip2);
172
173 EvtRecVeeVertex* KsVertex = new EvtRecVeeVertex;
174 KsVertex->setVertexId(310);
175 KsVertex->setVertexType(0);
176 KsVertex->setChi2(vtxfit0->chisq(0));
177 KsVertex->setNdof(1);
178 KsVertex->setMass(wKshort.p().m());
179 KsVertex->setW(wKshort.w());
180 KsVertex->setEw(wKshort.Ew());
181 KsVertex->setPair(pair);
182 KsVertex->setNCharge(0);
183 KsVertex->setNTracks(2);
184 KsVertex->addDaughter(track0, 0);
185 KsVertex->addDaughter(track1, 1);
186 veeVertexCol->push_back(KsVertex);
187 /*
188 cout << "============= After Vertex fitting ===========" << endl;
189 cout << "Event number = " << evtNo << endl;
190 cout << "chi2 = " << vtxfit0->chisq(0) << endl;
191 cout << "mass = " << wKshort.p().m() << endl;
192 cout << "w = " << wKshort.w() << endl;
193 cout << "Ew = " << wKshort.Ew() << endl;
194 cout << "track 0 : Z : " << track0->mdcTrack()->z() << endl;
195 cout << "track 1 : Z : " << track1->mdcTrack()->z() << endl; */
196 }
197 }
198
199 return StatusCode::SUCCESS;
200}
double cos(const BesAngle a)
Definition: BesAngle.h:213
EvtRecTrackCol::iterator EvtRecTrackIterator
Definition: EvtRecTrack.h:111
ObjectVector< EvtRecVeeVertex > EvtRecVeeVertexCol
const double mpi
Definition: Gam4pikp.cxx:47
std::vector< int > Vint
Definition: Gam4pikp.cxx:52
IMessageSvc * msgSvc()
const HepVector & helix() const
static void setPidType(PidType pidType)
const HepSymMatrix & err() const
const double theta() const
Definition: DstMdcTrack.h:59
const int charge() const
Definition: DstMdcTrack.h:53
const double z() const
Definition: DstMdcTrack.h:63
void setVertexType(int vtxType)
void setChi2(double chi2)
void addDaughter(const SmartRef< EvtRecTrack > &track, int i)
void setEw(const HepSymMatrix &Ew)
void setMass(double mass)
void setNdof(int ndof)
void setNTracks(int nTracks)
void setVertexId(int vtxId)
void setPair(const std::pair< int, int > &pair)
void setW(const HepVector &w)
void setNCharge(int nCharge)
void AddTrack(const int number, const double mass, const RecMdcTrack *trk)
Definition: TrackPool.cxx:22
double chisq() const
Definition: VertexFit.h:66
WTrackParameter wVirtualTrack(int n) const
Definition: VertexFit.h:92
void init()
Definition: VertexFit.cxx:29
void AddVertex(int number, VertexParameter vpar, std::vector< int > lis)
Definition: VertexFit.cxx:89
static VertexFit * instance()
Definition: VertexFit.cxx:15
void BuildVirtualParticle(int number)
Definition: VertexFit.cxx:619
bool Fit()
Definition: VertexFit.cxx:301
void setEvx(const HepSymMatrix &eVx)
void setVx(const HepPoint3D &vx)
HepLorentzVector p() const
HepVector w() const
HepSymMatrix Ew() const
_EXTERN_ std::string EvtRecEvent
Definition: EventModel.h:116
_EXTERN_ std::string EvtRecVeeVertexCol
Definition: EventModel.h:121
_EXTERN_ std::string EvtRecTrackCol
Definition: EventModel.h:117

◆ finalize()

StatusCode KShortReconstruction::finalize ( )

Definition at line 58 of file KShortReconstruction.cxx.

58 {
59 MsgStream log(msgSvc(), name());
60 log << MSG::INFO << "in finalize()" << endreq;
61
62 return StatusCode::SUCCESS;
63}

◆ initialize()

StatusCode KShortReconstruction::initialize ( )

Definition at line 50 of file KShortReconstruction.cxx.

50 {
51 MsgStream log(msgSvc(), name());
52 log << MSG::INFO << "in initialize()" <<endreq;
53
54 return StatusCode::SUCCESS;
55}

The documentation for this class was generated from the following files: