Example macro for the creation of tags (P.Christakoglou)
[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
6b1e4b22 5void Config(char directory[100]="", char option[6]="param")
8d6c1ae0 6{
7 //
8 // Config file for MUON test
6570c14d 9 //
8d6c1ae0 10
11 //=====================================================================
12 // Libraries required by geant321
13 gSystem->Load("libgeant321.so");
6570c14d 14 new TGeant3TGeo("C++ Interface to Geant3");
8d6c1ae0 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
33 //=======================================================================
34 // Set External decayer
35 TVirtualMCDecayer *decayer = new AliDecayerPythia();
36 decayer->SetForceDecay(kAll);
37 decayer->Init();
38 gMC->SetExternalDecayer(decayer);
39
40 //
41 //=======================================================================
42 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
43 gMC->SetProcess("DCAY",1);
44 gMC->SetProcess("PAIR",1);
45 gMC->SetProcess("COMP",1);
46 gMC->SetProcess("PHOT",1);
47 gMC->SetProcess("PFIS",0);
48 gMC->SetProcess("DRAY",0);
49 gMC->SetProcess("ANNI",1);
50 gMC->SetProcess("BREM",1);
51 gMC->SetProcess("MUNU",1);
52 gMC->SetProcess("CKOV",1);
53 gMC->SetProcess("HADR",1);
54 gMC->SetProcess("LOSS",2);
55 gMC->SetProcess("MULS",1);
56 gMC->SetProcess("RAYL",1);
57
58 Float_t cut = 1.e-3; // 1MeV cut by default
59 Float_t tofmax = 1.e10;
60
61 gMC->SetCut("CUTGAM", cut);
62 gMC->SetCut("CUTELE", cut);
63 gMC->SetCut("CUTNEU", cut);
64 gMC->SetCut("CUTHAD", cut);
65 gMC->SetCut("CUTMUO", cut);
66 gMC->SetCut("BCUTE", cut);
67 gMC->SetCut("BCUTM", cut);
68 gMC->SetCut("DCUTE", cut);
69 gMC->SetCut("DCUTM", cut);
70 gMC->SetCut("PPCUTM", cut);
71 gMC->SetCut("TOFMAX", tofmax);
72 //
73 //=======================================================================
74 // ************* STEERING parameters FOR ALICE SIMULATION **************
75 // Chamber positions
76 // From AliMUONConstants class we get :
77 // Position Z (along beam) of the chambers (in cm)
78 // (from AliMUONConstants class):
79 // 533.5, 546.5, 678.5, 693.5, 964.0, 986.0, 1251.5, 1278.5,
80 // 1416.5, 1443.5, 1610, 1625., 1710., 1725.
81 // Internal Radius (in cm)
82 // 36.4, 46.2, 66.0, 80., 80., 100., 100.
83 // External Radius (in cm)
84 // 183., 245., 395., 560., 563., 850., 900.
85 //=======================================================================
86 if (!strcmp(option,"box")) {
87 AliGenBox * gener = new AliGenBox(1);
88 gener->SetMomentumRange(20.,20.1);
89 gener->SetPhiRange(0., 360.);
90 gener->SetThetaRange(171.000,178.001);
91 gener->SetPart(13); // Muons
92 gener->SetOrigin(0.,0., 0.); //vertex position
93 gener->SetSigma(0.0, 0.0, 0.0); //Sigma in (X,Y,Z) (cm) on IP position
94 }
95 if (!strcmp(option,"gun")) {
96 //*********************************************
97 // Example for Fixed Particle Gun *
98 //*********************************************
99 AliGenFixed *gener = new AliGenFixed(ntracks);
100 gener->SetMomentum(10);
101 gener->SetPhiRange(0.);
102 gener->SetThetaRange(0.);
103 gener->SetOrigin(30,30,1200);//vertex position
104 gener->SetPart(13); //GEANT particle type 13 is muons
105 }
106 if (!strcmp(option,"scan")) {
107 AliGenScan *gener = new AliGenScan(-1);
108 gener->SetMomentumRange(10,10);
109 gener->SetPhiRange(0, 0);
110 gener->SetThetaRange(-180, -180);
111 //vertex position
112 //gener->SetSigma(1,1,0); //Sigma in (X,Y,Z) (cm) on IP position
113 gener->SetPart(kRootino);
114 gener->SetRange(100, -300., 300., 100, -300., 300., 1, 2000, 2000);
115 }
116 if (!strcmp(option,"param")) {
117 //*******************************************************
118 // Example for J/psi or Upsilon Production from Parameterisation *
119 //*******************************************************
120 AliGenParam *gener = new AliGenParam(1, AliGenMUONlib::kUpsilon);
121 gener->SetMomentumRange(0,999);
122 gener->SetPtRange(0,100.);
123 gener->SetPhiRange(0., 360.);
124 gener->SetCutOnChild(1);
125 gener->SetChildPhiRange(0.,360.);
126 gener->SetChildThetaRange(171.0,178.0);
127 gener->SetOrigin(0,0,0); //vertex position gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
128 gener->SetForceDecay(kDiMuon);
129 gener->SetTrackingFlag(1);
130 gener->Init();
131 }
132 //=============================================================
133 // Field (L3 0.4 T)
134 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k4kG);
135 gAlice->SetField(field);
136
137 //=================== Alice BODY parameters =============================
138 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
139 //=================== ABSO parameters ============================
140 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
141 //=================== DIPO parameters ============================
142 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
143 //================== HALL parameters ============================
144 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
145 //=================== PIPE parameters ============================
146 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
147 //=================== SHIL parameters ============================
148 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
149 //=================== MUON Subsystem ===========================
150 cout << ">>> Config.C: Creating AliMUONv1 ..."<<endl;
a2da7817 151
8d6c1ae0 152 // New MUONv1 version (geometry defined via builders)
153 AliMUON *MUON = new AliMUONv1("MUON", "default");
a2da7817 154 //AliMUON *MUON = new AliMUONv1("MUON", "AliMUONFactoryV3"); // New segmentation
6570c14d 155 // If align = true, the detection elements transformations
156 // are taken from the input files and not from the code
8d6c1ae0 157 //MUON->SetAlign(true);
8d6c1ae0 158 MUON->AddGeometryBuilder(new AliMUONSt1GeometryBuilderV2(MUON));
e768a44b 159 MUON->AddGeometryBuilder(new AliMUONSt2GeometryBuilderV2(MUON));
160 MUON->AddGeometryBuilder(new AliMUONSlatGeometryBuilder(MUON));
161 MUON->AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(MUON));
8d6c1ae0 162}
163
164Float_t EtaToTheta(Float_t arg){
165 return (180./TMath::Pi())*2.*atan(exp(-arg));
166}