LCOV - code coverage report
Current view: top level - EMCAL/EMCALUtils - AliEMCALGeometry.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 53 112 47.3 %
Date: 2016-06-14 17:26:59 Functions: 49 111 44.1 %

          Line data    Source code
       1             : #ifndef ALIEMCALGEOMETRY_H
       2             : #define ALIEMCALGEOMETRY_H
       3             : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       4             :  * See cxx source for full Copyright notice                               */
       5             : 
       6             : //_________________________________________________________________________
       7             : /// \class AliEMCALGeometry
       8             : /// \brief EMCal geometry, singleton
       9             : ///
      10             : /// Geometry class  for EMCAL : singleton
      11             : /// EMCAL consists of layers of scintillator and lead
      12             : /// with scintillator fiber arranged as "shish-kebab" skewers
      13             : /// Places the the Barrel Geometry of The EMCAL at Midrapidity
      14             : /// between 80 and 180(or 190) degrees of Phi and
      15             : /// -0.7 to 0.7 in eta
      16             : ///
      17             : ///    * EMCAL geometry tree:
      18             : ///    * EMCAL -> superModule -> module -> tower(cell)
      19             : ///    * Indexes
      20             : ///    *  absId -> nSupMod     -> nModule -> (nIphi,nIeta)
      21             : ///
      22             : ///   Name choices:
      23             : ///   * EMCAL_PDC06 (geometry used for PDC06 simulations, kept for backward compatibility)
      24             : ///      * = equivalent to SHISH_77_TRD1_2X2_FINAL_110DEG in old notation
      25             : ///   * EMCAL_COMPLETE (geometry for expected complete detector)
      26             : ///      * = equivalent to SHISH_77_TRD1_2X2_FINAL_110DEG scTh=0.176 pbTh=0.144
      27             : ///          in old notation
      28             : ///   * EMCAL_FIRSTYEARV1 - geometry for December 2009 to December 2010 run period;
      29             : ///      *          fixed bug for positions of modules inside SM
      30             : ///                 (first module has tilt 0.75 degree);
      31             : ///                 the sizes updated with last information from production
      32             : ///                 drawing (end of October 2010).
      33             : ///
      34             : ///   * EMCAL_COMPLETEV1: Same fixes as FIRSTYEAR and 10 SM instead of 10 + 2 one_third SM, for 2011 runs
      35             : ///
      36             : ///   * EMCAL_COMPLETE12SMV1: contains 12 SM for runs from year 2012 and on
      37             : ///
      38             : ///   * EMCAL_COMPLETE12SMV1_DCAL: contains 12 SM and 6 DCAL SM
      39             : ///
      40             : ///   * EMCAL_COMPLETE12SMV1_DCAL_8SM: contains 12 SM and 8 DCAL SM including the DCAL extention (2 SM)
      41             : ///
      42             : ///   * EMCAL_COMPLETE12SMV1_DCAL_DEV: contains 12 SM shifted and 10 DCAL SM
      43             : ///
      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             : ///
      49             : /// Usage:
      50             : ///         You can create the AliEMCALGeometry object independently from anything.
      51             : ///         You have to use just the correct name of geometry. If name is empty string the
      52             : ///         default name of geometry will be used.
      53             : ///
      54             : ///  AliEMCALGeometry* g = AliEMCALGeometry::GetInstance(name,title); // first time
      55             : ///  ..
      56             : ///  g = AliEMCALGeometry::GetInstance();                             // after first time
      57             : ///
      58             : ///  MC:   If you work with MC data you have to get geometry the next way:
      59             : ///  ==                                      =============================
      60             : ///  AliRunLoader    *rl   = AliRunLoader::Instance();
      61             : ///  AliEMCALGeometry *geom = dynamic_cast<AliEMCAL*>(rl->GetAliRun()->GetDetector("EMCAL"))->GetGeometry();
      62             : ///  TGeoManager::Import("geometry.root");
      63             : ///
      64             : /// \author Sahal Yacoob (LBL / UCT)
      65             : /// \author Yves Schutz (SUBATECH)
      66             : /// \author Jennifer Klay (LBL)
      67             : /// \author Alexei Pavlinov (WSU)
      68             : ///
      69             : ///  Implementation for analysis usage, before AliEMCALGeometry now (06/2011) merged again
      70             : ///  in AliEMCALGeometry
      71             : ///
      72             : /// \author Magali Estienne (magali.estienne@subatech.in2p3.fr)
      73             : /// \author M.L. Wang CCNU & Subatech Adapted for DCAL Oct-18-2012
      74             : ///
      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* geom = new AliEMCALGeometry("EMCAL_COMPLETE12SMV1","EMCAL");
      82             : ///  TGeoManager::Import("geometry.root");
      83             : ///
      84             : ///  MC:   If you work with MC data you have to get geometry the next way:
      85             : ///  ==                                      =============================
      86             : /// !!!!!!!!! This part has to be modified
      87             : ///  AliRunLoader    *rl   = AliRunLoader::GetRunLoader();
      88             : ///  AliEMCALEMCGeometry *geom = dynamic_cast<AliEMCAL*>(rl->GetAliRun()->GetDetector("EMCAL"))->GetGeometry();
      89             : ///  TGeoManager::Import("geometry.root");
      90             : //_________________________________________________________________________
      91             : 
      92             : // --- ROOT system ---
      93             : #include <TNamed.h>
      94             : #include <TMath.h>
      95             : #include <TArrayD.h>
      96             : #include <TVector3.h>
      97             : #include <TGeoMatrix.h> 
      98             : class TBrowser ;
      99             : class TParticle ;
     100             : 
     101             : // --- AliRoot header files ---
     102             : #include "AliEMCALEMCGeometry.h"
     103             : #include "AliEMCALGeoParams.h"
     104             : #include "AliEMCALTriggerMapping.h"
     105             : class AliEMCALShishKebabTrd1Module;
     106             : class AliLog;
     107             : 
     108             : class AliEMCALGeometry : public TNamed {
     109             : 
     110             : public: 
     111             :   enum fEMCSMType { kEMCAL_Standard = 0, kEMCAL_Half = 1, kEMCAL_3rd = 2, kDCAL_Standard = 3, kDCAL_Ext= 4 }; // possible SM Type
     112             : 
     113             :   AliEMCALGeometry();
     114             :   AliEMCALGeometry(const Text_t* name, const Text_t* title="",
     115             :                    const Text_t* mcname="", const Text_t* mctitle="");
     116             :   AliEMCALGeometry(const AliEMCALGeometry & geom);
     117             :   
     118             :   virtual ~AliEMCALGeometry(void); 
     119             :   AliEMCALGeometry & operator = (const AliEMCALGeometry  & rvalue);
     120             :   
     121             :   static AliEMCALGeometry * GetInstance();
     122             : 
     123             :   static AliEMCALGeometry * GetInstance(const Text_t* name,               const Text_t* title  =  "",
     124             :                                         const Text_t* mcname = "TGeant3", const Text_t* mctitle = "" ) ; 
     125             :   
     126             :   static AliEMCALGeometry * GetInstanceFromRunNumber(Int_t runNumber, 
     127             :                                                      TString geoName = "",
     128             :                                                      const Text_t* mcname  = "TGeant3", 
     129             :                                                      const Text_t* mctitle = ""        ) ;
     130             : 
     131             :   //////////
     132             :   // General
     133             :   //
     134           2 :   static Bool_t  IsInitialized(void)            {return AliEMCALEMCGeometry::fgInit; }
     135           6 :   static const Char_t* GetDefaultGeometryName() {return AliEMCALEMCGeometry::fgkDefaultGeometryName;}
     136             :   
     137             :   /////////////
     138             :   // TRD1 stuff
     139             :   void    CreateListOfTrd1Modules();
     140           2 :   TList  *GetShishKebabTrd1Modules() const {return fShishKebabTrd1Modules;}
     141             :   AliEMCALShishKebabTrd1Module *GetShishKebabModule(Int_t neta) const;
     142             : 
     143             :   void PrintGeometryGeoUtils();   // *MENU*  
     144             :   void PrintCellIndexes(Int_t absId=0, int pri=0, const char *tit="") const ;  //*MENU*
     145             :   void PrintLocalTrd1(Int_t pri=0) const;  // *MENU*
     146             :   virtual void Browse(TBrowser* b);
     147             :   virtual Bool_t  IsFolder() const;
     148             : 
     149             :   virtual Bool_t Impact(const TParticle *particle) const;
     150             :   void ImpactOnEmcal(TVector3 vtx, Double_t theta, Double_t phi, Int_t & absId, TVector3 & vimpact) const;
     151             :   Bool_t IsInEMCAL(Double_t x, Double_t y, Double_t z) const;
     152             :   Bool_t IsInDCAL(Double_t x, Double_t y, Double_t z) const;
     153             :   Int_t  IsInEMCALOrDCAL(Double_t x, Double_t y, Double_t z) const;
     154             : 
     155             :   //////////////////////////////////////
     156             :   // Return EMCAL geometrical parameters
     157             :   //
     158             :   
     159        2432 :   AliEMCALEMCGeometry* GetEMCGeometry()       const { return fEMCGeometry                            ; }
     160             :   
     161           0 :   AliEMCALTriggerMapping* GetTriggerMapping() const { return fTriggerMapping; }
     162             :   
     163             :   //
     164           4 :   const Char_t*  GetNameOfEMCALEnvelope(void) const { return fEMCGeometry->GetNameOfEMCALEnvelope()  ; }
     165           4 :   Float_t  GetArm1PhiMin(void)                const { return fEMCGeometry->GetArm1PhiMin()           ; }
     166           2 :   Float_t  GetArm1PhiMax(void)                const { return fEMCGeometry->GetArm1PhiMax()           ; }
     167           0 :   Float_t  GetArm1EtaMin(void)                const { return fEMCGeometry->GetArm1EtaMin()           ; }
     168           0 :   Float_t  GetArm1EtaMax(void)                const { return fEMCGeometry->GetArm1EtaMax()           ; }
     169           0 :   Float_t  GetIPDistance(void)                const { return fEMCGeometry->GetIPDistance()           ; }   
     170          16 :   Float_t  GetEnvelop(Int_t index)            const { return fEMCGeometry->GetEnvelop(index)         ; }  
     171           2 :   Float_t  GetShellThickness(void)            const { return fEMCGeometry->GetShellThickness()       ; }
     172           0 :   Float_t  GetZLength(void)                   const { return fEMCGeometry->GetZLength()              ; } 
     173         444 :   Float_t  GetDCALInnerEdge(void)             const { return fEMCGeometry->GetDCALInnerEdge()        ; }
     174           0 :   Float_t  GetDCALPhiMin(void)                const { return fEMCGeometry->GetDCALPhiMin()           ; }
     175           0 :   Float_t  GetDCALPhiMax(void)                const { return fEMCGeometry->GetDCALPhiMax()           ; }
     176           0 :   Float_t  GetEMCALPhiMax(void)               const { return fEMCGeometry->GetEMCALPhiMax()          ; }
     177         154 :   Int_t    GetNECLayers(void)                 const { return fEMCGeometry->GetNECLayers()            ; }
     178           0 :   Float_t  GetDCALInnerExtandedEta(void)      const { return fEMCGeometry->GetDCALInnerExtandedEta() ; }
     179         200 :   Int_t    GetNZ(void)                        const { return fEMCGeometry->GetNZ()                   ; }
     180           2 :   Int_t    GetNEta(void)                      const { return fEMCGeometry->GetNEta()                 ; }
     181         194 :   Int_t    GetNPhi(void)                      const { return fEMCGeometry->GetNPhi()                 ; }
     182         306 :   Float_t  GetECPbRadThick(void)              const { return fEMCGeometry->GetECPbRadThick()         ; }
     183         154 :   Float_t  GetECScintThick(void)              const { return fEMCGeometry->GetECScintThick()         ; }
     184          24 :   Float_t  GetSampling(void)                  const { return fEMCGeometry->GetSampling()             ; } 
     185      130650 :   Int_t    GetNumberOfSuperModules(void)      const { return fEMCGeometry->GetNumberOfSuperModules() ; }
     186           0 :   Float_t  GetPhiGapForSuperModules(void)     const { return fEMCGeometry->GetPhiGapForSuperModules(); }
     187        1350 :   Float_t  GetPhiModuleSize(void)             const { return fEMCGeometry->GetPhiModuleSize()        ; }
     188           6 :   Float_t  GetEtaModuleSize(void)             const { return fEMCGeometry->GetEtaModuleSize()        ; }
     189           0 :   Float_t  GetFrontSteelStrip(void)           const { return fEMCGeometry->GetFrontSteelStrip()      ; }
     190           6 :   Float_t  GetLateralSteelStrip(void)         const { return fEMCGeometry->GetLateralSteelStrip()    ; }
     191           0 :   Float_t  GetPassiveScintThick(void)         const { return fEMCGeometry->GetPassiveScintThick()    ; }
     192           0 :   Float_t  GetPhiTileSize(void)               const { return fEMCGeometry->GetPhiTileSize()          ; }
     193           0 :   Float_t  GetEtaTileSize(void)               const { return fEMCGeometry->GetEtaTileSize()          ; }
     194           0 :   Float_t  GetPhiSuperModule(void)            const { return fEMCGeometry->GetPhiSuperModule()       ; }
     195           0 :   Int_t    GetNPhiSuperModule(void)           const { return fEMCGeometry->GetNPhiSuperModule()      ; }
     196           2 :   Int_t    GetNPHIdiv(void)                   const { return fEMCGeometry->GetNPHIdiv()              ; }
     197           4 :   Int_t    GetNETAdiv(void)                   const { return fEMCGeometry->GetNETAdiv()              ; }
     198           2 :   Int_t    GetNCells(void)                    const { return fEMCGeometry->GetNCells()               ; }
     199           2 :   Float_t  GetLongModuleSize(void)            const { return fEMCGeometry->GetLongModuleSize()       ; }
     200           4 :   Float_t  GetTrd1Angle(void)                 const { return fEMCGeometry->GetTrd1Angle()            ; }
     201           2 :   Float_t  Get2Trd1Dx2(void)                  const { return fEMCGeometry->Get2Trd1Dx2()             ; }
     202          12 :   Float_t  GetTrd1AlFrontThick()              const { return fEMCGeometry->GetTrd1AlFrontThick()     ; }
     203         310 :   Float_t  GetTrd1BondPaperThick()            const { return fEMCGeometry->GetTrd1BondPaperThick()   ; }
     204             :   // --
     205           0 :   Int_t    GetNCellsInSupMod(void)            const { return fEMCGeometry->GetNCellsInSupMod()       ; }
     206           0 :   Int_t    GetNCellsInModule(void)            const { return fEMCGeometry->GetNCellsInModule()       ; }
     207           0 :   Int_t    GetKey110DEG(void)                 const { return fEMCGeometry->GetKey110DEG()            ; }
     208           0 :   Int_t    GetnSupModInDCAL(void)             const { return fEMCGeometry->GetnSupModInDCAL()        ; }
     209           0 :   Int_t    GetILOSS(void)                     const { return fEMCGeometry->GetILOSS()                ; }
     210           0 :   Int_t    GetIHADR(void)                     const { return fEMCGeometry->GetIHADR()                ; }  
     211             :   // --
     212           0 :   Float_t  GetDeltaEta(void)                  const { return fEMCGeometry->GetDeltaEta()             ; }
     213           0 :   Float_t  GetDeltaPhi(void)                  const { return fEMCGeometry->GetDeltaPhi()             ; }
     214           0 :   Int_t    GetNTowers(void)                   const { return fEMCGeometry->GetNTowers()              ; }
     215             :   //
     216          40 :   Double_t GetPhiCenterOfSM(Int_t nsupmod)    const { return fEMCGeometry->GetPhiCenterOfSM(nsupmod) ; }
     217          40 :   Double_t GetPhiCenterOfSMSec(Int_t nsupmod) const { return fEMCGeometry->GetPhiCenterOfSMSec(nsupmod) ; }
     218          12 :   Float_t  GetSuperModulesPar(Int_t ipar)     const { return fEMCGeometry->GetSuperModulesPar(ipar)  ; }
     219             :   //
     220     4132558 :   Int_t    GetSMType(Int_t nSupMod)           const { if( nSupMod > fEMCGeometry->GetNumberOfSuperModules() ) return -1;
     221     4132558 :                                                       return fEMCGeometry->GetEMCSystem()[nSupMod]                ; }
     222             :   Bool_t   IsDCALSM(Int_t nSupMod) const;
     223             :   Bool_t   IsDCALExtSM(Int_t nSupMod) const;
     224             :   Bool_t   GetPhiBoundariesOfSM(Int_t nSupMod, Double_t &phiMin, Double_t &phiMax)    const 
     225           0 :     { return fEMCGeometry->GetPhiBoundariesOfSM(nSupMod, phiMin, phiMax)   ; }
     226             :   Bool_t   GetPhiBoundariesOfSMGap(Int_t nPhiSec, Double_t &phiMin, Double_t &phiMax) const 
     227           0 :     { return fEMCGeometry->GetPhiBoundariesOfSMGap(nPhiSec, phiMin, phiMax); }
     228             :   //
     229             :   // especially for SM in extension, where center of SM != center of the SM-section.
     230             :   // Used in AliEMCALv0 to calculate position.
     231             :   
     232             :   //////////////////////////////////////////////////
     233             :   // Obsolete methods to be thrown out when feasible
     234           0 :   Float_t GetGap2Active(void)                 const { return fEMCGeometry->GetGap2Active()           ; }
     235         194 :   Float_t GetSteelFrontThickness(void)        const { return fEMCGeometry->GetSteelFrontThickness()  ; }
     236           0 :   Float_t GetTrd2AngleY(void)                 const { return fEMCGeometry->GetTrd2AngleY()           ; }
     237           0 :   Float_t Get2Trd2Dy2(void)                   const { return fEMCGeometry->Get2Trd2Dy2()             ; }
     238           0 :   Float_t GetTubsR(void)                      const { return fEMCGeometry->GetTubsR()                ; }
     239           0 :   Float_t GetTubsTurnAngle(void)              const { return fEMCGeometry->GetTubsTurnAngle()        ; }
     240             :   //Float_t GetAlFrontThickness(void)           const { return fEMCGeometry->GetAlFrontThickness()     ; }
     241             :   //Float_t GetIP2ECASection(void)              const { return fEMCGeometry->GetIP2ECASection()        ; }   
     242             :   //////////////////////////////////////////////////
     243             :   
     244             :   ///////////////////////////////
     245             :   //Geometry data member setters
     246             :   //
     247           0 :   void SetNZ(Int_t nz)           { fEMCGeometry->SetNZ(nz)         ; }
     248           0 :   void SetNPhi(Int_t nphi)       { fEMCGeometry->SetNPhi(nphi)     ; }
     249             :   //
     250           0 :   void SetSampling(Float_t samp) { fEMCGeometry->SetSampling(samp) ; }
     251             :   //
     252           8 :   void PrintGeometry()           { fEMCGeometry->PrintGeometry()   ; }  //*MENU*  
     253             :   
     254             :   //////////////////////////
     255             :   // Global geometry methods
     256             :   //
     257             :   void GetGlobal(const Double_t *loc, Double_t *glob, int ind) const;
     258             :   void GetGlobal(const TVector3 &vloc, TVector3 &vglob, int ind) const;
     259             :   void GetGlobal(Int_t absId, Double_t glob[3]) const;
     260             :   void GetGlobal(Int_t absId, TVector3 &vglob) const;
     261             : 
     262             :   ////////////////////////////////////////
     263             :   // May 31, 2006; ALICE numbering scheme: 
     264             :   // see ALICE-INT-2003-038: ALICE Coordinate System and Software Numbering Convention
     265             :   // All indexes are stared from zero now.
     266             :   // 
     267             :   // abs id <-> indexes; Shish-kebab case, only TRD1 now.
     268             :   // EMCAL -> Super Module -> module -> tower(or cell) - logic tree of EMCAL
     269             :   // 
     270             :   //**  Usual name of variable - Dec 18,2006 **
     271             :   //  nSupMod - index of super module (SM)
     272             :   //  nModule - index of module in SM
     273             :   //  nIphi   - phi index of tower(cell) in module
     274             :   //  nIeta   - eta index of tower(cell) in module
     275             :   //  
     276             :   //  Inside SM
     277             :   //  iphim   - phi index of module in SM  
     278             :   //  ietam   - eta index of module in SM  
     279             :   //
     280             :   //  iphi    - phi index of tower(cell) in SM  
     281             :   //  ieta    - eta index of tower(cell) in SM  
     282             :   //
     283             :   // for a given tower index absId returns eta and phi of gravity center of tower.
     284             :   void    EtaPhiFromIndex(Int_t absId, Double_t &eta, Double_t &phi) const;
     285             :   void    EtaPhiFromIndex(Int_t absId, Float_t  &eta, Float_t  &phi) const;
     286             : 
     287             :   Bool_t  GetAbsCellIdFromEtaPhi(Double_t eta,Double_t phi, Int_t &absId) const;
     288             :   Bool_t  SuperModuleNumberFromEtaPhi(Double_t eta, Double_t phi, Int_t &nSupMod) const;
     289             :   Int_t   GetAbsCellId(Int_t nSupMod, Int_t nModule, Int_t nIphi, Int_t nIeta) const;
     290             :   Bool_t  CheckAbsCellId(Int_t absId) const;
     291             :   Bool_t  GetCellIndex(Int_t absId, Int_t &nSupMod, Int_t &nModule, Int_t &nIphi, 
     292             :                        Int_t &nIeta) const;
     293             :   // Local coordinate of Super Module 
     294             :   void    GetModulePhiEtaIndexInSModule(Int_t nSupMod, Int_t nModule, Int_t &iphim, 
     295             :                                         Int_t &ietam) const;
     296             :   void    GetCellPhiEtaIndexInSModule(Int_t nSupMod, Int_t nModule, Int_t nIphi, Int_t nIeta,
     297             :                                       Int_t &iphi, Int_t &ieta) const ;
     298             :   Int_t   GetSuperModuleNumber(Int_t absId)  const;
     299             :   Int_t   GetNumberOfModuleInPhiDirection(Int_t nSupMod)  const
     300             :   { 
     301      129796 :     if(     GetSMType(nSupMod) == kEMCAL_Half) return fNPhi/2;
     302       65635 :     else if(GetSMType(nSupMod) == kEMCAL_3rd)  return fNPhi/3;
     303       64161 :     else if(GetSMType(nSupMod) == kDCAL_Ext)   return fNPhi/3;
     304       64161 :     else                                       return fNPhi;
     305       64898 :   } 
     306             :   // From cell indexes to abs cell id
     307             :   void    GetModuleIndexesFromCellIndexesInSModule(Int_t nSupMod, Int_t iphi, Int_t ieta, 
     308             :                                               Int_t &iphim, Int_t &ietam, Int_t &nModule) const;
     309             :   Int_t   GetAbsCellIdFromCellIndexes(Int_t nSupMod, Int_t iphi, Int_t ieta) const;
     310             : 
     311             :   void    ShiftOnlineToOfflineCellIndexes(Int_t sm, Int_t & iphi, Int_t & ieta) const ;
     312             :   void    ShiftOfflineToOnlineCellIndexes(Int_t sm, Int_t & iphi, Int_t & ieta) const ;
     313             :   
     314             :   // Methods for AliEMCALRecPoint - Feb 19, 2006
     315             :   Bool_t  RelPosCellInSModule(Int_t absId, 
     316             :                               Double_t &xr, Double_t &yr, Double_t &zr) const;
     317             :   Bool_t  RelPosCellInSModule(Int_t absId, Double_t distEff,
     318             :                               Double_t &xr, Double_t &yr, Double_t &zr) const;
     319             :   Bool_t  RelPosCellInSModule(Int_t absId, Double_t loc[3]) const;
     320             :   Bool_t  RelPosCellInSModule(Int_t absId, TVector3 &vloc)  const;
     321             : 
     322           2 :   Int_t  * GetEMCSystem()            const { return fEMCGeometry->GetEMCSystem()          ; }     //EMC System, SM type list
     323             :   // Local Coordinates of SM
     324        5822 :   TArrayD  GetCentersOfCellsEtaDir() const { return fCentersOfCellsEtaDir ; }     // size fNEta*fNETAdiv (for TRD1 only) (eta or z in SM, in cm)
     325           0 :   TArrayD  GetCentersOfCellsXDir()   const { return fCentersOfCellsXDir   ; }     // size fNEta*fNETAdiv (for TRD1 only) (       x in SM, in cm)
     326      123864 :   TArrayD  GetCentersOfCellsPhiDir() const { return fCentersOfCellsPhiDir ; }     // size fNPhi*fNPHIdiv (for TRD1 only) (phi or y in SM, in cm)
     327             :   //
     328           0 :   TArrayD  GetEtaCentersOfCells()    const { return fEtaCentersOfCells    ; }     // [fNEta*fNETAdiv*fNPhi*fNPHIdiv], positive direction (eta>0); eta depend from phi position; 
     329           0 :   TArrayD  GetPhiCentersOfCells()    const { return fPhiCentersOfCells    ; }     // [fNPhi*fNPHIdiv] from center of SM (-10. < phi < +10.)
     330             :         
     331             :   ///////////////////
     332             :   // useful utilities
     333             :   //
     334             :   Float_t AngleFromEta(Float_t eta)        const { // returns theta in radians for a given pseudorapidity
     335           0 :     return 2.0*TMath::ATan(TMath::Exp(-eta));
     336             :   }
     337             :   Float_t ZFromEtaR(Float_t r,Float_t eta) const { // returns z in for a given
     338             :     // pseudorapidity and r=sqrt(x*x+y*y).
     339           0 :     return r/TMath::Tan(AngleFromEta(eta));
     340             :   }
     341             : 
     342             :   //Method to set shift-rotational matrixes from ESDHeader
     343             :   void SetMisalMatrix(const TGeoHMatrix * m, Int_t smod);
     344             :         
     345             :   //Alternate geometry that allows to calculate tower position for different particles and different alignments
     346             :   void RecalculateTowerPosition(Float_t drow, Float_t dcol, const Int_t sm, const Float_t depth,
     347             :                                 const Float_t misaligTransShifts[15], const Float_t misaligRotShifts[15],Float_t global[3]) const;
     348             :   
     349             :   //Returns shift-rotational matrixes for different volumes
     350             :   const TGeoHMatrix * GetMatrixForSuperModule(Int_t smod) const ;
     351             :   const TGeoHMatrix * GetMatrixForSuperModuleFromGeoManager(Int_t smod) const ;
     352             :   const TGeoHMatrix * GetMatrixForSuperModuleFromArray(Int_t smod) const ;
     353             : 
     354             :   Bool_t GetAbsFastORIndexFromTRU(const Int_t iTRU, const Int_t iADC, Int_t& id) const { 
     355           0 :     return fTriggerMapping->GetAbsFastORIndexFromTRU(iTRU, iADC, id);
     356             :   }
     357             :   Bool_t GetAbsFastORIndexFromPositionInTRU(const Int_t iTRU, const Int_t iEta, const Int_t iPhi, Int_t& id) const { 
     358         188 :     return fTriggerMapping->GetAbsFastORIndexFromPositionInTRU(iTRU, iEta, iPhi, id);
     359             :   }
     360             :   Bool_t GetAbsFastORIndexFromPositionInSM(const Int_t  iSM, const Int_t iEta, const Int_t iPhi, Int_t& id) const { 
     361           0 :     return fTriggerMapping->GetAbsFastORIndexFromPositionInSM( iSM, iEta, iPhi, id);
     362             :   }
     363             :   Bool_t GetAbsFastORIndexFromPositionInEMCAL(const Int_t iEta, const Int_t iPhi, Int_t& id) const { 
     364         336 :     return fTriggerMapping->GetAbsFastORIndexFromPositionInEMCAL(iEta, iPhi, id);
     365             :   }
     366             :   Bool_t GetAbsFastORIndexFromPHOSSubregion(const Int_t iPHOS, Int_t& id) const {
     367           0 :     return fTriggerMapping->GetAbsFastORIndexFromPHOSSubregion(iPHOS, id);
     368             :   }
     369             :   Bool_t GetTRUFromAbsFastORIndex(const Int_t id, Int_t& iTRU, Int_t& iADC) const { 
     370          68 :     return fTriggerMapping->GetTRUFromAbsFastORIndex(id, iTRU, iADC);
     371             :   }
     372             :   Bool_t GetPositionInTRUFromAbsFastORIndex(const Int_t id, Int_t& iTRU, Int_t& iEta, Int_t& iPhi) const { 
     373           0 :     return fTriggerMapping->GetPositionInTRUFromAbsFastORIndex(id, iTRU, iEta, iPhi);
     374             :   }
     375             :   Bool_t GetPositionInSMFromAbsFastORIndex(const Int_t id, Int_t& iSM, Int_t& iEta, Int_t& iPhi) const { 
     376           0 :     return fTriggerMapping->GetPositionInSMFromAbsFastORIndex(id, iSM, iEta, iPhi);
     377             :   }
     378             :   Bool_t GetPositionInEMCALFromAbsFastORIndex(const Int_t id, Int_t& iEta, Int_t& iPhi) const { 
     379         452 :     return fTriggerMapping->GetPositionInEMCALFromAbsFastORIndex(id, iEta, iPhi);
     380             :   }
     381             :   Bool_t GetFastORIndexFromCellIndex(const Int_t id, Int_t& idx) const { 
     382         536 :     return fTriggerMapping->GetFastORIndexFromCellIndex(id, idx);
     383             :   }
     384             :   Bool_t GetCellIndexFromFastORIndex(const Int_t id, Int_t idx[4]) const { 
     385           0 :     return fTriggerMapping->GetCellIndexFromFastORIndex(id, idx);
     386             :   }
     387             :   Bool_t GetTRUIndexFromSTUIndex(const Int_t id, Int_t& idx, Int_t detector) const { 
     388           0 :     return fTriggerMapping->GetTRUIndexFromSTUIndex(id, idx, detector);
     389             :   }
     390             :   Bool_t GetTRUIndexFromOnlineIndex(const Int_t id, Int_t& idx) const { 
     391           0 :     return fTriggerMapping->GetTRUIndexFromOnlineIndex(id, idx);
     392             :   }
     393             :   Bool_t GetOnlineIndexFromTRUIndex(const Int_t id, Int_t& idx) const { 
     394           0 :     return fTriggerMapping->GetOnlineIndexFromTRUIndex(id, idx);
     395             :   }
     396             :   Bool_t GetFastORIndexFromL0Index(const Int_t iTRU, const Int_t id, Int_t idx[], const Int_t size) const { 
     397           0 :     return fTriggerMapping->GetFastORIndexFromL0Index(iTRU, id, idx, size);
     398             :   }
     399             :   Int_t  GetTRUIndexFromSTUIndex(const Int_t id, Int_t detector) const { 
     400           0 :     return fTriggerMapping->GetTRUIndexFromSTUIndex(id, detector);
     401             :   }
     402             :   Int_t  GetTRUIndexFromOnlineIndex(const Int_t id) const { 
     403           0 :     return fTriggerMapping->GetTRUIndexFromOnlineIndex(id);
     404             :   }
     405             :   Int_t  GetOnlineIndexFromTRUIndex(const Int_t id) const {
     406         120 :     return fTriggerMapping->GetOnlineIndexFromTRUIndex(id);
     407             :   }
     408             :   Int_t  GetNTotalTRU() const { 
     409         140 :     return fTriggerMapping->GetNTRU(); 
     410             :   }
     411             :   Int_t  GetTRUIndexFromOnlineHwAdd(Int_t hwAdd, Int_t ddl, Int_t sm)const{
     412           0 :     return fTriggerMapping->GetTRUIndexFromOnlineHwAdd(hwAdd, ddl, sm);
     413             :   }
     414             :   Bool_t GetSTUIndexFromTRUIndex(    const Int_t id, Int_t& idx                                    ) const { 
     415           0 :     return fTriggerMapping->GetSTUIndexFromTRUIndex(id, idx ); 
     416             :   }
     417             :   Int_t  GetSTUIndexFromTRUIndex(    const Int_t id                                                ) const { 
     418           0 :     return fTriggerMapping->GetSTUIndexFromTRUIndex(id      ); 
     419             :   }
     420             :   Bool_t GetTRUFromSTU(const Int_t iTRU, const Int_t iADC, Int_t& oTRU, Int_t& oADC, Int_t detector) const { 
     421           0 :     return fTriggerMapping->GetTRUFromSTU(iTRU, iADC, oTRU, oADC, detector); 
     422             :   }
     423             :   Bool_t GetSTUFromTRU(const Int_t iTRU, const Int_t iADC, Int_t& oTRU, Int_t& oADC                ) const {
     424           0 :     return fTriggerMapping->GetSTUFromTRU(iTRU, iADC, oTRU, oADC          ); 
     425             :   }
     426             :   Bool_t GetTRUFromSTU(const Int_t iTRU, const Int_t ieta, const Int_t iphi, Int_t& oTRU, Int_t& oeta, Int_t& ophi, Int_t detector) const {
     427           0 :     return fTriggerMapping->GetTRUFromSTU(iTRU, ieta, iphi, oTRU, oeta, ophi, detector) ;
     428             :   }
     429             :   Bool_t GetSTUFromTRU(const Int_t iTRU, const Int_t ieta, const Int_t iphi, Int_t& oTRU, Int_t& oeta, Int_t& ophi                ) const {
     430           0 :     return fTriggerMapping->GetSTUFromTRU(iTRU, ieta, iphi, oTRU, oeta, ophi          ) ;
     431             :   }
     432             :   Int_t  GetTriggerMappingVersion() const {
     433           4 :     return fTriggerMapping->GetUniqueID();
     434             :   }
     435             : 
     436             : protected:
     437             : 
     438             :   void Init(void);                   // initializes the parameters of EMCAL
     439             :   
     440             :   AliEMCALEMCGeometry * fEMCGeometry;// Geometry object for Electromagnetic calorimeter
     441             : 
     442             :   AliEMCALTriggerMapping* fTriggerMapping; // Trigger mapping
     443             :   
     444             :   TString  fGeoName;                 // geometry name
     445             :   //Int_t    *fEMCSMSystem;              // [fEMCGeometry.fNumberOfSuperModules] geometry structure
     446             :   Int_t    fKey110DEG;               // for calculation abs cell id; 19-oct-05 
     447             :   Int_t    fnSupModInDCAL;           // for calculation abs cell id; 06-nov-12
     448             :   Int_t    fNCellsInSupMod;          // number cell in super module
     449             :   Int_t    fNETAdiv;                 // number eta divizion of module
     450             :   Int_t    fNPHIdiv;                 // number phi divizion of module
     451             :   Int_t    fNCellsInModule;          // number cell in module
     452             :   TArrayD  fPhiBoundariesOfSM;       // phi boundaries of SM in rad; size is fNumberOfSuperModules;
     453             :   TArrayD  fPhiCentersOfSM;          // phi of centers of SM; size is fNumberOfSuperModules/2
     454             :   TArrayD  fPhiCentersOfSMSec;       // phi of centers of section where SM lies; size is fNumberOfSuperModules/2
     455             :   // Local Coordinates of SM
     456             :   TArrayD  fPhiCentersOfCells;       // [fNPhi*fNPHIdiv] from center of SM (-10. < phi < +10.)
     457             :   TArrayD  fCentersOfCellsEtaDir;    // size fNEta*fNETAdiv (for TRD1 only) (eta or z in SM, in cm)
     458             :   TArrayD  fCentersOfCellsPhiDir;    // size fNPhi*fNPHIdiv (for TRD1 only) (phi or y in SM, in cm)
     459             :   TArrayD  fEtaCentersOfCells;       // [fNEta*fNETAdiv*fNPhi*fNPHIdiv], positive direction (eta>0); eta depend from phi position; 
     460             :   Int_t    fNCells;                  // number of cells in calo
     461             :   Int_t    fNPhi;                    // Number of Towers in the PHI direction
     462             :   TArrayD  fCentersOfCellsXDir;      // size fNEta*fNETAdiv (for TRD1 only) (       x in SM, in cm)
     463             :   Float_t  fEnvelop[3];              // the GEANT TUB for the detector 
     464             :   Float_t  fArm1EtaMin;              // Minimum pseudorapidity position of EMCAL in Eta
     465             :   Float_t  fArm1EtaMax;              // Maximum pseudorapidity position of EMCAL in Eta
     466             :   Float_t  fArm1PhiMin;              // Minimum angular position of EMCAL in Phi (degrees)
     467             :   Float_t  fArm1PhiMax;              // Maximum angular position of EMCAL in Phi (degrees)
     468             :   Float_t  fEtaMaxOfTRD1;            // Max eta in case of TRD1 geometry (see AliEMCALShishKebabTrd1Module)
     469             :   Float_t  fDCALPhiMin;              // Minimum angular position of DCAL in Phi (degrees)
     470             :   Float_t  fDCALPhiMax;              // Maximum angular position of DCAL in Phi (degrees)
     471             :   Float_t  fEMCALPhiMax;             // Maximum angular position of EMCAL in Phi (degrees)
     472             :   Float_t  fDCALStandardPhiMax;      // special edge for the case that DCAL contian extension
     473             :   Float_t  fDCALInnerExtandedEta;    // DCAL inner edge in Eta (with some extension)
     474             :   TList   *fShishKebabTrd1Modules;   // list of modules
     475             :   Float_t  fParSM[3];                // SM sizes as in GEANT (TRD1)
     476             :   Float_t  fPhiModuleSize;           // Phi -> X 
     477             :   Float_t  fEtaModuleSize;           // Eta -> Y 
     478             :   Float_t  fPhiTileSize;             // Size of phi tile
     479             :   Float_t  fEtaTileSize;             // Size of eta tile
     480             :   Int_t    fNZ;                      // Number of Towers in the Z direction
     481             :   Float_t  fIPDistance;                    // Radial Distance of the inner surface of the EMCAL
     482             :   Float_t  fLongModuleSize;          // Size of long module
     483             :   // Geometry Parameters
     484             :   Float_t  fShellThickness;              // Total thickness in (x,y) direction
     485             :   Float_t  fZLength;                         // Total length in z direction
     486             :   Float_t  fSampling;                        // Sampling factor
     487             :         
     488             :   TGeoHMatrix* fkSModuleMatrix[AliEMCALGeoParams::fgkEMCALModules] ; //Orientations of EMCAL super modules
     489             :   Bool_t   fUseExternalMatrices;      // Use the matrices set in fkSModuleMatrix and not those in the geoManager
     490             :         
     491             : private:
     492             :   
     493             :   static AliEMCALGeometry *fgGeom;                     // Pointer to the unique instance of the singleton
     494             :   static Bool_t            fgInit;                     // Tells if geometry has been succesfully set up.
     495             :   static const Char_t     *fgkDefaultGeometryName; // Default name of geometry
     496             :   
     497             :   
     498        1236 :   ClassDef(AliEMCALGeometry,17)       // EMCAL geometry class 
     499             : 
     500             : } ;
     501             : 
     502             : #endif // AliEMCALGEOUTILS_H
     503             : 

Generated by: LCOV version 1.11