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