2 #include <St_base/StMessMgr.h>
3 #include "StEvent/StDcaGeometry.h"
5 #include "StGenericVertexMaker/StiPPVertex/TrackData.h"
6 #include "StGenericVertexMaker/StiPPVertex/VertexData.h"
7 #include "StMuDSTMaker/COMMON/StMuTrack.h"
11 TrackData::TrackData(
const void* motherTrack,
const StDcaGeometry* motherDca) :
18 dcaTrack(), zDca(0), ezDca(0), rxyDca(0),
20 mBtof(0), mCtb(0), mBemc(0), mEemc(0), mTpc(0),
21 anyMatch(false), anyVeto(false),
23 btofBin(-1), ctbBin(-1), bemcBin(-1), eemcBin(-1)
30 TrackData::matchVertex(
VertexData &V,
float dzMax) {
32 float dz = zDca - V.r.z();
33 bool ret = fabs(dz) < dzMax + ezDca;
36 LOG_DEBUG<< Form(
"PPV::matchTr2Ver VerID=%d weight=%.2f anyM=%d anyV=%d m: ctb=%d bemc=%d eemc=%d tpc=%d dz=%.2f +/- %.2f\n",V.id,weight,anyMatch,anyVeto,mCtb,mBemc,mEemc,mTpc,dz,ezDca)<<endm;
48 double dist = dca->thelix().Dca(vxyz, &err2);
49 double chi2 = dist*dist/err2;
58 TrackData::scanNodes(vector<int> &
hit,
int jz0){
65 const int minCenter=4 , minMiss=6;
72 bool vetoL=
false, vetoR=
false, matchL=
false, matchR=
false;
75 for(i=0;i<(int)hit.size();i++) {
78 if(nPatt[1]>mxDev)
break;
79 if(nPatt[0]<minMiss)
continue;
87 memset(nPatt,0,
sizeof(nPatt));
88 for(i=hit.size()-1; i>=0;i--) {
91 if(nPatt[1]>mxDev)
break;
92 if(nPatt[0]<minMiss)
continue;
99 if(jz0>minCenter && jz0<(
int)hit.size()-minCenter) {
101 memset(nPatt,0,
sizeof(nPatt));
102 for(i=jz0-1; i>=0;i--) {
105 if(nPatt[0]>mxDev)
break;
106 if(nPatt[1]<minCenter)
continue;
115 memset(nPatt,0,
sizeof(nPatt));
116 for(i=jz0;i<(int)hit.size();i++) {
119 if(nPatt[0]>mxDev)
break;
120 if(nPatt[1]<minCenter)
continue;
129 bool match= matchL && matchR;
130 bool veto=(vetoL || vetoR) && !match;
133 updateAnyMatch(match,veto,mTpc);
134 weight*=getTpcWeight();
140 TrackData::updateAnyMatch(
bool match,
bool veto,
int & mXXX){
146 }
else if(veto && (!match) ) {
157 TrackData:: getTpcWeight(){
158 const float Wdunno=1, Wmatch=5, Wveto=0.2;
159 if(mTpc>0)
return Wmatch;
160 if(mTpc<0)
return Wveto;
165 void TrackData::print(ostream& os)
const
167 os << Form(
"vertID=%d track@z0=%.2f +/- %.2f gPt=%.3f, rxyDca: %.3f, idTruth: %d, qaTruth: %d, idParentVx: %d",
168 vertexID, zDca, ezDca, gPt, rxyDca, mIdTruth, mQuality, mIdParentVx);
171 os << Form(
" dca: (%5.3f, %5.3f, %5.3f) +/- (imp: %5.3f, %5.3f)",
172 dca->origin().x(), dca->origin().y(), dca->origin().z(),
173 std::sqrt( dca->errMatrix()[0] ), std::sqrt( dca->errMatrix()[2] ) );
185 mIdTruth = motherTrack.idTruth();
186 mQuality = motherTrack.qaTruth();
187 mIdParentVx = motherTrack.idParentVx();
190 zDca = trackDca->z();
191 ezDca = std::sqrt(trackDca->errMatrix()[2]);
192 rxyDca = trackDca->impact();
193 gPt = trackDca->pt();
double calcChi2DCA(const VertexData &V) const
Calculates chi^2 at track DCA w.r.t. the vertex.