]> git.uio.no Git - u/mrichter/AliRoot.git/blob - macros/Config_PDC06_MUON.C
New configuration for AliGenMUONCocktailpp
[u/mrichter/AliRoot.git] / macros / Config_PDC06_MUON.C
1 // Config file MUON + ITS (for vertex) for PDC06
2 // Tuned for p+p min biais and quarkonia production (AliGenMUONCocktailpp)
3 // Remember to define the directory and option
4 // gAlice->SetConfigFunction("Config('$HOME','box');");
5 // april 3rd: added L3 magnet 
6
7
8 void Config(char directory[100]="", char option[6]="trg1mu")
9 {
10  
11   static Int_t sseed = 0; // Set 0 to use the current time
12
13   //=====================================================================
14   //  Libraries required by geant321
15   //  gSystem->Load("liblhapdf.so");
16   //  gSystem->Load("libEGPythia6.so");
17   //  gSystem->Load("libPythia6.so");
18   //  gSystem->Load("libpythia6.so");
19   //  gSystem->Load("libAliPythia6.so");
20   
21   gSystem->Load("libgeant321.so");
22   new TGeant3TGeo("C++ Interface to Geant3");
23   
24   //=======================================================================
25
26   if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
27     AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
28     AliCDBManager::Instance()->SetRun(0);
29   }
30   
31   // Set Random Number seed
32   gRandom->SetSeed(sseed);
33
34   //  Create the output file    
35   Text_t filename[100];
36   sprintf(filename,"%sgalice.root",directory);
37
38   AliRunLoader* rl=0x0;
39   rl = AliRunLoader::Open(
40         filename, AliConfig::GetDefaultEventFolderName(), "recreate");
41   if (rl == 0x0) {
42     gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
43     return;
44   }
45   rl->SetCompressionLevel(2);
46   rl->SetNumberOfEventsPerFile(1000);
47   gAlice->SetRunLoader(rl);
48   // gAlice->SetGeometryFromFile("geometry.root");
49   // gAlice->SetGeometryFromCDB();
50   
51   //=======================================================================
52   // Set the trigger configuration
53   gAlice->SetTriggerDescriptor("p-p");
54   cout<<"Trigger configuration is set to  p-p"<<endl;
55
56   //=======================================================================
57   // Set External decayer
58   TVirtualMCDecayer *decayer = new AliDecayerPythia();
59   decayer->SetForceDecay(kAll);
60   decayer->Init();
61   gMC->SetExternalDecayer(decayer);
62
63   //=======================================================================
64   // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
65     gMC->SetProcess("DCAY",1);
66     gMC->SetProcess("PAIR",1);
67     gMC->SetProcess("COMP",1);
68     gMC->SetProcess("PHOT",1);
69     gMC->SetProcess("PFIS",0);
70     gMC->SetProcess("DRAY",0);
71     gMC->SetProcess("ANNI",1);
72     gMC->SetProcess("BREM",1);
73     gMC->SetProcess("MUNU",1);
74     gMC->SetProcess("CKOV",1);
75     gMC->SetProcess("HADR",1);
76     gMC->SetProcess("LOSS",2);
77     gMC->SetProcess("MULS",1);
78     gMC->SetProcess("RAYL",1);
79
80     Float_t cut = 1.e-3;        // 1MeV cut by default
81     Float_t tofmax = 1.e10;
82
83     gMC->SetCut("CUTGAM", cut);
84     gMC->SetCut("CUTELE", cut);
85     gMC->SetCut("CUTNEU", cut);
86     gMC->SetCut("CUTHAD", cut);
87     gMC->SetCut("CUTMUO", cut);
88     gMC->SetCut("BCUTE",  cut); 
89     gMC->SetCut("BCUTM",  cut); 
90     gMC->SetCut("DCUTE",  cut); 
91     gMC->SetCut("DCUTM",  cut); 
92     gMC->SetCut("PPCUTM", cut);
93     gMC->SetCut("TOFMAX", tofmax); 
94   //
95   //=======================================================================
96   // ************* STEERING parameters FOR ALICE SIMULATION **************
97   // Chamber positions
98   // From AliMUONConstants class we get :
99   //   Position Z (along beam) of the chambers (in cm) 
100   //        (from AliMUONConstants class):  
101   //    533.5,  546.5,  678.5, 693.5,  964.0, 986.0, 1251.5, 1278.5, 
102   //   1416.5, 1443.5,  1610, 1625.,  1710., 1725. 
103   //   Internal Radius (in cm)   
104   //     36.4,  46.2,  66.0,  80.,  80., 100., 100.    
105   //   External Radius (in cm)
106   //    183.,  245.,  395.,  560., 563., 850., 900.  
107   //=======================================================================
108     AliGenPythia* PythiaForMUONCocktail(Decay_t dt)
109         {
110             AliGenPythia *pythia = new AliGenPythia(1);
111             pythia->SetProcess(kPyMbMSEL1);
112             pythia->SetStrucFunc(kCTEQ5L);
113             pythia->SetEnergyCMS(14000.);
114             pythia->SetForceDecay(dt);
115             pythia->SetPtRange(0.,100.);
116             pythia->SetYRange(-8.,8.);
117             pythia->SetPhiRange(0.,360.);
118             pythia->SetPtHard(2.76,-1.0);
119             pythia->SwitchHFOff();
120             return pythia;
121         }
122
123   if (!strcmp(option,"trg2mu")) {
124     AliGenMUONCocktailpp *gener = new AliGenMUONCocktailpp();
125       gener->SetPtRange(0.,100.);
126       gener->SetYRange(-4.,-2.4);
127       gener->SetPhiRange(0.,360.);
128       gener->SetMuonMultiplicity(2);  
129       gener->SetMuonPtCut(0.5);
130       gener->SetMuonThetaRange(171.,178.);      
131       gener->SetOrigin(0.,0.,0.); 
132       gener->SetSigma(0.,0.,5.);
133       gener->SetVertexSmear(kPerEvent);
134       Decay_t dt = gener->GetDecayModePythia(dt);
135       AliGenPythia* pythia = PythiaForMUONCocktail(dt);
136       pythia->Init();     
137       gener->AddGenerator(pythia,"Pythia",1);
138       gener->Init(); 
139   }
140  
141   if (!strcmp(option,"trg1mu")) {
142     AliGenMUONCocktailpp *gener = new AliGenMUONCocktailpp();
143       gener->SetPtRange(0.,100.);
144       gener->SetYRange(-4.,-2.4);
145       gener->SetPhiRange(0.,360.);
146       gener->SetMuonMultiplicity(1);  
147       gener->SetMuonPtCut(0.5);
148       gener->SetMuonThetaRange(171.,178.);      
149       gener->SetOrigin(0.,0.,0.); 
150       gener->SetSigma(0.,0.,5.);
151       gener->SetVertexSmear(kPerEvent);
152       Decay_t dt = gener->GetDecayModePythia();
153       AliGenPythia* pythia = PythiaForMUONCocktail(dt);
154       pythia->Init();     
155       gener->AddGenerator(pythia,"Pythia",1);
156       gener->Init(); 
157   }
158   //============================================================= 
159   // Field (L3 0.5 T) outside dimuon spectrometer
160   AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
161   field->SetL3ConstField(0); // Using const. field in the barrel 
162   gAlice->SetField(field);
163
164   Int_t   iITS = 1;
165   Int_t   iZDC = 1;
166   Int_t   iFMD = 1;
167   Int_t   iPHOS = 1;
168   Int_t   iPMD = 1;
169   Int_t   iT0 = 1;
170   Int_t   iVZERO = 1;
171
172   rl->CdGAFile();
173
174   //=================== Alice BODY parameters =============================
175   AliBODY *BODY = new AliBODY("BODY","Alice envelop");
176   //=================== ABSO parameters ============================
177   AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
178   //=================== DIPO parameters ============================
179   AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
180   //================== HALL parameters ============================
181   AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
182   //================== The L3 Magnet ==============================
183   AliMAG *MAG = new AliMAG("MAG", "L3 Magnet");
184   //=================== PIPE parameters ============================
185   AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
186   //=================== SHIL parameters ============================
187   AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
188   //=================== ITS parameters =============================
189   if(iITS) {
190       AliITSvPPRasymmFMD *ITS  = new AliITSvPPRasymmFMD("ITS","ITS PPR detailed version with asymmetric services");
191   }
192  //=================== ZDC parameters =============================
193   if(iZDC) {
194       AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
195   }      
196  //=================== FMD parameters =============================
197   if(iFMD) {
198       AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
199   }
200  //=================== PHOS  parameters =============================
201   if(iPHOS) {
202       AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
203   }
204  //=================== PMD parameters =============================
205   if(iPMD) {
206       AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
207   }
208  //=================== T0 parameters =============================  
209   if (iT0) {
210       AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
211   }
212  //=================== VZERO parameters =============================
213   if (iVZERO) {
214       AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
215   }
216
217   //=================== MUON Subsystem ===========================
218   cout << ">>> Config.C: Creating AliMUONv1 ..."<<endl;
219
220   // With the following compactor, what you get (in case you wonder...) is :
221   //
222   // - "FactoryV4", that is all stations using new segmentations/mapping
223   // - "sdigitizer:AliMUONSDigitizerV2", performing decalibration
224   // - "digitizer:NewDigitizerOldTrigger" <=> digitizer=AliMUONDigitizerV3,
225   //    using the "old" trigger code, performing calibration
226   //
227   AliMUON *MUON = new AliMUONv1("MUON");
228 }
229
230 Float_t EtaToTheta(Float_t arg){
231   return (180./TMath::Pi())*2.*atan(exp(-arg));
232 }
233
234
235