61 #include "StKinkMuDst.hh"
62 #include "StKinkVertex.h"
64 #include "StTrackGeometry.h"
65 #include "StTrackNode.h"
66 #include "StTrackFitTraits.h"
67 #include "StDedxPidTraits.h"
68 #include "StMessMgr.h"
71 #include "phys_constants.h"
81 mParentGeantId = kinkVertex->geantIdParent();
82 mDaughterGeantId = kinkVertex->geantIdDaughter();
83 mDcaParentDaughter = kinkVertex->dcaParentDaughter();
84 mDcaDaughterPrimaryVertex = kinkVertex->dcaDaughterPrimaryVertex();
85 mDcaParentPrimaryVertex = kinkVertex->dcaParentPrimaryVertex();
86 mHitDistanceParentDaughter = kinkVertex->hitDistanceParentDaughter();
87 mHitDistanceParentVertex = kinkVertex->hitDistanceParentVertex();
88 mDecayAngle = kinkVertex->decayAngle();
89 StTrack* parent = kinkVertex->parent();
90 if (!parent) gMessMgr->Error(
"StKinkMuDst: parent missing!");
91 StTrack* daughter = kinkVertex->daughter();
92 if (!daughter) gMessMgr->Error(
"StKinkMuDst: daughter missing!");
94 StTrack* parentPrimaryTrack = parent->node()->track(primary);
95 if (parentPrimaryTrack && (parentPrimaryTrack->geometry())) {
96 mParentPrimMomentumX = parentPrimaryTrack->geometry()->momentum().x();
97 mParentPrimMomentumY = parentPrimaryTrack->geometry()->momentum().y();
98 mParentPrimMomentumZ = parentPrimaryTrack->geometry()->momentum().z();
100 mParentPrimMomentumX = 999.;
101 mParentPrimMomentumY = 999.;
102 mParentPrimMomentumZ = 999.;
104 mParentPrimMomentum = ::sqrt( mParentPrimMomentumX*mParentPrimMomentumX +
105 mParentPrimMomentumY*mParentPrimMomentumY +
106 mParentPrimMomentumZ*mParentPrimMomentumZ );
109 mParentMomentumX = parentMom.x();
110 mParentMomentumY = parentMom.y();
111 mParentMomentumZ = parentMom.z();
112 mParentMomentum = parentMom.mag();
113 if (parent->geometry()) {
114 mParentCharge = parent->geometry()->charge();
117 gMessMgr->Warning(
"StKinkMuDst: parent geometry missing!");
119 mKeyParent = parent->key();
121 const StThreeVectorF daughterMom = kinkVertex->daughterMomentum();
122 mDaughterMomentumX = daughterMom.x();
123 mDaughterMomentumY = daughterMom.y();
124 mDaughterMomentumZ = daughterMom.z();
125 mDaughterMomentum = daughterMom.mag();
126 if (daughter->geometry()) {
127 mDaughterCharge = daughter->geometry()->charge();
130 gMessMgr->Warning(
"StKinkMuDst: daughter geometry missing!");
132 mKeyDaughter = daughter->key();
135 mPositionX = pos.x();
136 mPositionY = pos.y();
137 mPositionZ = pos.z();
138 mChi2Kink = kinkVertex->chiSquared();
139 mClKink = kinkVertex->probChiSquared();
141 mChi2Parent = parent->fitTraits().chi2(0);
142 mClParent = parent->fitTraits().chi2(1);
147 StPtrVecTrackPidTraits pidParent = parent->pidTraits(kTpcId);
149 for (i=0; i<pidParent.size(); i++) {
151 if (pid->method() == kTruncatedMeanId) {
152 mDedxParent = pid->mean();
153 mErrDedxParent = pid->errorOnMean();
154 mNumDedxParent = pid->numberOfPoints() + (100*((int) (pid->length())));
159 mChi2Daughter = daughter->fitTraits().chi2(0);
160 mClDaughter = daughter->fitTraits().chi2(1);
163 mNumDedxDaughter = 0;
165 StPtrVecTrackPidTraits pidDaughter = daughter->pidTraits(kTpcId);
166 for (i=0; i<pidDaughter.size(); i++) {
168 if (pid->method() == kTruncatedMeanId) {
169 mDedxDaughter = pid->mean();
170 mErrDedxDaughter = pid->errorOnMean();
171 mNumDedxDaughter = pid->numberOfPoints() + (100*((int) (pid->length())));
176 findMinDeltaEnergy(kinkVertex);
177 findDecayLength(kinkVertex);
179 findTransverseMomentum();
180 findTransverseMassKaon();
181 findTransverseMassPion();
186 StKinkMuDst::~StKinkMuDst() {}
189 StKinkMuDst::findMinDeltaEnergy(
StKinkVertex* kinkVertex)
191 mMinDeltaEnergy = kinkVertex->dE(0);
192 if( mMinDeltaEnergy > kinkVertex->dE(1) )
193 mMinDeltaEnergy = kinkVertex->dE(1);
194 if( mMinDeltaEnergy > kinkVertex->dE(2) )
195 mMinDeltaEnergy = kinkVertex->dE(2);
202 kinkVertex->parent()->node()->track(primary);
203 if( parentPrimaryTrack ) {
204 mDecayLength = parentPrimaryTrack->length();
211 StKinkMuDst::findTransverseMomentum()
213 mTransverseMomentum =
214 ::sqrt( mParentMomentumX * mParentMomentumX
215 + mParentMomentumY * mParentMomentumY );
219 StKinkMuDst::findTransverseMassKaon()
221 mTransverseMassKaon =
222 ::sqrt( M_KAON_PLUS * M_KAON_PLUS
223 + mTransverseMomentum * mTransverseMomentum );
227 StKinkMuDst::findTransverseMassPion()
229 mTransverseMassPion =
230 ::sqrt( M_PION_PLUS * M_PION_PLUS
231 + mTransverseMomentum * mTransverseMomentum );
235 StKinkMuDst::findRapidityKaon()
237 Float_t mTotalEnergy =
238 ::sqrt( M_KAON_PLUS * M_KAON_PLUS
239 + mParentMomentumX * mParentMomentumX
240 + mParentMomentumY * mParentMomentumY
241 + mParentMomentumZ * mParentMomentumZ );
244 ::log( (mTotalEnergy + mParentMomentumZ)/mTransverseMassKaon );
248 StKinkMuDst::findRapidityPion()
250 Float_t mTotalEnergy =
251 ::sqrt( M_PION_PLUS * M_PION_PLUS
252 + mParentMomentumX * mParentMomentumX
253 + mParentMomentumY * mParentMomentumY
254 + mParentMomentumZ * mParentMomentumZ );
257 ::log( (mTotalEnergy + mParentMomentumZ)/mTransverseMassPion );
virtual void setDaughterBad()
Set the daughter as bad.
virtual void setParentBad()
Set the parent as bad.