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