79 {
80 MsgStream log(
msgSvc(), name());
81 log << MSG::INFO << "in execute()" << endreq;
82
83 StatusCode sc;
84
85
86
87
88 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
91 log << MSG::DEBUG << "run and event = " << eventHeader->runNumber()
92 << " " << eventHeader->eventNumber() << endreq;
93 log << MSG::DEBUG <<"ncharg, nneu, tottks = "
94 << recEvent->totalCharged() << " , "
95 << recEvent->totalNeutral() << " , "
96 << recEvent->totalTracks() <<endreq;
97 int evtNo = eventHeader->eventNumber();
98
99
100
101
102 SmartDataPtr<EvtRecVeeVertexCol> veeVertexCol(eventSvc(),
104 if (!veeVertexCol) {
106 sc = registerEvtRecVeeVertexCol(veeVertexCol, log);
107 if (sc != StatusCode::SUCCESS) {
108 return sc;
109 }
110 }
111
112
113
114
115 Vint ipip, ipim, iGood;
116 for (unsigned int i = 0; i < recEvent->totalCharged(); i++) {
118
119 if(!(*itTrk)->isMdcTrackValid()) continue;
120 if(!(*itTrk)->isMdcKalTrackValid()) continue;
122 if (fabs(
cos(mdcTrk->
theta())) >= m_cosThetaCut)
continue;
123 if (fabs(mdcTrk->
z()) >= m_vzCut)
continue;
124 iGood.push_back(i);
125 if (mdcTrk->
charge() > 0) ipip.push_back(i);
126 if (mdcTrk->
charge() < 0) ipim.push_back(i);
127 }
128
129
130 if (ipip.size() < 1 || ipim.size() < 1) return StatusCode::SUCCESS;
131
132
133
134
136 HepSymMatrix Evx(3, 0);
137 double bx = 1E+6;
138 double by = 1E+6;
139 double bz = 1E+6;
140 Evx[0][0] = bx*bx;
141 Evx[1][1] = by*by;
142 Evx[2][2] = bz*bz;
143
144
145
146 for(unsigned int i1 = 0; i1 < ipip.size(); i1++) {
147 int ip1 = ipip[i1];
148 RecMdcKalTrack *pipKalTrk = (*(recTrackCol->begin()+ip1))->mdcKalTrack();
151
152 for(unsigned int i2 = 0; i2 < ipim.size(); i2++) {
153 int ip2 = ipim[i2];
154 RecMdcKalTrack *pimKalTrk = (*(recTrackCol->begin()+ip2))->mdcKalTrack();
157
158 if(m_useVFrefine){
162
165
166
170
171 bool fitok = vtxfit0->
Fit();
172 if(!fitok) continue;
173
174
175
176
177 if(vtxfit0->
chisq(0) > m_chisqCut)
continue;
179 std::pair<int, int> pair;
180 pair.first = 3;
181 pair.second = 3;
182
183 EvtRecTrack* track0 = *(recTrackCol->begin() + ip1);
184 EvtRecTrack* track1 = *(recTrackCol->begin() + ip2);
185
192 KsVertex->
setW(wKshort.
w());
199 veeVertexCol->push_back(KsVertex);
200
201
202
203
204
205
206
207
208
209
210 }else{
214
220 if(!(vtxfit0->
Fit(0)))
continue;
222 if(vtxfit0->
chisq(0) > m_chisqCut)
continue;
224 std::pair<int, int> pair;
225 pair.first = 3;
226 pair.second = 3;
227
228 EvtRecTrack* track0 = *(recTrackCol->begin() + ip1);
229 EvtRecTrack* track1 = *(recTrackCol->begin() + ip2);
230
237 KsVertex->
setW(wKshort.
w());
244 veeVertexCol->push_back(KsVertex);
245
246
247
248
249
250
251
252
253
254
255
256 }
257
258
259 }
260 }
261
262 return StatusCode::SUCCESS;
263}
double cos(const BesAngle a)
EvtRecTrackCol::iterator EvtRecTrackIterator
ObjectVector< EvtRecVeeVertex > EvtRecVeeVertexCol
const HepVector & helix() const
static void setPidType(PidType pidType)
const HepSymMatrix & err() const
const double theta() const
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 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)
WTrackParameter wVirtualTrack(int n) const
void AddTrack(const int index, RecMdcKalTrack *p, const RecMdcKalTrack::PidType pid)
static VertexFitRefine * instance()
void AddVertex(int number, VertexParameter vpar, std::vector< int > lis)
WTrackParameter wVirtualTrack(int n) const
void AddVertex(int number, VertexParameter vpar, std::vector< int > lis)
static VertexFit * instance()
void BuildVirtualParticle(int number)
void setEvx(const HepSymMatrix &eVx)
void setVx(const HepPoint3D &vx)
HepLorentzVector p() const
_EXTERN_ std::string EvtRecEvent
_EXTERN_ std::string EvtRecVeeVertexCol
_EXTERN_ std::string EvtRecTrackCol