1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 // Library class for particle pt and y distributions used for
18 // ITS Upgrade related signal simulations.
20 // Author: Annalisa Mastroserio <Annalisa.Mastroserio@cern.ch>
28 #include "AliGenITSULib.h"
31 ClassImp(AliGenITSULib)
33 typedef Double_t (*GenFunc) (const Double_t*, const Double_t*);
34 typedef Int_t (*GenFuncIp) (TRandom *);
37 Double_t AliGenITSULib::PtLcDist( const Double_t *x, const Double_t *)
40 // same shape as the Lb pt distribution for high pt were overestimated. The Lb fitting funcion has been
41 // used from 3.5 GeV/c on. At smaller Pt, the shape is likely as sqrt(x)*exp(-x)
42 Double_t par[6]={2.781336,1.353902,4.634330,(145479448.743187/202262270.892062),1.789479,-1.329143};
44 if(x[0]<3.5) y= par[3]*(TMath::Power(x[0],par[4]))*TMath::Exp(x[0]*par[5]);
45 else y= x[0]/TMath::Power((1+TMath::Power(x[0]/par[0],par[1])),par[2]);
50 Double_t AliGenITSULib::PtLbDist( const Double_t *x, const Double_t *)
52 // pt-distribution (fitted in 0-30 GeV/c)
53 Double_t par[4]={3.42500e-03,6.18902,1.76908,3.24823};
54 return par[0]*x[0]/TMath::Power((1+TMath::Power(x[0]/par[1],par[2])),par[3]);
57 GenFunc AliGenITSULib::GetPt(Int_t iPID, const char * sForm) const
59 // Return pointer to Pt parameterisation
60 AliDebug(1,Form("PID: %i, form: %s \n",iPID,sForm));
66 } else if(type=="DIST") {
68 switch(TMath::Abs(iPID)) {
70 case kLb : func=PtLbDist; break;
71 case kLc : func=PtLcDist; break;
72 case kXi_c : func=PtLcDist; break;
73 case kBplus : func=PtLbDist; break;
74 case kBzero : func=PtLbDist; break;
75 case kDs : func=PtLcDist; break;
76 case kDplus : func=PtLcDist; break;
77 default : AliError(Form("Unknown particle type: %i, Pt dist is 0",iPID)); func=0;
80 AliError(Form("Unknown Pt distribution %s. Pt distribution is set to 0 ",sForm));
87 GenFunc AliGenITSULib::GetY(Int_t iPID, const char *sForm) const
91 if(TMath::Abs(iPID) != kLc && TMath::Abs(iPID) != kLb && TMath::Abs(iPID) != kXi_c && TMath::Abs(iPID) != kBplus && TMath::Abs(iPID) != kBzero && TMath::Abs(iPID)!=kDplus && TMath::Abs(iPID)!=kDs) {
92 AliError(Form("Unknown PID: %i, form: %s, returning 0",iPID,sForm)); //////////
100 GenFuncIp AliGenITSULib::GetIp(Int_t iPID, const char *sForm) const
102 AliDebug(1,Form(" %i - %s",iPID,sForm));
103 // Return pointer to particle type parameterisation
106 if(TMath::Abs(iPID) != kLc && TMath::Abs(iPID) != kLb && TMath::Abs(iPID) != kXi_c && TMath::Abs(iPID) != kBplus && TMath::Abs(iPID) != kBzero && TMath::Abs(iPID)!=kDplus && TMath::Abs(iPID)!=kDs) {
107 AliError(Form("Unknown PID: %i, form: %s, return 0",iPID,sForm)); //////////
111 case kLc : return id=IpLcPlus;
112 case -kLc : return id=IpLcMinus;
113 case kLb : return id=IpLb;
114 case -kLb : return id=IpLbBar;
115 case kXi_c : return id=IpXic;
116 case -kXi_c : return id=IpXicBar;
117 case kBplus : return id=IpBPlus;
118 case kBzero : return id=IpB0;
119 case -kBzero: return id=IpB0Bar;
120 case -kBplus: return id=IpBMinus;
121 case kDs : return id=IpDsPlus;
122 case -kDs : return id=IpDsMinus;
123 case kDplus : return id=IpDPlus;
124 case -kDplus: return id=IpDMinus;
125 default : AliFatal(Form("Unknown particle type: %i",iPID)); id=0;