00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #include <algorithm>
00045 #include "TClass.h"
00046 #include "TFile.h"
00047 #include "StKinkVertex.h"
00048 #include "StParticleTable.hh"
00049 #include "StTrack.h"
00050 #if !defined(ST_NO_NAMESPACES)
00051 using std::fill_n;
00052 using std::copy;
00053 #endif
00054
00055 ClassImp(StKinkVertex)
00056
00057 static const char rcsid[] = "$Id: StKinkVertex.cxx,v 2.10 2009/11/23 16:34:06 fisyak Exp $";
00058
00059 StKinkVertex::StKinkVertex()
00060 {
00061 mType = kKinkVtxId;
00062 mDaughter = 0;
00063 mParentGeantId = 0;
00064 mDaughterGeantId = 0;
00065 mDcaParentDaughter = 0;
00066 mDcaDaughterPrimaryVertex = 0;
00067 mDcaParentPrimaryVertex = 0;
00068 mHitDistanceParentDaughter = 0;
00069 mHitDistanceParentVertex = 0;
00070 fill_n(mDeltaEnergy, 3, 0);
00071 mDecayAngle = 0;
00072 mDecayAngleCM = 0;
00073 }
00074
00075 StKinkVertex::~StKinkVertex() {}
00076
00077 StVertexId
00078 StKinkVertex::type() const { return kKinkVtxId; }
00079
00080 unsigned int
00081 StKinkVertex::numberOfDaughters() const { return mDaughter ? 1 : 0; }
00082
00083 StTrack*
00084 StKinkVertex::daughter(unsigned int i)
00085 {
00086 return i==0 ? (StTrack*)mDaughter : 0;
00087 }
00088
00089 const StTrack*
00090 StKinkVertex::daughter(unsigned int i) const
00091 {
00092 return i==0 ? (const StTrack*)mDaughter : 0;
00093 }
00094
00095 StPtrVecTrack
00096 StKinkVertex::daughters(StTrackFilter& filter)
00097 {
00098 StPtrVecTrack vec;
00099 if (filter(mDaughter)) vec.push_back(mDaughter);
00100 return vec;
00101 }
00102
00103 StParticleDefinition*
00104 StKinkVertex::pidParent() const
00105 {
00106 return StParticleTable::instance()->findParticleByGeantId(mParentGeantId);
00107 }
00108
00109 StParticleDefinition*
00110 StKinkVertex::pidDaughter() const
00111 {
00112 return StParticleTable::instance()->findParticleByGeantId(mDaughterGeantId);
00113 }
00114
00115 unsigned short
00116 StKinkVertex::geantIdParent() const { return mParentGeantId; }
00117
00118 unsigned short
00119 StKinkVertex::geantIdDaughter() const { return mDaughterGeantId; }
00120
00121 float
00122 StKinkVertex::dcaParentDaughter() const { return mDcaParentDaughter; }
00123
00124 float
00125 StKinkVertex::dcaDaughterPrimaryVertex() const { return mDcaDaughterPrimaryVertex; }
00126
00127 float
00128 StKinkVertex::dcaParentPrimaryVertex() const { return mDcaParentPrimaryVertex; }
00129
00130 float
00131 StKinkVertex::hitDistanceParentDaughter() const { return mHitDistanceParentDaughter; }
00132
00133 float
00134 StKinkVertex::hitDistanceParentVertex() const { return mHitDistanceParentVertex; }
00135
00136 float
00137 StKinkVertex::dE(unsigned int i) const
00138 {
00139 if (i < 3)
00140 return mDeltaEnergy[i];
00141 else
00142 return 0;
00143 }
00144
00145 float
00146 StKinkVertex::decayAngle() const { return mDecayAngle; }
00147
00148 float
00149 StKinkVertex::decayAngleCM() const { return mDecayAngleCM; }
00150
00151 const StThreeVectorF&
00152 StKinkVertex::parentMomentum() const { return mParentMomentum; }
00153
00154 StThreeVectorF&
00155 StKinkVertex::parentMomentum() { return mParentMomentum; }
00156
00157 const StThreeVectorF&
00158 StKinkVertex::daughterMomentum() const { return mDaughterMomentum; }
00159
00160 StThreeVectorF&
00161 StKinkVertex::daughterMomentum() { return mDaughterMomentum; }
00162
00163 void
00164 StKinkVertex::setGeantIdParent(unsigned short val) { mParentGeantId = val; }
00165
00166 void
00167 StKinkVertex::setGeantIdDaughter(unsigned short val) { mDaughterGeantId = val; }
00168
00169 void
00170 StKinkVertex::setDcaParentDaughter(float val) { mDcaParentDaughter = val; }
00171
00172 void
00173 StKinkVertex::setDcaDaughterPrimaryVertex(float val) { mDcaDaughterPrimaryVertex = val; }
00174
00175 void
00176 StKinkVertex::setDcaParentPrimaryVertex(float val) { mDcaParentPrimaryVertex = val; }
00177
00178 void
00179 StKinkVertex::setHitDistanceParentDaughter(float val) { mHitDistanceParentDaughter = val; }
00180
00181 void
00182 StKinkVertex::setHitDistanceParentVertex(float val) { mHitDistanceParentVertex = val; }
00183
00184 void
00185 StKinkVertex::setdE(unsigned int i, float val)
00186 {
00187 if (i < 3) mDeltaEnergy[i] = val;
00188 }
00189
00190 void
00191 StKinkVertex::setDecayAngle(float val) { mDecayAngle = val; }
00192
00193 void
00194 StKinkVertex::setDecayAngleCM(float val) { mDecayAngleCM = val; }
00195
00196 void
00197 StKinkVertex::setParentMomentum(const StThreeVectorF& val) { mParentMomentum = val; }
00198
00199 void
00200 StKinkVertex::setDaughterMomentum(const StThreeVectorF& val) { mDaughterMomentum = val; }
00201
00202 void
00203 StKinkVertex::addDaughter(StTrack* val)
00204 {
00205 if (val) mDaughter = val;
00206 }
00207
00208 void
00209 StKinkVertex::removeDaughter(StTrack* val)
00210 {
00211 if (mDaughter == val) mDaughter = 0;
00212 }
00213
00214 void StKinkVertex::Streamer(TBuffer &R__b)
00215 {
00216
00217
00218 if (R__b.IsReading()) {
00219 UInt_t R__s, R__c;
00220 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
00221 if (R__v > 1) {
00222 Class()->ReadBuffer(R__b, this, R__v, R__s, R__c);
00223 return;
00224 }
00225
00226 StVertex::Streamer(R__b);
00227
00228 R__b >> (StTrack*&)mDaughter;
00229
00230 R__b >> mParentGeantId;
00231 R__b >> mDaughterGeantId;
00232 R__b >> mDcaParentDaughter;
00233 R__b >> mDcaDaughterPrimaryVertex;
00234 R__b >> mDcaParentPrimaryVertex;
00235 R__b >> mHitDistanceParentDaughter;
00236 R__b >> mHitDistanceParentVertex;
00237
00238 Int_t dumy;
00239 if (gFile && gFile->GetVersion() < 30000) {R__b >> dumy;}
00240
00241 R__b.ReadFastArray(mDeltaEnergy,3);
00242 R__b >> mDecayAngle;
00243 R__b >> mDecayAngleCM;
00244 mParentMomentum.Streamer(R__b);
00245 mDaughterMomentum.Streamer(R__b);
00246 R__b.CheckByteCount(R__s, R__c, Class());
00247
00248
00249 } else {
00250 Class()->WriteBuffer(R__b,this);
00251 }
00252 }