1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // Cosmic Rays ALICE Trigger //
21 // This class contains the basic functions for the Cosmic Ray ALICE //
22 // detector. Functions specific to one particular geometry are //
23 // contained in the derived classes //
27 <img src="picts/AliACORDEClass.gif">
29 <p>The responsible person for this module is
30 <a href="mailto:Enrique.Gamez.Flores@cern.ch">Enrique Gamez Flores</a>.
38 ///////////////////////////////////////////////////////////////////////////////
40 #include <TClonesArray.h>
42 #include <TVirtualMC.h>
43 #include <TGeoManager.h>
45 #include "AliACORDE.h"
48 #include "AliACORDERawData.h"
52 //_____________________________________________________________________________
53 AliACORDE::AliACORDE()
59 // Default constructor
63 //_____________________________________________________________________________
64 AliACORDE::AliACORDE(const char *name, const char *title)
65 : AliDetector(name, title),
66 fCreateCavern(kFALSE),
71 // Standard constructor
74 //_____________________________________________________________________________
75 AliACORDE::~AliACORDE()
82 //_____________________________________________________________________________
83 void AliACORDE::CreateMaterials()
85 // Magnatic field inside the pit
86 Int_t isxfld = gAlice->Field()->Integ();
87 Float_t sxmgmx = gAlice->Field()->Max();
89 //Magnetic field above the Magnet.
90 Int_t xfield = 0; // no Magnetic field.
92 Float_t xepsil = 0.1; // Tracking precission in cm. obove the pit
94 // --- Define the various materials for GEANT ---
95 Float_t epsil, stmin, tmaxfd, deemax, stemax;
98 AliMaterial(9, "ALUMINIUM0$", 26.98, 13., 2.7, 8.9, 37.2);
99 AliMaterial(29, "ALUMINIUM1$", 26.98, 13., 2.7, 8.9, 37.2);
100 AliMaterial(49, "ALUMINIUM2$", 26.98, 13., 2.7, 8.9, 37.2);
103 AliMaterial(10, "IRON0$ ", 55.85, 26., 7.87, 1.76, 17.1);
104 AliMaterial(30, "IRON1$ ", 55.85, 26., 7.87, 1.76, 17.1);
105 AliMaterial(50, "IRON2$ ", 55.85, 26., 7.87, 1.76, 17.1);
108 AliMaterial(15, "AIR0$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
109 AliMaterial(35, "AIR1$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
110 AliMaterial(55, "AIR2$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
111 AliMaterial(75, "AIR3$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
112 AliMaterial(95, "AIR4$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
115 // Scintillator material polystyrene
116 Float_t aP[2] = {12.011, 1.00794};
117 Float_t zP[2] = {6.0, 1.0};
118 Float_t wP[2] = {1.0, 1.0};
120 AliMixture(13, "Polystyrene$", aP, zP, dP, -2, wP);
121 // Subalpine Molasse over the ALICE hall.
122 Float_t aMolasse[10] = { 1., 12.01, 15.994, 22.99, 24.305, 26.98, 28.086, 39.1, 40.08, 55.85 };
123 Float_t zMolasse[10] = {1., 6., 8., 11., 12., 13., 14., 19., 20., 26.};
124 Float_t wMolasse[10] = {0.008, 0.043, 0.485, 0.007, 0.042, 0.037, 0.215, 0.023, 0.1, 0.04};
125 Float_t dMolasse = 2.40;
126 AliMixture(24, "Molasse$", aMolasse, zMolasse, dMolasse, 10, wMolasse);
129 // Defines tracking media parameters.
130 // Les valeurs sont commentees pour laisser le defaut
131 // a GEANT (version 3-21, page CONS200), f.m.
132 epsil = .001; // Tracking precision, Inside the pit
133 stemax = -1.; // Maximum displacement for multiple scattering
134 tmaxfd = -20.; // Maximum angle due to field deflection
135 deemax = -.3; // Maximum fractional energy loss, DLS
139 Float_t atmaxfd = 10.;
140 Float_t adeemax = -0.1;
141 Float_t aepsil = 0.1;
142 Float_t astmin = -10.;
146 AliMedium(9, "ALU_C0 ", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
147 AliMedium(29, "ALU_C1 ", 29, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
148 AliMedium(49, "ALU_C2 ", 49, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
151 AliMedium(10, "FE_C0 ", 10, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
152 AliMedium(30, "FE_C1 ", 30, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
153 AliMedium(50, "FE_C2 ", 50, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
156 AliMedium(15, "AIR_C0 ", 15, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
157 AliMedium(35, "AIR_C1 ", 35, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
158 AliMedium(55, "AIR_C2 ", 55, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
159 AliMedium(75, "AIR_C4 ", 75, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
160 AliMedium(95, "AIR_C5 ", 95, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
164 // The scintillator of the CPV made of Polystyrene
165 // scintillator -> idtmed[1112]
166 AliMedium(12 , "CPV scint.0 ", 13, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
167 AliMedium(13 , "CPV scint.1 ", 13, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
168 AliMedium(14 , "CPV scint.2 ", 13, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
170 // Molasse -> idtmed[1123]
171 AliMedium(24 , "Molasse ", 24, 0, xfield, xfieldm, tmaxfd, stemax, deemax, xepsil, stmin);
173 // Concrete, in case if we need to put hte shafts by ourselves.
175 Float_t aconc[10] = { 1.,12.01,15.994,22.99,24.305,26.98,28.086,39.1,40.08,55.85 };
176 Float_t zconc[10] = { 1.,6.,8.,11.,12.,13.,14.,19.,20.,26. };
177 Float_t wconc[10] = { .01,.001,.529107,.016,.002,.033872,.337021,.013,.044,.014 };
179 AliMixture(17, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
181 AliMedium(17, "CC_C0 ", 17, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
182 AliMedium(27, "CC_C1 ", 17, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); // MX24
183 AliMedium(37, "CC_C2 ", 17, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); // PM25
184 AliMedium(47, "CC_C3 ", 17, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); // PGC2
188 //_____________________________________________________________________________
189 void AliACORDE::SetTreeAddress()
194 sprintf(branchname,"%s",GetName());
195 // Branch address for hit tree
196 TTree *treeH = fLoader->TreeH();
198 branch = treeH->GetBranch(branchname);
199 if (branch) branch->SetAddress(&fHits);
203 //_____________________________________________________________________________
204 void AliACORDE::MakeBranch(Option_t* opt)
207 // Initializes the branches of the ACORDE inside the trees written
210 const char* oH = strstr(opt, "H");
211 if ( fLoader->TreeH() && oH && (fHits == 0x0) ) {
212 fHits = new TClonesArray("AliACORDEhit", 1000);
215 AliDetector::MakeBranch(opt);
218 AliLoader* AliACORDE::MakeLoader(const char* topfoldername)
221 AliDebug(1,Form("Creating AliACORDELoader, Top folder is %s ",
223 fLoader = new AliACORDELoader(GetName(),topfoldername);
228 AliDigitizer* AliACORDE::CreateDigitizer(AliRunDigitizer* manager) const
232 return new AliACORDEDigitizer(manager);
235 void AliACORDE::Digits2Raw()
237 // Produce Raw data starting from digits
239 // 2. From digits get an array with the state of the modules
245 // 1.1 Get detector, load digits and set branch
246 AliACORDE* acorde = (AliACORDE*)gAlice->GetDetector("ACORDE");
247 fLoader->LoadDigits("READ");
248 TTree* treeD = fLoader->TreeD();
250 Error("Digits2Raw", "no digits tree");
253 TClonesArray *adigits = new TClonesArray ("AliACORDEdigit", 1000);
254 treeD->GetBranch("ACORDEdigit")->SetAddress(&adigits);
255 // 1.2 Get first entry (there is always only one)
256 acorde->ResetDigits();
259 // 2. From digits get an array with the state of the modules
260 // 2.1 Define and initialize the array
262 for (Int_t i=0;i<60;i++) Modules[i]= kFALSE;
263 // 2.2 Loop over all digits
264 Int_t ndig = adigits->GetEntriesFast();
265 for (Int_t idig=0;idig<ndig;idig++) {
266 // 2.3 set the array entry for each digit
267 AliACORDEdigit* digit = (AliACORDEdigit*) adigits->At(idig);
268 Int_t mod = digit->GetModule();
269 Modules[mod-1]=kTRUE;
272 fLoader->UnloadDigits();
275 AliACORDERawData rawdata;
276 rawdata.WriteACORDERawData(Modules);
279 //_____________________________________________________________________________
280 void AliACORDE::AddAlignableVolumes() const
283 // Create entries for alignable volumes associating the symbolic volume
284 // name with the corresponding volume path. Needs to be syncronized with
285 // eventual changes in the geometry.
287 TString vpstr1 = "ALIC_1/ACORDE1_";
288 TString snstr1="ACORDE/Array";
289 TString volpath, symname;
291 for(Int_t cnt=1; cnt<=3; cnt++){
296 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
297 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));