- Adding a new group for macros
[u/mrichter/AliRoot.git] / MUON / Config.C
CommitLineData
8d6c1ae0 1// Config file test for MUON spectormeter
2// Remember to define the directory and option
3// gAlice->SetConfigFunction("Config('$HOME','box');");
4
40312696 5void Config(char directory[100]="", char option[6]="param", const char* digitstore="AliMUONDigitStoreV2S")
8d6c1ae0 6{
bd0cb923 7 //=====================================================================
8d6c1ae0 8 // Config file for MUON test
8d6c1ae0 9 //=====================================================================
10 // Libraries required by geant321
11 gSystem->Load("libgeant321.so");
6570c14d 12 new TGeant3TGeo("C++ Interface to Geant3");
8d6c1ae0 13 //=======================================================================
14 // Create the output file
15 Text_t filename[100];
16 sprintf(filename,"%sgalice.root",directory);
17 cout << ">>> Output file is " << filename << endl;
18 cout << ">>> Config.C: Creating Run Loader ..."<<endl;
19 AliRunLoader* rl=0x0;
20 rl = AliRunLoader::Open(
bd0cb923 21 filename, AliConfig::GetDefaultEventFolderName(), "recreate");
22 if (rl == 0x0)
23 { gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
24 return; }
8d6c1ae0 25 rl->SetCompressionLevel(2);
26 rl->SetNumberOfEventsPerFile(100);
27 gAlice->SetRunLoader(rl);
bd0cb923 28 //=======================================================================
29 // For having more debuging messages
b5fb1f3e 30 //AliLog::SetModuleDebugLevel("MUON", 1);
8d6c1ae0 31 //=======================================================================
32 // Set External decayer
33 TVirtualMCDecayer *decayer = new AliDecayerPythia();
34 decayer->SetForceDecay(kAll);
35 decayer->Init();
36 gMC->SetExternalDecayer(decayer);
8d6c1ae0 37 //=======================================================================
38 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
bd0cb923 39 gMC->SetProcess("DCAY",1);
40 gMC->SetProcess("PAIR",1);
41 gMC->SetProcess("COMP",1);
42 gMC->SetProcess("PHOT",1);
43 gMC->SetProcess("PFIS",0);
44 gMC->SetProcess("DRAY",0);
45 gMC->SetProcess("ANNI",1);
46 gMC->SetProcess("BREM",1);
47 gMC->SetProcess("MUNU",1);
48 gMC->SetProcess("CKOV",1);
49 gMC->SetProcess("HADR",1);
50 gMC->SetProcess("LOSS",2);
51 gMC->SetProcess("MULS",1);
52 gMC->SetProcess("RAYL",1);
53 Float_t cut = 1.e-3; // 1MeV cut by default
54 Float_t tofmax = 1.e10;
55 gMC->SetCut("CUTGAM", cut);
56 gMC->SetCut("CUTELE", cut);
57 gMC->SetCut("CUTNEU", cut);
58 gMC->SetCut("CUTHAD", cut);
59 gMC->SetCut("CUTMUO", cut);
60 gMC->SetCut("BCUTE", cut);
61 gMC->SetCut("BCUTM", cut);
62 gMC->SetCut("DCUTE", cut);
63 gMC->SetCut("DCUTM", cut);
64 gMC->SetCut("PPCUTM", cut);
65 gMC->SetCut("TOFMAX", tofmax);
8d6c1ae0 66 //=======================================================================
bd0cb923 67 // Examples of generators. Only option param is sistematically tested
8d6c1ae0 68 if (!strcmp(option,"box")) {
69 AliGenBox * gener = new AliGenBox(1);
70 gener->SetMomentumRange(20.,20.1);
71 gener->SetPhiRange(0., 360.);
72 gener->SetThetaRange(171.000,178.001);
9bb2665f 73 gener->SetPart(kMuonMinus); // Muons
8d6c1ae0 74 gener->SetOrigin(0.,0., 0.); //vertex position
75 gener->SetSigma(0.0, 0.0, 0.0); //Sigma in (X,Y,Z) (cm) on IP position
76 }
77 if (!strcmp(option,"gun")) {
f47563ed 78 AliGenFixed *gener = new AliGenFixed(1);
8d6c1ae0 79 gener->SetMomentum(10);
80 gener->SetPhiRange(0.);
81 gener->SetThetaRange(0.);
f47563ed 82 gener->SetOrigin(30,30,-1200);//vertex position
9bb2665f 83 gener->SetPart(kMuonMinus); //GEANT particle type 13 is muons
8d6c1ae0 84 }
85 if (!strcmp(option,"scan")) {
86 AliGenScan *gener = new AliGenScan(-1);
87 gener->SetMomentumRange(10,10);
88 gener->SetPhiRange(0, 0);
89 gener->SetThetaRange(-180, -180);
90 //vertex position
91 //gener->SetSigma(1,1,0); //Sigma in (X,Y,Z) (cm) on IP position
92 gener->SetPart(kRootino);
93 gener->SetRange(100, -300., 300., 100, -300., 300., 1, 2000, 2000);
94 }
95 if (!strcmp(option,"param")) {
8d6c1ae0 96 AliGenParam *gener = new AliGenParam(1, AliGenMUONlib::kUpsilon);
97 gener->SetMomentumRange(0,999);
98 gener->SetPtRange(0,100.);
99 gener->SetPhiRange(0., 360.);
100 gener->SetCutOnChild(1);
101 gener->SetChildPhiRange(0.,360.);
102 gener->SetChildThetaRange(171.0,178.0);
103 gener->SetOrigin(0,0,0); //vertex position gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
104 gener->SetForceDecay(kDiMuon);
105 gener->SetTrackingFlag(1);
106 gener->Init();
107 }
bd0cb923 108 if (!strcmp(option,"hijing")) { //Hijing generator from ConfigPPR in macros
109 AliGenHijing *gener = new AliGenHijing(-1);
110 // centre of mass energy
111 gener->SetEnergyCMS(5500.);
112 // reference frame
113 gener->SetReferenceFrame("CMS");
114 // projectile
115 gener->SetProjectile("A", 208, 82);
116 gener->SetTarget ("A", 208, 82);
117 // tell hijing to keep the full parent child chain
118 gener->KeepFullEvent();
119 // enable jet quenching
120 gener->SetJetQuenching(1);
121 // enable shadowing
122 gener->SetShadowing(1);
123 // neutral pion and heavy particle decays switched off
124 gener->SetDecaysOff(1);
125 // Don't track spectators
126 gener->SetSpectators(0);
127 // kinematic selection
128 gener->SetSelectAll(0);
129 // impact parameter range
130 gener->SetImpactParameterRange(0., 5.); // 0. - 5. fm corresponds to ~10% most central
131 gener->Init();
132 }
133 if (!strcmp(option,"muoncocktail")) { // Muon cocktail for PbPb
134 AliGenMUONCocktail * gener = new AliGenMUONCocktail();
135 gener->SetPtRange(1.,100.); // Transverse momentum range
136 gener->SetPhiRange(0.,360.); // Azimuthal angle range
137 gener->SetYRange(-4.0,-2.5);
138 gener->SetMuonPtCut(0.5);
139 gener->SetMuonThetaCut(171.,178.);
140 gener->SetMuonMultiplicity(2);
141 gener->SetImpactParameterRange(0.,5.); // 10% most centra PbPb collisions
142 gener->SetVertexSmear(kPerTrack);
143 gener->SetOrigin(0,0,0); // Vertex position
144 gener->SetSigma(0,0,0.0); // Sigma in (X,Y,Z) (cm) on IP position
145 gener->Init();
146 }
8d6c1ae0 147 //=============================================================
bd0cb923 148 // Field (L3 0.5 T)
149 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
8d6c1ae0 150 gAlice->SetField(field);
bd0cb923 151 //=============================================================
8d6c1ae0 152 //=================== Alice BODY parameters =============================
153 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
154 //=================== ABSO parameters ============================
654302a0 155 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
8d6c1ae0 156 //=================== DIPO parameters ============================
654302a0 157 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 2");
8d6c1ae0 158 //================== HALL parameters ============================
654302a0 159 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
8d6c1ae0 160 //=================== PIPE parameters ============================
654302a0 161 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
8d6c1ae0 162 //=================== SHIL parameters ============================
654302a0 163 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 2");
e107e560 164
8d6c1ae0 165 //=================== MUON Subsystem ===========================
9bf406e1 166 AliMUON *MUON = new AliMUONv1("MUON", "default");
e107e560 167
2849388f 168 // The 3 switches below are to be used for the trigger code
08db3bf4 169 // their default value is set in AliMUON.h
afb3ccf0 170 // activate trigger cluster-size (0=default, 1=cluster-size according to AliMUONResponseTriggerV1
171 // MUON->SetTriggerResponseV1(0);
08db3bf4 172 // activate 4/4 trigger coincidence (0=default (coinc 3/4), 1=coinc 4/4)
afb3ccf0 173 // MUON->SetTriggerCoinc44(0);
174 // activate trigger chamber efficiency by cells (0=default, 1=trigger efficiency according to AliMUONTriggerEfficiencyCells
08db3bf4 175 // MUON->SetTriggerEffCells(0);
176
5ee595ac 177 // Use SetDigitStoreClassName() to change the digitStore implementation used by (s)digitizer
178 MUON->SetDigitStoreClassName(digitstore);
179
180 cout << "MUON DigitStore is " << MUON->DigitStoreClassName().Data() << endl;
181
0aaf64c2 182 // Noise-only digits in tracker/trigger (0=no noise, 1=default (noise in tracker), 2=noise in tracker and trigger):
d07a7866 183 //MUON->SetDigitizerWithNoise(kFALSE);
5812b5ad 184
bee76de2 185 // Use fast raw data decoder
186 // MUON->SetFastDecoder(kTRUE);
187
826f8de7 188 //
599766cd 189 // If SetAlign, the detection elements transformations
190 // are taken from the input file and not from the code
191 // MUON->SetAlign("transform.dat");
df729182 192
d83a3fce 193 // To generate and read scaler trigger events in rawdata
194 // MUON->SetTriggerScalerEvent();
df729182 195
e107e560 196 // If you want to play with builders, first reset the geometry builder,
197 // and then add yours.
198 // MUON->ResetGeometryBuilder();
199 // MUON->AddGeometryBuilder(new AliMUONSt1GeometryBuilderV2(MUON));
200 // MUON->AddGeometryBuilder(new AliMUONSt2GeometryBuilderV2(MUON));
201 // MUON->AddGeometryBuilder(new AliMUONSlatGeometryBuilder(MUON));
202 // MUON->AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(MUON));
8d6c1ae0 203}