47 #include "StKinkVertex.h"
48 #include "StParticleTable.hh"
50 #if !defined(ST_NO_NAMESPACES)
57 static const
char rcsid[] = "$Id:
StKinkVertex.cxx,v 2.10 2009/11/23 16:34:06 fisyak Exp $";
65 mDcaParentDaughter = 0;
66 mDcaDaughterPrimaryVertex = 0;
67 mDcaParentPrimaryVertex = 0;
68 mHitDistanceParentDaughter = 0;
69 mHitDistanceParentVertex = 0;
70 fill_n(mDeltaEnergy, 3, 0);
75 StKinkVertex::~StKinkVertex() {}
78 StKinkVertex::type()
const {
return kKinkVtxId; }
81 StKinkVertex::numberOfDaughters()
const {
return mDaughter ? 1 : 0; }
84 StKinkVertex::daughter(
unsigned int i)
86 return i==0 ? (
StTrack*)mDaughter : 0;
90 StKinkVertex::daughter(
unsigned int i)
const
92 return i==0 ? (
const StTrack*)mDaughter : 0;
99 if (filter(mDaughter)) vec.push_back(mDaughter);
104 StKinkVertex::pidParent()
const
106 return StParticleTable::instance()->findParticleByGeantId(mParentGeantId);
110 StKinkVertex::pidDaughter()
const
112 return StParticleTable::instance()->findParticleByGeantId(mDaughterGeantId);
116 StKinkVertex::geantIdParent()
const {
return mParentGeantId; }
119 StKinkVertex::geantIdDaughter()
const {
return mDaughterGeantId; }
122 StKinkVertex::dcaParentDaughter()
const {
return mDcaParentDaughter; }
125 StKinkVertex::dcaDaughterPrimaryVertex()
const {
return mDcaDaughterPrimaryVertex; }
128 StKinkVertex::dcaParentPrimaryVertex()
const {
return mDcaParentPrimaryVertex; }
131 StKinkVertex::hitDistanceParentDaughter()
const {
return mHitDistanceParentDaughter; }
134 StKinkVertex::hitDistanceParentVertex()
const {
return mHitDistanceParentVertex; }
137 StKinkVertex::dE(
unsigned int i)
const
140 return mDeltaEnergy[i];
146 StKinkVertex::decayAngle()
const {
return mDecayAngle; }
149 StKinkVertex::decayAngleCM()
const {
return mDecayAngleCM; }
152 StKinkVertex::parentMomentum()
const {
return mParentMomentum; }
155 StKinkVertex::parentMomentum() {
return mParentMomentum; }
158 StKinkVertex::daughterMomentum()
const {
return mDaughterMomentum; }
161 StKinkVertex::daughterMomentum() {
return mDaughterMomentum; }
164 StKinkVertex::setGeantIdParent(
unsigned short val) { mParentGeantId = val; }
167 StKinkVertex::setGeantIdDaughter(
unsigned short val) { mDaughterGeantId = val; }
170 StKinkVertex::setDcaParentDaughter(
float val) { mDcaParentDaughter = val; }
173 StKinkVertex::setDcaDaughterPrimaryVertex(
float val) { mDcaDaughterPrimaryVertex = val; }
176 StKinkVertex::setDcaParentPrimaryVertex(
float val) { mDcaParentPrimaryVertex = val; }
179 StKinkVertex::setHitDistanceParentDaughter(
float val) { mHitDistanceParentDaughter = val; }
182 StKinkVertex::setHitDistanceParentVertex(
float val) { mHitDistanceParentVertex = val; }
185 StKinkVertex::setdE(
unsigned int i,
float val)
187 if (i < 3) mDeltaEnergy[i] = val;
191 StKinkVertex::setDecayAngle(
float val) { mDecayAngle = val; }
194 StKinkVertex::setDecayAngleCM(
float val) { mDecayAngleCM = val; }
197 StKinkVertex::setParentMomentum(
const StThreeVectorF& val) { mParentMomentum = val; }
200 StKinkVertex::setDaughterMomentum(
const StThreeVectorF& val) { mDaughterMomentum = val; }
203 StKinkVertex::addDaughter(
StTrack* val)
205 if (val) mDaughter = val;
209 StKinkVertex::removeDaughter(
StTrack* val)
211 if (mDaughter == val) mDaughter = 0;
214 void StKinkVertex::Streamer(TBuffer &R__b)
218 if (R__b.IsReading()) {
220 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
222 Class()->ReadBuffer(R__b,
this, R__v, R__s, R__c);
226 StVertex::Streamer(R__b);
230 R__b >> mParentGeantId;
231 R__b >> mDaughterGeantId;
232 R__b >> mDcaParentDaughter;
233 R__b >> mDcaDaughterPrimaryVertex;
234 R__b >> mDcaParentPrimaryVertex;
235 R__b >> mHitDistanceParentDaughter;
236 R__b >> mHitDistanceParentVertex;
239 if (gFile && gFile->GetVersion() < 30000) {R__b >> dumy;}
241 R__b.ReadFastArray(mDeltaEnergy,3);
243 R__b >> mDecayAngleCM;
244 mParentMomentum.Streamer(R__b);
245 mDaughterMomentum.Streamer(R__b);
246 R__b.CheckByteCount(R__s, R__c, Class());
250 Class()->WriteBuffer(R__b,
this);