]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/doc/geometry.tex
reviewing typos -- Cath
[u/mrichter/AliRoot.git] / EMCAL / doc / geometry.tex
index fc9976b8ce8800dc602d4cbff419b92d92ee0e24..024a9d90a217ee7b22b1c9be18a09f32511eb2b6 100644 (file)
@@ -1,51 +1,54 @@
-\section{Geometry code - Marco +++}
+\section{EMCAL geometry software - Marco +++}
 
-EMCAL Geometry, description and methods
-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.
 
- \subsection {Detailed classes description}
+This page is intended for a description of the EMCAL geometry and the methods to access it.  
+{\it This is a very preliminary version that needs work.}
 
-The EMCAL geometry is implemented in several classes, here I present  a (right now very brief, it should be completed) description:
+ \subsection {Classes description}
+
+The EMCAL geometry is implemented in several classes : {\color{red} (right now very brief description, it should be completed) }
 \begin{itemize}
-\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.
-\item AliEMCALGeometry: Derives from AliEMCALGeoUtils, contains dependencies on other EMCAL classes (AliEMCALRecPoint)
+\item AliEMCALGeoUtils: Steering geometry class.  No dependencies on STEER or EMCAL non geometry classes. Can be called during the analysis without loading all aliroot classes.
+\item AliEMCALGeometry: Derives from AliEMCALGeoUtils, contains dependencies on other EMCAL classes (AliEMCALRecPoint).
 \item AliEMCALEMCGeometry: Does the geometry initialization. Does all the definitions of the geometry (towers composition, size, Super Modules number ...)
 \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.
 \item AliEMCALShishKebabTrd1Module: Here the modules are defined and the position of the modules in the local super module reference system is calculated
 \end{itemize}
 
-\subsection{How to get the geometry}
-You can get the geometry pointer in the following ways:\\
-
-If galice.root is available:\\
-
-    AliRunLoader *rl = AliRunLoader::Open("galice.root",AliConfig::GetDefaultEventFolderName(),"read");\\
-    
-    rl->LoadgAlice();//Needed to get geometry\\
-    
-    AliEMCALLoader *emcalLoader = dynamic\_cast<AliEMCALLoader*>(rl->GetDetectorLoader("EMCAL"));\\
-    
-    AliRun * alirun = rl->GetAliRun();\\
-
-    AliEMCAL * emcal = (AliEMCAL*)alirun->GetDetector("EMCAL"); AliEMCALGeometry * geom = emcal->GetGeometry();\\
-
-else, if galice.root is not available:\\
-
-   AliEMCALGeometry * geom =  AliEMCALGeometry::GetInstance("EMCAL\_COMPLETE") ;\\
-
+\subsection{Accessing the geometry}
+One can get the geometry pointer in the following ways:
+\begin{itemize}
+\item If galice.root is available:
+
+\begin{DDbox}{\linewidth}
+\begin{lstlisting}
+AliRunLoader *rl = AliRunLoader::Open("galice.root",AliConfig::GetDefaultEventFolderName(),"read"); 
+rl->LoadgAlice();//Needed to get geometry
+AliEMCALLoader *emcalLoader = dynamic\_cast<AliEMCALLoader*>(rl->GetDetectorLoader("EMCAL"));
+AliRun * alirun = rl->GetAliRun();
+AliEMCAL * emcal = (AliEMCAL*)alirun->GetDetector("EMCAL"); AliEMCALGeometry * geom = emcal->GetGeometry();
+else, if galice.root is not available:
+AliEMCALGeometry * geom =  AliEMCALGeometry::GetInstance("EMCAL\_COMPLETE") ;
+
+\end{lstlisting}
+\end{DDbox}
+\end{itemize}
 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.
 
-The way to load this file is:\\
-
-   TGeoManager::Import("geometry.root");\\
+The way to load this file is:
+%\begin{DDbox}{\linewidth}
+\begin{lstlisting}
+TGeoManager::Import("geometry.root");
+\end{lstlisting}
+%\end{DDbox}
 
 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.
 
- 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().
+ If you want to see different parameters used in the geometry printed (cells centers, distance to IP, etc), one just has to execute the method PrintGeometry().
  
 
 \subsection{Geometry configuration options}
-Right now we have the following geometry options:
+Right now the following geometry options are implemented:
 \begin{itemize}
 \item EMCAL\_COMPLETE: 12 Super Modules (2 half Super Modules)
 \item EMCAL\_FIRSTYEAR: 4 Super Modules (year 2010)
@@ -54,18 +57,17 @@ Right now we have the following geometry options:
 \item EMCAL\_COMPLETE12SMV1: 12 Super Modules (10+2/3), corrected geometry (year 2012)
 \end{itemize}
 
-There are other options but NOT TO BE USED, at some point they have to be removed:
-
+Other options exists but need to be removed as they {\bf should not be used}:
 \begin{itemize}
-\item EMCAL\_PDC06: Old geometry, for reading old data (which might not exist).
+\item EMCAL\_PDC06: Old geometry, for reading old data (which do not exist anymore).
 \item EMCAL\_WSU: Prototype geometry. 
 \end{itemize}
 
-By default geometry is loaded with the EMCAL\_COMPLETE12SMV1 configuration.
+By default, the geometry is loaded with the EMCAL\_COMPLETE12SMV1 configuration.
 
  
  \subsection{Mapping}
-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
+The tower row/column mapping online and offline follows the alice numbering convention. Figures~\ref{fig:Map1} to \ref{fig:Map2} display the position of the super modules from different points of view and the position of the tower index in them.
 
 \begin{figure}[ht]
 \begin{center}
@@ -92,51 +94,77 @@ The tower row/column mapping online and offline follows the alice numbering conv
 
 \subsection{Tower index transformation methods}
 \subsubsection{Absolute tower ID to Row/Column index}
-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:
 
-From absId to col-row: 
-Int\_t nSupMod, nModule, nIphi, nIeta, iphi, ieta;
+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. The procedure to go from the absId to the (row, col) formulation or viceversa is as follow:
 
-//Check if this absId exists
+\begin{itemize}
+\item From absId to col-row: 
 
+\begin{DDbox}{\linewidth}
+\begin{lstlisting}
+Int\_t nSupMod, nModule, nIphi, nIeta, iphi, ieta;
+//Check if this absId exists
 if(!CheckAbsCellId(absId)) return kFALSE;
-
 // Get from the absId the super module number, the module number and the eta-phi index (0 or 1) in the module
-
 GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta);
-
 // 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) 
 GetCellPhiEtaIndexInSModule(nSupMod,nModule,nIphi,nIeta, iphi, ieta); 
+\end{lstlisting}
+\end{DDbox}
 
-From col-row to absId, following the same notation as above: 
+\item From col-row to absId, following the same notation as above: 
+
+\begin{DDbox}{\linewidth}
+\begin{lstlisting}
 
 absid = GetAbsCellIdFromCellIndexes(nSupMode, iphi, ieta);
+\end{lstlisting}
+\end{DDbox}
 
 or
 
+\begin{DDbox}{\linewidth}
+\begin{lstlisting}
+
 absid = GetAbsCellId(nSupMod, nModule, nIphi, nIeta);
+\end{lstlisting}
+\end{DDbox}
 
-Other interesting method is
+\item Other interesting method is
 
-Int\_t   GetSuperModuleNumber(Int\_t absId)  
+\begin{DDbox}{\linewidth}
+\begin{lstlisting}
 
+Int\_t   GetSuperModuleNumber(Int\_t absId)  
+\end{lstlisting}
+\end{DDbox}
+\end{itemize}
 
 \subsection{Tower index to local / global reference system position}
 \subsubsection{Local coordinates}
-To correlate the tower index and its position in local coordinates we have the following methods: 
 
+To correlate the tower index and its position in local coordinates, the following methods are available:
+
+\begin{DDbox}{\linewidth}
+\begin{lstlisting}
   Bool\_t  AliEMCALGeoUtils::RelPosCellInSModule(Int\_t absId, Double\_t \&xr, Double\_t \&yr, Double\_t \&zr) const;
 
   Bool\_t  AliEMCALGeoUtils::RelPosCellInSModule(Int\_t absId, Double\_t loc[3]) const;
 
   Bool\_t  AliEMCALGeoUtils::RelPosCellInSModule(Int\_t absId, TVector3 \&vloc) const;
+\end{lstlisting}
+\end{DDbox}
+
+To which the input is the absId and the output are the coordinates of the center of towers in the local coordinates of the Super Module. This method gets the column and row index of the cell from the absId, independently of the Super Module (like above), and gets the center of the cell from 3 arrays (x,y,z) filled with such quantities. Such central positions are calculated during the initialization of the geometry, where the arrys are filled, in the method :
 
- 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
+\begin{DDbox}{\linewidth}
+\begin{lstlisting}
 
   AliEMCALGeoUtils::CreateListOfTrd1Modules()
+\end{lstlisting}
+\end{DDbox}
 
-<<<<<Someone else should explain how it works>>>>>
+{\color{red}<<<<<Someone else should explain how it works>>>>>}
 
  
 
@@ -144,29 +172,39 @@ In case we calculate the cluster position, things are a bit different.
 
  
 
-<<<<< This explanation should go to the clusterization section>>>>
+{\color{red}<<<<< This explanation should go to the clusterization section>>>>}
 
  
 
 This is done in 
 
+\begin{DDbox}{\linewidth}
+\begin{lstlisting}
 void AliEMCALRecPoint::EvalLocalPosition()
+\end{lstlisting}
+\end{DDbox}
 
 First we calculate the cell position with the  method 
 
+\begin{DDbox}{\linewidth}
+\begin{lstlisting}
 AliEMCALGeometry::RelPosCellInSModule(Int\_t absId, Int\_t maxAbsId, Double\_t tmax, Double\_t \&xr, Double\_t \&yr, Double\_t \&zr)
+\end{lstlisting}
+\end{DDbox}
 
 The calculation of the cell position done here is different in the "x-z" but the same in "y". 
 
  
 
-<<<<<Someone else should explain how it works>>>>>
+{\color{red}<<<<< <<<<<Someone else should explain how it works>>>>>}
 
  
  
 
 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
 
+\begin{DDbox}{\linewidth}
+\begin{lstlisting}
   Double\_t AliEMCALRecPoint::TmaxInCm(const Double\_t e){
 
       //e: energy sum of cells
@@ -182,16 +220,26 @@ static Double\_t ca = 4.82;// shower max parameter - first guess; ca=TMath::Log(
       tmax *= x0; // convert to cm
 
   }
+\end{lstlisting}
+\end{DDbox}
 
-After the cells position of the cluster is get, the position of the cluster is calculated averaging the cell positions with a logarithmic weight:
+After the cells position of the cluster is accessed, the position of the cluster is calculated averaging the cell positions with a logarithmic weight:
 
+\begin{DDbox}{\linewidth}
+\begin{lstlisting}
   w(cell i) = TMath::Max( 0., logWeight + TMath::Log( energy[cell i] / summed\_cluster\_cell\_energy ));
+\end{lstlisting}
+\end{DDbox}
 
 where the logWeight was chosen to be 4.5 (this value was taken from PHOS, never optimized as far as I know)
 
 So in the end the position,  is 
 
+\begin{DDbox}{\linewidth}
+\begin{lstlisting}
 f = Sum(f(i) * w(i))/Sum(w(i))
+\end{lstlisting}
+\end{DDbox}
 
 where f=x,y,z.
 
@@ -202,6 +250,9 @@ where f=x,y,z.
 
 To transform from local to global we have the methods
 
+\begin{DDbox}{\linewidth}
+\begin{lstlisting}
+
   void GetGlobal(const Double\_t *loc, Double\_t *glob, int ind) const;
 
   void GetGlobal(const TVector3 \&vloc, TVector3 \&vglob, int ind) const;
@@ -209,33 +260,56 @@ To transform from local to global we have the methods
   void GetGlobal(Int\_t absId, Double\_t glob[3]) const;
 
   void GetGlobal(Int\_t absId, TVector3 \&vglob) const;
+\end{lstlisting}
+\end{DDbox}
 
  
 
  These methods take the local coordinates and transform them into global coordinates using the transformation matrix of the Super Module.
 
+\begin{DDbox}{\linewidth}
+\begin{lstlisting}
  
 
 TGeoHMatrix* m = GetMatrixForSuperModule(nSupMod);
 
 if(m) m->LocalToMaster(loc, glob);
 
+\end{lstlisting}
+\end{DDbox}
  
 
  GetGlobal is called in the following useful methods in the geometry class:
 
  
+\begin{itemize}
+\item Return the eta and phi angular position of the cell from the AbsId
 
- Return the eta and phi angular position of the cell from the AbsId
+\begin{DDbox}{\linewidth}
+\begin{lstlisting}
 void    EtaPhiFromIndex(Int\_t absId, Double\_t \&eta, Double\_t \&phi) const;
 void    EtaPhiFromIndex(Int\_t absId, Float\_t \&eta, Float\_t \&phi) const;
-Print information of the cells. For "pri>0" returns more information. "tit" has not much use, this value is printed.
+\end{lstlisting}
+\end{DDbox}
+\item Print information of the cells. For "pri>0" returns more information. "tit" has not much use, this value is printed.
+
+\begin{DDbox}{\linewidth}
+\begin{lstlisting}
 void PrintCellIndexes(Int\_t absId, int pri, const char *tit)
+\end{lstlisting}
+\end{DDbox}
+\end{itemize} 
 
 \subsection{Geometry Alignment}
-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: 
-
-AliAlignObj  AliAlignObjMatrix  AliAlignObjParams  AliAlignmentTracks
-
-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. 
+AliRoot contains a frame for the correction of the misplacement of geometry objects with respect to the ideal positions which are kept in the STEER/ directory of the following classes:
+
+\begin{DDbox}{\linewidth}
+\begin{lstlisting}
+AliAlignObj  
+AliAlignObjMatrix  
+AliAlignObjParams  
+AliAlignmentTracks
+\end{lstlisting}
+\end{DDbox}
+
+The class AliEMCALSurvey 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.