]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/doc/geometry.tex
squeleton of EMCAL documentation, partially filled
[u/mrichter/AliRoot.git] / EMCAL / doc / geometry.tex
1 \section{Geometry code - Marco +++}
2
3 EMCAL Geometry, description and methods
4 This page is intended for a description of the geometry, how it works, how can we access to it and its methods.  Very preliminary version, to be worked.
5
6  \subsection {Detailed classes description}
7
8 The EMCAL geometry is implemented in several classes, here I present  a (right now very brief, it should be completed) description:
9 \begin{itemize}
10 \item AliEMCALGeoUtils: Steering geometry class.  No dependencies on STEER or EMCAL non geometry classes. Can be called during the analysis not loading all aliroot classes.
11 \item AliEMCALGeometry: Derives from AliEMCALGeoUtils, contains dependencies on other EMCAL classes (AliEMCALRecPoint)
12 \item AliEMCALEMCGeometry: Does the geometry initialization. Does all the definitions of the geometry (towers composition, size, Super Modules number ...)
13 \item AliEMCALGeoParams:  Class container of some of the geometry parameters so that it can be accessed everywhere in the EMCAL code, to avoid "magic numbers". Its use has to be propagated to all the code.
14 \item AliEMCALShishKebabTrd1Module: Here the modules are defined and the position of the modules in the local super module reference system is calculated
15 \end{itemize}
16
17 \subsection{How to get the geometry}
18 You can get the geometry pointer in the following ways:\\
19
20 If galice.root is available:\\
21
22     AliRunLoader *rl = AliRunLoader::Open("galice.root",AliConfig::GetDefaultEventFolderName(),"read");\\
23     
24     rl->LoadgAlice();//Needed to get geometry\\
25     
26     AliEMCALLoader *emcalLoader = dynamic\_cast<AliEMCALLoader*>(rl->GetDetectorLoader("EMCAL"));\\
27     
28     AliRun * alirun = rl->GetAliRun();\\
29
30     AliEMCAL * emcal = (AliEMCAL*)alirun->GetDetector("EMCAL"); AliEMCALGeometry * geom = emcal->GetGeometry();\\
31
32 else, if galice.root is not available:\\
33
34    AliEMCALGeometry * geom =  AliEMCALGeometry::GetInstance("EMCAL\_COMPLETE") ;\\
35
36 In this case you might need the file geometry.root if you want to access to certain methods that require local to global position transformations. This file can be generated doing a simple simulation, it just contains the transformation matrix to go from global to local.
37
38 The way to load this file is:\\
39
40    TGeoManager::Import("geometry.root");\\
41
42 The transformation matrices are also stored in the ESDs so if you do not load this file, you can have to load these matrices from the ESDs.
43
44  If you want to see different parameters used in the geometry printed (cells centers, distance to IP, etc), you have just to execute the method PrintGeometry().
45  
46
47 \subsection{Geometry configuration options}
48 Right now we have the following geometry options:
49 \begin{itemize}
50 \item EMCAL\_COMPLETE: 12 Super Modules (2 half Super Modules)
51 \item EMCAL\_FIRSTYEAR: 4 Super Modules (year 2010)
52 \item EMCAL\_FIRSTYEARV1: 4 Super Modules, corrected geometry (year 2010)
53 \item EMCAL\_COMPLETEV1: 10 Super Modules, corrected geometry (year 2011)
54 \item EMCAL\_COMPLETE12SMV1: 12 Super Modules (10+2/3), corrected geometry (year 2012)
55 \end{itemize}
56
57 There are other options but NOT TO BE USED, at some point they have to be removed:
58
59 \begin{itemize}
60 \item EMCAL\_PDC06: Old geometry, for reading old data (which might not exist).
61 \item EMCAL\_WSU: Prototype geometry. 
62 \end{itemize}
63
64 By default geometry is loaded with the EMCAL\_COMPLETE12SMV1 configuration.
65
66  
67  \subsection{Mapping}
68 The tower row/column mapping online and offline follows the alice numbering convention, here you will see a few pictures displaying the position of the super modules from different points of view and the position of the tower index in them
69
70 \begin{figure}[ht]
71 \begin{center}
72 \includegraphics[width=1.0\textwidth]{figures/EMCALMap0_0.jpeg}
73 \end{center}
74 \caption{\label{fig:Map1}}
75 \end{figure}
76
77 \begin{figure}[ht]
78 \begin{center}
79 \includegraphics[width=1.0\textwidth]{figures/EMCALMap1.jpeg}
80 \end{center}
81 \caption{\label{fig:Map0}}
82 \end{figure}
83
84
85 \begin{figure}[ht]
86 \begin{center}
87 \includegraphics[width=1.0\textwidth]{figures/EMCALMap2.jpeg}
88 \end{center}
89 \caption{\label{fig:Map2}}
90 \end{figure}
91
92
93 \subsection{Tower index transformation methods}
94 \subsubsection{Absolute tower ID to Row/Column index}
95 Each EMCAL supermodule is composed of 24x48 towers (phi,eta), grouped in 4x4 modules. Each tower (even each module) has a unique number assigned, called in the code "absolute ID" number (absId). This number can be transformed into a row (phi direction) or column (eta direction) index. Here I list how can we go from the absId to the (row, col) formulation or viceversa:
96
97 From absId to col-row: 
98 Int\_t nSupMod, nModule, nIphi, nIeta, iphi, ieta;
99
100 //Check if this absId exists
101
102 if(!CheckAbsCellId(absId)) return kFALSE;
103
104 // Get from the absId the super module number, the module number and the eta-phi index (0 or 1) in the module
105
106 GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta);
107
108 // Get from the  the super module number, the module number and the eta-phi index (0 or 1) in the module the tower row (iphi) and column (ieta) 
109 GetCellPhiEtaIndexInSModule(nSupMod,nModule,nIphi,nIeta, iphi, ieta); 
110
111 From col-row to absId, following the same notation as above: 
112
113 absid = GetAbsCellIdFromCellIndexes(nSupMode, iphi, ieta);
114
115 or
116
117 absid = GetAbsCellId(nSupMod, nModule, nIphi, nIeta);
118
119 Other interesting method is
120
121 Int\_t   GetSuperModuleNumber(Int\_t absId)  
122
123  
124
125 \subsection{Tower index to local / global reference system position}
126 \subsubsection{Local coordinates}
127 To correlate the tower index and its position in local coordinates we have the following methods: 
128
129   Bool\_t  AliEMCALGeoUtils::RelPosCellInSModule(Int\_t absId, Double\_t \&xr, Double\_t \&yr, Double\_t \&zr) const;
130
131   Bool\_t  AliEMCALGeoUtils::RelPosCellInSModule(Int\_t absId, Double\_t loc[3]) const;
132
133   Bool\_t  AliEMCALGeoUtils::RelPosCellInSModule(Int\_t absId, TVector3 \&vloc) const;
134
135  which input is the absId and the output are the coordinates of the center of towers in the local coordinates of the Super Module. What it does inside is to get from the absId the column and row index of the cell, independently of the Super Module (like above), and it gets the center of the cell from 3 arrays (x,y,z) filled with such quantities. How and where are calculated such central positions?  The arrays are filled during the initialization of the geometry in method
136
137   AliEMCALGeoUtils::CreateListOfTrd1Modules()
138
139 <<<<<Someone else should explain how it works>>>>>
140
141  
142
143 In case we calculate the cluster position, things are a bit different.
144
145  
146
147 <<<<< This explanation should go to the clusterization section>>>>
148
149  
150
151 This is done in 
152
153 void AliEMCALRecPoint::EvalLocalPosition()
154
155 First we calculate the cell position with the  method 
156
157 AliEMCALGeometry::RelPosCellInSModule(Int\_t absId, Int\_t maxAbsId, Double\_t tmax, Double\_t \&xr, Double\_t \&yr, Double\_t \&zr)
158
159 The calculation of the cell position done here is different in the "x-z" but the same in "y". 
160
161  
162
163 <<<<<Someone else should explain how it works>>>>>
164
165  
166  
167
168 In this particular case the position calculation per tower depends on the position of the maximum cell, and the sum of the energy of the cells of the cluster. The maximum depth (tmax) is calculated with the method
169
170   Double\_t AliEMCALRecPoint::TmaxInCm(const Double\_t e){
171
172       //e: energy sum of cells
173
174 static Double\_t ca = 4.82;// shower max parameter - first guess; ca=TMath::Log(1000./8.07)
175
176       static Double\_t x0 = 1.23; // radiation lenght (cm)
177
178       static Double\_t tmax = 0.; // position of electromagnetic shower max in cm
179
180       tmax = TMath::Log(e) + ca+0.5;
181
182       tmax *= x0; // convert to cm
183
184   }
185
186 After the cells position of the cluster is get, the position of the cluster is calculated averaging the cell positions with a logarithmic weight:
187
188   w(cell i) = TMath::Max( 0., logWeight + TMath::Log( energy[cell i] / summed\_cluster\_cell\_energy ));
189
190 where the logWeight was chosen to be 4.5 (this value was taken from PHOS, never optimized as far as I know)
191
192 So in the end the position,  is 
193
194 f = Sum(f(i) * w(i))/Sum(w(i))
195
196 where f=x,y,z.
197
198  
199
200  \subsubsection{Global coordinates}
201  
202
203 To transform from local to global we have the methods
204
205   void GetGlobal(const Double\_t *loc, Double\_t *glob, int ind) const;
206
207   void GetGlobal(const TVector3 \&vloc, TVector3 \&vglob, int ind) const;
208
209   void GetGlobal(Int\_t absId, Double\_t glob[3]) const;
210
211   void GetGlobal(Int\_t absId, TVector3 \&vglob) const;
212
213  
214
215  These methods take the local coordinates and transform them into global coordinates using the transformation matrix of the Super Module.
216
217  
218
219 TGeoHMatrix* m = GetMatrixForSuperModule(nSupMod);
220
221 if(m) m->LocalToMaster(loc, glob);
222
223  
224
225  GetGlobal is called in the following useful methods in the geometry class:
226
227  
228
229  Return the eta and phi angular position of the cell from the AbsId
230 void    EtaPhiFromIndex(Int\_t absId, Double\_t \&eta, Double\_t \&phi) const;
231 void    EtaPhiFromIndex(Int\_t absId, Float\_t \&eta, Float\_t \&phi) const;
232 Print information of the cells. For "pri>0" returns more information. "tit" has not much use, this value is printed.
233 void PrintCellIndexes(Int\_t absId, int pri, const char *tit)
234  
235
236 \subsection{Geometry Alignment}
237 AliRoot contains a frame for the correction of the misplacement of geometry objects with respect to the ideal positions. You can have a look in STEER to classes: 
238
239 AliAlignObj  AliAlignObjMatrix  AliAlignObjParams  AliAlignmentTracks
240
241 In EMCAL, we have the class AliEMCALSurvey that creates the corrections to the alignable objects.  The class AliEMCALSurvey was established to take the survey parameters from OCDB, calculate the shift in position of the center of the end faces of the supermodules from the nominal position, and convert this to a transformation matrix for each supermodule which is applied to correct the global position of the supermodules.  All calculations of global positions would then use these corrected supermodule positions to determine their locations within the ALICE global coordinate system.