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 **************************************************************************/
16 /* $Id: AliAD.cxx $ */
18 ///////////////////////////////////////////////////////////////////////////
20 // AD (ALICE Diffractive) Detector //
22 // This class contains the base procedures for the AD detector //
23 // All comments should be sent to : //
26 ///////////////////////////////////////////////////////////////////////////
29 // --- Standard libraries ---
30 #include <Riostream.h>
33 // --- ROOT libraries ---
41 #include "TClonesArray.h"
42 #include "TGeoGlobalMagField.h"
44 #include "TStopwatch.h"
45 #include "TParameter.h"
48 // --- AliRoot header files ---
53 #include "AliADLoader.h"
54 #include "AliADDigitizer.h"
55 #include "AliDigitizationInput.h"
56 #include "AliADdigit.h"
57 #include "AliADSDigit.h"
59 #include "AliRawReader.h"
60 #include "AliCDBManager.h"
61 #include "AliCDBEntry.h"
62 #include "AliADReconstructor.h"
65 //__________________________________________________________________
68 fSetADAToInstalled(0),
71 /// Default Constructor
76 //_____________________________________________________________________________
77 AliAD::AliAD(const char *name, const char *title)
78 : AliDetector(name,title),
79 fSetADAToInstalled(kTRUE),
80 fSetADCToInstalled(kTRUE)
84 // Standard constructor for AD Detector
89 //_____________________________________________________________________________
93 // Default destructor for AD Detector
98 //_____________________________________________________________________________
99 void AliAD::CreateMaterials()
102 // MATERIALS FOR ADC AND ADA
105 // Parameters for simulation scope for ADA and ADC (stolen from AliVZEROv7::CreateMaterials )
106 Int_t fieldType = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ(); // Field type
107 Double_t maxField = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max(); // Field max.
108 Double_t maxBending = 10; // Max Angle
109 Double_t maxStepSize = 0.01; // Max step size
110 Double_t maxEnergyLoss = 1; // Max Delta E
111 Double_t precision = 0.003; // Precision
112 Double_t minStepSize = 0.003; // Minimum step size
113 Float_t density, as[11], zs[11], ws[11];
114 Double_t radLength, absLength, a_ad, z_ad;
118 // Parameters for AD scintillator: NE-102 (BC400)
120 // NE-102, has the following properties : (from internet, need better reference)
121 // Density : ca. 1.03 g/cm3
122 // Electrons/cm3: 3.39 x 10^23
123 // H atoms/cm3: 5.28 x 10^22
124 // C atoms/cm3: 4.78 x 10^22
125 // Ratio of H to C : 1.104 .
126 // wavelength of emission : ~4.23 nm.
127 // Decay time : ~2.4 ns.
128 // Luminescent efficiency : typically 18% of NaI(Tl)
129 // Photons/MeV: 2.5 x 10^4
132 as[0] = 1.00794; as[1] = 12.011;
133 zs[0] = 1.; zs[1] = 6.;
134 ws[0] = 5.23; ws[1] = 4.74;
137 AliMixture( id, "NE102", as, zs, density, -2, ws );
138 AliMedium( id, "NE102", id, 1, fieldType, maxField, maxBending, maxStepSize,
139 maxEnergyLoss, precision, minStepSize );
142 // Parameters for lightGuide:
143 // TODO check material
144 // Should be Poly(methyl methacrylate) (PMMA) acrylic
146 // Density 1.18 g/cm3
147 // Mixture PMMA Aeff=12.3994 Zeff=6.23653 rho=1.18 radlen=34.0677 intlen=63.3073
148 // Element #0 : C Z= 6.00 A= 12.01 w= 0.600 natoms=5
149 // Element #1 : H Z= 1.00 A= 1.01 w= 0.081 natoms=8
150 // Element #2 : O Z= 8.00 A= 16.00 w= 0.320 natoms=2
152 // Carbon Hydrogen Oxygen
153 as[0] = 12.0107; as[1] = 1.00794; as[2] = 15.9994;
154 zs[0] = 6.; zs[1] = 1.; zs[2] = 8.;
155 ws[0] = 0.60; ws[1] = 0.081; ws[2] = 0.32;
158 AliMixture( id, "PMMA", as, zs, density, 3, ws );
159 AliMedium( id,"PMMA", id, 1, fieldType, maxField, maxBending, maxStepSize,
160 maxEnergyLoss, precision, minStepSize );
164 // Niquel Iron Molybdenum Manganese
165 as[0] = 58.6934; as[1] = 55.845; as[2] = 95.94; as[3] = 54.9380;
166 zs[0] = 28.; zs[1] = 26.; zs[2] = 42.; zs[3] = 25.;
167 ws[0] = 0.802; ws[1] = 0.14079; ws[2] = 0.0485; ws[3] = 0.005;
168 // Silicon Chromium Cobalt Aluminium
169 as[4] = 28.0855; as[5] = 51.9961; as[6] = 58.9332; as[7] = 26.981539;
170 zs[4] = 14.; zs[5] = 24.; zs[6] = 27.; zs[7] = 13.;
171 ws[4] = 0.003; ws[5] = 0.0002; ws[6] = 0.0002; ws[7] = 0.0001;
172 // Carbon Phosphorus Sulfur
173 as[8] = 12.0107; as[9] = 30.97376; as[10] = 32.066;
174 zs[8] = 6.; zs[9] = 15.; zs[10] = 16.;
175 ws[8] = 0.00015; ws[9] = 0.00005; ws[10] = 0.00001;
178 AliMixture( id, "MuMetal", as, zs, density, 11, ws );
179 AliMedium( id,"MuMetal", id, 1, fieldType, maxField, maxBending, maxStepSize,
180 maxEnergyLoss, precision, minStepSize );
182 // Parameters for ADCPMA: Aluminium
189 AliMaterial (id, "Alum", a_ad, z_ad, density, radLength, absLength, 0, 0 );
190 AliMedium( id, "Alum", id, 1, fieldType, maxField, maxBending, maxStepSize,
191 maxEnergyLoss, precision, minStepSize );
193 // Parameters for ADCPMG: Glass for the simulation Aluminium
201 AliMaterial( id, "Glass", a_ad, z_ad, density, radLength, absLength, 0, 0 );
202 AliMedium( id, "Glass", id, 1, fieldType, maxField, maxBending, maxStepSize,
203 maxEnergyLoss, precision, minStepSize );
207 //_____________________________________________________________________________
208 void AliAD::SetTreeAddress()
211 // Sets tree address for hits.
216 snprintf(branchname,19,"%s",GetName());
217 // Branch address for hit tree
218 TTree *treeH = fLoader->TreeH();
221 branch = treeH->GetBranch(branchname);
222 if (branch) branch->SetAddress(&fHits);
227 //_____________________________________________________________________________
228 void AliAD::MakeBranch(Option_t* opt)
230 const char* oH = strstr(opt,"H");
231 if (fLoader->TreeH() && oH && (fHits==0x0))
233 fHits = new TClonesArray("AliADhit",1000);
236 AliDetector::MakeBranch(opt);
238 //_____________________________________________________________________________
239 AliLoader* AliAD::MakeLoader(const char* topfoldername)
242 AliDebug(1,Form("Creating AliADLoader, Top folder is %s ",topfoldername));
243 fLoader = new AliADLoader(GetName(),topfoldername);
247 //_____________________________________________________________________________
248 AliDigitizer* AliAD::CreateDigitizer(AliDigitizationInput* digInput) const
251 // Creates a digitizer for AD
253 return new AliADDigitizer(digInput);
256 //_____________________________________________________________________________
258 void AliAD::Digits2Raw()
260 // produces raw data from digits
261 // for AD not implemented yet (needs detailed hardware info)
264 //_____________________________________________________________________________
266 Bool_t AliAD::Raw2SDigits(AliRawReader* rawReader)
268 // reads raw data to produce digits
269 // for AD not implemented yet (needs detailed hardware info)