]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVGEN/AliGenITSULib.cxx
better just warning than error in case of mirrors requesting when putting to local...
[u/mrichter/AliRoot.git] / EVGEN / AliGenITSULib.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15
16
17 // Library class for particle pt and y distributions used for 
18 // ITS Upgrade related signal simulations.
19 //
20 // Author: Annalisa Mastroserio <Annalisa.Mastroserio@cern.ch>
21 //
22
23 #include <TPDGCode.h>
24 #include <TMath.h>
25 #include <TRandom.h>
26 #include <TString.h>
27
28 #include "AliGenITSULib.h"
29 #include "AliLog.h"
30
31 ClassImp(AliGenITSULib)
32
33  typedef Double_t (*GenFunc)   (const Double_t*,  const Double_t*);
34  typedef Int_t    (*GenFuncIp) (TRandom *);
35
36
37 Double_t AliGenITSULib::PtLcDist( const Double_t *x, const Double_t *)
38 {
39  //     pt-distribution
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}; 
43  Double_t y=0;
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]);
46  return y;
47 }
48
49
50 Double_t AliGenITSULib::PtLbDist( const Double_t *x, const Double_t *)
51 {
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]);
55 }
56
57 GenFunc AliGenITSULib::GetPt(Int_t iPID, const char * sForm) const
58 {
59  // Return pointer to Pt parameterisation
60  AliDebug(1,Form("PID: %i, form: %s \n",iPID,sForm));   
61  TString type(sForm);
62  GenFunc func;
63
64  if(type=="FLAT") {
65   func=PtFlat;
66  } else if(type=="DIST") {
67
68   switch(TMath::Abs(iPID)) {
69
70    case kLb    :    func=PtLbDist; break;  
71    case kLc    :    func=PtLcDist; break;  
72    case kXi_c  :    func=PtLcDist; break;
73    case kB     :    func=PtLbDist; break;
74    case kDs    :    func=PtLcDist; break;
75    case kDplus :    func=PtLcDist; break;
76    default : AliError(Form("Unknown particle type: %i, Pt dist is 0",iPID));      func=0;
77   } 
78  }else {
79   AliError(Form("Unknown Pt distribution %s. Pt distribution is set to 0 ",sForm));
80   func=0;
81  }
82
83  return func;
84 }
85
86 GenFunc AliGenITSULib::GetY(Int_t iPID, const char *sForm) const
87 {
88  GenFunc func;
89
90  if(TMath::Abs(iPID) != kLc && TMath::Abs(iPID) != kLb && TMath::Abs(iPID) != kXi_c && TMath::Abs(iPID) != kB && TMath::Abs(iPID)!=kDplus && TMath::Abs(iPID)!=kDs) {
91   AliError(Form("Unknown PID: %i, form: %s, returning 0",iPID,sForm));   //////////     
92   func=0;
93  } else { 
94   func = YFlat;
95  }
96  return func;
97 }
98
99 GenFuncIp AliGenITSULib::GetIp(Int_t iPID, const char *sForm) const
100 {
101  AliDebug(1,Form(" %i - %s",iPID,sForm));
102  // Return pointer to particle type parameterisation
103  GenFuncIp id;
104
105  if(TMath::Abs(iPID) != kLc && TMath::Abs(iPID) != kLb && TMath::Abs(iPID) != kXi_c && TMath::Abs(iPID) != kB && TMath::Abs(iPID)!=kDplus && TMath::Abs(iPID)!=kDs) {
106   AliError(Form("Unknown PID: %i, form: %s, return 0",iPID,sForm));   //////////        
107   id = 0;
108  } else {
109   switch (iPID){
110    case kLc    :                                  return id=IpLcPlus;
111    case -kLc   :                                  return id=IpLcMinus;
112    case kLb    :                                  return id=IpLb;
113    case -kLb   :                                  return id=IpLbBar;
114    case kXi_c  :                                  return id=IpXic;
115    case -kXi_c :                                  return id=IpXicBar;
116    case kB     :                                  return id=IpBPlus;
117    case -kB    :                                  return id=IpBMinus;
118    case kDs    :                                  return id=IpDsPlus;
119    case -kDs   :                                  return id=IpDsMinus;
120    case kDplus :                                  return id=IpDPlus;
121    case -kDplus:                                  return id=IpDMinus;
122    default  : AliFatal(Form("Unknown particle type: %i",iPID));  id=0;
123   }
124
125  }
126
127  return id;
128 }