StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StXiMuDst.cc
1 /***********************************************************************
2  *
3  * $Id: StXiMuDst.cc,v 3.5 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, 30-Mar-1999
7  *
8  ***********************************************************************
9  *
10  * Description: Xi (cascade) micro dst class
11  *
12  ***********************************************************************
13  *
14  * $Log: StXiMuDst.cc,v $
15  * Revision 3.5 2008/07/10 16:16:55 genevb
16  * Allow for marking of bad tracks -> bad secondary vertices
17  *
18  * Revision 3.4 2003/08/26 22:36:28 genevb
19  * Calculate Xi momenta at/near primary vertex
20  *
21  * Revision 3.3 2001/11/05 23:41:07 genevb
22  * Add more dEdx, B field info, careful of changes to TTree unrolling
23  *
24  * Revision 3.2 2001/05/04 20:15:15 genevb
25  * Common interfaces and reorganization of components, add MC event info
26  *
27  * Revision 3.1 2000/08/10 01:16:25 genevb
28  * Added number of dedx points
29  *
30  * Revision 3.0 2000/07/14 12:56:50 genevb
31  * Revision 3 has event multiplicities and dedx information for vertex tracks
32  *
33  * Revision 2.0 2000/06/02 22:11:55 genevb
34  * New version of Strangeness micro DST package
35  *
36  * Revision 1.3 2000/03/31 03:20:24 jones
37  * Added topology map to V0/Xi; access funcs for each data member
38  *
39  * Revision 1.2 2000/03/29 20:52:14 genevb
40  * Added StKinkMuDst, replaced arrays
41  *
42  * Revision 1.1 2000/03/29 03:10:08 genevb
43  * Introduction of Strangeness Micro DST package
44  *
45  *
46  ***********************************************************************/
47 #include "StXiMuDst.hh"
48 #include "StXiVertex.h"
49 #include "StTrack.h"
50 #include "StTrackFitTraits.h"
51 #include "StStrangeEvMuDst.hh"
52 #include "StDedxPidTraits.h"
53 #include "phys_constants.h"
54 #include "SystemOfUnits.h"
55 #include "StPhysicalHelixD.hh"
56 
57 StPhysicalHelixD XiHelix;
58 StThreeVectorD temp3VD;
59 
60 ClassImp(StXiMuDst)
61 
62 StXiMuDst::StXiMuDst() : StXiI() {
63 }
64 
65 void StXiMuDst::Fill(StXiVertex* xiVertex,
66  StV0Vertex* v0Vertex,
67  StStrangeEvMuDst* event) {
68  StV0MuDst::Fill(v0Vertex, event);
69  FillXi(xiVertex);
70 }
71 
72 void StXiMuDst::FillXi(StXiVertex* xiVertex) {
73  mCharge = (Int_t) (xiVertex->chargeOfBachelor());
74  mDecayVertexXiX = xiVertex->position().x();
75  mDecayVertexXiY = xiVertex->position().y();
76  mDecayVertexXiZ = xiVertex->position().z();
77  mDcaXiDaughters = xiVertex->dcaDaughters();
78  mDcaBachelorToPrimVertex = xiVertex->dcaBachelorToPrimaryVertex();
79  mDcaXiToPrimVertex = xiVertex->dcaParentToPrimaryVertex();
80  mMomBachelorX = xiVertex->momentumOfBachelor().x();
81  mMomBachelorY = xiVertex->momentumOfBachelor().y();
82  mMomBachelorZ = xiVertex->momentumOfBachelor().z();
83  mChi2Xi = xiVertex->chiSquared();
84  mClXi = xiVertex->probChiSquared();
85 
86  StTrack* trk = xiVertex->bachelor();
87  mKeyBachelor = trk->key();
88  mTopologyMapBachelor = trk->topologyMap();
89  mChi2Bachelor = trk->fitTraits().chi2(0);
90  mClBachelor = trk->fitTraits().chi2(1);
91  if (trk->bad()) setBachelorBad();
92  mDedxBachelor = 0.;
93  mNumDedxBachelor = 0;
94  // For now, get the truncated mean dE/dX from the TPC
95  StPtrVecTrackPidTraits pidBachelor = trk->pidTraits(kTpcId);
96  for (UInt_t i=0; i<pidBachelor.size(); i++) {
97  StDedxPidTraits* pid = (StDedxPidTraits*) pidBachelor[i];
98  if (pid->method() == kTruncatedMeanId) {
99  mDedxBachelor = pid->mean();
100  mErrDedxBachelor = pid->errorOnMean();
101  mNumDedxBachelor = pid->numberOfPoints() + (100*((int) (pid->length())));
102  break;
103  }
104  }
105 }
106 
107 StXiMuDst::~StXiMuDst() {
108 }
109 
111  return ((100*detectorIdV0())+
112  detectorIdTrack(mTopologyMapBachelor));
113 }
114 
116  return 1; // Currently, only one set of parameters actually used
117 }
118 
119 void StXiMuDst::setXiHelix() {
120  double pt = ptXi();
121  double bcharge = mCharge*(mEvent->magneticField());
122  double curvature = TMath::Abs(bcharge)*C_D_CURVATURE/pt;
123  double dip = TMath::ATan(momXiZ()/pt);
124  int h = ((bcharge > 0) ? -1 : 1);
125  double phase = TMath::ATan2(momXiY(),momXiX()) - (h*TMath::PiOver2());
126  temp3VD.setX(mDecayVertexXiX);
127  temp3VD.setY(mDecayVertexXiY);
128  temp3VD.setZ(mDecayVertexXiZ);
129  XiHelix.setParameters(curvature,dip,phase,temp3VD,h);
130 }
131 
132 StPhysicalHelixD& StXiMuDst::helixXi() {
133  setXiHelix();
134  return XiHelix;
135 }
136 
138  setXiHelix();
139  temp3VD.setX(mEvent->primaryVertexX());
140  temp3VD.setY(mEvent->primaryVertexY());
141  temp3VD.setZ(mEvent->primaryVertexZ());
142 
143  // actually the momentum at the DCA to the primary vertex
144  temp3VD = XiHelix.momentumAt(XiHelix.pathLength(temp3VD),
145  mEvent->magneticField()*kilogauss);
146  return TVector3(temp3VD.x(),temp3VD.y(),temp3VD.z());
147 }
void setParameters(double c, double dip, double phase, const StThreeVector< double > &o, int h)
starting point
Definition: StHelix.cc:139
Long_t detectorIdXi()
Detector ID for Xi vertex.
Definition: StXiMuDst.cc:110
Float_t momXiZ()
Momentum components of Xi/Omega at decay vertex.
Definition: StXiMuDst.hh:120
Float_t magneticField() const
Magnetic field.
Definition: StXiI.hh:24
Long_t detectorIdV0()
Detector ID for V0 Vertex.
Definition: StV0MuDst.cc:141
pair< double, double > pathLength(double r) const
path length at given r (cylindrical r)
Definition: StHelix.cc:351
Float_t ptXi()
Transverse momentum of Xi/Omega.
Definition: StXiI.hh:338
TVector3 momXiAtPrimVertex()
Momentum of Xi/Omega at primary vertex.
Definition: StXiMuDst.cc:137
virtual Long_t detectorIdPars()
Detector ID for pars used in V0 finder.
Definition: StXiMuDst.cc:115
Float_t primaryVertexZ() const
Primary vtx position coordinates.
void setBachelorBad()
Set the bachelor as bad.
Definition: StXiMuDst.hh:131