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);
125 if(gRandom->Rndm()<(1-flambda))LEDWEIGHT.WEIN=1.;}
127 return LEDWEIGHT.WEIN;
131 /************************************************************/
132 void AliHBTLLWeights::Init()
134 //---------------------------------------------------------------------
136 //initial parameters of model
138 FSI_NS.NS = approximationModel;
140 if(!ftest){LEDWEIGHT.ITEST=0;}
144 if(fColoumbSwitch){FSI_NS.ICH =1;}
146 if(fStrongInterSwitch){FSI_NS.ISI=1;}
148 if(fQuantStatSwitch){FSI_NS.IQS=1;}
150 if(fColWithResidNuclSwitch){FSI_NS.I3C=1;}
154 if(fRandomPosition){LEDWEIGHT.IRANPOS=1;}
155 else{LEDWEIGHT.IRANPOS=0;}
158 if ( (fPID1 == 0) || (fPID2 == 0) )
160 Fatal("Init","Particles types are not set");
164 FSI_NS.LL = GetPairCode(fPID1,fPID2);
168 Fatal("Init","Particles types are not supported");
173 TParticlePDG* tpart1 = TDatabasePDG::Instance()->GetParticle(fPID1);
176 Fatal("init","We can not find particle with ID=%d in our DataBase",fPID1);
180 FSI_POC.AM1=tpart1->Mass();
181 FSI_POC.C1=tpart1->Charge();
183 TParticlePDG* tpart2 = TDatabasePDG::Instance()->GetParticle(fPID2);
190 Fatal("init","We can not find particle with ID=%d in our DataBase",fPID2);
194 FSI_POC.AM2=tpart2->Mass();
195 FSI_POC.C1=tpart2->Charge();
201 //constants for radii simulation
204 fsigma =TMath::Sqrt(2.)*fRadius;
209 Int_t AliHBTLLWeights::GetPairCode(const AliHBTPair* partpair)
211 return GetPairCode(partpair->Particle1()->GetPdgCode(),partpair->Particle2()->GetPdgCode());
214 Int_t AliHBTLLWeights::GetPairCode(Int_t pid1,Int_t pid2)
216 // 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
217 // 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
218 // 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
219 // NS=1 y/n: + + + + + - - - - - - - - - - - - - - - - - - - - - - -
221 //alphas, deuterons and tyts are NOT supported here
223 Int_t chargefactor = 1;
224 Int_t hpid; //pid in higher row
225 Int_t lpid; //pid in lower row
226 Int_t code; //pairCode
230 //determine the order of selcetion in switch
231 if (TMath::Abs(pid1) < TMath::Abs(pid2) )
233 if (pid1<0) chargefactor=-1;
234 hpid=pid2*chargefactor;
235 lpid=pid1*chargefactor;
240 if (pid2<0) chargefactor=-1;
241 hpid=pid1*chargefactor;
242 lpid=pid2*chargefactor;
251 //Determine the pair code
252 switch (hpid) //switch on first particle id
258 code = 1; //neutron neutron
262 code = 3; //neutron proton
266 code = 28; //neutron lambda
270 return 0; //given pair not supported
279 code = 2; //proton proton
283 code = 27;//proton lambda
287 return 0; //given pair not supported
298 code = 7; //piplus piplus
302 code = 5; //piplus piminus
306 code = 10; //piplus Kminus
310 code = 11; //piplus Kplus
314 code = 12; //piplus proton
319 return 0; //given pair not supported
331 return 0; //given pair not supported
340 code = 14; //Kplus Kminus
344 code = 15; //Kplus Kplus
348 code = 16; //Kplus proton
352 return 0; //given pair not supported
361 code = 17; //Kminus proton
366 return 0; //given pair not supported
375 code = 2; //Kzero Kzero
379 code = 17; //Kzero KzeroBar
383 return 0; //given pair not supported