]>
Commit | Line | Data |
---|---|---|
e5a93224 | 1 | /************************************************************************** |
2012850d | 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 |
d297ef6e | 21 | // with scintillator fiber arranged as "shish-kebab" skewers |
ffa6d63b | 22 | // Places the the Barrel Geometry of The EMCAL at Midrapidity |
d87bd045 | 23 | // between 80 and 180(or 190) degrees of Phi and |
ffa6d63b | 24 | // -0.7 to 0.7 in eta |
d297ef6e | 25 | // |
1d46d1f6 | 26 | // EMCAL geometry tree: |
2bb3725c | 27 | // EMCAL -> superModule -> module -> tower(cell) |
1d46d1f6 | 28 | // Indexes |
2bb3725c | 29 | // absId -> nSupMod -> nModule -> (nIphi,nIeta) |
1d46d1f6 | 30 | // |
d297ef6e | 31 | // Name choices: |
32 | // EMCAL_PDC06 (geometry used for PDC06 simulations, kept for backward compatibility) | |
33 | // = equivalent to SHISH_77_TRD1_2X2_FINAL_110DEG in old notation | |
34 | // EMCAL_COMPLETE (geometry for expected complete detector) | |
35 | // = equivalent to SHISH_77_TRD1_2X2_FINAL_110DEG scTh=0.176 pbTh=0.144 | |
36 | // in old notation | |
3d841a9f | 37 | // EMCAL_4SMs - geometry for December 2009 to December 2010 run period; |
38 | // fixed bug for positions of modules inside SM | |
39 | // (first module has tilt 0.75 degree); | |
40 | // the sizes updated with last information from production | |
41 | // drawing (end of October 2010). | |
42 | // | |
43 | // | |
d297ef6e | 44 | // EMCAL_WSUC (Wayne State test stand) |
45 | // = no definite equivalent in old notation, was only used by | |
46 | // Aleksei, but kept for testing purposes | |
47 | // | |
48 | // etc. | |
49 | // | |
50 | // | |
51 | // | |
b13bbe81 | 52 | //*-- Author: Sahal Yacoob (LBL / UCT) |
53 | // and : Yves Schutz (SUBATECH) | |
54 | // and : Jennifer Klay (LBL) | |
3d841a9f | 55 | // and : Alexei Pavlinov (WSU) |
1d46d1f6 | 56 | // |
090026bf | 57 | |
0c5b726e | 58 | //--- Root header files --- |
1ae500a2 | 59 | #include <TVector2.h> |
090026bf | 60 | #include <TVector3.h> |
0c5b726e | 61 | //-- ALICE Headers. |
e5a93224 | 62 | #include "AliLog.h" |
173558f2 | 63 | |
0c5b726e | 64 | // // --- EMCAL headers |
ca8f5bd0 | 65 | #include "AliEMCALGeometry.h" |
e52475ed | 66 | #include "AliEMCALShishKebabTrd1Module.h" |
2ebdefe6 | 67 | //#include "AliEMCALRecPoint.h" |
0c5b726e | 68 | //#include "AliEMCALHistoUtilities.h" |
2012850d | 69 | |
925e6570 | 70 | ClassImp(AliEMCALGeometry) |
2012850d | 71 | |
d434833b | 72 | // these initialisations are needed for a singleton |
73 | AliEMCALGeometry *AliEMCALGeometry::fgGeom = 0; | |
0c5b726e | 74 | const Char_t* AliEMCALGeometry::fgkDefaultGeometryName = "EMCAL_COMPLETE"; |
89557f6d | 75 | // |
76 | // Usage: | |
77 | // You can create the AliEMCALGeometry object independently from anything. | |
78 | // You have to use just the correct name of geometry. If name is empty string the | |
79 | // default name of geometry will be used. | |
80 | // | |
81 | // AliEMCALGeometry* g = AliEMCALGeometry::GetInstance(name,title); // first time | |
82 | // .. | |
83 | // g = AliEMCALGeometry::GetInstance(); // after first time | |
84 | // | |
76855a3c | 85 | // MC: If you work with MC data you have to get geometry the next way: |
86 | // == ============================= | |
33c3c91a | 87 | // AliRunLoader *rl = AliRunLoader::Instance(); |
d297ef6e | 88 | // AliEMCALGeometry *geom = dynamic_cast<AliEMCAL*>(rl->GetAliRun()->GetDetector("EMCAL"))->GetGeometry(); |
89 | // TGeoManager::Import("geometry.root"); | |
dc7da436 | 90 | |
9cff4509 | 91 | AliEMCALGeometry::AliEMCALGeometry() |
0c5b726e | 92 | : AliEMCALGeoUtils() |
dc7da436 | 93 | { |
94 | // default ctor only for internal usage (singleton) | |
937d0661 | 95 | // must be kept public for root persistency purposes, |
96 | // but should never be called by the outside world | |
97 | ||
dc7da436 | 98 | AliDebug(2, "AliEMCALGeometry : default ctor "); |
99 | } | |
100 | //______________________________________________________________________ | |
9cff4509 | 101 | AliEMCALGeometry::AliEMCALGeometry(const Text_t* name, const Text_t* title) |
0c5b726e | 102 | : AliEMCALGeoUtils(name, title) |
9cff4509 | 103 | { |
104 | // ctor only for internal usage (singleton) | |
dc7da436 | 105 | AliDebug(2, Form("AliEMCALGeometry(%s,%s) ", name,title)); |
1d46d1f6 | 106 | |
dc7da436 | 107 | } |
0a4cb131 | 108 | //______________________________________________________________________ |
9cff4509 | 109 | AliEMCALGeometry::AliEMCALGeometry(const AliEMCALGeometry& geom) |
0c5b726e | 110 | : AliEMCALGeoUtils(geom) |
9cff4509 | 111 | { |
0a4cb131 | 112 | //copy ctor |
0a4cb131 | 113 | } |
114 | ||
b13bbe81 | 115 | //______________________________________________________________________ |
116 | AliEMCALGeometry::~AliEMCALGeometry(void){ | |
117 | // dtor | |
2012850d | 118 | } |
d297ef6e | 119 | |
f0377b23 | 120 | |
b13bbe81 | 121 | //______________________________________________________________________ |
122 | AliEMCALGeometry * AliEMCALGeometry::GetInstance(){ | |
05a92d59 | 123 | // Returns the pointer of the unique instance |
124 | ||
e52475ed | 125 | AliEMCALGeometry * rv = static_cast<AliEMCALGeometry *>( fgGeom ); |
126 | return rv; | |
2012850d | 127 | } |
173558f2 | 128 | |
b13bbe81 | 129 | //______________________________________________________________________ |
130 | AliEMCALGeometry* AliEMCALGeometry::GetInstance(const Text_t* name, | |
131 | const Text_t* title){ | |
132 | // Returns the pointer of the unique instance | |
133 | ||
134 | AliEMCALGeometry * rv = 0; | |
135 | if ( fgGeom == 0 ) { | |
89557f6d | 136 | if ( strcmp(name,"") == 0 ) { // get default geometry |
0c5b726e | 137 | fgGeom = new AliEMCALGeometry(fgkDefaultGeometryName, title); |
89557f6d | 138 | } else { |
139 | fgGeom = new AliEMCALGeometry(name, title); | |
140 | } // end if strcmp(name,"") | |
0c5b726e | 141 | if ( AliEMCALEMCGeometry::fgInit ) rv = (AliEMCALGeometry * ) fgGeom; |
89557f6d | 142 | else { |
143 | rv = 0; | |
144 | delete fgGeom; | |
145 | fgGeom = 0; | |
146 | } // end if fgInit | |
b13bbe81 | 147 | }else{ |
e5a93224 | 148 | if ( strcmp(fgGeom->GetName(), name) != 0) { |
87926378 | 149 | printf("\ncurrent geometry is %s : ", fgGeom->GetName()); |
150 | printf(" you cannot call %s ",name); | |
b13bbe81 | 151 | }else{ |
9859bfc0 | 152 | rv = (AliEMCALGeometry *) fgGeom; |
e52475ed | 153 | } // end |
b13bbe81 | 154 | } // end if fgGeom |
155 | return rv; | |
2012850d | 156 | } |
173558f2 | 157 | |
d297ef6e | 158 | //________________________________________________________________________________________________ |
1ae500a2 | 159 | Bool_t AliEMCALGeometry::RelPosCellInSModule(Int_t absId, Double_t distEff, Double_t &xr, Double_t &yr, Double_t &zr) const |
160 | { | |
161 | // Jul 30, 2007 - taking into account position of shower max | |
162 | // Look to see what the relative | |
163 | // position inside a given cell is | |
164 | // for a recpoint. | |
165 | // In: | |
166 | // absId - cell is as in Geant, 0<= absId < fNCells; | |
167 | // e - cluster energy | |
168 | // OUT: | |
169 | // xr,yr,zr - x,y,z coordinates of cell with absId inside SM | |
170 | ||
171 | // Shift index taking into account the difference between standard SM | |
172 | // and SM of half size in phi direction | |
37890aaf | 173 | const Int_t kphiIndexShift = fCentersOfCellsPhiDir.GetSize()/4; // Nov 22, 2006; was 6 for cas 2X2 |
53e430a3 | 174 | static Int_t nSupMod=0, nModule=-1, nIphi=-1, nIeta=-1, iphi=-1, ieta=-1; |
175 | static Int_t iphim=-1, ietam=-1; | |
1ae500a2 | 176 | static AliEMCALShishKebabTrd1Module *mod = 0; |
177 | static TVector2 v; | |
178 | if(!CheckAbsCellId(absId)) return kFALSE; | |
c694fff1 | 179 | |
1ae500a2 | 180 | GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta); |
181 | GetModulePhiEtaIndexInSModule(nSupMod, nModule, iphim, ietam); | |
182 | GetCellPhiEtaIndexInSModule(nSupMod,nModule,nIphi,nIeta, iphi, ieta); | |
c694fff1 | 183 | |
184 | //Get eta position. Careful with ALICE conventions (increase index decrease eta) | |
185 | if(nSupMod%2 == 0) { | |
186 | ietam = (fCentersOfCellsEtaDir.GetSize()/2-1)-ietam;// 47-ietam, revert the ordering on A side in order to keep convention. | |
187 | if(nIeta == 0) nIeta = 1; | |
188 | else nIeta = 0; | |
189 | } | |
1ae500a2 | 190 | mod = GetShishKebabModule(ietam); |
c694fff1 | 191 | mod ->GetPositionAtCenterCellLine(nIeta, distEff, v); |
1ae500a2 | 192 | xr = v.Y() - fParSM[0]; |
193 | zr = v.X() - fParSM[2]; | |
c694fff1 | 194 | |
195 | //Get phi position. Careful with ALICE conventions (increase index increase phi) | |
196 | Int_t iphi2 = iphi; | |
197 | if(nSupMod<10) { | |
198 | if(nSupMod%2 != 0) | |
199 | iphi2 = (fCentersOfCellsPhiDir.GetSize()-1)-iphi;// 23-iphi, revert the ordering on C side in order to keep convention. | |
200 | yr = fCentersOfCellsPhiDir.At(iphi2); | |
201 | ||
1ae500a2 | 202 | } else { |
c694fff1 | 203 | if(nSupMod%2 != 0) |
204 | iphi2 = (fCentersOfCellsPhiDir.GetSize()/2-1)-iphi;// 11-iphi, revert the ordering on C side in order to keep convention. | |
205 | yr = fCentersOfCellsPhiDir.At(iphi2 + kphiIndexShift); | |
1ae500a2 | 206 | } |
c694fff1 | 207 | |
1ae500a2 | 208 | AliDebug(1,Form("absId %i nSupMod %i iphi %i ieta %i xr %f yr %f zr %f ",absId,nSupMod,iphi,ieta,xr,yr,zr)); |
c694fff1 | 209 | |
1ae500a2 | 210 | return kTRUE; |
211 | } | |
212 | ||
7cfcebd3 | 213 | //Not in use, comment for the moment |
d297ef6e | 214 | //________________________________________________________________________________________________ |
7cfcebd3 | 215 | //Bool_t AliEMCALGeometry::RelPosCellInSModule(Int_t absId, Int_t maxAbsId, Double_t distEff, Double_t &xr, Double_t &yr, Double_t &zr) const |
216 | //{ | |
217 | // // Jul 31, 2007 - taking into account position of shower max and apply coor2. | |
218 | // // Look to see what the relative | |
219 | // // position inside a given cell is | |
220 | // // for a recpoint. | |
221 | // // In: | |
222 | // // absId - cell is as in Geant, 0<= absId < fNCells; | |
223 | // // maxAbsId - abs id of cell with highest energy | |
224 | // // e - cluster energy | |
225 | // // OUT: | |
226 | // // xr,yr,zr - x,y,z coordinates of cell with absId inside SM | |
227 | // | |
228 | // // Shift index taking into account the difference between standard SM | |
229 | // // and SM of half size in phi direction | |
230 | // const Int_t kphiIndexShift = fCentersOfCellsPhiDir.GetSize()/4; // Nov 22, 2006; was 6 for cas 2X2 | |
231 | // static Int_t nSupMod, nModule, nIphi, nIeta, iphi, ieta; | |
232 | // static Int_t iphim, ietam; | |
233 | // static AliEMCALShishKebabTrd1Module *mod = 0; | |
234 | // static TVector2 v; | |
235 | // | |
236 | // static Int_t nSupModM, nModuleM, nIphiM, nIetaM, iphiM, ietaM; | |
237 | // static Int_t iphimM, ietamM, maxAbsIdCopy=-1; | |
238 | // static AliEMCALShishKebabTrd1Module *modM = 0; | |
239 | // static Double_t distCorr; | |
240 | // | |
241 | // if(!CheckAbsCellId(absId)) return kFALSE; | |
242 | // | |
243 | // GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta); | |
244 | // GetModulePhiEtaIndexInSModule(nSupMod, nModule, iphim, ietam); | |
245 | // GetCellPhiEtaIndexInSModule(nSupMod,nModule,nIphi,nIeta, iphi, ieta); | |
246 | // | |
247 | // //Get eta position. Careful with ALICE conventions (increase index decrease eta) | |
248 | // if(nSupMod%2 == 0) { | |
249 | // ietam = (fCentersOfCellsEtaDir.GetSize()/2-1)-ietam;// 23-ietam, revert the ordering on A side in order to keep convention. | |
250 | // if(nIeta == 0) nIeta = 1; | |
251 | // else nIeta = 0; | |
252 | // } | |
253 | // | |
254 | // mod = GetShishKebabModule(ietam); | |
255 | // | |
256 | // if(absId != maxAbsId) { | |
257 | // distCorr = 0.; | |
258 | // if(maxAbsIdCopy != maxAbsId) { | |
259 | // GetCellIndex(maxAbsId, nSupModM, nModuleM, nIphiM, nIetaM); | |
260 | // GetModulePhiEtaIndexInSModule(nSupModM, nModuleM, iphimM, ietamM); | |
261 | // GetCellPhiEtaIndexInSModule(nSupModM,nModuleM,nIphiM,nIetaM, iphiM, ietaM); | |
262 | // //Careful with ALICE conventions (increase index decrease eta) | |
263 | // if(nSupModM%2 == 0) { | |
264 | // ietamM = (fCentersOfCellsEtaDir.GetSize()/2-1)-ietamM;// 47-ietam, revert the ordering on A side in order to keep convention. | |
265 | // } | |
266 | // | |
267 | // modM = GetShishKebabModule(ietamM); // do I need this ? | |
268 | // maxAbsIdCopy = maxAbsId; | |
269 | // } | |
270 | // | |
271 | // if(ietamM !=0) { | |
272 | // distCorr = fEMCGeometry->GetEtaModuleSize()*(ietam-ietamM)/TMath::Tan(modM->GetTheta()); // Stay here | |
273 | // //printf(" distCorr %f | dist %f | ietam %i -> etamM %i\n", distCorr, dist, ietam, ietamM); | |
274 | // } | |
275 | // // distEff += distCorr; | |
276 | // } | |
277 | // // Bad resolution in this case, strong bias vs phi | |
278 | // // distEff = 0.0; | |
279 | // mod->GetPositionAtCenterCellLine(nIeta, distEff, v); // Stay here | |
280 | // xr = v.Y() - fParSM[0]; | |
281 | // zr = v.X() - fParSM[2]; | |
282 | // | |
283 | // //Get phi position. Careful with ALICE conventions (increase index increase phi) | |
284 | // Int_t iphi2 = iphi; | |
285 | // if(nSupMod<10) { | |
286 | // if(nSupMod%2 != 0) | |
287 | // iphi2 = (fCentersOfCellsPhiDir.GetSize()-1)-iphi;// 23-iphi, revert the ordering on C side in order to keep convention. | |
288 | // yr = fCentersOfCellsPhiDir.At(iphi2); | |
289 | // | |
290 | // } else { | |
291 | // if(nSupMod%2 != 0) | |
292 | // iphi2 = (fCentersOfCellsPhiDir.GetSize()/2-1)-iphi;// 11-iphi, revert the ordering on C side in order to keep convention. | |
293 | // yr = fCentersOfCellsPhiDir.At(iphi2 + kphiIndexShift); | |
294 | // } | |
295 | // AliDebug(1,Form("absId %i nSupMod %i iphi %i ieta %i xr %f yr %f zr %f ",absId,nSupMod,iphi,ieta,xr,yr,zr)); | |
296 | // | |
297 | // return kTRUE; | |
298 | //} | |
299 | // | |
1d46d1f6 | 300 | |
0c5b726e | 301 | // |
302 | // == Shish-kebab cases == | |
303 | // | |
14e75ea7 | 304 | |
7cfcebd3 | 305 | // |
306 | ////_________________________________________________________________________________ | |
307 | //void AliEMCALGeometry::GetGlobalEMCAL(const AliEMCALRecPoint *rp, TVector3 &vglob) const | |
308 | //{ | |
309 | // // Figure out the global numbering | |
310 | // // of a given supermodule from the | |
311 | // // local numbering for RecPoints | |
312 | // | |
313 | // static TVector3 vloc; | |
314 | // static Int_t nSupMod, nModule, nIphi, nIeta; | |
315 | // | |
316 | // const AliEMCALRecPoint *rpTmp = rp; | |
317 | // const AliEMCALRecPoint *rpEmc = rpTmp; | |
318 | // | |
319 | // GetCellIndex(rpEmc->GetAbsId(0), nSupMod, nModule, nIphi, nIeta); | |
320 | // rpTmp->GetLocalPosition(vloc); | |
321 | // GetGlobal(vloc, vglob, nSupMod); | |
322 | //} | |
e52475ed | 323 |