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
00045
00046
00047
00048
00049
00050 #include <Stiostream.h>
00051 #include "TClass.h"
00052 #include "StXiVertex.h"
00053 #include "StV0Vertex.h"
00054 #include "StTrack.h"
00055 #include "StTrackGeometry.h"
00056
00057 static const char rcsid[] = "$Id: StXiVertex.cxx,v 2.11 2009/11/23 16:34:08 fisyak Exp $";
00058
00059 ClassImp(StXiVertex)
00060
00061 StXiVertex::StXiVertex()
00062 {
00063 mType = kXiVtxId;
00064 mDaughter = 0;
00065 mDcaBachelorToPrimaryVertex = 0;
00066 mDcaDaughters = 0;
00067 mDcaParentToPrimaryVertex = 0;
00068 mV0Vertex = 0;
00069 }
00070
00071 StXiVertex::~StXiVertex() { }
00072
00073 StVertexId
00074 StXiVertex::type() const { return kXiVtxId; }
00075
00076 unsigned int
00077 StXiVertex::numberOfDaughters() const { return mDaughter ? 1 : 0;}
00078
00079 StTrack*
00080 StXiVertex::daughter(unsigned int i)
00081 {
00082 return i == 0 ? (StTrack*)mDaughter : 0;
00083 }
00084
00085 const StTrack*
00086 StXiVertex::daughter(unsigned int i) const
00087 {
00088 return i == 0 ? (const StTrack*)mDaughter : 0;
00089 }
00090
00091 StPtrVecTrack
00092 StXiVertex::daughters(StTrackFilter& filter)
00093 {
00094 StPtrVecTrack vec;
00095 if (filter(mDaughter)) vec.push_back(mDaughter);
00096 return vec;
00097 }
00098
00099 float
00100 StXiVertex::dcaV0ToPrimaryVertex() const
00101 {
00102 if (mV0Vertex)
00103 return mV0Vertex->dcaParentToPrimaryVertex();
00104 else
00105 return 0;
00106 }
00107
00108 StThreeVectorF
00109 StXiVertex::momentumOfV0() const
00110 {
00111 if (mV0Vertex) {
00112 const StThreeVectorF& nMom = mV0Vertex->momentumOfDaughter(negative);
00113 const StThreeVectorF& pMom = mV0Vertex->momentumOfDaughter(positive);
00114 return (nMom + pMom);
00115 }
00116 else
00117 return StThreeVectorF();
00118 }
00119
00120 float
00121 StXiVertex::dcaBachelorToPrimaryVertex () const
00122 {
00123 return mDcaBachelorToPrimaryVertex;
00124 }
00125
00126 const StThreeVectorF&
00127 StXiVertex::momentumOfBachelor() const { return mMomentumOfBachelor; }
00128
00129 StThreeVectorF
00130 StXiVertex::momentum() const
00131 {
00132 return mMomentumOfBachelor + momentumOfV0();
00133 }
00134
00135 float
00136 StXiVertex::dcaDaughters() const { return mDcaDaughters; }
00137
00138 float
00139 StXiVertex::dcaParentToPrimaryVertex() const { return TMath::Abs(mDcaParentToPrimaryVertex); }
00140
00141 float
00142 StXiVertex::signedDcaParentToPrimaryVertex() const { return mDcaParentToPrimaryVertex; }
00143
00144 StV0Vertex*
00145 StXiVertex::v0Vertex() { return mV0Vertex; }
00146
00147 StTrack*
00148 StXiVertex::bachelor() { return mDaughter; }
00149
00150 void
00151 StXiVertex::setDcaBachelorToPrimaryVertex(float val)
00152 {
00153 mDcaBachelorToPrimaryVertex = val;
00154 }
00155
00156 double
00157 StXiVertex::chargeOfBachelor()
00158 {
00159 StTrack* b = bachelor();
00160 return b ? b->geometry()->charge() : 0;
00161 }
00162
00163 void
00164 StXiVertex::setMomentumOfBachelor(const StThreeVectorF& v)
00165 {
00166 mMomentumOfBachelor = v;
00167 }
00168
00169 void
00170 StXiVertex::setDcaDaughters(float val) { mDcaDaughters = val; }
00171
00172 void
00173 StXiVertex::setDcaParentToPrimaryVertex(float val) { mDcaParentToPrimaryVertex = val; }
00174
00175 void
00176 StXiVertex::setV0Vertex(StV0Vertex* v0vtx)
00177 {
00178 mV0Vertex = v0vtx;
00179 }
00180
00181 void
00182 StXiVertex::addDaughter(StTrack* track) { mDaughter = track; }
00183
00184
00185 void
00186 StXiVertex::removeDaughter(StTrack* track)
00187 {
00188 if (track == mDaughter) mDaughter = 0;
00189 }
00190
00191 void StXiVertex::Streamer(TBuffer &R__b)
00192 {
00193
00194
00195 if (R__b.IsReading()) {
00196 UInt_t R__s, R__c;
00197 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
00198 if (R__v > 1) {
00199 Class()->ReadBuffer(R__b, this, R__v, R__s, R__c);
00200 return;
00201 }
00202
00203 StVertex::Streamer(R__b);
00204 R__b >> (StTrack*&)mDaughter;
00205 R__b >> mDcaBachelorToPrimaryVertex;
00206 mMomentumOfBachelor.Streamer(R__b);
00207 R__b >> mDcaDaughters;
00208 R__b >> mDcaParentToPrimaryVertex;
00209 R__b >> (StV0Vertex*&)mV0Vertex;
00210
00211 R__b.CheckByteCount(R__s, R__c, Class());
00212
00213
00214 } else {
00215 Class()->WriteBuffer(R__b,this);
00216 }
00217 }
00218
00219
00220
00221