]>
Commit | Line | Data |
---|---|---|
2012850d | 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 | // Geometry class for EMCAL : singleton | |
b13bbe81 | 20 | // EMCAL consists of layers of scintillator and lead |
2012850d | 21 | // |
b13bbe81 | 22 | //*-- Author: Sahal Yacoob (LBL / UCT) |
23 | // and : Yves Schutz (SUBATECH) | |
24 | // and : Jennifer Klay (LBL) | |
2012850d | 25 | |
26 | // --- ROOT system --- | |
27 | ||
28 | // --- Standard library --- | |
29 | ||
30 | #include <iostream.h> | |
31 | ||
32 | // --- AliRoot header files --- | |
33 | ||
34 | #include "AliEMCALGeometry.h" | |
35 | #include "AliConst.h" | |
36 | ||
b13bbe81 | 37 | ClassImp(AliEMCALGeometry); |
2012850d | 38 | |
b13bbe81 | 39 | AliEMCALGeometry *AliEMCALGeometry::fgGeom = 0; |
40 | Bool_t AliEMCALGeometry::fgInit = kFALSE; | |
2012850d | 41 | |
b13bbe81 | 42 | //______________________________________________________________________ |
43 | AliEMCALGeometry::~AliEMCALGeometry(void){ | |
44 | // dtor | |
2012850d | 45 | } |
b13bbe81 | 46 | //______________________________________________________________________ |
47 | void AliEMCALGeometry::Init(void){ | |
48 | // Initializes the EMCAL parameters | |
49 | ||
50 | if(!( (strcmp( fName, "EMCALArch1a" ) == 0) | | |
51 | (strcmp( fName, "EMCALArch1b" ) == 0) | | |
52 | (strcmp( fName, "EMCALArch2a" ) == 0) | | |
53 | (strcmp( fName, "EMCALArch2b" ) == 0) )){ | |
54 | fgInit = kFALSE; | |
55 | cout <<"Instance " << fName << " undefined" << endl; | |
56 | } // end if | |
57 | fgInit = kTRUE; | |
58 | ||
59 | // geometry | |
60 | fAirGap = 5.0; | |
61 | fArm1PhiMin = 0.0; | |
62 | fArm1PhiMax = 120.0; | |
63 | ||
64 | fIPDistance = 454.0; | |
65 | fZLength = 817.0; | |
66 | fEnvelop[0] = fIPDistance; | |
67 | fEnvelop[2] = fZLength; | |
68 | fGap2Active = 1.0; | |
69 | fShellThickness = 3.18 + 1.2 + (double)((2*fNLayers -3)/2); | |
70 | fEnvelop[1] = fIPDistance + fShellThickness; | |
71 | ||
72 | if (((strcmp( fName, "EMCALArch1a" )) == 0) | | |
73 | ((strcmp( fName, "EMCALArch1b" )) == 0)){ | |
74 | fNZ = 96; | |
75 | fNPhi = 144; | |
76 | } // end if | |
77 | if (((strcmp( fName, "EMCALArch2a" )) == 0) | | |
78 | ((strcmp( fName, "EMCALArch2b" )) == 0)){ | |
79 | fNZ = 112; | |
80 | fNPhi = 168; | |
81 | } // end if | |
82 | if (((strcmp( fName, "EMCALArch1a" )) == 0) | | |
83 | ((strcmp( fName, "EMCALArch2a" )) == 0)){ | |
84 | fNLayers = 21; | |
85 | } // end if | |
86 | if (((strcmp( fName, "EMCALArch1b" )) == 0) | | |
87 | ((strcmp( fName, "EMCALArch2b" )) == 0)){ | |
88 | fNLayers = 25; | |
89 | } // end if | |
2012850d | 90 | } |
b13bbe81 | 91 | //______________________________________________________________________ |
92 | AliEMCALGeometry * AliEMCALGeometry::GetInstance(){ | |
93 | // Returns the pointer of the unique instance | |
2012850d | 94 | |
b13bbe81 | 95 | return (AliEMCALGeometry *) fgGeom; |
2012850d | 96 | } |
b13bbe81 | 97 | //______________________________________________________________________ |
98 | AliEMCALGeometry* AliEMCALGeometry::GetInstance(const Text_t* name, | |
99 | const Text_t* title){ | |
100 | // Returns the pointer of the unique instance | |
101 | ||
102 | AliEMCALGeometry * rv = 0; | |
103 | if ( fgGeom == 0 ) { | |
104 | if ( strcmp(name,"") == 0 ) rv = 0; | |
105 | else { | |
106 | fgGeom = new AliEMCALGeometry(name, title); | |
107 | if ( fgInit ) rv = (AliEMCALGeometry * ) fgGeom; | |
108 | else { | |
109 | rv = 0; | |
110 | delete fgGeom; | |
111 | fgGeom = 0; | |
112 | } // end if fgInit | |
113 | } // end if strcmp(name,"") | |
114 | }else{ | |
115 | if ( strcmp(fgGeom->GetName(), name) != 0 ) { | |
116 | cout << "AliEMCALGeometry <E> : current geometry is " | |
117 | << fgGeom->GetName() << endl | |
118 | << " you cannot call " << name | |
119 | << endl; | |
120 | }else{ | |
121 | rv = (AliEMCALGeometry *) fgGeom; | |
122 | } // end if | |
123 | } // end if fgGeom | |
124 | return rv; | |
2012850d | 125 | } |