2 #include "AliHBTLLWeights.h"
4 #include "AliHBTPair.h"
5 #include "AliHBTParticle.h"
10 /*******************************************************************/
11 /****** ROUTINES USED FOR COMMUNUCATION ********/
12 /******************** WITH FORTRAN ********************/
13 /*******************************************************************/
15 # define led_bldata led_bldata_
16 # define fsiini fsiini_
17 # define ltran12 ltran12_
21 # define led_bldata LED_BLDATA
22 # define fsiini FSIINI
23 # define ltran12 LTRAN12
25 # define type_of_call _stdcall
27 /****************************************************************/
28 extern "C" void type_of_call led_bldata();
29 extern "C" void type_of_call fsiini();
30 extern "C" void type_of_call ltran12();
31 extern "C" void type_of_call fsiw();
32 /**************************************************************/
34 ClassImp(AliHBTLLWeights)
36 //Interface to Richard Lednicky's weight alghorithm (Fortran implementation)
37 //Ludmila Malinina JINR
38 //Piotr Krzysztof Skowronski CERN/WUT
40 AliHBTLLWeights* AliHBTLLWeights::fgLLWeights=NULL;
42 AliHBTLLWeights::AliHBTLLWeights()
44 // Default Constructor
48 SetColWithResidNuclSwitch();
49 SetStrongInterSwitch();
50 SetQuantumStatistics();
56 AliHBTLLWeights* AliHBTLLWeights::Instance()
64 fgLLWeights = new AliHBTLLWeights();
70 Double_t AliHBTLLWeights::GetWeight(const AliHBTPair* partpair)
72 AliHBTParticle *part1 = partpair->Particle1();
73 AliHBTParticle *part2 = partpair->Particle2();
75 if ( (part1 == 0x0) || (part2 == 0x0))
77 Error("GetWeight","Null particle pointer");
81 Double_t part1Momentum[]={part1->Px(),part1->Py(),part1->Pz()};
82 Double_t part2Momentum[]={part2->Px(),part2->Py(),part2->Pz()};
85 if ( (part1->Px() == part2->Px()) && (part1->Py() == part2->Py())
86 && (part1->Pz() == part2->Pz()) )
87 {//if particles have the same momentum
92 if ((!fRandomPosition) && (part1->Vx() == part2->Vx()) && (part1->Vy() == part2->Vy())
93 && (part1->Vz() == part2->Vz()) )
94 { //if particles have the same position
98 //put momenta of particles in LAB into Fortran commons
100 FSI_MOM.P1X=part1Momentum[0];
101 FSI_MOM.P1Y=part1Momentum[1];
102 FSI_MOM.P1Z=part1Momentum[2];
104 FSI_MOM.P2X=part2Momentum[0];
105 FSI_MOM.P2Y=part2Momentum[1];
106 FSI_MOM.P2Z=part2Momentum[2];
110 Double_t rxcm = fsigma*gRandom->Gaus();
111 Double_t rycm = fsigma*gRandom->Gaus();
112 Double_t rzcm = fsigma*gRandom->Gaus();
114 FSI_PRF.X=rxcm*fwcons;
115 FSI_PRF.Y=rycm*fwcons;
116 FSI_PRF.Z=rzcm*fwcons;
119 Double_t rps=rxcm*rxcm+rycm*rycm+rzcm*rzcm;
120 Double_t rp=TMath::Sqrt(rps);
127 return LEDWEIGHT.WEIN;
130 /************************************************************/
131 void AliHBTLLWeights::Init()
133 //---------------------------------------------------------------------
135 //initial parameters of model
137 FSI_NS.NS = approximationModel;
139 if(!ftest) LEDWEIGHT.ITEST=0;
144 if(fColoumbSwitch) FSI_NS.ICH =1;
147 if(fStrongInterSwitch) FSI_NS.ISI=1;
150 if(fQuantStatSwitch) FSI_NS.IQS=1;
153 if(fColWithResidNuclSwitch) FSI_NS.I3C=1;
157 if(fRandomPosition) LEDWEIGHT.IRANPOS=1;
158 else LEDWEIGHT.IRANPOS=0;
160 if ( (fPID1 == 0) || (fPID2 == 0) )
162 Fatal("Init","Particles types are not set");
166 FSI_NS.LL = GetPairCode(fPID1,fPID2);
170 Fatal("Init","Particles types are not supported");
174 TParticlePDG* tpart1 = TDatabasePDG::Instance()->GetParticle(fPID1);
177 Fatal("init","We can not find particle with ID=%d in our DataBase",fPID1);
181 FSI_POC.AM1=tpart1->Mass();
182 FSI_POC.C1=tpart1->Charge();
184 TParticlePDG* tpart2 = TDatabasePDG::Instance()->GetParticle(fPID2);
187 Fatal("init","We can not find particle with ID=%d in our DataBase",fPID2);
191 FSI_POC.AM2=tpart2->Mass();
192 FSI_POC.C1=tpart2->Charge();
198 //constants for radii simulation
202 fsigma =TMath::Sqrt(2.)*fRadius;
207 Int_t AliHBTLLWeights::GetPairCode(const AliHBTPair* partpair)
209 return GetPairCode(partpair->Particle1()->GetPdgCode(),partpair->Particle2()->GetPdgCode());
212 Int_t AliHBTLLWeights::GetPairCode(Int_t pid1,Int_t pid2)
214 // pairCode 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
215 // hpid: n p n alfa pi+ pi0 pi+ n p pi+ pi+ pi+ pi- K+ K+ K+ K- d d t t K0 K0 d p p p n
216 // lpid: n p p alfa pi- pi0 pi+ d d K- K+ p p K- K+ p p d alfa t alfa K0 K0b t t alfa lambda lambda
217 // NS=1 y/n: + + + + + - - - - - - - - - - - - - - - - - - - - - - -
219 //alphas, deuterons and tyts are NOT supported here
221 Int_t chargefactor = 1;
222 Int_t hpid; //pid in higher row
223 Int_t lpid; //pid in lower row
224 Int_t code; //pairCode
228 //determine the order of selcetion in switch
229 if (TMath::Abs(pid1) < TMath::Abs(pid2) )
231 if (pid1<0) chargefactor=-1;
232 hpid=pid2*chargefactor;
233 lpid=pid1*chargefactor;
238 if (pid2<0) chargefactor=-1;
239 hpid=pid1*chargefactor;
240 lpid=pid2*chargefactor;
244 //Determine the pair code
245 switch (hpid) //switch on first particle id
251 code = 1; //neutron neutron
255 code = 3; //neutron proton
259 code = 28; //neutron lambda
263 return 0; //given pair not supported
272 code = 2; //proton proton
276 code = 27;//proton lambda
280 return 0; //given pair not supported
290 code = 7; //piplus piplus
294 code = 5; //piplus piminus
298 code = 10; //piplus Kminus
302 code = 11; //piplus Kplus
306 code = 12; //piplus proton
311 return 0; //given pair not supported
323 return 0; //given pair not supported
332 code = 14; //Kplus Kminus
336 code = 15; //Kplus Kplus
340 code = 16; //Kplus proton
344 return 0; //given pair not supported
353 code = 17; //Kminus proton
358 return 0; //given pair not supported
367 code = 2; //Kzero Kzero
371 code = 17; //Kzero KzeroBar
375 return 0; //given pair not supported