]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/Config_MUON_test.C
New Stepmanager function.
[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(
88cb7938 24 filename, AliConfig::fgkDefaultEventFolderName, "recreate");
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);
1391e633 90 gener->SetPhiRange(-180, 180.01);
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.);
114 gener->SetPhiRange(-180, 180);
88cb7938 115 gener->SetCutOnChild(1);
1391e633 116 gener->SetChildThetaRange(171.0,178.0);
88cb7938 117 gener->SetOrigin(0,0,0); //vertex position gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
118 gener->SetForceDecay(kDiMuon);
119 gener->SetTrackingFlag(1);
9bf560e7 120 gener->Init();
88cb7938 121 }
122
9def5bff 123 //=============================================================
124 // Field (L3 0.4 T)
1391e633 125 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k4kG);
126 gAlice->SetField(field);
88cb7938 127
128 //=================== Alice BODY parameters =============================
129 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
130
131
132 //=================== MUON Subsystem ===========================
1391e633 133 cout << ">>> Config_MUON_test.C: Creating AliMUONv1 ..."<<endl;
134 AliMUONv1 *MUON = new AliMUONv1("MUON","default");
88cb7938 135}
136
88cb7938 137Float_t EtaToTheta(Float_t arg){
138 return (180./TMath::Pi())*2.*atan(exp(-arg));
139}