LCOV - code coverage report
Current view: top level - PHOS/PHOSUtils - AliPHOSGeoUtils.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 2 50.0 %
Date: 2016-06-14 17:26:59 Functions: 1 6 16.7 %

          Line data    Source code
       1             : #ifndef ALIPHOSGEOUTILS_H
       2             : #define ALIPHOSGEOUTILS_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 for geometry transformations in PHOS
       8             : // this class contains AiRoot-independent transformations,
       9             : // AliRoot part is in AliPHOSGeometry
      10             : // PHOS consists of the electromagnetic calorimeter (EMCA)
      11             : // charged particle veto (CPV) and support
      12             : // 
      13             : //*-- Author: Dmitri Peressounko (RRC "KI")
      14             : 
      15             : // --- ROOT system ---
      16             : #include "TNamed.h"
      17             : 
      18             : // --- AliRoot header files ---
      19             : 
      20             : class TGeoHMatrix ;
      21             : class TVector3;
      22             : class TParticle ;
      23             : class TClonesArray;
      24             : class AliPHOSEMCAGeometry;
      25             : class AliPHOSCPVGeometry;
      26             : class AliPHOSSupportGeometry;
      27             : 
      28             : class AliPHOSGeoUtils : public TNamed {
      29             : 
      30             : public: 
      31             : 
      32             :   AliPHOSGeoUtils() ;
      33             :   AliPHOSGeoUtils(const Text_t* name, const Text_t* title="") ;
      34             :   AliPHOSGeoUtils(const AliPHOSGeoUtils & geom) ;
      35             :   
      36             :   virtual ~AliPHOSGeoUtils(void) ; 
      37             :   AliPHOSGeoUtils & operator = (const AliPHOSGeoUtils  & rvalue) ;
      38             : 
      39             :   Bool_t AbsToRelNumbering(Int_t AbsId, Int_t * RelId) const ; 
      40             :                                          // converts the absolute PHOS cell numbering to a relative 
      41             :   Bool_t RelToAbsNumbering(const Int_t * RelId, Int_t & AbsId) const ; 
      42             :                                          // converts the absolute PHOS numbering to a relative         
      43             :                                          
      44             :   void RelPosInModule(const Int_t * relId, Float_t & y, Float_t & z) const ; 
      45             :                                          // gets the position of element (pad or Xtal) relative to 
      46             :                                          // center of PHOS module  
      47             :   void RelPosToAbsId(Int_t module, Double_t x, Double_t z, Int_t & AbsId) const; 
      48             :                                          // converts local PHOS-module (x, z) coordinates to absId 
      49             :   void RelPosToRelId(Int_t module, Double_t x, Double_t z, Int_t * relId) const; 
      50             :                                          // converts local PHOS-module (x, z) coordinates to relId 
      51             :   void RelPosInAlice(Int_t AbsId, TVector3 &  pos) const ;             
      52             :                                          // gets the position of element (pad or Xtal) relative to Alice
      53             :   void GetCrystalsEdges(Int_t mod, Float_t & xmin, Float_t &zmin, Float_t &xmax, Float_t &zmax) ;
      54             :                                          // Reterns edges of crystal matrix in local frame  
      55             :   
      56             :   void Local2Global(Int_t module, Float_t x, Float_t z, TVector3 &globaPos) const ;
      57             : 
      58             :   void TestSurvey(Int_t module, const Float_t *point, TVector3 &globaPos) const ; //method used in PHOS alignment check
      59             :              
      60             :   void Global2Local(TVector3& localPosition,const TVector3& globalPosition,Int_t module) const ;
      61             : 
      62             :   Bool_t GlobalPos2RelId(TVector3 & global, Int_t * relId) ;
      63             :         //Tranfers global position into numbers in PHOS cols-raws
      64             :         //Returns FALSE if local x,z beyond PHOS. Distance in perpendicular to PHOS direction is not checked.
      65             : 
      66             :   Bool_t ImpactOnEmc(const TParticle * particle,Int_t & ModuleNumber, Double_t & z, Double_t & x) const ;
      67             :                                          //Checks if NEUTRAL particle hits PHOS
      68             :   Bool_t ImpactOnEmc(const Double_t * vtx, const TVector3& vec,                
      69             :                    Int_t & ModuleNumber, Double_t & z, Double_t & x) const ; 
      70             :                                          // calculates the impact coordinates of a neutral particle  
      71             :                                          // emitted in direction theta and phi in ALICE
      72             :   Bool_t ImpactOnEmc(const Double_t * vtx, const Double_t theta, const Double_t phi, 
      73             :                    Int_t & ModuleNumber, Double_t & z, Double_t & x) const ; 
      74             :                                          // calculates the impact coordinates of a neutral particle  
      75             :                                          // emitted in direction theta and phi in ALICE
      76             :   void  GetIncidentVector(const TVector3 &vtx, Int_t module, Float_t x, Float_t z, TVector3& vInc) const ;
      77             :                                          //calculates vector from vertex to current point in module local frame
      78             : 
      79           0 :   Bool_t IsInEMC(Int_t id) const { if (id > fNModules *  fNCristalsInModule ) return kFALSE; return kTRUE; } 
      80             : 
      81             :   //Method to set shift-rotational matrixes from ESDHeader
      82             :   void SetMisalMatrix(const TGeoHMatrix * m, Int_t mod) ;
      83             : 
      84             : protected:
      85             :   //Returns shift-rotational matrixes for different volumes
      86             :   const TGeoHMatrix * GetMatrixForModule(Int_t mod)const ;
      87             :   const TGeoHMatrix * GetMatrixForStrip(Int_t mod, Int_t strip)const ;
      88             :   const TGeoHMatrix * GetMatrixForCPV(Int_t mod)const ;
      89             :   const TGeoHMatrix * GetMatrixForPHOS(Int_t mod)const ;
      90             : 
      91             : protected:
      92             : 
      93             :   AliPHOSEMCAGeometry     *fGeometryEMCA ;   // Geometry object for Electromagnetic calorimeter
      94             :   AliPHOSCPVGeometry      *fGeometryCPV ;    // Geometry object for CPV  (IHEP)
      95             :   AliPHOSSupportGeometry  *fGeometrySUPP ;   // Geometry object for PHOS support
      96             :  
      97             : 
      98             :   Int_t fNModules ;          //Maximal designed number of modules in PHOS
      99             :   Int_t fNCristalsInModule ; //Number of crystals in one module
     100             :   Int_t fNPhi ;              //Number of crystals along Phi direction
     101             :   Int_t fNZ ;                //Number of crystals along Z direction
     102             :   Int_t fNumberOfCPVPadsPhi; //Number of CPV pads along Phi direction
     103             :   Int_t fNumberOfCPVPadsZ ;  //Number of CPV pads along Z direction
     104             :   Int_t fNCellsXInStrip ;    //Number of crystals in strip
     105             :   Int_t fNCellsZInStrip ;    //Number of crystals in strip in Z direction 
     106             :   Int_t fNStripZ ;           //Number of strips in Z direction
     107             : 
     108             :   Float_t fCrystalShift ;    //Distance between center of module and crystal surface
     109             :   Float_t fXtlArrSize[3] ;   //Total size of cristals array
     110             :   Float_t fCryCellShift ; 
     111             :   Float_t fCryStripShift ;
     112             :   Float_t fCellStep ; 
     113             :   Float_t fPadSizePhi ;      //Size of CPV pad in Phi direction
     114             :   Float_t fPadSizeZ ;        //Size of CPV pad in Z direction
     115             :   Float_t fCPVBoxSizeY ;
     116             : 
     117             :   TGeoHMatrix* fEMCMatrix[5] ; //Orientations of crystalls array in modules
     118             :   TGeoHMatrix* fStripMatrix[5][224];  //Orientations of strip units
     119             :   TGeoHMatrix* fCPVMatrix[5] ; //Orientations of CPV
     120             :   const TGeoHMatrix* fPHOSMatrix[5] ; //Orientations of PHOS modules
     121             : 
     122             :   TClonesArray * fMisalArray ;
     123             : 
     124          46 :   ClassDef(AliPHOSGeoUtils,2)       // PHOS geometry class 
     125             : 
     126             : } ;
     127             : 
     128             : #endif // AliPHOSGEOUTILS_H

Generated by: LCOV version 1.11