Adding histos for the LEGO train
[u/mrichter/AliRoot.git] / EVGEN / AliGenLcLib.cxx
CommitLineData
feb24caa 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// LambdaC simulations.
19// To be used with AliGenParam.
20//
21// Author: Annalisa Mastroserio <Annalisa.Mastroserio@cern.ch>
22//
23
24#include <TPDGCode.h>
25#include <TMath.h>
26#include <TRandom.h>
27#include <TString.h>
28
29#include "AliGenLcLib.h"
30#include "AliLog.h"
31
32ClassImp(AliGenLcLib)
33
34
35//---------------------------------------------
36// LambdaC
37//---------------------------------------------
38 Int_t AliGenLcLib::IpLcPlus(TRandom *)
39{
40 //PDG code
41 return 4122;
42}
43
44Int_t AliGenLcLib::IpLcMinus(TRandom *)
45{
46 //PDG code
47 return -4122;
48}
49
50Double_t AliGenLcLib::PtLcFlat( const Double_t *, const Double_t *)
51{
52 // FLAT pt-distribution
53 return 1;
54}
55
56Double_t AliGenLcLib::PtLcExp( const Double_t *x, const Double_t *)
57{
58 // EXP pt-distribution
59 return x[0]*TMath::Exp(-x[0]/0.17);
60}
61
62Double_t AliGenLcLib::YLcFlat(const Double_t */*x*/,const Double_t *)
63{
64 //LambdaC y-distribution
65 return 5;
66}
67
68
69
70typedef Double_t (*GenFunc) (const Double_t*, const Double_t*);
71typedef Int_t (*GenFuncIp) (TRandom *);
72
73GenFunc AliGenLcLib::GetPt(Int_t iPID, const char * sForm) const
74{
75 // Return pointer to Pt parameterisation
76 printf("PID: %i, form: %s \n",iPID,sForm);
77 TString type(sForm);
78 GenFunc func;
79
80 switch(iPID) {
81
82 case kLcPlus:
83 if (type=="FLAT") {func=PtLcFlat; break;}
84 else if(type=="EXP") {func=PtLcExp; break;}
85 else {
86 AliFatal(Form("Unknown Pt distribution form: %s",sForm)); func=0;
87 }
88
89 case kLcMinus:
90 if (type=="FLAT") {func=PtLcFlat; break;}
91 else if(type=="EXP") {func=PtLcExp; break;}
92 else {
93 AliFatal(Form("Unknown Pt distribution form: %s",sForm)); func=0;
94 }
95
96 default : AliFatal(Form("Unknown particle type: %i",iPID)); func=0;
97 }//switch
98
99 return func;
100}
101
102GenFunc AliGenLcLib::GetY(Int_t iPID, const char *sForm) const
103{
104 AliDebug(1,Form("PID: %i, form: %s",iPID,sForm));
105 GenFunc func;
106 switch (iPID) {
107
108 case kLcPlus: func=YLcFlat; break;
109 case kLcMinus: func=YLcFlat; break;
110
111 default : AliFatal(Form("Unknown particle type: %i",iPID)); func=0; break;
112
113 }//switch
114 return func;
115}
116
117GenFuncIp AliGenLcLib::GetIp(Int_t iPID, const char *sForm) const
118{
119 // Return pointer to particle type parameterisation
120 AliDebug(1,Form("PID: %i, form: %s",iPID,sForm)); //////////
121
122 switch (iPID){
123
124 case kLcPlus: return IpLcPlus;
125 case kLcMinus: return IpLcMinus;
126
127 default : AliFatal(Form("Unknown particle type: %i",iPID)); return 0;
128 }
129}