51 #include "StV0Vertex.h"
53 #include "StTrackGeometry.h"
55 #if !defined(ST_NO_NAMESPACES)
62 static const
char rcsid[] = "$Id:
StV0Vertex.cxx,v 2.11 2009/11/23 16:34:08 fisyak Exp $";
68 mDaughters[negative] = 0;
69 mDaughters[positive] = 0;
70 fill_n(mDcaDaughtersToPrimaryVertex, 2, 0);
72 mDcaParentToPrimaryVertex = 0;
76 StV0Vertex::~StV0Vertex() { }
79 StV0Vertex::type()
const {
return kV0VtxId; }
82 StV0Vertex::numberOfDaughters()
const {
return 2; }
85 StV0Vertex::daughter(
unsigned int i)
87 return i < 2 ? mDaughters[i] : 0;
91 StV0Vertex::daughter(
unsigned int i)
const
93 return i < 2 ? mDaughters[i] : 0;
100 for (
int i=0; i<2; i++)
101 if (filter(mDaughters[i])) vec.push_back(mDaughters[i]);
109 if (track->geometry()->charge() > 0)
110 mDaughters[positive] = track;
112 mDaughters[negative] = track;
117 StV0Vertex::removeDaughter(
StTrack* t)
119 if (t == mDaughters[positive]) mDaughters[positive] = 0;
120 if (t == mDaughters[negative]) mDaughters[negative] = 0;
124 StV0Vertex::daughter(StChargeSign sign)
126 return mDaughters[sign];
130 StV0Vertex::daughter(StChargeSign sign)
const
132 return mDaughters[sign];
136 StV0Vertex::dcaDaughterToPrimaryVertex(StChargeSign sign)
const
138 return mDcaDaughtersToPrimaryVertex[sign];
142 StV0Vertex::momentumOfDaughter(StChargeSign sign)
const
144 return (sign == negative ? mMomentumOfDaughters[0] : mMomentumOfDaughters[1]);
148 StV0Vertex::momentum()
const
150 return (mMomentumOfDaughters[0] +
151 mMomentumOfDaughters[1]);
155 StV0Vertex::dcaDaughters()
const {
return mDcaDaughters; }
158 StV0Vertex::dcaParentToPrimaryVertex()
const {
return mDcaParentToPrimaryVertex; }
161 StV0Vertex::setDcaDaughterToPrimaryVertex(StChargeSign sign,
float val)
163 mDcaDaughtersToPrimaryVertex[sign] = val;
167 StV0Vertex::setMomentumOfDaughter(StChargeSign sign,
const StThreeVectorF& v)
169 if (sign == negative)
170 mMomentumOfDaughters[0] = v;
172 mMomentumOfDaughters[1] = v;
176 StV0Vertex::setDcaDaughters(
float val) { mDcaDaughters = val; }
179 StV0Vertex::setDcaParentToPrimaryVertex(
float val) { mDcaParentToPrimaryVertex = val; }
182 void StV0Vertex::Streamer(TBuffer &R__b)
186 if (R__b.IsReading()) {
188 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
190 Class()->ReadBuffer(R__b,
this, R__v, R__s, R__c);
197 StVertex::Streamer(R__b);
198 mDaughters.Streamer(R__b);
199 R__b >> mDcaDaughtersToPrimaryVertex[0];
200 R__b >> mDcaDaughtersToPrimaryVertex[1];
207 if (R__v==1) {R__b.ReadVersion(&R__s2, &R__c2);}
208 mMomentumOfDaughters[0].Streamer(R__b);
209 mMomentumOfDaughters[1].Streamer(R__b);
213 R__b >> mDcaDaughters;
214 R__b >> mDcaParentToPrimaryVertex;
215 R__b.CheckByteCount(R__s, R__c, Class());
219 Class()->WriteBuffer(R__b,
this);