Flexible pt range for the efficiency histogramming
[u/mrichter/AliRoot.git] / MUON / genTestConfig.C
CommitLineData
6ef73001 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/* $Id$ */
17
18/// \ingroup macros
19/// \file genTestConfig.C
20/// \brief Configuration macro for event generator
21/// for MUON spectrometer Monte Carlo simulation
22
23Float_t EtaToTheta(Float_t arg);
24
25AliGenerator* genConfig(char option[6]="param")
26{
27 cout << "Running genTestConfig.C ... " << endl;
28
29 //=======================================================================
30 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
31 if ( gMC ) {
32 gMC->SetProcess("DCAY",1);
33 gMC->SetProcess("PAIR",1);
34 gMC->SetProcess("COMP",1);
35 gMC->SetProcess("PHOT",1);
36 gMC->SetProcess("PFIS",0);
37 gMC->SetProcess("DRAY",0);
38 gMC->SetProcess("ANNI",1);
39 gMC->SetProcess("BREM",1);
40 gMC->SetProcess("MUNU",1);
41 gMC->SetProcess("CKOV",1);
42 gMC->SetProcess("HADR",1);
43 gMC->SetProcess("LOSS",2);
44 gMC->SetProcess("MULS",1);
45 gMC->SetProcess("RAYL",1);
46 Float_t cut = 1.e-3; // 1MeV cut by default
47 Float_t tofmax = 1.e10;
48 gMC->SetCut("CUTGAM", cut);
49 gMC->SetCut("CUTELE", cut);
50 gMC->SetCut("CUTNEU", cut);
51 gMC->SetCut("CUTHAD", cut);
52 gMC->SetCut("CUTMUO", cut);
53 gMC->SetCut("BCUTE", cut);
54 gMC->SetCut("BCUTM", cut);
55 gMC->SetCut("DCUTE", cut);
56 gMC->SetCut("DCUTM", cut);
57 gMC->SetCut("PPCUTM", cut);
58 gMC->SetCut("TOFMAX", tofmax);
59 }
60
61 // Set External decayer
62 TVirtualMCDecayer *decayer = new AliDecayerPythia();
63 decayer->SetForceDecay(kAll);
64 decayer->Init();
65 if ( gMC ) gMC->SetExternalDecayer(decayer);
66
67 //=======================================================================
68 // Examples of generators. Only option param is sistematically tested
69 if (!strcmp(option,"box")) {
70 AliGenBox * gener = new AliGenBox(1);
71 gener->SetMomentumRange(20.,20.1);
72 gener->SetPhiRange(0., 360.);
73 gener->SetThetaRange(171.000,178.001);
74 gener->SetPart(kMuonMinus); // Muons
75 gener->SetOrigin(0.,0., 0.); //vertex position
76 gener->SetSigma(0.0, 0.0, 0.0); //Sigma in (X,Y,Z) (cm) on IP position
77 }
78 if (!strcmp(option,"gun")) {
79 AliGenFixed *gener = new AliGenFixed(1);
80 gener->SetMomentum(10);
81 gener->SetPhiRange(0.);
82 gener->SetThetaRange(0.);
83 gener->SetOrigin(30,30,-1200);//vertex position
84 gener->SetPart(kMuonMinus); //GEANT particle type 13 is muons
85 }
86 if (!strcmp(option,"scan")) {
87 AliGenScan *gener = new AliGenScan(-1);
88 gener->SetMomentumRange(10,10);
89 gener->SetPhiRange(0, 0);
90 gener->SetThetaRange(-180, -180);
91 //vertex position
92 //gener->SetSigma(1,1,0); //Sigma in (X,Y,Z) (cm) on IP position
93 gener->SetPart(kRootino);
94 gener->SetRange(100, -300., 300., 100, -300., 300., 1, 2000, 2000);
95 }
96 if (!strcmp(option,"param")) {
97 AliGenParam *gener = new AliGenParam(1, AliGenMUONlib::kUpsilon);
98 gener->SetMomentumRange(0,999);
99 gener->SetPtRange(0,100.);
100 gener->SetPhiRange(0., 360.);
101 gener->SetCutOnChild(1);
102 gener->SetChildPhiRange(0.,360.);
103 gener->SetChildThetaRange(171.0,178.0);
104 gener->SetOrigin(0,0,0); //vertex position gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
105 gener->SetForceDecay(kDiMuon);
106 gener->SetTrackingFlag(1);
b52579a7 107 gener->Init();
6ef73001 108 }
109 if (!strcmp(option,"paramJpsi")) {
110 AliGenParam *gener = new AliGenParam(1, AliGenMUONlib::kJpsi);
111 gener->SetMomentumRange(0,999);
112 gener->SetPtRange(0,100.);
113 gener->SetPhiRange(0., 360.);
114 gener->SetCutOnChild(1);
115 gener->SetChildPhiRange(0.,360.);
116 gener->SetChildThetaRange(171.0,178.0);
117 gener->SetOrigin(0,0,0);
118 gener->SetForceDecay(kDiMuon);
119 gener->SetTrackingFlag(1);
b52579a7 120 gener->Init();
6ef73001 121 }
122 if (!strcmp(option,"hijing")) { //Hijing generator from ConfigPPR in macros
123 AliGenHijing *gener = new AliGenHijing(-1);
124 // centre of mass energy
125 gener->SetEnergyCMS(5500.);
126 // reference frame
127 gener->SetReferenceFrame("CMS");
128 // projectile
129 gener->SetProjectile("A", 208, 82);
130 gener->SetTarget ("A", 208, 82);
131 // tell hijing to keep the full parent child chain
132 gener->KeepFullEvent();
133 // enable jet quenching
134 gener->SetJetQuenching(1);
135 // enable shadowing
136 gener->SetShadowing(1);
137 // neutral pion and heavy particle decays switched off
138 gener->SetDecaysOff(1);
139 // Don't track spectators
140 gener->SetSpectators(0);
141 // kinematic selection
142 gener->SetSelectAll(0);
143 // impact parameter range
144 gener->SetImpactParameterRange(0., 5.); // 0. - 5. fm corresponds to ~10% most central
b52579a7 145 gener->Init();
6ef73001 146 }
147 if (!strcmp(option,"muoncocktail")) { // Muon cocktail for PbPb
148 AliGenMUONCocktail * gener = new AliGenMUONCocktail();
149 gener->SetPtRange(1.,100.); // Transverse momentum range
150 gener->SetPhiRange(0.,360.); // Azimuthal angle range
151 gener->SetYRange(-4.0,-2.5);
152 gener->SetMuonPtCut(0.5);
153 gener->SetMuonThetaCut(171.,178.);
154 gener->SetMuonMultiplicity(2);
155 gener->SetImpactParameterRange(0.,5.); // 10% most centra PbPb collisions
156 gener->SetVertexSmear(kPerTrack);
157 gener->SetOrigin(0,0,0); // Vertex position
158 gener->SetSigma(0,0,0.0); // Sigma in (X,Y,Z) (cm) on IP position
b52579a7 159 gener->Init();
6ef73001 160 }
6ef73001 161 return gener;
162
163 cout << "Running genGunConfig.C finished ... " << endl;
164}
165
166Float_t EtaToTheta(Float_t arg){
167 return (180./TMath::Pi())*2.*atan(exp(-arg));
168}