78 {
79 MsgStream log(
msgSvc(), name());
80 log << MSG::INFO << "in execute()" << endreq;
81
82 StatusCode sc;
83
84
85
86
87 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
90 log << MSG::DEBUG << "run and event = " << eventHeader->runNumber()
91 << " " << eventHeader->eventNumber() << endreq;
92 log << MSG::DEBUG <<"ncharg, nneu, tottks = "
93 << recEvent->totalCharged() << " , "
94 << recEvent->totalNeutral() << " , "
95 << recEvent->totalTracks() <<endreq;
96 int evtNo = eventHeader->eventNumber();
97
98
99
100
101 SmartDataPtr<EvtRecVeeVertexCol> veeVertexCol(eventSvc(),
103 if (!veeVertexCol) {
105 sc = registerEvtRecVeeVertexCol(veeVertexCol, log);
106 if (sc != StatusCode::SUCCESS) {
107 return sc;
108 }
109 }
110
111
112
113
114 Vint icp, icm, iGood;
115 for (unsigned int i = 0; i < recEvent->totalCharged(); i++) {
117 if(!(*itTrk)->isMdcTrackValid()) continue;
118 if(!(*itTrk)->isMdcKalTrackValid()) continue;
120 if (fabs(
cos(mdcTrk->
theta())) >= m_cosThetaCut)
continue;
121 if (fabs(mdcTrk->
z()) >= m_vzCut)
continue;
122 iGood.push_back(i);
123 if (mdcTrk->
charge() > 0) icp.push_back(i);
124 if (mdcTrk->
charge() < 0) icm.push_back(i);
125 }
126
127
128 if (icp.size() < 1 || icm.size() < 1) return StatusCode::SUCCESS;
129
130
131
132
134 HepSymMatrix Evx(3, 0);
135 double bx = 1E+6;
136 double by = 1E+6;
137 double bz = 1E+6;
138 Evx[0][0] = bx*bx;
139 Evx[1][1] = by*by;
140 Evx[2][2] = bz*bz;
144
146
147
148 for(unsigned int i1 = 0; i1 < icp.size(); i1++) {
149 int ip1 = icp[i1];
150 RecMdcKalTrack *ppKalTrk = (*(recTrackCol->begin()+ip1))->mdcKalTrack();
153
154 for(unsigned int i2 = 0; i2 < icm.size(); i2++) {
155 int ip2 = icm[i2];
156 RecMdcKalTrack *pimKalTrk = (*(recTrackCol->begin()+ip2))->mdcKalTrack();
159
164 if(!(vtxfit0->
Fit(0)))
continue;
166 if(vtxfit0->
chisq(0) > m_chisqCut)
continue;
168 std::pair<int, int> pair;
169 pair.first = 5;
170 pair.second = 3;
171
172 EvtRecTrack* track0 = *(recTrackCol->begin() + ip1);
173 EvtRecTrack* track1 = *(recTrackCol->begin() + ip2);
174
180 LambdaVertex->
setMass(wLamb.
p().m());
181 LambdaVertex->
setW(wLamb.
w());
182 LambdaVertex->
setEw(wLamb.
Ew());
188 veeVertexCol->push_back(LambdaVertex);
189
190
191
192
193
194
195
196
197
198 }
199 }
200
201
202 for(unsigned int i1 = 0; i1 < icp.size(); i1++) {
203 int ip1 = icp[i1];
204 RecMdcKalTrack *pipKalTrk = (*(recTrackCol->begin()+ip1))->mdcKalTrack();
207
208 for(unsigned int i2 = 0; i2 < icm.size(); i2++) {
209 int ip2 = icm[i2];
210 RecMdcKalTrack *pmKalTrk = (*(recTrackCol->begin()+ip2))->mdcKalTrack();
213
218 if(!(vtxfit0->
Fit(0)))
continue;
220 if(vtxfit0->
chisq(0) > m_chisqCut)
continue;
222 std::pair<int, int> pair;
223 pair.first = 3;
224 pair.second = 5;
225
226 EvtRecTrack* track0 = *(recTrackCol->begin() + ip1);
227 EvtRecTrack* track1 = *(recTrackCol->begin() + ip2);
228
234 ALambdaVertex->
setMass(wALamb.
p().m());
235 ALambdaVertex->
setW(wALamb.
w());
236 ALambdaVertex->
setEw(wALamb.
Ew());
242 veeVertexCol->push_back(ALambdaVertex);
243
244
245
246
247
248
249
250
251
252 }
253 }
254
255
256
257 return StatusCode::SUCCESS;
258}
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 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