-/**************************************************************************
- * 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 kB : 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) != kB && 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) != kB && 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 kB : return id=IpBPlus;
- case -kB : 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;
-}
+/**************************************************************************\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
-#ifndef ALIGENITSULIB_H
-#define ALIGENITSULIB_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-// Library class for particle pt and y distributions used for
-// LambdaB simulations.
-// To be used with AliGenParam.
-//
-// Author: Annalisa Mastroserio <Annalisa.Mastroserio@cern.ch>
-
-#include "AliGenLib.h"
-
-class TRandom;
-
-class AliGenITSULib :public AliGenLib {
-
- public:
-
- enum EPartId {kLb=5122,kLc=4122,kXi_c = 4232,kB = 521,kDs=431,kDplus=411};
-
- //Getters
-
- GenFunc GetPt(Int_t iPID, const char * sForm=0) const;
- GenFunc GetY (Int_t iPID, const char * sForm=0) const;
- GenFuncIp GetIp(Int_t iPID, const char * sForm=0) const;
-
- private:
-
- static Int_t IpLcPlus(TRandom * /*ran*/) {return (int)kLc;}
- static Int_t IpLcMinus(TRandom * /*ran*/) {return -(int)kLc;}
- static Int_t IpLb(TRandom * /*ran*/) {return (int)kLb;}
- static Int_t IpLbBar(TRandom * /*ran*/) {return -(int)kLb;}
- static Int_t IpXic(TRandom * /*ran*/) {return (int)kXi_c;}
- static Int_t IpXicBar(TRandom * /*ran*/) {return -(int)kXi_c;}
- static Int_t IpBPlus(TRandom * /*ran*/) {return (int)kB;}
- static Int_t IpBMinus(TRandom * /*ran*/) {return -(int)kB;}
- static Int_t IpDsPlus(TRandom * /*ran*/) {return (int)kDs;}
- static Int_t IpDsMinus(TRandom * /*ran*/) {return -(int)kDs;}
- static Int_t IpDPlus(TRandom * /*ran*/) {return (int)kDplus;}
- static Int_t IpDMinus(TRandom * /*ran*/) {return -(int)kDplus;}
-
- static Double_t PtFlat(const Double_t * /*px*/, const Double_t * /*dummy*/) {return 1;}
- static Double_t YFlat (const Double_t * /*py*/, const Double_t * /*dummy*/) {return 1;}
-
- static Double_t PtLbDist (const Double_t *px, const Double_t *dummy);
- static Double_t PtLcDist (const Double_t *px, const Double_t *dummy);
- static Double_t PtBDist (const Double_t *px, const Double_t *dummy);
-
-
-
- ClassDef(AliGenITSULib,0)
- };
-
-#endif
-
-
-
-
-
-
-
+#ifndef ALIGENITSULIB_H\r
+#define ALIGENITSULIB_H\r
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
+ * See cxx source for full Copyright notice */\r
+\r
+// Library class for particle pt and y distributions used for \r
+// LambdaB simulations.\r
+// To be used with AliGenParam.\r
+//\r
+// Author: Annalisa Mastroserio <Annalisa.Mastroserio@cern.ch>\r
+\r
+#include "AliGenLib.h"\r
+\r
+class TRandom;\r
+\r
+class AliGenITSULib :public AliGenLib {\r
+\r
+ public:\r
+\r
+ enum EPartId {kLb=5122,kLc=4122,kXi_c = 4232,kBplus = 521,kBzero = 511,kDs=431,kDplus=411};\r
+\r
+ //Getters\r
+ \r
+ GenFunc GetPt(Int_t iPID, const char * sForm=0) const;\r
+ GenFunc GetY (Int_t iPID, const char * sForm=0) const;\r
+ GenFuncIp GetIp(Int_t iPID, const char * sForm=0) const; \r
+\r
+ private:\r
+\r
+ static Int_t IpLcPlus(TRandom * /*ran*/) {return (int)kLc;}\r
+ static Int_t IpLcMinus(TRandom * /*ran*/) {return -(int)kLc;}\r
+ static Int_t IpLb(TRandom * /*ran*/) {return (int)kLb;}\r
+ static Int_t IpLbBar(TRandom * /*ran*/) {return -(int)kLb;}\r
+ static Int_t IpXic(TRandom * /*ran*/) {return (int)kXi_c;}\r
+ static Int_t IpXicBar(TRandom * /*ran*/) {return -(int)kXi_c;}\r
+ static Int_t IpBPlus(TRandom * /*ran*/) {return (int)kBplus;}\r
+ static Int_t IpBMinus(TRandom * /*ran*/) {return -(int)kBplus;}\r
+ static Int_t IpB0(TRandom * /*ran*/) {return (int)kBzero;}\r
+ static Int_t IpB0Bar(TRandom * /*ran*/) {return -(int)kBzero;}\r
+ static Int_t IpDsPlus(TRandom * /*ran*/) {return (int)kDs;}\r
+ static Int_t IpDsMinus(TRandom * /*ran*/) {return -(int)kDs;}\r
+ static Int_t IpDPlus(TRandom * /*ran*/) {return (int)kDplus;}\r
+ static Int_t IpDMinus(TRandom * /*ran*/) {return -(int)kDplus;}\r
+\r
+ static Double_t PtFlat(const Double_t * /*px*/, const Double_t * /*dummy*/) {return 1;}\r
+ static Double_t YFlat (const Double_t * /*py*/, const Double_t * /*dummy*/) {return 1;}\r
+\r
+ static Double_t PtLbDist (const Double_t *px, const Double_t *dummy);\r
+ static Double_t PtLcDist (const Double_t *px, const Double_t *dummy);\r
+ static Double_t PtBDist (const Double_t *px, const Double_t *dummy);\r
+\r
+\r
+\r
+ ClassDef(AliGenITSULib,1)\r
+ };\r
+\r
+#endif\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r