StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtThPair.hh
1 /***************************************************************************
2  *
3  *
4  *
5  * Author: Laurent Conin, Fabrice Retiere, Subatech, France
6  ***************************************************************************
7  *
8  * Description : Buffer between the StHbtPair and the correlation function
9  * this base Class is responsible for accessing data concerning afterburner
10  * correlator i.e :
11  * user must plug in one StHbtFsiWeight
12  * then the StHbtThPair is initialised with Set(StHbtPair)
13  * then user have access to RealMomentum, Measured Momentum, Emission Point,
14  * Pid Weight of Numerator and Denominator.
15  * for each instantiation of that class, programmer choose which data
16  * he want to be returned
17  *
18  ***************************************************************************
19  *
20  *
21  *
22  ***************************************************************************/
23 
24 #ifndef ST_HBT_TH_PAIR_HH
25 #define ST_HBT_TH_PAIR_HH
26 
27 
28 #include "StHbtMaker/Infrastructure/StHbtPair.hh"
29 #include "StHbtMaker/Infrastructure/StHbtTypes.hh"
30 
31 class StHbtFsiWeight;
32 
33 class StHbtThPair {
34 public:
35 
36  StHbtThPair();
37  virtual ~StHbtThPair(){/* no-op */};
38 
39  virtual void Set(const StHbtPair*);
40  virtual void SetWeight(StHbtFsiWeight*);
41 
42  virtual const StHbtLorentzVector* GetRealMomentum1() const;
43  virtual const StHbtLorentzVector* GetRealMomentum2() const;
44  virtual const StHbtLorentzVector* GetMeasMomentum1() const;
45  virtual const StHbtLorentzVector* GetMeasMomentum2() const;
46  virtual const StHbtLorentzVector* GetEmPoint1() const;
47  virtual const StHbtLorentzVector* GetEmPoint2() const;
48  virtual int GetPid1() const;
49  virtual int GetPid2() const;
50  virtual const StHbtPair* GetMeasPair() const;
51  virtual double GetWeightNum() ;
52  virtual double GetWeightDen() ;
53  virtual StHbtString Report();
54  virtual double RealQInv() const;
55  double RealqSideCMS() const;
56  double RealqOutCMS() const;
57  double RealqLongCMS() const;
58  double RealqSidePf() const;
59  double RealqOutPf() const;
60  double RealqLongPf() const;
61 
62  // Fabrice private
63  virtual void set(const StHbtPair*);
64  void setMomRes1(int pid);
65  void setMomRes2(int pid);
66  void setPairPurity(double aPairPurity);
67  virtual StHbtLorentzVector const* getMomentum1() const;
68  virtual StHbtLorentzVector const* getMomentum2() const;
69  virtual StHbtLorentzVector const* getEmPoint1() const;
70  virtual StHbtLorentzVector const* getEmPoint2() const;
71  virtual int getPid1() const;
72  virtual int getPid2() const;
73  virtual double QInv() const;
74 
75  double KStarSide() const;
76  double KStarOut() const;
77  double KStarLong() const;
78  double KStar() const;
79  double CVK() const;
80  double KStarFlipped() const;
81  double CVKFlipped() const;
82  double RStar() const;
83  double RTrans() const;
84  double ROut() const;
85  double RLong() const;
86  double RSide() const;
87  double DTime() const;
88  double DTimePairLCMS() const;
89  double ROutPairCMS() const;
90  double RLongPairCMS() const;
91  double RSidePairCMS() const;
92  double DTimePairCMS() const;
93 
94  double Betat() const;
95  double Ut() const;
96  double Pt() const;
97 
98 protected:
99  virtual void setVariables(const StHbtPair*);
100 
101  const StHbtLorentzVector* mMomentum1;
102  const StHbtLorentzVector* mMomentum2;
103  StHbtLorentzVector* mEmPoint1;
104  StHbtLorentzVector* mEmPoint2;
105  int mPid1;
106  int mPid2;
107 
108  const StHbtPair* mMeasPair;
109 
110  StHbtFsiWeight* mWeight;
111  double mWeightNum;
112  double mWeightDen;
113  bool mWeightOk;
114  void UpdateWeight();
115 
116  mutable short mMomParCalculated;
117  void calcMomParameters() const;
118  mutable double mKStarSide;
119  mutable double mKStarOut;
120  mutable double mKStarLong;
121  mutable double mKStar;
122  mutable double mCVK;
123  mutable double mKStarFlipped;
124  mutable double mCVKFlipped;
125  mutable double mBetat;
126  mutable double mUt;
127  mutable double mPt;
128 
129  mutable short mPosParCalculated;
130  void calcPosParameters() const;
131  mutable double mRStar;
132  mutable double mRTrans;
133  mutable double mROut;
134  mutable double mRSide;
135  mutable double mRLong;
136  mutable double mDTime;
137  mutable double mDTimePairLCMS;
138  mutable double mROutPairCMS;
139  mutable double mRSidePairCMS;
140  mutable double mRLongPairCMS; // same as LCMS?
141  mutable double mDTimePairCMS;
142 
143  short mMomRes1;
144  short mMomRes2;
145  // param : Y = [0] + [1] * X^[2]
146  double mPLoss1[3]; // Momentum loss parametrization
147  double mPtRes1[3]; // pt resolution
148  double mPhiRes1[3]; // Phi res
149  double mThetaRes1[3]; // Theta res
150  double mPLoss2[3]; // Momentum loss parametrization
151  double mPtRes2[3]; // pt resolution
152  double mPhiRes2[3]; //
153  double mThetaRes2[3]; //
154  //void applyMomRes1();
155  //void applyMomRes2();
156 
157  double mPairPurity;
158 
159 #ifdef __ROOT__
160  ClassDef(StHbtThPair,1)
161 #endif
162 };
163 
164 
165 inline const StHbtLorentzVector* StHbtThPair::GetRealMomentum1() const
166 {return mMomentum1;};
167 inline const StHbtLorentzVector* StHbtThPair::GetRealMomentum2() const
168 {return mMomentum2;};
169 inline const StHbtLorentzVector* StHbtThPair::GetMeasMomentum1() const
170 {return (StHbtLorentzVector*)(&(mMeasPair->track1()->FourMomentum()));};
171 inline const StHbtLorentzVector* StHbtThPair::GetMeasMomentum2() const
172 {return (StHbtLorentzVector*)(&(mMeasPair->track2()->FourMomentum()));};
173 inline const StHbtLorentzVector* StHbtThPair::GetEmPoint1() const
174 {return mEmPoint1;};
175 inline const StHbtLorentzVector* StHbtThPair::GetEmPoint2() const
176 {return mEmPoint2;};
177 inline int StHbtThPair::GetPid1() const {return mPid1;};
178 inline int StHbtThPair::GetPid2() const {return mPid2;};
179 inline const StHbtPair* StHbtThPair::GetMeasPair() const
180 {return mMeasPair;};
181 inline double StHbtThPair::GetWeightNum() {
182  if (!(mWeightOk)) UpdateWeight();
183  return mWeightNum;}
184 inline double StHbtThPair::GetWeightDen() {
185  if (!(mWeightOk)) UpdateWeight();
186  return mWeightDen;};
187 
188 inline void StHbtThPair::SetWeight(StHbtFsiWeight* aWeight)
189 {mWeight=aWeight;};
190 inline double StHbtThPair::RealQInv() const{
191  return abs(*mMomentum1-*mMomentum2);
192 }
193 
194 inline void StHbtThPair::setPairPurity(double aPairPurity){
195  mPairPurity=aPairPurity;
196 }
197 inline void StHbtThPair::Set(const StHbtPair* aPair){
198  mMomParCalculated=0;
199  mPosParCalculated=0;
200  mWeightOk=false;
201  mMeasPair=aPair;
202  setVariables(aPair);
203 
204  //if(mMomRes1) applyMomRes1();
205  //if(mMomRes2) applyMomRes2();
206 }
207 // Fabrice private
208 inline void StHbtThPair::set(const StHbtPair* aPair){
209  static StHbtParticle* tPrevPart1;
210  static StHbtParticle* tPrevPart2;
211  if(tPrevPart1 != aPair->track1() || tPrevPart2 != aPair->track2()){
212  mWeightOk=false;
213  mMeasPair=aPair;
214  setVariables(aPair);
215  calcMomParameters();
216  calcPosParameters();
217  }
218  tPrevPart1 = aPair->track1();
219  tPrevPart2 = aPair->track2();
220  //if(mMomRes1) applyMomRes1();
221  //if(mMomRes2) applyMomRes2();
222 }
223 inline StHbtLorentzVector const* StHbtThPair::getMomentum1() const
224 {return mMomentum1;};
225 inline StHbtLorentzVector const* StHbtThPair::getMomentum2() const
226 {return mMomentum2;};
227 inline StHbtLorentzVector const* StHbtThPair::getEmPoint1() const
228 {return mEmPoint1;};
229 inline StHbtLorentzVector const* StHbtThPair::getEmPoint2() const
230 {return mEmPoint2;};
231 inline int StHbtThPair::getPid1() const {return mPid1;};
232 inline int StHbtThPair::getPid2() const {return mPid2;};
233 
234 inline double StHbtThPair::QInv() const{
235  return abs((*mMomentum1)-(*mMomentum2));
236 }
237 
238 inline double StHbtThPair::KStarSide() const{
239  if(!mMomParCalculated) calcMomParameters();
240  return mKStarSide;
241 }
242 inline double StHbtThPair::KStarOut() const{
243  if(!mMomParCalculated) calcMomParameters();
244  return mKStarOut;
245 }
246 inline double StHbtThPair::KStarLong() const{
247  if(!mMomParCalculated) calcMomParameters();
248  return mKStarLong;
249 }
250 inline double StHbtThPair::KStar() const{
251  if(!mMomParCalculated) calcMomParameters();
252  return mKStar;
253 }
254 inline double StHbtThPair::CVK() const{
255  if(!mMomParCalculated) calcMomParameters();
256  return mCVK;
257 }
258 inline double StHbtThPair::KStarFlipped() const{
259  if(!mMomParCalculated) calcMomParameters();
260  return mKStarFlipped;
261 }
262 inline double StHbtThPair::CVKFlipped() const{
263  if(!mMomParCalculated) calcMomParameters();
264  return mCVKFlipped;
265 }
266 inline double StHbtThPair::Betat() const{
267  if(!mMomParCalculated) calcMomParameters();
268  return mBetat;
269 }
270 inline double StHbtThPair::Ut() const{
271  if(!mMomParCalculated) calcMomParameters();
272  return mUt;
273 }
274 inline double StHbtThPair::Pt() const{
275  if(!mMomParCalculated) calcMomParameters();
276  return mPt;
277 }
278 
279 inline double StHbtThPair::RStar() const{
280  if(!mPosParCalculated){ calcPosParameters(); }
281  return mRStar;
282 }
283 inline double StHbtThPair::RTrans() const{
284  if(!mPosParCalculated){ calcPosParameters(); }
285  return mRTrans;
286 }
287 inline double StHbtThPair::ROut() const{
288  if(!mPosParCalculated){ calcPosParameters(); }
289  return mROut;
290 }
291 inline double StHbtThPair::RLong() const{
292  if(!mPosParCalculated){ calcPosParameters(); }
293  return mRLong;
294 }
295 inline double StHbtThPair::RSide() const{
296  if(!mPosParCalculated){ calcPosParameters(); }
297  return mRSide;
298 }
299 inline double StHbtThPair::DTime() const{
300  if(!mPosParCalculated){ calcPosParameters(); }
301  return mDTime;
302 }
303 inline double StHbtThPair::DTimePairLCMS() const{
304  if(!mPosParCalculated){ calcPosParameters(); }
305  return mDTimePairLCMS;
306 }
307 inline double StHbtThPair::ROutPairCMS() const{
308  if(!mPosParCalculated){ calcPosParameters(); }
309  return mROutPairCMS;
310 }
311 inline double StHbtThPair::RLongPairCMS() const{
312  if(!mPosParCalculated){ calcPosParameters(); }
313  return mRLongPairCMS;
314 }
315 inline double StHbtThPair::RSidePairCMS() const{
316  if(!mPosParCalculated){ calcPosParameters(); }
317  return mRSidePairCMS;
318 }
319 inline double StHbtThPair::DTimePairCMS() const{
320  if(!mPosParCalculated){ calcPosParameters(); }
321  return mDTimePairCMS;
322 }
323 
324 #endif