Using getter instead of global constant
[u/mrichter/AliRoot.git] / MUON / Config_MUON_test.C
CommitLineData
88cb7938 1// Config file test for MUON spectormeter
2// Remember to define the directory and option
3// gAlice->SetConfigFunction("Config('$HOME','box');");
4
5void Config(char directory[100]="", char option[6]="box")
6{
7 //
8 // Config file for MUON test
1391e633 9 // Gines MARTINEZ, Subatech, mai 2003, august 2003
88cb7938 10 //
11
12 //=====================================================================
13 // Libraries required by geant321
14 gSystem->Load("libgeant321.so");
88cb7938 15 new TGeant3("C++ Interface to Geant3");
88cb7938 16 //=======================================================================
17 // Create the output file
18 Text_t filename[100];
19 sprintf(filename,"%sgalice.root",directory);
20 cout << ">>> Output file is " << filename << endl;
21 cout << ">>> Config_MUON_test.C: Creating Run Loader ..."<<endl;
ecff27be 22 AliRunLoader* rl=0x0;
23 rl = AliRunLoader::Open(
f5a857b2 24 filename, AliConfig::GetDefaultEventFolderName(), "recreate");
88cb7938 25 if (rl == 0x0) {
26 gAlice->Fatal("Config_MUON_test.C","Can not instatiate the Run Loader");
27 return;
28 }
29 rl->SetCompressionLevel(2);
30 rl->SetNumberOfEventsPerFile(100);
31 gAlice->SetRunLoader(rl);
32
ecff27be 33
88cb7938 34 //=======================================================================
35 // Set External decayer
ecff27be 36 TVirtualMCDecayer *decayer = new AliDecayerPythia();
88cb7938 37 decayer->SetForceDecay(kAll);
38 decayer->Init();
39 gMC->SetExternalDecayer(decayer);
40
41 //
42 //=======================================================================
43 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
ecff27be 44 gMC->SetProcess("DCAY",1);
45 gMC->SetProcess("PAIR",1);
46 gMC->SetProcess("COMP",1);
47 gMC->SetProcess("PHOT",1);
48 gMC->SetProcess("PFIS",0);
49 gMC->SetProcess("DRAY",0);
50 gMC->SetProcess("ANNI",1);
51 gMC->SetProcess("BREM",1);
52 gMC->SetProcess("MUNU",1);
53 gMC->SetProcess("CKOV",1);
54 gMC->SetProcess("HADR",1);
55 gMC->SetProcess("LOSS",2);
56 gMC->SetProcess("MULS",1);
57 gMC->SetProcess("RAYL",1);
58
59 Float_t cut = 1.e-3; // 1MeV cut by default
60 Float_t tofmax = 1.e10;
61
62 gMC->SetCut("CUTGAM", cut);
63 gMC->SetCut("CUTELE", cut);
64 gMC->SetCut("CUTNEU", cut);
65 gMC->SetCut("CUTHAD", cut);
66 gMC->SetCut("CUTMUO", cut);
67 gMC->SetCut("BCUTE", cut);
68 gMC->SetCut("BCUTM", cut);
69 gMC->SetCut("DCUTE", cut);
70 gMC->SetCut("DCUTM", cut);
71 gMC->SetCut("PPCUTM", cut);
72 gMC->SetCut("TOFMAX", tofmax);
88cb7938 73 //
74 //=======================================================================
75 // ************* STEERING parameters FOR ALICE SIMULATION **************
76 // Chamber positions
77 // From AliMUONConstants class we get :
78 // Position Z (along beam) of the chambers (in cm)
79 // (from AliMUONConstants class):
80 // 533.5, 546.5, 678.5, 693.5, 964.0, 986.0, 1251.5, 1278.5,
81 // 1416.5, 1443.5, 1610, 1625., 1710., 1725.
82 // Internal Radius (in cm)
83 // 36.4, 46.2, 66.0, 80., 80., 100., 100.
84 // External Radius (in cm)
85 // 183., 245., 395., 560., 563., 850., 900.
86 //=======================================================================
87 if (!strcmp(option,"box")) {
88 AliGenBox * gener = new AliGenBox(1);
9bf560e7 89 gener->SetMomentumRange(20.,20.1);
1aa815a0 90 gener->SetPhiRange(0., 360.);
1391e633 91 gener->SetThetaRange(171.000,178.001);
88cb7938 92 gener->SetPart(13); // Muons
93 gener->SetOrigin(0.,0., 0.); //vertex position
94 gener->SetSigma(0.0, 0.0, 0.0); //Sigma in (X,Y,Z) (cm) on IP position
95 }
96 if (!strcmp(option,"gun")) {
97 //*********************************************
98 // Example for Fixed Particle Gun *
99 //*********************************************
100 AliGenFixed *gener = new AliGenFixed(ntracks);
101 gener->SetMomentum(10);
102 gener->SetPhiRange(0.);
103 gener->SetThetaRange(0.);
104 gener->SetOrigin(30,30,1200);//vertex position
105 gener->SetPart(13); //GEANT particle type 13 is muons
106 }
107 if (!strcmp(option,"param")) {
108 //*******************************************************
109 // Example for J/psi or Upsilon Production from Parameterisation *
110 //*******************************************************
111 AliGenParam *gener = new AliGenParam(1, AliGenMUONlib::kUpsilon);
112 gener->SetMomentumRange(0,999);
113 gener->SetPtRange(0,100.);
1aa815a0 114 gener->SetPhiRange(0., 360.);
88cb7938 115 gener->SetCutOnChild(1);
182f2aba 116 gener->SetChildPhiRange(0.,360.);
1391e633 117 gener->SetChildThetaRange(171.0,178.0);
88cb7938 118 gener->SetOrigin(0,0,0); //vertex position gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
119 gener->SetForceDecay(kDiMuon);
120 gener->SetTrackingFlag(1);
9bf560e7 121 gener->Init();
88cb7938 122 }
9def5bff 123 //=============================================================
124 // Field (L3 0.4 T)
a88eb0d0 125 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k4kG);
1391e633 126 gAlice->SetField(field);
88cb7938 127
128 //=================== Alice BODY parameters =============================
129 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
182f2aba 130 //=================== ABSO parameters ============================
501cb804 131 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
182f2aba 132 //=================== DIPO parameters ============================
501cb804 133 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
182f2aba 134 //================== HALL parameters ============================
501cb804 135 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
182f2aba 136 //=================== PIPE parameters ============================
501cb804 137 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
182f2aba 138 //=================== SHIL parameters ============================
501cb804 139 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
88cb7938 140 //=================== MUON Subsystem ===========================
182f2aba 141 cout << ">>> Config_MUON_test.C: Creating AliMUONv1 ..."<<endl;
d1cd2474 142
143 // Old MUONv1 version (renamed to MUONv3)
144 //AliMUONv3 *MUON = new AliMUONv3("MUON","default");
145
146 // New MUONv1 version (geometry defined via builders)
147 AliMUON *MUON = new AliMUONv1("MUON", "default");
148 //MUON->AddGeometryBuilder(new AliMUONSt1GeometryBuilder(MUON));
501cb804 149 MUON->AddGeometryBuilder(new AliMUONSt1GeometryBuilderV2(MUON));
150 MUON->AddGeometryBuilder(new AliMUONSt2GeometryBuilder(MUON));
d1cd2474 151 MUON->AddGeometryBuilder(new AliMUONSlatGeometryBuilder(MUON));
501cb804 152 MUON->AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(MUON));
88cb7938 153}
154
88cb7938 155Float_t EtaToTheta(Float_t arg){
156 return (180./TMath::Pi())*2.*atan(exp(-arg));
157}