1 #include "AliHBTLLWeights.h"
2 /**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
17 //_________________________________________________________________________
18 ///////////////////////////////////////////////////////////////////////////
20 // class AliHBTLLWeights
22 // This class introduces the weight's calculation
23 // according to the Lednicky's algorithm.
28 // Description from fortran code by author R. Lednicky
30 // Calculates final state interaction (FSI) weights
31 // WEIF = weight due to particle - (effective) nucleus FSI (p-N)
32 // WEI = weight due to p-p-N FSI
33 // WEIN = weight due to p-p FSI; note that WEIN=WEI if I3C=0;
34 // note that if I3C=1 the calculation of
35 // WEIN can be skipped by putting J=0
36 //.......................................................................
37 // Correlation Functions:
38 // CF(p-p-N) = sum(WEI)/sum(WEIF)
39 // CF(p-p) = sum(WEIN)/sum(1); here the nucleus is completely
41 // CF(p-p-"N") = sum(WEIN*WEIF')/sum(WEIF'), where WEIN and WEIF'
42 // are not correlated (calculated at different emission
43 // points, e.g., for different events);
44 // thus here the nucleus affects one-particle
45 // spectra but not the correlation
46 //.......................................................................
47 // User must supply data file <fn> on unit NUNIT (e.g. =11) specifying
49 // NS : approximation used to calculate Bethe-Salpeter amplitude
51 // If ITEST=1 then also following parameters are required
52 // ICH : 1(0) Coulomb interaction between the two particles ON (OFF)
53 // IQS : 1(0) quantum statistics for the two particles ON (OFF)
54 // ISI : 1(0) strong interaction between the two particles ON (OFF)
55 // I3C : 1(0) Coulomb interaction with residual nucleus ON (OFF)
56 // This data file can contain other information useful for the user.
57 // It is read by subroutines READINT4 and READREA8(4) (or READ_FILE).
58 // -------------------------------------------------------------------
59 //- LL 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
60 //- part. 1: n p n alfa pi+ pi0 pi+ n p pi+ pi+ pi+ pi- K+ K+ K+ K-
61 //- part. 2: n p p alfa pi- pi0 pi+ d d K- K+ p p K- K+ p p
62 // NS=1 y/n: + + + + + - - - - - - - - - - - -
63 // -------------------------------------------------------------------
64 //- LL 18 19 20 21 22 23 24 25 26 27 28
65 //- part. 1: d d t t K0 K0 d p p p n
66 //- part. 2: d alfa t alfa K0 K0b t t alfa lambda lambda
67 // NS=1 y/n: - - - - - - - - - + +
68 // -------------------------------------------------------------------
69 // NS=1 Square well potential,
71 // NS=4 scattered wave approximated by the spherical wave,
72 // NS=2 same as NS=4 but the approx. of equal emission times in PRF
73 // not required (t=0 approx. used in all other cases).
74 // Note: if NS=2,4, the B-S amplitude diverges at zero distance r* in
75 // the two-particle c.m.s.; user can specify a cutoff AA in
76 // SUBROUTINE FSIINI, for example:
77 // IF(NS.EQ.2.OR.NS.EQ.4)AA=5.D0 !! in 1/GeV --> AA=1. fm
78 // ------------------------------------------------------------------
79 // ITEST=1 any values of parameters ICH, IQS, ISI, I3C are allowed
80 // and should be given in data file <fn>
81 // ITEST=0 physical values of these parameters are put automatically
82 // in FSIINI (their values are not required in data file)
83 //=====================================================================
84 // At the beginning of calculation user should call FSIINI,
85 // which reads LL, NS, ITEST (and eventually ICH, IQS, ISI, I3C)
86 // and initializes various parameters.
87 // In particular the constants in
88 // COMMON/FSI_CONS/PI,PI2,SPI,DR,W
89 // may be useful for the user:
90 // W=1/.1973D0 ! from fm to 1/GeV
94 // DR=180.D0/PI ! from radian to degree
95 // _______________________________________________________
96 // !! |Important note: all real quantities are assumed REAL*8 | !!
97 // -------------------------------------------------------
98 // For each event user should fill in the following information
99 // in COMMONs (all COMMONs in FSI calculation start with FSI_):
100 // ...................................................................
101 // COMMON/FSI_POC/AMN,AM1,AM2,CN,C1,C2,AC1,AC2
103 // AMN = mass of the effective nucleus [GeV/c**2]
104 // CN = charge of the effective nucleus [elem. charge units]
106 // ...................................................................
107 // COMMON/FSI_MOM/P1X,P1Y,P1Z,E1,P1, !part. momenta in the rest frame
108 // 1 P2X,P2Y,P2Z,E2,P2 !of effective nucleus (NRF)
109 // Only the components
110 // PiX,PiY,PiZ [GeV/c]
111 // in NRF are required.
112 // To make the corresponding Lorentz transformation user can use the
113 // subroutines LTRAN and LTRANB
114 // ...................................................................
115 // COMMON/FSI_COOR/X1,Y1,Z1,T1,R1, ! 4-coord. of emission
116 // 1 X2,Y2,Z2,T2,R2 ! points in NRF
119 // and emission times
121 // should be given in NRF with the origin assumed at the center
122 // of the effective nucleus. If the effect of residual nucleus is
123 // not calculated within FSIW, the NRF can be any fixed frame.
124 // --------------------------------------------------------------------
125 // Before calling FSIW the user must call
127 // Besides Lorentz transformation to pair rest frame:
128 // (p1-p2)/2 --> k* it also transforms 4-coordinates of
129 // emission points from fm to 1/GeV and calculates Ei,Pi and Ri.
130 // Note that |k*|=AK in COMMON/FSI_PRF/
131 // --------------------------------------------------------------------
132 // After making some additional filtering using k* (say k* < k*max)
133 // or direction of vector k*,
134 // user can finally call FSIW to calculate the FSI weights
135 // to be used to construct the correlation function
136 //======================================================================
139 /*******************************************************************/
140 /****** ROUTINES USED FOR COMMUNUCATION ********/
141 /******************** WITH FORTRAN ********************/
142 /*******************************************************************/
144 # define led_bldata led_bldata_
145 # define fsiini fsiini_
146 # define ltran12 ltran12_
148 # define setpdist setpdist_
149 # define type_of_call
151 # define led_bldata LED_BLDATA
152 # define fsiini FSIINI
153 # define ltran12 LTRAN12
155 # define setpdist SETPDIST
156 # define type_of_call _stdcall
158 /****************************************************************/
159 extern "C" void type_of_call led_bldata();
160 extern "C" void type_of_call fsiini();
161 extern "C" void type_of_call ltran12();
162 extern "C" void type_of_call fsiw();
163 extern "C" void type_of_call setpdist(Double_t& r);
164 /**************************************************************/
166 #include "AliHBTPair.h"
167 #include "AliHBTParticle.h"
168 #include "WLedCOMMONS.h"
172 #include <TPDGCode.h>
175 ClassImp(AliHBTLLWeights)
177 AliHBTLLWeights* AliHBTLLWeights::fgLLWeights = 0x0;
178 const Double_t AliHBTLLWeights::fgkWcons = 1./0.1973;
180 AliHBTLLWeights::AliHBTLLWeights():
182 fColoumbSwitch(kTRUE),
183 fQuantStatSwitch(kTRUE),
184 fStrongInterSwitch(kTRUE),
185 fColWithResidNuclSwitch(kTRUE),
188 fRandomPosition(kFALSE),
194 // Default Constructor
196 /**************************************************************/
198 AliHBTLLWeights* AliHBTLLWeights::Instance()
200 // returns instance of class
207 fgLLWeights = new AliHBTLLWeights();
213 Double_t AliHBTLLWeights::GetWeight(const AliHBTPair* partpair)
215 // calculates weight for a pair
216 static const Double_t cmtofm = 1.e13;
218 AliHBTParticle *part1 = partpair->Particle1();
219 AliHBTParticle *part2 = partpair->Particle2();
221 if ( (part1 == 0x0) || (part2 == 0x0))
223 Error("GetWeight","Null particle pointer");
229 if ( (part1->Px() == part2->Px()) &&
230 (part1->Py() == part2->Py()) &&
231 (part1->Pz() == part2->Pz()) )
236 if ((!fRandomPosition) &&
237 (part1->Vx() == part2->Vx()) &&
238 (part1->Vy() == part2->Vy()) &&
239 (part1->Vz() == part2->Vz()) )
244 FSI_MOM.P1X = part1->Px();
245 FSI_MOM.P1Y = part1->Py();
246 FSI_MOM.P1Z = part1->Pz();
248 FSI_MOM.P2X = part2->Px();
249 FSI_MOM.P2Y = part2->Py();
250 FSI_MOM.P2Z = part2->Pz();
252 FSI_COOR.X1 = part1->Vx()*cmtofm;
253 FSI_COOR.Y1 = part1->Vy()*cmtofm;
254 FSI_COOR.Z1 = part1->Vz()*cmtofm;
255 FSI_COOR.T1 = part1->T();
257 FSI_COOR.X2 = part2->Vx()*cmtofm;
258 FSI_COOR.Y2 = part2->Vy()*cmtofm;
259 FSI_COOR.Z2 = part2->Vz()*cmtofm;
260 FSI_COOR.T2 = part2->T();
264 //this must be after ltran12 because it would overwrite what we set below
267 Double_t rxcm = fSigma*gRandom->Gaus();
268 Double_t rycm = fSigma*gRandom->Gaus();
269 Double_t rzcm = fSigma*gRandom->Gaus();
271 FSI_PRF.X=rxcm*fgkWcons;
272 FSI_PRF.Y=rycm*fgkWcons;
273 FSI_PRF.Z=rzcm*fgkWcons;
276 Double_t rps=rxcm*rxcm+rycm*rycm+rzcm*rzcm;
277 Double_t rp=TMath::Sqrt(rps);
282 return LEDWEIGHT.WEIN;
284 /************************************************************/
286 void AliHBTLLWeights::Init()
288 //initial parameters of model
290 FSI_NS.NS = fApproximationModel;
292 LEDWEIGHT.ITEST = fTest;
295 FSI_NS.ICH = fColoumbSwitch;
296 FSI_NS.ISI = fStrongInterSwitch;
297 FSI_NS.IQS = fQuantStatSwitch;
298 FSI_NS.I3C = fColWithResidNuclSwitch;
299 LEDWEIGHT.IRANPOS = fRandomPosition;
302 if ( (fPID1 == 0) || (fPID2 == 0) )
304 Fatal("Init","Particles types are not set");
307 FSI_NS.LL = GetPairCode(fPID1,fPID2);
311 Fatal("Init","Particles types are not supported");
316 TParticlePDG* tpart1 = TDatabasePDG::Instance()->GetParticle(fPID1);
319 Fatal("init","We can not find particle with ID=%d in PDG DataBase",fPID1);
323 FSI_POC.AM1=tpart1->Mass();
324 FSI_POC.C1=tpart1->Charge();
326 TParticlePDG* tpart2 = TDatabasePDG::Instance()->GetParticle(fPID2);
330 Fatal("init","We can not find particle with ID=%d in our DataBase",fPID2);
334 FSI_POC.AM2=tpart2->Mass();
335 FSI_POC.C1=tpart2->Charge();
341 //constants for radii simulation
345 fSigma =TMath::Sqrt(2.)*fRadius;
348 /************************************************************/
350 Int_t AliHBTLLWeights::GetPairCode(const AliHBTPair* partpair)
352 //returns Code corresponding to that pair
353 return GetPairCode(partpair->Particle1()->GetPdgCode(),partpair->Particle2()->GetPdgCode());
355 /************************************************************/
357 Int_t AliHBTLLWeights::GetPairCode(Int_t pid1,Int_t pid2)
359 // returns code corresponding to the pair of PIDs
360 // 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
361 // 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
362 // 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
363 // NS=1 y/n: + + + + + - - - - - - - - - - - - - - - - - - - - - - -
365 //alphas, deuterons and tyts are NOT supported here
367 Int_t chargefactor = 1;
368 Int_t hpid; //pid in higher row
369 Int_t lpid; //pid in lower row
370 Int_t code; //pairCode
374 //determine the order of selcetion in switch
375 if (TMath::Abs(pid1) < TMath::Abs(pid2) )
377 if (pid1<0) chargefactor=-1;
378 hpid=pid2*chargefactor;
379 lpid=pid1*chargefactor;
384 if (pid2<0) chargefactor=-1;
385 hpid=pid1*chargefactor;
386 lpid=pid2*chargefactor;
395 //Determine the pair code
396 switch (hpid) //switch on first particle id
402 code = 1; //neutron neutron
406 code = 3; //neutron proton
410 code = 28; //neutron lambda
414 return 0; //given pair not supported
423 code = 2; //proton proton
427 code = 27;//proton lambda
431 return 0; //given pair not supported
442 code = 7; //piplus piplus
446 code = 5; //piplus piminus
450 code = 10; //piplus Kminus
454 code = 11; //piplus Kplus
458 code = 12; //piplus proton
463 return 0; //given pair not supported
475 return 0; //given pair not supported
484 code = 14; //Kplus Kminus
488 code = 15; //Kplus Kplus
492 code = 16; //Kplus proton
496 return 0; //given pair not supported
505 code = 17; //Kminus proton
510 return 0; //given pair not supported
519 code = 2; //Kzero Kzero
523 code = 17; //Kzero KzeroBar
527 return 0; //given pair not supported
536 /************************************************************/
538 void AliHBTLLWeights::SetTest(Bool_t rtest)
543 /************************************************************/
545 void AliHBTLLWeights::SetColoumb(Bool_t col)
547 // (ICH in fortran code) Coulomb interaction between the two particles ON (OFF)
548 fColoumbSwitch = col;
550 /************************************************************/
552 void AliHBTLLWeights::SetQuantumStatistics(Bool_t qss)
554 //IQS: quantum statistics for the two particles ON (OFF)
555 //if non-identical particles automatically off
556 fQuantStatSwitch = qss;
558 /************************************************************/
560 void AliHBTLLWeights::SetStrongInterSwitch(Bool_t sis)
562 //ISI: strong interaction between the two particles ON (OFF)
563 fStrongInterSwitch = sis;
565 /************************************************************/
567 void AliHBTLLWeights::SetColWithResidNuclSwitch(Bool_t crn)
569 //I3C: Coulomb interaction with residual nucleus ON (OFF)
570 fColWithResidNuclSwitch = crn;
572 /************************************************************/
574 void AliHBTLLWeights::SetApproxModel(Int_t ap)
576 //sets Model of Approximation (NS in Fortran code)
577 fApproximationModel=ap;
579 /************************************************************/
581 void AliHBTLLWeights::SetRandomPosition(Bool_t rp)
583 //ON=kTRUE(OFF=kFALSE)
584 //ON -- calculation of the Gauss source radii
585 //if the generator don't allows the source generation (for example MeVSim)
586 //if ON the following parameters are requested:
587 fRandomPosition = rp;
589 /************************************************************/
591 void AliHBTLLWeights::SetR1dw(Double_t R)
593 //spherical source model radii
596 /************************************************************/
598 void AliHBTLLWeights::SetParticlesTypes(Int_t pid1, Int_t pid2)
600 //set AliRoot particles types
604 /************************************************************/
606 void AliHBTLLWeights::SetNucleusCharge(Double_t ch)
608 // not used now (see comments in fortran code)
611 /************************************************************/
613 void AliHBTLLWeights::SetNucleusMass(Double_t mass)
615 // (see comments in fortran code)