StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DcaService.h
1 
9 #ifndef STAR_DcaService
10 #define STAR_DcaService
11 
12 #include "StarClassLibrary/StHelixD.hh"
13 #include "StStrangeMuDstMaker.h"
14 #include "StStrangeEvMuDst.hh"
15 
16 class StXiMuDst;
17 class StV0MuDst;
18 
19 class DcaService {
20  public:
21  DcaService() {}
22  virtual ~DcaService() {}
23 
25 
26  static void setBfield(double b);
27  static void setBfield(StStrangeEvMuDst* ev);
28  static void setBfield(StStrangeMuDstMaker* mk);
29 
30  static void setPrimVertex(StThreeVectorD& pv);
31  static void setPrimVertex(StStrangeEvMuDst* ev);
32  static void setPrimVertex(StStrangeMuDstMaker* mk);
33 
34  static void initEvent(StStrangeEvMuDst* ev);
35  static void initEvent(StStrangeMuDstMaker* mk);
37 
39 
40  static double dcaXiToPrimVertex(StXiMuDst* xi);
41  // For daughter tracks:
42  // Note that the track is assumed to pass
43  // through the decay vertex, so the calc may
44  // be different from the global track calc
45  static double dcaBachelorToPrimVertex(StXiMuDst* xi);
46  static double dcaPosToPrimVertex(StV0MuDst* v0);
47  static double dcaNegToPrimVertex(StV0MuDst* v0);
49 
51 
52  static double signedDcaXiToPrimVertex(StXiMuDst* xi);
53  static double signedDcaBachelorToPrimVertex(StXiMuDst* xi);
54  static double signedDcaPosToPrimVertex(StV0MuDst* v0);
55  static double signedDcaNegToPrimVertex(StV0MuDst* v0);
57 
59 
60  static void replaceDcaXiToPrimVertex(StXiMuDst* xi, Float_t dca);
61  static void replaceDcaBachelorToPrimVertex(StXiMuDst* xi, Float_t dca);
62  static void replaceDcaPosToPrimVertex(StV0MuDst* v0, Float_t dca);
63  static void replaceDcaNegToPrimVertex(StV0MuDst* v0, Float_t dca);
65 
67 
68  static void fixDcaXiToPrimVertex(StXiMuDst* xi);
69  static void fixSignedDcaXiToPrimVertex(StXiMuDst* xi);
70  static void fixSignedDcaBachelorToPrimVertex(StXiMuDst* xi);
71  static void fixSignedDcaPosToPrimVertex(StV0MuDst* v0);
72  static void fixSignedDcaNegToPrimVertex(StV0MuDst* v0);
74 
76 
77  static void fixDcaXiToPrimVertex(StStrangeMuDstMaker* mk);
78  static void fixSignedDcaXiToPrimVertex(StStrangeMuDstMaker* mk);
79  static void fixSignedDcaBachelorToPrimVertex(StStrangeMuDstMaker* mk);
80  static void fixSignedDcaPosToPrimVertex(StStrangeMuDstMaker* mk);
81  static void fixSignedDcaNegToPrimVertex(StStrangeMuDstMaker* mk);
82 
83  // Multiple fixes simultaneously
85  static void fixSignedDcasXis(StStrangeMuDstMaker* mk);
87  static void fixSignedDcasV0s(StStrangeMuDstMaker* mk);
89  static void fixSignedDcas(StStrangeMuDstMaker* mk);
91 
92 
93  private:
94  static double B;
95  static StThreeVectorD PrimVertex;
96  static StThreeVectorD Origin;
97  static StHelixD Track;
98  static Long_t offsetDcaXiToPrimVertex;
99  static Long_t offsetDcaBachelorToPrimVertex;
100  static Long_t offsetDcaPosToPrimVertex;
101  static Long_t offsetDcaNegToPrimVertex;
102 
103  static void initOffsets();
104  static double signIt();
105  static void replaceDca(TObject*, Float_t, Long_t&, TClass*, const char*);
106  static double dcaToPrimVertex(int, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t);
107 
108  ClassDef(DcaService,0)
109 };
110 
111 
112 inline void DcaService::setBfield(double b)
113  { B=b; }
114 
115 inline void DcaService::setBfield(StStrangeEvMuDst* ev)
116  { B=ev->magneticField(); }
117 
118 inline void DcaService::setBfield(StStrangeMuDstMaker* mk)
119  { setBfield(mk->GetEvent()); }
120 
121 inline void DcaService::setPrimVertex(StThreeVectorD& pv)
122  { PrimVertex=pv; }
123 
124 inline void DcaService::setPrimVertex(StStrangeMuDstMaker* mk)
125  { setPrimVertex(mk->GetEvent()); }
126 
127 inline void DcaService::initEvent(StStrangeEvMuDst* ev)
128  { setBfield(ev); setPrimVertex(ev); }
129 
130 inline void DcaService::initEvent(StStrangeMuDstMaker* mk)
131  { initEvent(mk->GetEvent()); }
132 
133 inline double DcaService::signedDcaXiToPrimVertex(StXiMuDst* xi)
134  { return dcaXiToPrimVertex(xi)*signIt(); }
135 
136 inline double DcaService::signedDcaBachelorToPrimVertex(StXiMuDst* xi)
137  { return dcaBachelorToPrimVertex(xi)*signIt(); }
138 
139 inline double DcaService::signedDcaPosToPrimVertex(StV0MuDst* v0)
140  { return dcaPosToPrimVertex(v0)*signIt(); }
141 
142 inline double DcaService::signedDcaNegToPrimVertex(StV0MuDst* v0)
143  { return dcaNegToPrimVertex(v0)*signIt(); }
144 
145 inline void DcaService::fixDcaXiToPrimVertex(StXiMuDst* xi)
146  { replaceDcaXiToPrimVertex(xi,dcaXiToPrimVertex(xi)); }
147 
148 inline void DcaService::fixSignedDcaXiToPrimVertex(StXiMuDst* xi)
149  { replaceDcaXiToPrimVertex(xi,signedDcaXiToPrimVertex(xi)); }
150 
151 inline void DcaService::fixSignedDcaBachelorToPrimVertex(StXiMuDst* xi)
152  { replaceDcaBachelorToPrimVertex(xi,signedDcaBachelorToPrimVertex(xi)); }
153 
154 inline void DcaService::fixSignedDcaPosToPrimVertex(StV0MuDst* v0)
155  { replaceDcaPosToPrimVertex(v0,signedDcaPosToPrimVertex(v0)); }
156 
157 inline void DcaService::fixSignedDcaNegToPrimVertex(StV0MuDst* v0)
158  { replaceDcaNegToPrimVertex(v0,signedDcaNegToPrimVertex(v0)); }
159 
161  { fixSignedDcasXis(mk); fixSignedDcasV0s(mk); }
162 
163 #endif
164 
165 //_____________________________________________________________________________
166 // $Id: DcaService.h,v 3.3 2009/09/02 19:39:44 genevb Exp $
167 // $Log: DcaService.h,v $
168 // Revision 3.3 2009/09/02 19:39:44 genevb
169 // Fixes to pointer and string conversions (RT ticket 1612), prep for 64-bit
170 //
171 // Revision 3.2 2003/05/30 21:20:18 genevb
172 // doxygen savvy, encoding of FTPC mults, change virtual funcs
173 //
174 // Revision 3.1 2002/08/13 19:18:54 genevb
175 // Introduction of DcaService
176 //
177 //
178 
static void fixSignedDcasV0s(StStrangeMuDstMaker *mk)
All DCAs for V0s.
Definition: DcaService.cxx:176
Float_t magneticField() const
Magnetic field.
static void fixSignedDcas(StStrangeMuDstMaker *mk)
All DCAs for V0s and Xis.
Definition: DcaService.h:160
C++ STL includes.
Definition: AgUStep.h:47
static void fixSignedDcasXis(StStrangeMuDstMaker *mk)
All DCAs for Xis.
Definition: DcaService.cxx:165