StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtV0.cc
1 #include "StHbtV0.hh"
2 #include "StHbtTTreeV0.h"
3 #include "phys_constants.h"
4 #include "StHbtTTreeEvent.h"
5 
6 // -----------------------------------------------------------------------
7 StHbtV0::StHbtV0(const StHbtV0& v){ // copy constructor
8  mDecayLengthV0 = v.mDecayLengthV0;
9  mDecayVertexV0 = v.mDecayVertexV0;
10  mDcaV0Daughters = v.mDcaV0Daughters;
11  mDcaV0ToPrimVertex = v.mDcaV0ToPrimVertex;
12  mDcaPosToPrimVertex = v.mDcaPosToPrimVertex;
13  mDcaNegToPrimVertex = v.mDcaNegToPrimVertex;
14  mMomPos = v.mMomPos;
15  mMomNeg = v.mMomNeg;
16 
17  mTrackTopologyMapPos[0] = v.mTrackTopologyMapPos[0];
18  mTrackTopologyMapPos[1] = v.mTrackTopologyMapPos[1];
19  mTrackTopologyMapNeg[0] = v.mTrackTopologyMapNeg[0];
20  mTrackTopologyMapNeg[1] = v.mTrackTopologyMapNeg[1];
21 
22  mKeyPos = v.mKeyPos;
23  mKeyNeg = v.mKeyNeg;
24 
25  mTpcHitsPos = v.mTpcHitsPos;
26  mTpcHitsNeg = v.mTpcHitsNeg;
27 
28  mChi2V0 = v.mChi2V0;
29  mClV0 = v.mClV0;
30  mChi2Pos = v.mChi2Pos;
31  mClPos = v.mClPos;
32  mChi2Neg = v.mChi2Neg;
33  mClNeg = v.mClNeg;
34  mDedxPos = v.mDedxPos;
35  mErrDedxPos = v.mErrDedxPos;//Gael 04Fev2002
36  mLenDedxPos = v.mLenDedxPos;//Gael 04Fev2002
37  mDedxNeg = v.mDedxNeg;
38  mErrDedxNeg = v.mErrDedxNeg;//Gael 04Fev2002
39  mLenDedxNeg = v.mLenDedxNeg;//Gael 04Fev2002
40 
41  mNumDedxPos = v.mNumDedxPos;
42  mNumDedxNeg = v.mNumDedxNeg;
43 
44  mHelixPos = v.mHelixPos;// Gael 12 Sept
45  mHelixNeg = v.mHelixNeg;// Gael 12 Sept
46  mHiddenInfo = v.mHiddenInfo? v.mHiddenInfo->clone() : 0;// GR 11 DEC 02
47  UpdateV0();
48 }
49 // -----------------------------------------------------------------------
50 void StHbtV0::UpdateV0(){
51  //Calc. derived memebers of the v0 class
52  float MomNegAlongV0, MomPosAlongV0;
53 
54  mMomV0 = mMomPos + mMomNeg;
55  mPtV0 = mMomV0.perp();
56  mPtotV0 = mMomV0.mag();
57  mPtPos = mMomPos.perp();
58  mPtotPos= mMomPos.mag();
59  mPtNeg = mMomNeg.perp();
60  mPtotNeg= mMomNeg.mag();
61  mELambda= ::sqrt(mPtotV0*mPtotV0+M_LAMBDA*M_LAMBDA);
62  mEK0Short= ::sqrt(mPtotV0*mPtotV0+M_KAON_0_SHORT*M_KAON_0_SHORT);
63  mEPosProton = ::sqrt(mPtotPos*mPtotPos+M_PROTON*M_PROTON);
64  mENegProton = ::sqrt(mPtotNeg*mPtotNeg+M_PROTON*M_PROTON);
65  mEPosPion = ::sqrt(mPtotPos*mPtotPos+M_PION_PLUS*M_PION_PLUS);
66  mENegPion = ::sqrt(mPtotNeg*mPtotNeg+M_PION_MINUS*M_PION_MINUS);
67 
68  MomNegAlongV0 = mMomNeg*mMomV0 / ::sqrt(::pow(mPtotV0,2));
69  MomPosAlongV0 = mMomPos*mMomV0 / ::sqrt(::pow(mPtotV0,2));
70 
71  mAlphaV0 = (MomPosAlongV0-MomNegAlongV0)/(MomPosAlongV0+MomNegAlongV0);
72  mPtArmV0 = ::sqrt(mPtotPos*mPtotPos - MomPosAlongV0*MomPosAlongV0);
73  mMassLambda = ::sqrt(::pow(mEPosProton+mENegPion,2)-::pow(mPtotV0,2));
74  mMassAntiLambda = ::sqrt(::pow(mENegProton+mEPosPion,2)-::pow(mPtotV0,2));
75  mMassK0Short = ::sqrt(::pow(mENegPion+mEPosPion,2)-::pow(mPtotV0,2));
76 
77  mRapLambda = 0.5*::log( (mELambda+mMomV0.z()) / (mELambda-mMomV0.z()) );
78  mCTauLambda = M_LAMBDA*(mDecayLengthV0) / ::sqrt( ::pow((double)mMomV0.mag(),2.) );
79 
80  mRapK0Short = 0.5*::log( (mEK0Short+mMomV0.z()) / (mEK0Short-mMomV0.z()) );
81  mCTauK0Short = M_KAON_0_SHORT*(mDecayLengthV0) / ::sqrt( ::pow((double)mMomV0.mag(),2.) );
82 
83 }
84 // -----------------------------------------------------------------------
85 #ifdef __ROOT__
86 #include "StStrangeMuDstMaker/StV0MuDst.hh"
87 StHbtV0::StHbtV0( StV0MuDst& v){ // from strangess micro dst structure
88  mDecayLengthV0 = v.decayLengthV0();
89  mDecayVertexV0 = StHbtThreeVector( v.decayVertexV0X(), v.decayVertexV0Y(), v.decayVertexV0Z() );
90  mDcaV0Daughters = v.dcaV0Daughters();
91  mDcaV0ToPrimVertex = v.dcaV0ToPrimVertex();
92  mDcaPosToPrimVertex = v.dcaPosToPrimVertex();
93  mDcaNegToPrimVertex = v.dcaNegToPrimVertex();
94  mMomPos = StHbtThreeVector( v.momPosX(), v.momPosY(), v.momPosZ() );
95  mMomNeg = StHbtThreeVector( v.momNegX(), v.momNegY(), v.momNegZ() );
96 #ifdef STHBTDEBUG
97  cout << " hist pos ";
98  cout << v.topologyMapPos().numberOfHits(kTpcId);
99  cout << " hist neg ";
100  cout << v.topologyMapNeg().numberOfHits(kTpcId) << endl;
101 #endif
102  mTpcHitsPos = ( v.topologyMapPos().numberOfHits(kTpcId) );
103  mTpcHitsNeg = ( v.topologyMapNeg().numberOfHits(kTpcId) );
104  mTrackTopologyMapPos[0] = ( v.topologyMapPos().data(0) );
105  mTrackTopologyMapPos[1] = ( v.topologyMapPos().data(1) );
106  mTrackTopologyMapNeg[0] = ( v.topologyMapNeg().data(0) );
107  mTrackTopologyMapNeg[1] = ( v.topologyMapNeg().data(1) );
108  mKeyPos = v.keyPos();
109  mKeyNeg = v.keyNeg();
110  mChi2V0 = v.chi2V0();
111  mClV0 = v.clV0();
112  mChi2Pos = v.chi2Pos();
113  mClPos = v.clPos();
114  mChi2Neg = v.chi2Neg();
115  mClNeg = v.clNeg();
116  mDedxPos = v.dedxPos();
117  mErrDedxPos = v.errDedxPos();//Gael 04Fev2002
118  mLenDedxPos = v.lenDedxPos();//Gael 04Fev2002
119  mDedxNeg = v.dedxNeg();
120  mErrDedxNeg = v.errDedxNeg();//Gael 04Fev2002
121  mLenDedxNeg = v.lenDedxNeg();//Gael 04Fev2002
122  mNumDedxPos = v.numDedxPos();
123  mNumDedxNeg = v.numDedxNeg();
124  mHiddenInfo = 0;//GR 11 DEC 02
125 
126 #ifdef STHBTDEBUG
127  cout << " keyPos " << v.keyPos() << endl;
128  cout << " keyNeg " << v.keyNeg() << endl;
129 #endif
130  mMomV0 = StHbtThreeVector( v.momV0X(), v.momV0Y(), v.momV0Z() );
131 #ifdef STHBTDEBUG
132  cout << " alpha ";
133  cout << v.alphaV0();
134  cout << " ptArm ";
135  cout << v.ptArmV0() << endl;
136 #endif
137  mAlphaV0 = v.alphaV0();
138  mPtArmV0 = v.ptArmV0();
139  mELambda = v.eLambda();
140  mEK0Short = v.eK0Short();
141  mEPosProton = v.ePosProton();
142  mEPosPion = v.ePosPion();
143  mENegPion = v.eNegPion();
144  mENegProton = v.eNegProton();
145  mMassLambda = v.massLambda();
146  mMassAntiLambda = v.massAntiLambda();
147  mMassK0Short = v.massK0Short();
148  mRapLambda = v.rapLambda();
149  mRapK0Short = v.rapK0Short();
150  mCTauLambda = v.cTauLambda();
151  mCTauK0Short = v.cTauK0Short();
152  mPtV0 = v.ptV0();
153  mPtotV0 = v.ptotV0();
154  mPtPos = v.ptPos();
155  mPtotPos = v.ptotPos();
156  mDedxPos = v.dedxPos();
157  mPtNeg = v.ptNeg();
158  mPtotNeg = v.ptotNeg();
159  mDedxNeg = v.dedxNeg();
160 }
161 
162 
163 StHbtV0::StHbtV0(const StHbtTTreeEvent* ev, const StHbtTTreeV0* v) {
164  mDecayVertexV0 = StHbtThreeVector(v->mDecayVertexV0X,v->mDecayVertexV0Y,v->mDecayVertexV0Z);
165 
166  mPrimaryVertex.setX(ev->mVertexX);
167  mPrimaryVertex.setY(ev->mVertexY);
168  mPrimaryVertex.setZ(ev->mVertexZ);
169 
170  mDecayLengthV0 = v->mDecayLengthV0;
171  mDcaV0Daughters = v->mDcaV0Daughters;
172  mDcaV0ToPrimVertex = v->mDcaV0ToPrimVertex;
173  mDcaPosToPrimVertex = v->mDcaPosToPrimVertex;
174  mDcaNegToPrimVertex = v->mDcaNegToPrimVertex;
175 
176  mMomPos = StHbtThreeVector( v->mMomPosX, v->mMomPosY, v->mMomPosZ);
177  mMomNeg = StHbtThreeVector( v->mMomNegX, v->mMomNegY, v->mMomNegZ);
178 
179  mTrackTopologyMapPos[0] = v->mTrackTopologyMapPos[0];
180  mTrackTopologyMapPos[1] = v->mTrackTopologyMapPos[1];
181  mTrackTopologyMapNeg[0] = v->mTrackTopologyMapNeg[0];
182  mTrackTopologyMapNeg[1] = v->mTrackTopologyMapNeg[1];
183 
184  mKeyPos = v->mKeyPos;
185  mKeyNeg = v->mKeyNeg;
186 
187  mTpcHitsPos = v->mTpcHitsPos;
188  mTpcHitsNeg = v->mTpcHitsNeg;
189 
190  mChi2V0 = v->mChi2V0;
191  mClV0 = v->mClV0;
192  mChi2Pos = v->mChi2Pos;
193  mClPos = v->mClPos;
194  mChi2Neg = v->mChi2Neg;
195  mClNeg = v->mClNeg;
196 
197  mDedxPos = v->mDedxPos;
198  mErrDedxPos = v->mErrDedxPos;//Gael 04Fev2002
199  mLenDedxPos = v->mLenDedxPos;//Gael 04Fev2002
200  mDedxNeg = v->mDedxNeg;
201  mErrDedxNeg = v->mErrDedxNeg;//Gael 04Fev2002
202  mLenDedxNeg = v->mLenDedxNeg;//Gael 04Fev2002
203 
204  mNumDedxPos = v->mNumDedxPos;
205  mNumDedxNeg = v->mNumDedxNeg;
206 
207  mHiddenInfo = 0;
208 
209  UpdateV0();
210 }
211 
212 #endif // __ROOT__
213 void StHbtV0::SetHelixPos(const StPhysicalHelixD& h){mHelixPos = h;}// Gael 12 Sept 02
214 const StPhysicalHelixD& StHbtV0::HelixPos() const {return mHelixPos;}// Gael 12 Sept 02
215 void StHbtV0::SetHelixNeg(const StPhysicalHelixD& h){mHelixNeg = h;}// Gael 12 Sept 02
216 const StPhysicalHelixD& StHbtV0::HelixNeg() const {return mHelixNeg;}// Gael 12 Sept 02
217 
218 void StHbtV0::SetHiddenInfo(StHbtHiddenInfo* aHiddenInfo) {mHiddenInfo=aHiddenInfo;}
219 bool StHbtV0::ValidHiddenInfo() const { if (mHiddenInfo) return true; else return false; }
220 StHbtHiddenInfo* StHbtV0::getHiddenInfo() const {return mHiddenInfo;}
221 
Float_t momPosZ() const
Momentum components of pos. daughter.
Definition: StV0MuDst.hh:124
Float_t chi2V0() const
Chi square of V0.
Definition: StV0MuDst.hh:137
Float_t ptotV0()
Total momentum.
Definition: StV0I.hh:463
UShort_t numDedxNeg() const
Number of dE/dX points for neg. daughter.
Definition: StV0MuDst.hh:150
Float_t ePosProton()
Energy of pos. daughter assuming proton.
Definition: StV0I.hh:384
Float_t dcaV0ToPrimVertex() const
DCA of v0 to primary vertex.
Definition: StV0MuDst.hh:116
Float_t massAntiLambda()
Mass assuming antilambda hypothesis.
Definition: StV0I.hh:409
Int_t keyNeg() const
Neg. daughter track key.
Definition: StV0MuDst.hh:133
Float_t dcaPosToPrimVertex() const
DCA of pos v0 daughter to pri vertex.
Definition: StV0MuDst.hh:118
Float_t ptV0()
Transverse momentum.
Definition: StV0I.hh:459
Float_t ptotPos()
Total momentum of pos. daughter.
Definition: StV0I.hh:447
Float_t massLambda()
Mass assuming lambda hypothesis.
Definition: StV0I.hh:405
Float_t rapK0Short()
Rapidity assuming k-short.
Definition: StV0I.hh:429
Float_t eNegPion()
Energy of neg. daughter assuming pion.
Definition: StV0I.hh:396
virtual Float_t decayLengthV0() const
3-d decay distance
Definition: StV0I.hh:298
Int_t keyPos() const
Pos. daughter track key.
Definition: StV0MuDst.hh:132
StTrackTopologyMap & topologyMapPos()
Pos. daughter track topology map.
Definition: StV0MuDst.hh:128
Float_t lenDedxPos() const
Length of dE/dX track of pos. daughter.
Definition: StV0MuDst.hh:151
Float_t eNegProton()
Energy of neg. daughter assuming antiproton.
Definition: StV0I.hh:388
Float_t ptArmV0()
Armenteros-Podolanski variables.
Definition: StV0I.hh:359
Float_t lenDedxNeg() const
Length of dE/dX track of neg. daughter.
Definition: StV0MuDst.hh:152
Float_t eK0Short()
Energy assuming k-short hypothesis.
Definition: StV0I.hh:372
Float_t dcaNegToPrimVertex() const
DCA of neg v0 daughter to pri vertex.
Definition: StV0MuDst.hh:120
Float_t dedxNeg() const
dE/dX of neg. daughter
Definition: StV0MuDst.hh:146
Float_t cTauLambda()
Lifetime (ctau) assuming (anti)lambda.
Definition: StV0I.hh:435
Float_t cTauK0Short()
Lifetime (ctau) assuming k-short.
Definition: StV0I.hh:439
Float_t ptPos()
Transverse momentum of pos. daughter.
Definition: StV0I.hh:443
Float_t ptotNeg()
Total momentum of neg. daughter.
Definition: StV0I.hh:455
Float_t momV0Z() const
Momentum components of V0.
Definition: StV0MuDst.hh:136
Float_t dedxPos() const
dE/dX of pos. daughter
Definition: StV0MuDst.hh:145
StTrackTopologyMap & topologyMapNeg()
Neg. daughter track topology map.
Definition: StV0MuDst.hh:130
Float_t chi2Neg() const
Chi square of neg. daughter.
Definition: StV0MuDst.hh:141
Float_t ptNeg()
Transverse momentum of neg. daughter.
Definition: StV0I.hh:451
Float_t rapLambda()
Rapidity assuming (anti)lambda.
Definition: StV0I.hh:423
Float_t eLambda()
Energy assuming lambda hypothesis.
Definition: StV0I.hh:368
Float_t errDedxNeg() const
Error on mean of dE/dX of neg. daughter.
Definition: StV0MuDst.hh:148
Float_t dcaV0Daughters() const
DCA of v0 daughters at decay vertex.
Definition: StV0MuDst.hh:114
Float_t chi2Pos() const
Chi square of pos. daughter.
Definition: StV0MuDst.hh:139
Float_t massK0Short()
Mass assuming k-short hypothesis.
Definition: StV0I.hh:413
Float_t clPos() const
Confidence level of pos. daughter.
Definition: StV0MuDst.hh:140
Float_t ePosPion()
Energy of pos. daughter assuming pion.
Definition: StV0I.hh:392
Float_t clV0() const
Confidence level of V0.
Definition: StV0MuDst.hh:138
Float_t decayVertexV0Z() const
Coordinates of decay vertex.
Definition: StV0MuDst.hh:113
UShort_t numDedxPos() const
Number of dE/dX points for pos. daughter.
Definition: StV0MuDst.hh:149
Float_t errDedxPos() const
Error on mean of dE/dX of pos. daughter.
Definition: StV0MuDst.hh:147
Float_t momNegZ() const
Momentum components of neg. daughter.
Definition: StV0MuDst.hh:127
Float_t clNeg() const
Confidence level of neg. daughter.
Definition: StV0MuDst.hh:142