added G3TOG4, corrected G3G4_NO_REFLECTION setting
[u/mrichter/AliRoot.git] / HBTAN / AliHBTPair.h
CommitLineData
1b446896 1#ifndef ALIHBTPAIR_H
2#define ALIHBTPAIR_H
3
4#include <TObject.h>
5
6
7#include "AliHBTParticle.h"
8//class implements pair of particles and taking care of caluclation (almost)
9//all of pair properties (Qinv, InvMass,...)
10//more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html
11
12class AliHBTPair: public TObject
13{
14 public:
15 AliHBTPair(Bool_t rev = kFALSE); //contructor
16 ~AliHBTPair(){}
17 void SetParticles(AliHBTParticle*,AliHBTParticle*); //sets particles in the pair
18 AliHBTPair* GetSwapedPair() {return fSwapedPair;} //returns pair with swapped particles
19
20 AliHBTParticle* Particle1() const {return fPart1;} //returns pointer to first particle
21 AliHBTParticle* Particle2() const {return fPart2;} //returns pointer to decond particle
22
23 //Center Mass System - Longitudinally Comoving
24
25 Double_t GetInvMass(); //returns invariant mass of the pair
26
27 Double_t GetQSideCMSLC(); //returns Q Side CMS longitudionally co-moving
28 Double_t GetQOutCMSLC(); //returns Q out CMS longitudionally co-moving
29 Double_t GetQLongCMSLC(); //returns Q Long CMS longitudionally co-moving
30
31
32 Double_t GetKt(); //returns K transverse
33 Double_t GetKStar();
34
35 Double_t GetQInv(); //returns Q invariant
36 Double_t GetQSide(); //returns Q side
37 Double_t GetQLong(); //returns Q long
38 Double_t GetQOut(); //returns Q out
39
40
41 protected:
42 AliHBTParticle* fPart1; //pointer to first particle
43 AliHBTParticle* fPart2; //pointer to second particle
44
45 AliHBTPair* fSwapedPair; //pointer to swapped pair
46
47/************************************************************/
48/************CMS (LC) Q's *********************************/
49/************************************************************/
50 //Center Mass System - Longitudinally Comoving
51
52 Double_t fQSideCMSLC; //value of Q side CMS longitudially co-moving
53 Bool_t fQSideCMSLCNotCalc; //flag indicating if fQSideCMSLC is already calculated for this pair
54
55 Double_t fQOutCMSLC; //value of Q out CMS longitudially co-moving
56 Bool_t fQOutCMSLCNotCalc;//flag indicating if fQOutCMSLC is already calculated for this pair
57
58 Double_t fQLongCMSLC; //value of Q long CMS longitudially co-moving
59 Bool_t fQLongCMSLCNotCalc;//flag indicating if fQLongCMSLC is already calculated for this pair
60/************************************************************/
61/************************************************************/
62 Double_t fQInv; //half of differnece of 4-momenta
63 Bool_t fQInvNotCalc;//flag indicating if fQInv is already calculated for this pair
64
65 Double_t fInvMass; //invariant mass
66 Bool_t fInvMassNotCalc;//flag indicating if fInvMass is already calculated for this pair
67
68 Double_t fKt; //K == sum vector of particle's momenta. Kt transverse component
69 Bool_t fKtNotCalc;//flag indicating if fKt is already calculated for this pair
70
30025bb4 71 Double_t fKStar; //
1b446896 72 Bool_t fKStarNotCalc;
73
74 Double_t fPInv; //invariant momentum
75 Double_t fQSide; //Q Side
76 Double_t fOut;//Q Out
77 Double_t fQLong;//Q Long
78
79
80 Double_t fInvMassSqr;//squre of invariant mass
81 Bool_t fMassSqrNotCalc; //
82 void CalculateInvMassSqr();
83
84 Double_t fQInvL;
85 Bool_t fQInvLNotCalc;
86 void CalculateQInvL();
87
88 Double_t fPxSum;
89 Double_t fPySum;
90 Double_t fPzSum;
91 Double_t fESum;
92 Bool_t fSumsNotCalc;
93 void CalculateSums();
94
95 Double_t fPxDiff;
96 Double_t fPyDiff;
97 Double_t fPzDiff;
98 Double_t fEDiff;
99 Bool_t fDiffsNotCalc;
100 void CalculateDiffs();
101
102
103 /***************************************************/
104 void CalculateBase();
105 Bool_t fChanged;
106
107
108 private:
109 public:
110 ClassDef(AliHBTPair,1)
111};
112/****************************************************************/
113inline
114void AliHBTPair::SetParticles(AliHBTParticle* p1,AliHBTParticle* p2)
115{
116 //sets the particle to the pair
117
118 fPart1 = p1;
119 fPart2 = p2;
120 if (fSwapedPair) //if we have Swaped (so we are not)
121 fSwapedPair->SetParticles(p2,p1); //set particles for him too
122
123 // Resel all calculations (flags)
124
125 fChanged = kTRUE;
126 fSumsNotCalc = kTRUE;
127 fDiffsNotCalc = kTRUE;
128 fMassSqrNotCalc = kTRUE;
129 fInvMassNotCalc = kTRUE;
130 fQInvNotCalc = kTRUE;
131 fQSideCMSLCNotCalc = kTRUE;
132 fQOutCMSLCNotCalc = kTRUE;
133 fQLongCMSLCNotCalc = kTRUE;
134 fKtNotCalc = kTRUE;
135 fKStarNotCalc = kTRUE;
136 fQInvLNotCalc = kTRUE;
137
138 //and do nothing until will be asked for
139}
140/****************************************************************/
1b446896 141/****************************************************************/
142inline
143void AliHBTPair::CalculateInvMassSqr()
144 {
145 if (fMassSqrNotCalc)
146 {
147 CalculateSums();
148
149 Double_t fPart12s= (fPxSum*fPxSum) + (fPySum*fPySum) + (fPzSum*fPzSum);
150
151 fInvMassSqr=fESum*fESum-fPart12s;
152
153 fMassSqrNotCalc = kFALSE;
154 }
155 }
156/****************************************************************/
157inline
158void AliHBTPair::CalculateQInvL()
159 {
160 if (fQInvLNotCalc)
161 {
162 CalculateDiffs();
163 fQInvL = fEDiff*fEDiff - ( fPxDiff*fPxDiff + fPyDiff*fPyDiff + fPzDiff*fPzDiff );
164 fQInvLNotCalc = kFALSE;
165 }
166 }
167/****************************************************************/
168inline
169void AliHBTPair::CalculateSums()
170 {
171 if(fSumsNotCalc)
172 {
173 fPxSum = fPart1->Px()+fPart2->Px();
174 fPySum = fPart1->Py()+fPart2->Py();
175 fPzSum = fPart1->Pz()+fPart2->Pz();
176 fESum = fPart1->Energy() + fPart2->Energy();
177 fSumsNotCalc = kFALSE;
178 }
179 }
180/****************************************************************/
181inline
182void AliHBTPair::CalculateDiffs()
183 {
184 if(fDiffsNotCalc)
185 {
186 fPxDiff = fPart1->Px()-fPart2->Px();
187 fPyDiff = fPart1->Py()-fPart2->Py();
188 fPzDiff = fPart1->Pz()-fPart2->Pz();
189 fEDiff = fPart1->Energy() - fPart2->Energy();
190 fDiffsNotCalc = kFALSE;
191 }
192 }
193
194#endif