Attempt to monitor what file is read and merged by what job
[u/mrichter/AliRoot.git] / EVGEN / AliGenITSULib.cxx
CommitLineData
77f4c245 1/**************************************************************************\r
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
3 * *\r
4 * Author: The ALICE Off-line Project. *\r
5 * Contributors are mentioned in the code where appropriate. *\r
6 * *\r
7 * Permission to use, copy, modify and distribute this software and its *\r
8 * documentation strictly for non-commercial purposes is hereby granted *\r
9 * without fee, provided that the above copyright notice appears in all *\r
10 * copies and that both the copyright notice and this permission notice *\r
11 * appear in the supporting documentation. The authors make no claims *\r
12 * about the suitability of this software for any purpose. It is *\r
13 * provided "as is" without express or implied warranty. *\r
14 **************************************************************************/\r
15\r
16\r
17// Library class for particle pt and y distributions used for \r
18// ITS Upgrade related signal simulations.\r
19//\r
20// Author: Annalisa Mastroserio <Annalisa.Mastroserio@cern.ch>\r
21//\r
22\r
23#include <TPDGCode.h>\r
24#include <TMath.h>\r
25#include <TRandom.h>\r
26#include <TString.h>\r
27\r
28#include "AliGenITSULib.h"\r
29#include "AliLog.h"\r
30\r
31ClassImp(AliGenITSULib)\r
32\r
33 typedef Double_t (*GenFunc) (const Double_t*, const Double_t*);\r
34 typedef Int_t (*GenFuncIp) (TRandom *);\r
35\r
36\r
37Double_t AliGenITSULib::PtLcDist( const Double_t *x, const Double_t *)\r
38{\r
39 // pt-distribution\r
40 // same shape as the Lb pt distribution for high pt were overestimated. The Lb fitting funcion has been\r
41 // used from 3.5 GeV/c on. At smaller Pt, the shape is likely as sqrt(x)*exp(-x) \r
42 Double_t par[6]={2.781336,1.353902,4.634330,(145479448.743187/202262270.892062),1.789479,-1.329143}; \r
43 Double_t y=0;\r
44 if(x[0]<3.5) y= par[3]*(TMath::Power(x[0],par[4]))*TMath::Exp(x[0]*par[5]);\r
45 else y= x[0]/TMath::Power((1+TMath::Power(x[0]/par[0],par[1])),par[2]);\r
46 return y;\r
47}\r
48\r
49\r
50Double_t AliGenITSULib::PtLbDist( const Double_t *x, const Double_t *)\r
51{\r
52 // pt-distribution (fitted in 0-30 GeV/c)\r
53 Double_t par[4]={3.42500e-03,6.18902,1.76908,3.24823};\r
54 return par[0]*x[0]/TMath::Power((1+TMath::Power(x[0]/par[1],par[2])),par[3]);\r
55}\r
56\r
57GenFunc AliGenITSULib::GetPt(Int_t iPID, const char * sForm) const\r
58{\r
59 // Return pointer to Pt parameterisation\r
60 AliDebug(1,Form("PID: %i, form: %s \n",iPID,sForm)); \r
61 TString type(sForm);\r
62 GenFunc func;\r
63\r
64 if(type=="FLAT") {\r
65 func=PtFlat;\r
66 } else if(type=="DIST") {\r
67\r
68 switch(TMath::Abs(iPID)) {\r
69\r
70 case kLb : func=PtLbDist; break; \r
71 case kLc : func=PtLcDist; break; \r
72 case kXi_c : func=PtLcDist; break;\r
73 case kBplus : func=PtLbDist; break;\r
74 case kBzero : func=PtLbDist; break;\r
75 case kDs : func=PtLcDist; break;\r
76 case kDplus : func=PtLcDist; break;\r
77 default : AliError(Form("Unknown particle type: %i, Pt dist is 0",iPID)); func=0;\r
78 } \r
79 }else {\r
80 AliError(Form("Unknown Pt distribution %s. Pt distribution is set to 0 ",sForm));\r
81 func=0;\r
82 }\r
83\r
84 return func;\r
85}\r
86\r
87GenFunc AliGenITSULib::GetY(Int_t iPID, const char *sForm) const\r
88{\r
89 GenFunc func;\r
90\r
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) {\r
92 AliError(Form("Unknown PID: %i, form: %s, returning 0",iPID,sForm)); ////////// \r
93 func=0;\r
94 } else { \r
95 func = YFlat;\r
96 }\r
97 return func;\r
98}\r
99\r
100GenFuncIp AliGenITSULib::GetIp(Int_t iPID, const char *sForm) const\r
101{\r
102 AliDebug(1,Form(" %i - %s",iPID,sForm));\r
103 // Return pointer to particle type parameterisation\r
104 GenFuncIp id;\r
105\r
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) {\r
107 AliError(Form("Unknown PID: %i, form: %s, return 0",iPID,sForm)); ////////// \r
108 id = 0;\r
109 } else {\r
110 switch (iPID){\r
111 case kLc : return id=IpLcPlus;\r
112 case -kLc : return id=IpLcMinus;\r
113 case kLb : return id=IpLb;\r
114 case -kLb : return id=IpLbBar;\r
115 case kXi_c : return id=IpXic;\r
116 case -kXi_c : return id=IpXicBar;\r
117 case kBplus : return id=IpBPlus;\r
118 case kBzero : return id=IpB0;\r
119 case -kBzero: return id=IpB0Bar;\r
120 case -kBplus: return id=IpBMinus;\r
121 case kDs : return id=IpDsPlus;\r
122 case -kDs : return id=IpDsMinus;\r
123 case kDplus : return id=IpDPlus;\r
124 case -kDplus: return id=IpDMinus;\r
125 default : AliFatal(Form("Unknown particle type: %i",iPID)); id=0;\r
126 }\r
127\r
128 }\r
129\r
130 return id;\r
131}\r