StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StV0MuDst.cc
1 /***********************************************************************
2  *
3  * $Id: StV0MuDst.cc,v 3.6 2008/07/10 16:16:55 genevb Exp $
4  *
5  * Authors: Gene Van Buren, UCLA, 24-Mar-2000
6  * Peter G. Jones, University of Birmingham, 04-Jun-1999
7  *
8  ***********************************************************************
9  *
10  * Description: V0 micro dst class
11  *
12  ***********************************************************************
13  *
14  * $Log: StV0MuDst.cc,v $
15  * Revision 3.6 2008/07/10 16:16:55 genevb
16  * Allow for marking of bad tracks -> bad secondary vertices
17  *
18  * Revision 3.5 2001/11/05 23:41:06 genevb
19  * Add more dEdx, B field info, careful of changes to TTree unrolling
20  *
21  * Revision 3.4 2001/05/04 20:15:15 genevb
22  * Common interfaces and reorganization of components, add MC event info
23  *
24  * Revision 3.3 2000/04/25 18:22:49 perev
25  * HPcorrs
26  *
27  * Revision 3.2 2000/08/31 21:25:34 genevb
28  * Adjustment for V0s used in Xis only
29  *
30  * Revision 3.1 2000/08/10 01:16:24 genevb
31  * Added number of dedx points
32  *
33  * Revision 3.0 2000/07/14 12:56:50 genevb
34  * Revision 3 has event multiplicities and dedx information for vertex tracks
35  *
36  * Revision 2.0 2000/06/02 22:11:54 genevb
37  * New version of Strangeness micro DST package
38  *
39  * Revision 1.3 2000/03/31 03:20:24 jones
40  * Added topology map to V0/Xi; access funcs for each data member
41  *
42  * Revision 1.2 2000/03/29 20:52:13 genevb
43  * Added StKinkMuDst, replaced arrays
44  *
45  * Revision 1.1 2000/03/29 03:10:08 genevb
46  * Introduction of Strangeness Micro DST package
47  *
48  *
49  ***********************************************************************/
50 #include "phys_constants.h"
51 #include "StV0MuDst.hh"
52 #include "StTrack.h"
53 #include "StTrackFitTraits.h"
54 #include "StV0Vertex.h"
55 #include "StStrangeEvMuDst.hh"
56 #include "StDedxPidTraits.h"
57 #include "TMath.h"
58 ClassImp(StV0MuDst)
59 
60 StV0MuDst::StV0MuDst() : StV0I() {
61 }
62 
63 void StV0MuDst::Fill(StV0Vertex* v0Vertex,
64  StStrangeEvMuDst* event) {
65  mEvent = event;
66  mDecayVertexV0X = v0Vertex->position().x();
67  mDecayVertexV0Y = v0Vertex->position().y();
68  mDecayVertexV0Z = v0Vertex->position().z();
69  mDcaV0Daughters = v0Vertex->dcaDaughters();
70  mDcaV0ToPrimVertex = TMath::Abs(v0Vertex->dcaParentToPrimaryVertex());
71  mDcaPosToPrimVertex = v0Vertex->dcaDaughterToPrimaryVertex(positive);
72  mDcaNegToPrimVertex = v0Vertex->dcaDaughterToPrimaryVertex(negative);
73  mMomNegX = v0Vertex->momentumOfDaughter(negative).x();
74  mMomNegY = v0Vertex->momentumOfDaughter(negative).y();
75  mMomNegZ = v0Vertex->momentumOfDaughter(negative).z();
76  mMomPosX = v0Vertex->momentumOfDaughter(positive).x();
77  mMomPosY = v0Vertex->momentumOfDaughter(positive).y();
78  mMomPosZ = v0Vertex->momentumOfDaughter(positive).z();
79  mChi2V0 = v0Vertex->chiSquared();
80  mClV0 = v0Vertex->probChiSquared();
81 
82  StTrack* trk = v0Vertex->daughter(positive);
83  mKeyPos = trk->key();
84  mTopologyMapPos = trk->topologyMap();
85  mChi2Pos = trk->fitTraits().chi2(0);
86  mClPos = trk->fitTraits().chi2(1);
87  if (trk->bad()) setPosBad();
88  mDedxPos = 0.;
89  mNumDedxPos = 0;
90  // For now, get the truncated mean dE/dX from the TPC
91  StPtrVecTrackPidTraits pidPos = trk->pidTraits(kTpcId);
92  UInt_t i;
93  for (i=0; i<pidPos.size(); i++) {
94  StDedxPidTraits* pid = (StDedxPidTraits*) pidPos[i];
95  if (pid->method() == kTruncatedMeanId) {
96  mDedxPos = pid->mean();
97  mErrDedxPos = pid->errorOnMean();
98  mNumDedxPos = pid->numberOfPoints() + (100*((int) (pid->length())));
99  break;
100  }
101  }
102 
103  trk = v0Vertex->daughter(negative);
104  mKeyNeg = trk->key();
105  mTopologyMapNeg = trk->topologyMap();
106  mChi2Neg = trk->fitTraits().chi2(0);
107  mClNeg = trk->fitTraits().chi2(1);
108  if (trk->bad()) setNegBad();
109  mDedxNeg = 0.;
110  mNumDedxNeg = 0;
111  // For now, get the truncated mean dE/dX from the TPC
112  StPtrVecTrackPidTraits pidNeg = trk->pidTraits(kTpcId);
113  for (i=0; i<pidNeg.size(); i++) {
114  StDedxPidTraits* pid = (StDedxPidTraits*) pidNeg[i];
115  if (pid->method() == kTruncatedMeanId) {
116  mDedxNeg = pid->mean();
117  mErrDedxNeg = pid->errorOnMean();
118  mNumDedxNeg = pid->numberOfPoints() + (100*((int) (pid->length())));
119  break;
120  }
121  }
122 }
123 
124 StV0MuDst::~StV0MuDst() {
125 }
126 
127 Long_t StV0MuDst::detectorIdTrack(StTrackTopologyMap& map) {
128  UInt_t tpcHits = map.numberOfHits(kTpcId);
129  UInt_t svtHits = map.numberOfHits(kSvtId);
130  UInt_t ssdHits = map.numberOfHits(kSvtId);
131  if (( tpcHits)&&(!svtHits)&&(!ssdHits)) return kTpcId;
132  if ((!tpcHits)&&( svtHits)&&(!ssdHits)) return kSvtId;
133  if ((!tpcHits)&&(!svtHits)&&( ssdHits)) return kSsdId;
134  if (( tpcHits)&&( svtHits)&&(!ssdHits)) return kTpcSvtId;
135  if (( tpcHits)&&(!svtHits)&&( ssdHits)) return kTpcSsdId;
136  if ((!tpcHits)&&( svtHits)&&( ssdHits)) return kSsdSvtId;
137  if (( tpcHits)&&( svtHits)&&( ssdHits)) return kTpcSsdSvtId;
138  return kUnknownId;
139 }
140 
142  return ((100*detectorIdTrack(mTopologyMapPos))+
143  detectorIdTrack(mTopologyMapNeg));
144 }
145 
147  Long_t det_id_pos = detectorIdTrack(mTopologyMapPos);
148  Long_t det_id_neg = detectorIdTrack(mTopologyMapNeg);
149  if ((det_id_pos == kTpcId) ||(det_id_neg == kTpcId)) return 1;
150  if ((det_id_pos == kSvtId) ||(det_id_neg == kSvtId)||
151  (det_id_pos == kSsdId) ||(det_id_neg == kSsdId)||
152  (det_id_pos == kSsdSvtId)||(det_id_neg == kSsdSvtId)) return 2;
153  return 3;
154 }
155 
156 StTrackTopologyMap* gFakeTopoPtr = new StTrackTopologyMap();
Definition: StV0I.hh:31
Long_t detectorIdV0()
Detector ID for V0 Vertex.
Definition: StV0MuDst.cc:141
virtual Long_t detectorIdPars()
Detector ID for pars used in V0 finder.
Definition: StV0MuDst.cc:146
void setPosBad()
Set the pos. daughter as bad.
Definition: StV0MuDst.hh:143
StStrangeEvMuDst * event()
Pointer to event information.
Definition: StV0I.hh:294
void setNegBad()
Set the neg. daughter as bad.
Definition: StV0MuDst.hh:144