-/**************************************************************************\r
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
- * *\r
- * Author: The ALICE Off-line Project. *\r
- * Contributors are mentioned in the code where appropriate. *\r
- * *\r
- * Permission to use, copy, modify and distribute this software and its *\r
- * documentation strictly for non-commercial purposes is hereby granted *\r
- * without fee, provided that the above copyright notice appears in all *\r
- * copies and that both the copyright notice and this permission notice *\r
- * appear in the supporting documentation. The authors make no claims *\r
- * about the suitability of this software for any purpose. It is *\r
- * provided "as is" without express or implied warranty. *\r
- **************************************************************************/\r
-\r
-\r
-// Library class for particle pt and y distributions used for \r
-// ITS Upgrade related signal simulations.\r
-//\r
-// Author: Annalisa Mastroserio <Annalisa.Mastroserio@cern.ch>\r
-//\r
-\r
-#include <TPDGCode.h>\r
-#include <TMath.h>\r
-#include <TRandom.h>\r
-#include <TString.h>\r
-\r
-#include "AliGenITSULib.h"\r
-#include "AliLog.h"\r
-\r
-ClassImp(AliGenITSULib)\r
-\r
- typedef Double_t (*GenFunc) (const Double_t*, const Double_t*);\r
- typedef Int_t (*GenFuncIp) (TRandom *);\r
-\r
-\r
-Double_t AliGenITSULib::PtLcDist( const Double_t *x, const Double_t *)\r
-{\r
- // pt-distribution\r
- // same shape as the Lb pt distribution for high pt were overestimated. The Lb fitting funcion has been\r
- // used from 3.5 GeV/c on. At smaller Pt, the shape is likely as sqrt(x)*exp(-x) \r
- Double_t par[6]={2.781336,1.353902,4.634330,(145479448.743187/202262270.892062),1.789479,-1.329143}; \r
- Double_t y=0;\r
- if(x[0]<3.5) y= par[3]*(TMath::Power(x[0],par[4]))*TMath::Exp(x[0]*par[5]);\r
- else y= x[0]/TMath::Power((1+TMath::Power(x[0]/par[0],par[1])),par[2]);\r
- return y;\r
-}\r
-\r
-\r
-Double_t AliGenITSULib::PtLbDist( const Double_t *x, const Double_t *)\r
-{\r
- // pt-distribution (fitted in 0-30 GeV/c)\r
- Double_t par[4]={3.42500e-03,6.18902,1.76908,3.24823};\r
- return par[0]*x[0]/TMath::Power((1+TMath::Power(x[0]/par[1],par[2])),par[3]);\r
-}\r
-\r
-GenFunc AliGenITSULib::GetPt(Int_t iPID, const char * sForm) const\r
-{\r
- // Return pointer to Pt parameterisation\r
- AliDebug(1,Form("PID: %i, form: %s \n",iPID,sForm)); \r
- TString type(sForm);\r
- GenFunc func;\r
-\r
- if(type=="FLAT") {\r
- func=PtFlat;\r
- } else if(type=="DIST") {\r
-\r
- switch(TMath::Abs(iPID)) {\r
-\r
- case kLb : func=PtLbDist; break; \r
- case kLc : func=PtLcDist; break; \r
- case kXi_c : func=PtLcDist; break;\r
- case kBplus : func=PtLbDist; break;\r
- case kBzero : func=PtLbDist; break;\r
- case kDs : func=PtLcDist; break;\r
- case kDplus : func=PtLcDist; break;\r
- default : AliError(Form("Unknown particle type: %i, Pt dist is 0",iPID)); func=0;\r
- } \r
- }else {\r
- AliError(Form("Unknown Pt distribution %s. Pt distribution is set to 0 ",sForm));\r
- func=0;\r
- }\r
-\r
- return func;\r
-}\r
-\r
-GenFunc AliGenITSULib::GetY(Int_t iPID, const char *sForm) const\r
-{\r
- GenFunc func;\r
-\r
- 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
- AliError(Form("Unknown PID: %i, form: %s, returning 0",iPID,sForm)); ////////// \r
- func=0;\r
- } else { \r
- func = YFlat;\r
- }\r
- return func;\r
-}\r
-\r
-GenFuncIp AliGenITSULib::GetIp(Int_t iPID, const char *sForm) const\r
-{\r
- AliDebug(1,Form(" %i - %s",iPID,sForm));\r
- // Return pointer to particle type parameterisation\r
- GenFuncIp id;\r
-\r
- 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
- AliError(Form("Unknown PID: %i, form: %s, return 0",iPID,sForm)); ////////// \r
- id = 0;\r
- } else {\r
- switch (iPID){\r
- case kLc : return id=IpLcPlus;\r
- case -kLc : return id=IpLcMinus;\r
- case kLb : return id=IpLb;\r
- case -kLb : return id=IpLbBar;\r
- case kXi_c : return id=IpXic;\r
- case -kXi_c : return id=IpXicBar;\r
- case kBplus : return id=IpBPlus;\r
- case kBzero : return id=IpB0;\r
- case -kBzero: return id=IpB0Bar;\r
- case -kBplus: return id=IpBMinus;\r
- case kDs : return id=IpDsPlus;\r
- case -kDs : return id=IpDsMinus;\r
- case kDplus : return id=IpDPlus;\r
- case -kDplus: return id=IpDMinus;\r
- default : AliFatal(Form("Unknown particle type: %i",iPID)); id=0;\r
- }\r
-\r
- }\r
-\r
- return id;\r
-}\r
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+
+// Library class for particle pt and y distributions used for
+// ITS Upgrade related signal simulations.
+//
+// Author: Annalisa Mastroserio <Annalisa.Mastroserio@cern.ch>
+//
+
+#include <TPDGCode.h>
+#include <TMath.h>
+#include <TRandom.h>
+#include <TString.h>
+
+#include "AliGenITSULib.h"
+#include "AliLog.h"
+
+ClassImp(AliGenITSULib)
+
+ typedef Double_t (*GenFunc) (const Double_t*, const Double_t*);
+ typedef Int_t (*GenFuncIp) (TRandom *);
+
+
+Double_t AliGenITSULib::PtLcDist( const Double_t *x, const Double_t *)
+{
+ // pt-distribution
+ // same shape as the Lb pt distribution for high pt were overestimated. The Lb fitting funcion has been
+ // used from 3.5 GeV/c on. At smaller Pt, the shape is likely as sqrt(x)*exp(-x)
+ Double_t par[6]={2.781336,1.353902,4.634330,(145479448.743187/202262270.892062),1.789479,-1.329143};
+ Double_t y=0;
+ if(x[0]<3.5) y= par[3]*(TMath::Power(x[0],par[4]))*TMath::Exp(x[0]*par[5]);
+ else y= x[0]/TMath::Power((1+TMath::Power(x[0]/par[0],par[1])),par[2]);
+ return y;
+}
+
+
+Double_t AliGenITSULib::PtLbDist( const Double_t *x, const Double_t *)
+{
+ // pt-distribution (fitted in 0-30 GeV/c)
+ Double_t par[4]={3.42500e-03,6.18902,1.76908,3.24823};
+ return par[0]*x[0]/TMath::Power((1+TMath::Power(x[0]/par[1],par[2])),par[3]);
+}
+
+GenFunc AliGenITSULib::GetPt(Int_t iPID, const char * sForm) const
+{
+ // Return pointer to Pt parameterisation
+ AliDebug(1,Form("PID: %i, form: %s \n",iPID,sForm));
+ TString type(sForm);
+ GenFunc func;
+
+ if(type=="FLAT") {
+ func=PtFlat;
+ } else if(type=="DIST") {
+
+ switch(TMath::Abs(iPID)) {
+
+ case kLb : func=PtLbDist; break;
+ case kLc : func=PtLcDist; break;
+ case kXi_c : func=PtLcDist; break;
+ case kBplus : func=PtLbDist; break;
+ case kBzero : func=PtLbDist; break;
+ case kDs : func=PtLcDist; break;
+ case kDplus : func=PtLcDist; break;
+ default : AliError(Form("Unknown particle type: %i, Pt dist is 0",iPID)); func=0;
+ }
+ }else {
+ AliError(Form("Unknown Pt distribution %s. Pt distribution is set to 0 ",sForm));
+ func=0;
+ }
+
+ return func;
+}
+
+GenFunc AliGenITSULib::GetY(Int_t iPID, const char *sForm) const
+{
+ GenFunc func;
+
+ 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) {
+ AliError(Form("Unknown PID: %i, form: %s, returning 0",iPID,sForm)); //////////
+ func=0;
+ } else {
+ func = YFlat;
+ }
+ return func;
+}
+
+GenFuncIp AliGenITSULib::GetIp(Int_t iPID, const char *sForm) const
+{
+ AliDebug(1,Form(" %i - %s",iPID,sForm));
+ // Return pointer to particle type parameterisation
+ GenFuncIp id;
+
+ 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) {
+ AliError(Form("Unknown PID: %i, form: %s, return 0",iPID,sForm)); //////////
+ id = 0;
+ } else {
+ switch (iPID){
+ case kLc : return id=IpLcPlus;
+ case -kLc : return id=IpLcMinus;
+ case kLb : return id=IpLb;
+ case -kLb : return id=IpLbBar;
+ case kXi_c : return id=IpXic;
+ case -kXi_c : return id=IpXicBar;
+ case kBplus : return id=IpBPlus;
+ case kBzero : return id=IpB0;
+ case -kBzero: return id=IpB0Bar;
+ case -kBplus: return id=IpBMinus;
+ case kDs : return id=IpDsPlus;
+ case -kDs : return id=IpDsMinus;
+ case kDplus : return id=IpDPlus;
+ case -kDplus: return id=IpDMinus;
+ default : AliFatal(Form("Unknown particle type: %i",iPID)); id=0;
+ }
+
+ }
+
+ return id;
+}