1 #include "AliHBTLLWeights.h"
3 #include "AliHBTPair.h"
4 #include "AliHBTParticle.h"
9 /*******************************************************************/
10 /****** ROUTINES USED FOR COMMUNUCATION ********/
11 /******************** WITH FORTRAN ********************/
12 /*******************************************************************/
14 # define led_bldata led_bldata_
15 # define fsiini fsiini_
16 # define ltran12 ltran12_
20 # define led_bldata LED_BLDATA
21 # define fsiini FSIINI
22 # define ltran12 LTRAN12
24 # define type_of_call _stdcall
26 /****************************************************************/
27 extern "C" void type_of_call led_bldata();
28 extern "C" void type_of_call fsiini();
29 extern "C" void type_of_call ltran12();
30 extern "C" void type_of_call fsiw();
31 /**************************************************************/
33 ClassImp(AliHBTLLWeights)
35 AliHBTLLWeights* AliHBTLLWeights::fgLLWeights=NULL;
37 AliHBTLLWeights::AliHBTLLWeights()
39 // Default Constructor
43 SetColWithResidNuclSwitch();
44 SetStrongInterSwitch();
45 SetQuantumStatistics();
52 AliHBTLLWeights* AliHBTLLWeights::Instance()
57 fgLLWeights = new AliHBTLLWeights();
63 Double_t AliHBTLLWeights::GetWeight(const AliHBTPair* partpair)
65 AliHBTParticle *part1 = partpair->Particle1();
66 AliHBTParticle *part2 = partpair->Particle2();
68 if ( (part1 == 0x0) || (part2 == 0x0))
70 Error("GetWeight","Null particle pointer");
75 Double_t part1Momentum[]={part1->Px(),part1->Py(),part1->Pz()};
76 Double_t part2Momentum[]={part2->Px(),part2->Py(),part2->Pz()};
78 if ( (part1->Px() == part2->Px()) &&
79 (part1->Py() == part2->Py()) &&
80 (part1->Pz() == part2->Pz()) )
86 if ((!fRandomPosition) &&
87 (part1->Vx() == part2->Vx()) && (part1->Vy() == part2->Vy())
88 && (part1->Vz() == part2->Vz()) )
95 FSI_MOM.P1X=part1Momentum[0];
96 FSI_MOM.P1Y=part1Momentum[1];
97 FSI_MOM.P1Z=part1Momentum[2];
99 FSI_MOM.P2X=part2Momentum[0];
100 FSI_MOM.P2Y=part2Momentum[1];
101 FSI_MOM.P2Z=part2Momentum[2];
103 if (fRandomPosition){
105 Double_t rxcm = fsigma*gRandom->Gaus();
106 Double_t rycm = fsigma*gRandom->Gaus();
107 Double_t rzcm = fsigma*gRandom->Gaus();
109 FSI_PRF.X=rxcm*fwcons;
110 FSI_PRF.Y=rycm*fwcons;
111 FSI_PRF.Z=rzcm*fwcons;
114 Double_t rps=rxcm*rxcm+rycm*rycm+rzcm*rzcm;
115 Double_t rp=TMath::Sqrt(rps);
124 return LEDWEIGHT.WEIN;
128 /************************************************************/
129 void AliHBTLLWeights::Init()
131 //---------------------------------------------------------------------
133 //initial parameters of model
135 FSI_NS.NS = approximationModel;
137 if(!ftest){LEDWEIGHT.ITEST=0;}
141 if(fColoumbSwitch){FSI_NS.ICH =1;}
143 if(fStrongInterSwitch){FSI_NS.ISI=1;}
145 if(fQuantStatSwitch){FSI_NS.IQS=1;}
147 if(fColWithResidNuclSwitch){FSI_NS.I3C=1;}
151 if(fRandomPosition){LEDWEIGHT.IRANPOS=1;}
152 else{LEDWEIGHT.IRANPOS=0;}
155 if ( (fPID1 == 0) || (fPID2 == 0) )
157 Fatal("Init","Particles types are not set");
161 FSI_NS.LL = GetPairCode(fPID1,fPID2);
165 Fatal("Init","Particles types are not supported");
170 TParticlePDG* tpart1 = TDatabasePDG::Instance()->GetParticle(fPID1);
173 Fatal("init","We can not find particle with ID=%d in our DataBase",fPID1);
177 FSI_POC.AM1=tpart1->Mass();
178 FSI_POC.C1=tpart1->Charge();
180 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
201 fsigma =TMath::Sqrt(2.)*fRadius;
206 Int_t AliHBTLLWeights::GetPairCode(const AliHBTPair* partpair)
208 return GetPairCode(partpair->Particle1()->GetPdgCode(),partpair->Particle2()->GetPdgCode());
211 Int_t AliHBTLLWeights::GetPairCode(Int_t pid1,Int_t pid2)
213 // 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
214 // 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
215 // 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
216 // NS=1 y/n: + + + + + - - - - - - - - - - - - - - - - - - - - - - -
218 //alphas, deuterons and tyts are NOT supported here
220 Int_t chargefactor = 1;
221 Int_t hpid; //pid in higher row
222 Int_t lpid; //pid in lower row
223 Int_t code; //pairCode
227 //determine the order of selcetion in switch
228 if (TMath::Abs(pid1) < TMath::Abs(pid2) )
230 if (pid1<0) chargefactor=-1;
231 hpid=pid2*chargefactor;
232 lpid=pid1*chargefactor;
237 if (pid2<0) chargefactor=-1;
238 hpid=pid1*chargefactor;
239 lpid=pid2*chargefactor;
248 //Determine the pair code
249 switch (hpid) //switch on first particle id
255 code = 1; //neutron neutron
259 code = 3; //neutron proton
263 code = 28; //neutron lambda
267 return 0; //given pair not supported
276 code = 2; //proton proton
280 code = 27;//proton lambda
284 return 0; //given pair not supported
295 code = 7; //piplus piplus
299 code = 5; //piplus piminus
303 code = 10; //piplus Kminus
307 code = 11; //piplus Kplus
311 code = 12; //piplus proton
316 return 0; //given pair not supported
328 return 0; //given pair not supported
337 code = 14; //Kplus Kminus
341 code = 15; //Kplus Kplus
345 code = 16; //Kplus proton
349 return 0; //given pair not supported
358 code = 17; //Kminus proton
363 return 0; //given pair not supported
372 code = 2; //Kzero Kzero
376 code = 17; //Kzero KzeroBar
380 return 0; //given pair not supported