]>
Commit | Line | Data |
---|---|---|
88cb7938 | 1 | |
2 | // Config file test for MUON spectormeter | |
3 | // Remember to define the directory and option | |
4 | // gAlice->SetConfigFunction("Config('$HOME','box');"); | |
5 | ||
6 | void Config(char directory[100]="", char option[6]="box") | |
7 | { | |
8 | // | |
9 | // Config file for MUON test | |
10 | // Gines MARITNEZ, Subatech, mai 2003 | |
11 | // | |
12 | ||
13 | //===================================================================== | |
14 | // Libraries required by geant321 | |
15 | gSystem->Load("libgeant321.so"); | |
16 | ||
17 | new TGeant3("C++ Interface to Geant3"); | |
18 | ||
19 | //======================================================================= | |
20 | // Create the output file | |
21 | Text_t filename[100]; | |
22 | sprintf(filename,"%sgalice.root",directory); | |
23 | cout << ">>> Output file is " << filename << endl; | |
24 | cout << ">>> Config_MUON_test.C: Creating Run Loader ..."<<endl; | |
25 | AliRunLoader* rl = AliRunLoader::Open( | |
26 | filename, AliConfig::fgkDefaultEventFolderName, "recreate"); | |
27 | if (rl == 0x0) { | |
28 | gAlice->Fatal("Config_MUON_test.C","Can not instatiate the Run Loader"); | |
29 | return; | |
30 | } | |
31 | rl->SetCompressionLevel(2); | |
32 | rl->SetNumberOfEventsPerFile(100); | |
33 | gAlice->SetRunLoader(rl); | |
34 | ||
35 | //======================================================================= | |
36 | // MonteCarlo | |
37 | TGeant3 *geant3 = (TGeant3*)gMC; | |
38 | ||
39 | //======================================================================= | |
40 | // Set External decayer | |
41 | AliDecayer* decayer = new AliDecayerPythia(); | |
42 | decayer->SetForceDecay(kAll); | |
43 | decayer->Init(); | |
44 | gMC->SetExternalDecayer(decayer); | |
45 | ||
46 | // | |
47 | //======================================================================= | |
48 | // ******* GEANT STEERING parameters FOR ALICE SIMULATION ******* | |
49 | geant3->SetTRIG(1); //Number of events to be processed | |
50 | geant3->SetSWIT(4,10); | |
51 | geant3->SetDEBU(0,0,1); | |
52 | //geant3->SetSWIT(2,2); | |
53 | geant3->SetDCAY(1); | |
54 | geant3->SetPAIR(1); | |
55 | geant3->SetCOMP(1); | |
56 | geant3->SetPHOT(1); | |
57 | geant3->SetPFIS(0); | |
58 | geant3->SetDRAY(0); | |
59 | geant3->SetANNI(1); | |
60 | geant3->SetBREM(1); | |
61 | geant3->SetMUNU(1); | |
62 | geant3->SetCKOV(1); | |
63 | geant3->SetHADR(1); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3) | |
64 | geant3->SetLOSS(2); | |
65 | geant3->SetSTRA(0); // Simulation des collisions dans the thin layers | |
66 | geant3->SetMULS(1); | |
67 | geant3->SetRAYL(1); | |
68 | geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0) | |
69 | geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks | |
70 | geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2) | |
71 | geant3->SetERAN(5.e-7); | |
72 | Float_t cut = 1.e-3; // 1MeV cut by default | |
73 | Float_t tofmax = 1.e10; | |
74 | // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX | |
75 | geant3->SetCUTS(cut,cut, cut, cut, cut, cut, cut, cut, cut, cut, tofmax); | |
76 | // | |
77 | //======================================================================= | |
78 | // ************* STEERING parameters FOR ALICE SIMULATION ************** | |
79 | // Chamber positions | |
80 | // From AliMUONConstants class we get : | |
81 | // Position Z (along beam) of the chambers (in cm) | |
82 | // (from AliMUONConstants class): | |
83 | // 533.5, 546.5, 678.5, 693.5, 964.0, 986.0, 1251.5, 1278.5, | |
84 | // 1416.5, 1443.5, 1610, 1625., 1710., 1725. | |
85 | // Internal Radius (in cm) | |
86 | // 36.4, 46.2, 66.0, 80., 80., 100., 100. | |
87 | // External Radius (in cm) | |
88 | // 183., 245., 395., 560., 563., 850., 900. | |
89 | //======================================================================= | |
90 | if (!strcmp(option,"box")) { | |
91 | AliGenBox * gener = new AliGenBox(1); | |
92 | gener->SetMomentumRange(7.,7.1); | |
93 | gener->SetPhiRange(-180., 180.); | |
94 | gener->SetThetaRange(2.000,9.000); | |
95 | gener->SetPart(13); // Muons | |
96 | gener->SetOrigin(0.,0., 0.); //vertex position | |
97 | gener->SetSigma(0.0, 0.0, 0.0); //Sigma in (X,Y,Z) (cm) on IP position | |
98 | } | |
99 | if (!strcmp(option,"gun")) { | |
100 | //********************************************* | |
101 | // Example for Fixed Particle Gun * | |
102 | //********************************************* | |
103 | AliGenFixed *gener = new AliGenFixed(ntracks); | |
104 | gener->SetMomentum(10); | |
105 | gener->SetPhiRange(0.); | |
106 | gener->SetThetaRange(0.); | |
107 | gener->SetOrigin(30,30,1200);//vertex position | |
108 | gener->SetPart(13); //GEANT particle type 13 is muons | |
109 | } | |
110 | if (!strcmp(option,"param")) { | |
111 | //******************************************************* | |
112 | // Example for J/psi or Upsilon Production from Parameterisation * | |
113 | //******************************************************* | |
114 | AliGenParam *gener = new AliGenParam(1, AliGenMUONlib::kUpsilon); | |
115 | gener->SetMomentumRange(0,999); | |
116 | gener->SetPtRange(0,100.); | |
117 | gener->SetPhiRange(-180, 180); | |
118 | gener->SetYRange(2.5,4); | |
119 | gener->SetCutOnChild(1); | |
120 | gener->SetChildThetaRange(2.0,9); | |
121 | gener->SetOrigin(0,0,0); //vertex position gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position | |
122 | gener->SetForceDecay(kDiMuon); | |
123 | gener->SetTrackingFlag(1); | |
124 | } | |
125 | ||
126 | //============================================================= | |
127 | //Specify maximum magnetic field in Tesla (neg. ==> default field) | |
128 | gAlice->SetField(2,1) ; //(-999,2); | |
129 | ||
130 | //=================== Alice BODY parameters ============================= | |
131 | AliBODY *BODY = new AliBODY("BODY","Alice envelop"); | |
132 | ||
133 | ||
134 | //=================== MUON Subsystem =========================== | |
135 | AliMUONv1 *MUON = new AliMUONv1("MUON","default"); | |
136 | ||
137 | } | |
138 | ||
139 | ||
140 | Float_t EtaToTheta(Float_t arg){ | |
141 | return (180./TMath::Pi())*2.*atan(exp(-arg)); | |
142 | } |