]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSv11.cxx
Coding violations...
[u/mrichter/AliRoot.git] / ITS / AliITSv11.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15
16 /* $Id$ */
17
18 //////////////////////////////////////////////////////////////////////////////
19 //                                                                          //
20 //  Inner Traking System version 11                                         //
21 //  This class contains the base procedures for the Inner Tracking System   //
22 //                                                                          //
23 // Authors: R. Barbera                                                      //
24 // version 6.                                                               //
25 // Created  2000.                                                           //
26 //                                                                          //
27 //  NOTE: THIS IS THE  SYMMETRIC PPR geometry of the ITS.                   //
28 // THIS WILL NOT WORK                                                       //
29 // with the geometry or module classes or any analysis classes. You are     //
30 // strongly encouraged to uses AliITSv5.                                    //
31 //                                                                          //
32 //////////////////////////////////////////////////////////////////////////////
33 // See AliITSv11::StepManager().
34 // General C/C++ includes
35 #include <stdio.h>
36 #include <stdlib.h>
37 // General Root includes
38 #include <Riostream.h>
39 #include <TMath.h>
40 #include <float.h>
41 #include <TObjArray.h>
42 #include <TClonesArray.h>
43 #include <TLorentzVector.h>
44 #include <TObjString.h>
45 // Root Geometry includes
46 #include <TGeoManager.h>
47 #include <TGeoVolume.h>
48 #include <TGeoPcon.h>
49 #include <TGeoCone.h>
50 #include <TGeoTube.h> // contaings TGeoTubeSeg
51 #include <TGeoArb8.h>
52 #include <TGeoCompositeShape.h>
53 #include <TGeoMatrix.h>
54 #include <TGeoNode.h>
55 #include <TGeoMaterial.h>
56 #include <TGeoMedium.h>
57 #include "AliITSv11GeometrySupport.h"
58 // General AliRoot includes
59 #include "AliRun.h"
60 #include "AliMagF.h"
61 #include "AliConst.h"
62 // ITS specific includes
63 #include "AliITSgeomSPD.h"
64 #include "AliITSgeomSDD.h"
65 #include "AliITSDetType.h"
66 #include "AliITSresponseSPD.h"
67 #include "AliITSresponseSDD.h"
68 #include "AliITSsegmentationSPD.h"
69 #include "AliITSsegmentationSDD.h"
70 #include "AliITSsimulationSPD.h"
71 #include "AliITSsimulationSDD.h"
72 #include "AliITSClusterFinderSSD.h"
73 #include "AliITSv11.h"
74 #include "AliITSv11GeometrySPD.h"
75 #include "AliITSv11GeometrySDD.h"
76 #include "AliITSv11GeometrySupport.h"
77
78 ClassImp(AliITSv11)
79
80 /*
81   Some temparary #define's used untill ROOT has addoppted the proper
82   Getter in it's classes.
83   These Below are for TGeoPcon functions.
84 */
85
86 //______________________________________________________________________
87 AliITSv11::AliITSv11() : 
88     AliITS(),
89     fGeomDetOut(kFALSE),
90     fGeomDetIn(kFALSE),
91     fMajorVersion(11),
92     fMinorVersion(0),
93     fDet1(0.0),
94     fDet2(0.0),
95     fChip1(0.0),
96     fChip2(0.0),
97     fRails(0),
98     fFluid(1),
99     fSPDgeom(0),
100     fSupgeom(0){
101     // Standard default constructor for the ITS version 11.
102     // Inputs:
103     //   none.
104     // Outputs:
105     //   none.
106     // Return
107     //   A default constructed AliITSv11 class.
108
109     //fITSV = 0;
110     //fcS = 0;
111 //   fcD = 0;
112
113     SetEUCLID(kFALSE);
114 }
115 //______________________________________________________________________
116 AliITSv11::AliITSv11(Int_t debugITS,Int_t debugSPD,Int_t debugSDD,
117                      Int_t debugSSD,Int_t debugSUP) : 
118     AliITS(),
119     fGeomDetOut(kFALSE),
120     fGeomDetIn(kFALSE),
121     fMajorVersion(11),
122     fMinorVersion(0),
123     fDet1(0.0),
124     fDet2(0.0),
125     fChip1(0.0),
126     fChip2(0.0),
127     fRails(0),
128     fFluid(1),
129     fSPDgeom(0),
130     fSupgeom(0){
131     // Standard default constructor for the ITS version 11.
132     // Inputs:
133     //   Int_t    debugITS  Debug flag for ITS code (required).
134     //   Int_t    debugSPD  Debug flag for SPD geometry (default = 0).
135     //   Int_t    debugSDD  Debug flag for SDD geometry (default = 0).
136     //   Int_t    debugSSD  Debug flag for SSD geometry (default = 0).
137     //   Int_t    debugSUP  Debug flag for SUPort geometry (default = 0).
138     // Outputs:
139     //   none.
140     // Return
141     //   A Constructor for ITS geometry version 11 useful for Geometry display.
142
143     SetEUCLID(kFALSE);
144     debugSSD = debugSDD; // remove waring for unused variables.
145     SetDebug(debugITS);
146     fSPDgeom = new AliITSv11GeometrySPD(debugSPD);
147     fSDDgeom = new AliITSv11GeometrySDD(debugSDD);
148     fSupgeom = new AliITSv11GeometrySupport(debugSUP);
149 }
150 //______________________________________________________________________
151 AliITSv11::AliITSv11(const char *title) : 
152     AliITS("ITS", title),
153     fGeomDetOut(kFALSE),
154     fGeomDetIn(kFALSE),
155     fMajorVersion(11),
156     fMinorVersion(0),
157     fDet1(0.0),
158     fDet2(0.0),
159     fChip1(0.0),
160     fChip2(0.0),
161     fRails(0),
162     fFluid(1),
163     fSPDgeom(0),
164     fSupgeom(0){
165     // Standard constructor for the ITS version 11.
166     // Inputs:
167     //   const char *title  The title of for this geometry.
168     // Outputs:
169     //   none.
170     // Return
171     //   A Standard constructed AliITSv11 class.
172     SetEUCLID(kFALSE);
173     fSPDgeom = new AliITSv11GeometrySPD(GetDebug());
174     fSupgeom = new AliITSv11GeometrySupport(GetDebug());
175 }
176 //______________________________________________________________________
177 AliITSv11::~AliITSv11() {
178     // Standard destructor for the ITS version 11.
179     // Inputs:
180     //   none.
181     // Outputs:
182     //   none.
183     // Return
184     //   none.
185
186 //    if(fITSV!=0) delete fITSV;
187 //    if(fcS!=0) delete fcS;
188 //    if(fcD!=0) delete fcD;
189 }
190 //______________________________________________________________________
191 AliITSv11::AliITSv11(const AliITSv11 &source) : AliITS(source){
192     //     Copy Constructor for ITS version 11.
193     // Inputs:
194     //   AliITSv11 &source  class to be copied from.
195     // Outputs:
196     //   none.
197     // Return
198     //   none.
199
200     if(&source == this) return;
201     Error("Copy Constructor","Not allowed to copy AliITSv11");
202     return;
203 }
204 //______________________________________________________________________
205 AliITSv11& AliITSv11::operator=(const AliITSv11 &source){
206     //    Assignment operator for the ITS version 11.
207     // Inputs:
208     //   AliITSv11 &source  class to be copied from.
209     // Outputs:
210     //   none.
211     // Return
212     //   none.
213
214     if(&source == this) return *this;
215     Error("= operator","Not allowed to copy AliITSv11");
216     return *this;
217 }
218 //______________________________________________________________________
219 void AliITSv11::BuildGeometry(){
220     // This routine defines and Creates the geometry for version 11 of 
221     // the ITS for use in the simulation display routines. This is a 
222     // very simplified geometry for speed of viewing.
223     // Inputs:
224     //   none.
225     // Outputs:
226     //   none.
227     // Return
228     //   none.
229     //TVector3 t(0.0,0.0,0.0);
230
231     //if(fITSV==0) fITSV = new AliITSGeometryITSV(this,"ALIC");
232     //if(fcS==0) fcS = new AliITSGeometrySSDCone(this,t,"TSV",1);
233
234     //fcS->BuildDisplayGeometry();
235 }
236 //______________________________________________________________________
237 void AliITSv11::CreateGeometry(){
238     // This routine defines and Creates the geometry for version 11 of 
239     // the ITS. The geometry is used by the particle trasport routines,
240     // and therefore, is very detailed.
241     // Inputs:
242     //   none.
243     // Outputs:
244     //   none.
245     // Return
246     //   none.
247     TVector3 t(0.0,0.0,0.0);
248     const Double_t kcm = 1.0;
249
250     TGeoManager *mgr = gGeoManager;
251     TGeoVolume *vALIC = mgr->GetTopVolume();
252
253     TGeoPcon *sITS = new TGeoPcon("ITS Top Volume, Daughter of ALIC",
254                                   0.0,360.0,2);
255     // DefineSection(section number, Z, Rmin, Rmax).
256     sITS->DefineSection(0,-300.0*kcm,0.01*kcm,50.0*kcm);
257     sITS->DefineSection(1,+300.0*kcm,0.01*kcm,50.0*kcm);
258     TGeoVolume *vITS = new TGeoVolume("ITSV",sITS,0);
259     mgr->AddVolume(vITS);
260     vITS->SetVisibility(kFALSE);
261     vALIC->AddNode(vITS,1,0);
262     //
263     fSPDgeom->CarbonFiberSector(vITS);
264     fSDDgeom->SetGeomParameters(); // needed
265     fSDDgeom->Layer3(vITS);
266     fSDDgeom->Layer4(vITS);
267     fSupgeom->SPDCone(vITS);
268     fSupgeom->SPDThermalSheald(vITS);
269     fSupgeom->SDDCone(vITS);
270     fSupgeom->SSDCone(vITS);
271     fSupgeom->ServicesCableSupport(vITS);
272 }
273 //______________________________________________________________________
274 void AliITSv11::CreateMaterials(){
275     // Create ITS materials
276     //     This function defines the default materials used in the Geant
277     // Monte Carlo simulations for the geometries AliITSv11.
278     // In general it is automatically replaced by
279     // Inputs:
280     //   none.
281     // Outputs:
282     //   none.
283     // Return
284     //   none.
285
286     //TGeoMaterial *C  = new TGeoMaterial("ITSCarbon",12.0,6.0,2.265);
287     TGeoMaterial *matAl = new TGeoMaterial("ITSAluminum",26.981539,13.0,2.07);
288     TGeoMixture *matCfiber = new TGeoMixture("ITSCarbonFiber",6,1.930);
289     TGeoMixture *matRohacell = new TGeoMixture("ITSRohacell",6,1.930);
290     TGeoMixture *matStaselite = new TGeoMixture("ITSStaselite4411w",6,1.930);
291     TGeoMixture *matAir = new TGeoMixture("ITSAir",6,1.205*1.E-3);
292     TGeoMixture *matStainless = new TGeoMixture("ITSStainless",6,1.930);
293     //
294     Double_t medSPDcone[20];
295     medSPDcone[0] = 1.0; // imat
296     medSPDcone[1] = 0.0; // isvol
297     medSPDcone[2] = gAlice->Field()->Integ(); // ifield
298     medSPDcone[3] = gAlice->Field()->Max(); // fieldm
299     medSPDcone[4] = 1.0; // tmaxfd [degrees]
300     medSPDcone[5] = 1.0; // stemax [cm]
301     medSPDcone[6] = 0.5; // deemax [fraction]
302     medSPDcone[7] = 1.0E-3; // epsil [cm]
303     medSPDcone[8] = 0.0; // stmin [cm]
304     new TGeoMedium("ITSspdCarbonFiber",1,matCfiber,medSPDcone);
305     medSPDcone[0] += 1.0;
306     new TGeoMedium("ITSspdStaselite4411w",2,matStaselite,medSPDcone);
307     medSPDcone[0] += 1.0;
308     new TGeoMedium("ITSspdRohacell50A",3,matRohacell,medSPDcone);
309     medSPDcone[0] += 1.0;
310     new TGeoMedium("ITSspdStainlesSteal",4,matStainless,medSPDcone);
311     medSPDcone[0] += 1.0;
312     new TGeoMedium("ITSspdAir",5,matAir,medSPDcone);
313     medSPDcone[0] += 1.0;
314     new TGeoMedium("ITSspdAl",6,matAl,medSPDcone);
315     //
316     Double_t medSSDcone[20];
317     medSSDcone[0] = 1.0; // imat
318     medSSDcone[1] = 0.0; // isvol
319     medSSDcone[2] = gAlice->Field()->Integ(); // ifield
320     medSSDcone[3] = gAlice->Field()->Max(); // fieldm
321     medSSDcone[4] = 1.0; // tmaxfd [degrees]
322     medSSDcone[5] = 1.0; // stemax [cm]
323     medSSDcone[6] = 0.5; // deemax [fraction]
324     medSSDcone[7] = 1.0E-3; // epsil [cm]
325     medSSDcone[8] = 0.0; // stmin [cm]
326     new TGeoMedium("ITSssdCarbonFiber",1,matCfiber,medSSDcone);
327     medSSDcone[0] += 1.0;
328     new TGeoMedium("ITSssdStaselite4411w",2,matStaselite,medSSDcone);
329     medSSDcone[0] += 1.0;
330     new TGeoMedium("ITSssdRohacell50A",3,matRohacell,medSSDcone);
331     medSSDcone[0] += 1.0;
332     new TGeoMedium("ITSssdStainlesSteal",4,matStainless,medSSDcone);
333     medSSDcone[0] += 1.0;
334     new TGeoMedium("ITSssdAir",5,matAir,medSSDcone);
335     medSSDcone[0] += 1.0;
336     new TGeoMedium("ITSssdAl",6,matAl,medSSDcone);
337 }
338 //______________________________________________________________________
339 void AliITSv11::InitAliITSgeom(){
340     // Based on the geometry tree defined in Geant 3.21, this
341     // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS 
342     // geometry sturture.
343     // Inputs:
344     //   none.
345     // Outputs:
346     //   none.
347     // Return
348     //   none.
349 }
350 //______________________________________________________________________
351 void AliITSv11::Init(){
352     // Initialise the ITS after it has been created.
353     // Inputs:
354     //   none.
355     // Outputs:
356     //   none.
357     // Return
358     //   none.
359 }
360 //______________________________________________________________________
361 void AliITSv11::SetDefaults(){
362     // Sets the default segmentation, response, digit and raw cluster 
363     // classes to be used. These defaults can be overwritten in the
364     // macros that do these later steps. Defaults are give hear for the
365     // general user.
366     // Inputs:
367     //   none.
368     // Outputs:
369     //   none.
370     // Return
371     //   none.
372 }
373 //______________________________________________________________________
374 void AliITSv11::DrawModule(){
375     // Draw a standard set of shaded view of the ITS version 11.
376     // Inputs:
377     //   none.
378     // Outputs:
379     //   none.
380     // Return
381     //   none.
382 }
383 //______________________________________________________________________
384 void AliITSv11::StepManager(){
385     // Called for every step in the ITS, then calles the AliITShit class
386     // creator with the information to be recoreded about that hit.
387     //  The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
388     // printing of information to a file which can be used to create a .det
389     // file read in by the routine CreateGeometry(). If set to 0 or any other
390     // value except 1, the default behavior, then no such file is created nor
391     // is the extra variables and the like used in the printing allocated.
392 }
393