]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/Config.C
Updated comments for Doxygen
[u/mrichter/AliRoot.git] / MUON / Config.C
1 // Config file test for MUON spectormeter
2 // Remember to define the directory and option
3 // gAlice->SetConfigFunction("Config('$HOME','box');");
4
5 void Config(char directory[100]="", char option[6]="param")
6 {
7   //
8   // Config file for MUON test
9   //
10
11   //=====================================================================
12   //  Libraries required by geant321
13   gSystem->Load("libgeant321.so");
14   new TGeant3TGeo("C++ Interface to Geant3");
15   //=======================================================================
16   //  Create the output file    
17   Text_t filename[100];
18   sprintf(filename,"%sgalice.root",directory);
19   cout << ">>> Output file is " << filename << endl;   
20   cout << ">>> Config.C: Creating Run Loader ..."<<endl;
21   AliRunLoader* rl=0x0;
22   rl = AliRunLoader::Open(
23         filename, AliConfig::GetDefaultEventFolderName(), "recreate");
24   if (rl == 0x0) {
25     gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
26     return;
27   }
28   rl->SetCompressionLevel(2);
29   rl->SetNumberOfEventsPerFile(100);
30   gAlice->SetRunLoader(rl);
31
32   //AliLog::SetModuleDebugLevel("MUON", 1);
33   
34   //=======================================================================
35   // Set External decayer
36   TVirtualMCDecayer *decayer = new AliDecayerPythia();
37   decayer->SetForceDecay(kAll);
38   decayer->Init();
39   gMC->SetExternalDecayer(decayer);
40
41   //
42   //=======================================================================
43   // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
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); 
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);
89     gener->SetMomentumRange(20.,20.1);
90     gener->SetPhiRange(0., 360.);         
91     gener->SetThetaRange(171.000,178.001);
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,"scan")) {
108     AliGenScan *gener = new AliGenScan(-1);
109     gener->SetMomentumRange(10,10);
110     gener->SetPhiRange(0, 0);
111     gener->SetThetaRange(-180, -180);
112     //vertex position
113     //gener->SetSigma(1,1,0);           //Sigma in (X,Y,Z) (cm) on IP position
114     gener->SetPart(kRootino); 
115     gener->SetRange(100, -300., 300., 100, -300., 300., 1, 2000, 2000);
116   }  
117   if (!strcmp(option,"param")) {
118     //*******************************************************
119     // Example for J/psi or Upsilon Production from  Parameterisation *
120     //*******************************************************
121     AliGenParam *gener = new AliGenParam(1, AliGenMUONlib::kUpsilon);
122     gener->SetMomentumRange(0,999);
123     gener->SetPtRange(0,100.);
124     gener->SetPhiRange(0., 360.);
125     gener->SetCutOnChild(1);
126     gener->SetChildPhiRange(0.,360.);
127     gener->SetChildThetaRange(171.0,178.0);
128     gener->SetOrigin(0,0,0);          //vertex position    gener->SetSigma(0,0,0);           //Sigma in (X,Y,Z) (cm) on IP position
129     gener->SetForceDecay(kDiMuon);
130     gener->SetTrackingFlag(1);
131     gener->Init();
132   }
133   //============================================================= 
134   // Field (L3 0.4 T)
135   AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k4kG);
136   gAlice->SetField(field);
137
138   //=================== Alice BODY parameters =============================
139   AliBODY *BODY = new AliBODY("BODY","Alice envelop");
140   //=================== ABSO parameters ============================
141   AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
142   //=================== DIPO parameters ============================
143   AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
144   //================== HALL parameters ============================
145   AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
146   //=================== PIPE parameters ============================
147   AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
148   //=================== SHIL parameters ============================
149   AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
150
151   //=================== MUON Subsystem ===========================
152   cout << ">>> Config.C: Creating AliMUONv1 ..."<<endl;
153
154   // With the following compact ctor, what you get (in case you wonder...) is :
155   //
156   // - "FactoryV4", that is all stations using new segmentations/mapping
157   // - "sdigitizer:AliMUONSDigitizerV2", performing decalibration
158   // - "digitizer:NewDigitizerWithNoiseOldTrigger" => 
159   //    digitizer=AliMUONDigitizerV3,
160   //    using the "old" trigger code, performing calibration, and
161   //    generating noise-only digits for the tracker.
162
163   AliMUON *MUON = new AliMUONv1("MUON");
164
165   //To get old behavior (which usage is no longer supported), please use :
166   // 
167   //  AliMUON* MUON = new AliMUONv1("MUON","FactoryV3",
168   //                                "AliMUONSDigitizerv1",
169   //                                "AliMUONDigitizerv2");
170   //
171   // To get brand new trigger code, please use :
172   //
173   // AliMUON *MUON = new AliMUONv1("MUON", "FactoryV4",
174   //                               "sdigitizer:AliMUONSDigitizerV2",
175   //                               "digitizer:NewDigitizerNewTrigger");
176   //
177   // To enable Trigger Chamber Efficiency, please use :
178   //
179   // AliMUON *MUON = new AliMUONv1("MUON", "FactoryV4",
180   //                              "sdigitizer:AliMUONSDigitizerV2",
181   //                              "digitizer:NewDigitizerEffTrigger");
182   // 
183   // If SetAlign, the detection elements transformations
184   // are taken from the input file and not from the code
185   // MUON->SetAlign("transform.dat");
186
187   // To generate and read scaler trigger events in rawdata
188   // MUON->SetTriggerScalerEvent();
189
190   // If you want to play with builders, first reset the geometry builder,
191   // and then add yours.
192   //  MUON->ResetGeometryBuilder();
193   //  MUON->AddGeometryBuilder(new AliMUONSt1GeometryBuilderV2(MUON));
194   //  MUON->AddGeometryBuilder(new AliMUONSt2GeometryBuilderV2(MUON));
195   //  MUON->AddGeometryBuilder(new AliMUONSlatGeometryBuilder(MUON));
196   //  MUON->AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(MUON));
197 }
198
199 Float_t EtaToTheta(Float_t arg){
200   return (180./TMath::Pi())*2.*atan(exp(-arg));
201 }