LCOV - code coverage report
Current view: top level - EMCAL/EMCALUtils - AliEMCALTriggerMappingV2.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 9 14 64.3 %
Date: 2016-06-14 17:26:59 Functions: 5 14 35.7 %

          Line data    Source code
       1             : #ifndef ALIEMCALTRIGGERMAPPINGV2_H
       2             : #define ALIEMCALTRIGGERMAPPINGV2_H
       3             : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       4             :  * See cxx source for full Copyright notice                               */
       5             : 
       6             : /*
       7             :  
       8             :  
       9             : Author: 
      10             : H. YOKOYAMA Tsukuba University
      11             : R. GUERNANE LPSC Grenoble CNRS/IN2P3
      12             : */
      13             : 
      14             : #include "AliEMCALTriggerMapping.h"
      15             : class AliEMCALGeometry;
      16             : class AliEMCALTriggerMappingV2 : public AliEMCALTriggerMapping 
      17             : {
      18             : public:
      19             : 
      20             :   //********************************************
      21             :   //static constant
      22             :   //********************************************
      23             :   static const Int_t  fNumberOfSuperModules = 20                                      ;//Total SM in EMCAL
      24             :   static const Int_t  fNTotalTRU            = 52                                      ;//Total TRU in EMCAL
      25             :   static const Int_t  fNModulesInTRUEta     =  8                                      ;//#FastOR/TRU in Eta
      26             :   static const Int_t  fNModulesInTRUPhi     = 12                                      ;//#FastOR/TRU in Phi
      27             :   static const Int_t  fNModulesInTRU        = fNModulesInTRUEta * fNModulesInTRUPhi   ;//#FastOR/TRU
      28             :   static const Int_t  fNTRUEta              =  3                                      ;//#TRUs/SM in Eta  
      29             :   static const Int_t  fNTRUPhi              =  1                                      ;//#TRUs/SM in Phi
      30             :   static const Int_t  fNTRU                 = fNTRUEta * fNTRUPhi                     ;//#TRUs/SM  
      31             :   static const Int_t  fNEta                 = fNModulesInTRUEta * fNTRUEta            ;//#FastOR/SM in Eta
      32             :   static const Int_t  fNPhi                 = fNModulesInTRUPhi * fNTRUPhi            ;//#FastOR/SM in Phi 
      33             :   static const Int_t  fSTURegionNEta        = 2/*Aside,Cside*/ * fNEta                ;//EMCAL+DCAL region eta size
      34             :   static const Int_t  fSTURegionNPhi        = (5 * fNPhi) + (1 * fNPhi/3)   /*EMCAL*/      
      35             :                                             + (3 * fNPhi) + (1 * fNPhi/3)   /*DCAL */ ;//#FastOR/EMCALs in Phi
      36             :   static const Int_t  fSTURegionN           = fSTURegionNEta * fSTURegionNPhi         ;//#FastOR/EMCALs
      37             :   
      38             :   //********************************************
      39             :   //SM type 
      40             :   //********************************************
      41             :   enum fEMCSMType { 
      42             :     kEMCAL_Standard = 0, 
      43             :     kEMCAL_Half     = 1, 
      44             :     kEMCAL_3rd      = 2, 
      45             :     kDCAL_Standard  = 3, 
      46             :     kDCAL_Ext       = 4 
      47             :   }; // possible SM Type
      48             :   enum fDetType { 
      49             :     kEMCAL  = 0, 
      50             :     kDCAL   = 1, 
      51             :     kPHOS   = 2
      52             :   }; 
      53             :         
      54             : 
      55             :   //********************************************
      56             :   //constructor,destructor
      57             :   //********************************************
      58             :   AliEMCALTriggerMappingV2();
      59             :   AliEMCALTriggerMappingV2(Int_t ntru, const AliEMCALGeometry* geo);
      60           0 :   virtual ~AliEMCALTriggerMappingV2() {}
      61             : 
      62             :   //********************************************
      63             :   //Get FastOR index from TRU/SM/EMCAL Geometry
      64             :   //********************************************
      65             :   Bool_t  GetAbsFastORIndexFromTRU(          Int_t iTRU, Int_t iADC, Int_t& id) const;
      66             :   Bool_t  GetAbsFastORIndexFromPositionInTRU(Int_t iTRU, Int_t iEta, Int_t iPhi, Int_t& id) const;  
      67             :   Bool_t  GetAbsFastORIndexFromPositionInSM( Int_t  iSM, Int_t iEta, Int_t iPhi, Int_t& id) const;  
      68             :   Bool_t  GetAbsFastORIndexFromPositionInEMCAL(                Int_t iEta, Int_t iPhi, Int_t& id) const;
      69             :   Bool_t  GetAbsFastORIndexFromPHOSSubregion( Int_t iPHOS, Int_t& id) const;
      70             : 
      71             :   //********************************************
      72             :   //Get TRU/SM/EMCAL Geometry from FastOR index
      73             :   //********************************************
      74             :   Bool_t  GetTRUFromAbsFastORIndex(             Int_t id, Int_t& iTRU , Int_t& iADC) const;
      75             :   Bool_t  GetPositionInTRUFromAbsFastORIndex(   Int_t id, Int_t& iTRU , Int_t& iEta, Int_t& iPhi) const;
      76             :   Bool_t  GetPositionInSMFromAbsFastORIndex(    Int_t id, Int_t& iSM  , Int_t& iEta, Int_t& iPhi) const;
      77             :   Bool_t  GetPositionInEMCALFromAbsFastORIndex( Int_t id,               Int_t& iEta, Int_t& iPhi) const;
      78             : 
      79             :   //********************************************
      80             :   //TRU vs. STU
      81             :   //********************************************
      82             :   Bool_t  GetTRUFromSTU(Int_t iTRU, Int_t iADC, Int_t& oTRU, Int_t& oADC, Int_t detector) const;
      83             :   Bool_t  GetSTUFromTRU(Int_t iTRU, Int_t iADC, Int_t& oTRU, Int_t& oADC                ) const;
      84             :   Bool_t  GetTRUFromSTU(Int_t iTRU, Int_t ieta, Int_t iphi, Int_t& oTRU, Int_t& oeta, Int_t& ophi, Int_t detector) const;
      85             :   Bool_t  GetSTUFromTRU(Int_t iTRU, Int_t ieta, Int_t iphi, Int_t& oTRU, Int_t& oeta, Int_t& ophi                ) const;
      86             : 
      87             :   //********************************************
      88             :   //Cell Index
      89             :   //********************************************
      90             :   Bool_t  GetFastORIndexFromCellIndex(Int_t id, Int_t& idx) const;
      91             :   Bool_t  GetCellIndexFromFastORIndex(Int_t id, Int_t idx[4]) const;
      92             : 
      93             :   //********************************************
      94             :   //TRU index
      95             :   //********************************************
      96             :   Bool_t  GetTRUIndexFromSTUIndex(    Int_t id, Int_t& idx , Int_t detector ) const;
      97             :   Int_t   GetTRUIndexFromSTUIndex(    Int_t id             , Int_t detector ) const;
      98             :   Bool_t  GetSTUIndexFromTRUIndex(    Int_t id, Int_t& idx                  ) const;
      99             :   Int_t   GetSTUIndexFromTRUIndex(    Int_t id                              ) const;
     100           0 :   Bool_t  GetTRUIndexFromOnlineIndex( Int_t id, Int_t& idx) const{idx = id  ; return kTRUE  ;};
     101           0 :   Int_t   GetTRUIndexFromOnlineIndex( Int_t id            ) const{return id ;};
     102           0 :   Bool_t  GetOnlineIndexFromTRUIndex( Int_t id, Int_t& idx) const{idx = id  ; return kTRUE  ;};
     103          60 :   Int_t   GetOnlineIndexFromTRUIndex( Int_t id            ) const{return id ;};
     104             :   Int_t   GetTRUIndexFromOnlineHwAdd(Int_t hwAdd, Int_t ddl, Int_t sm) const;
     105             : 
     106             :   //********************************************
     107             :   //L0 Index
     108             :   //********************************************
     109             :   Bool_t  GetFastORIndexFromL0Index(Int_t iTRU, Int_t id, Int_t idx[], Int_t size) const;
     110             : 
     111             :   Bool_t GetInfoFromAbsFastORIndex(
     112             :     Int_t id, 
     113             :     Int_t& iTRU , Int_t& iADC , Int_t& iEta_TRU , Int_t& iPhi_TRU , 
     114             :     Int_t& iSM  ,               Int_t& iEta_SM  , Int_t& iPhi_SM  
     115             :     ) const;
     116             :         
     117             : private:
     118             :                  
     119             :   AliEMCALTriggerMappingV2(const AliEMCALTriggerMappingV2& rhs);
     120             :   AliEMCALTriggerMappingV2& operator=(const AliEMCALTriggerMappingV2& rhs);
     121             :         
     122             :   //********************************************
     123             :   //fastOR offset parameters
     124             :   //********************************************
     125             :   Int_t   fTRUFastOROffsetX[fNTotalTRU] ;//FastOR offset[#of TRU]
     126             :   Int_t   fTRUFastOROffsetY[fNTotalTRU] ;//
     127             :   Int_t   fnFastORInTRUPhi[ fNTotalTRU] ;//TRU size
     128             :   Int_t   fnFastORInTRUEta[ fNTotalTRU] ;//
     129             :   Bool_t  fTRUIsCside[ fNTotalTRU] ;//
     130             :   
     131             :   Int_t   fSMFastOROffsetX[ fNumberOfSuperModules] ;//FastOR offset[#of SM ]
     132             :   Int_t   fSMFastOROffsetY[ fNumberOfSuperModules] ;//
     133             :   Int_t   fnFastORInSMPhi[  fNumberOfSuperModules] ;//SM size
     134             :   Int_t   fnFastORInSMEta[  fNumberOfSuperModules] ;//
     135             : 
     136             :   Int_t   fnModuleInEMCALPhi[5]    ;//#FastOR/EMCAL in Phi
     137             : 
     138             :   //********************************************
     139             :   //Initialization of FastOR index offset of each SM/TRU
     140             :   //********************************************
     141             :   Bool_t Init_TRU_offset()  ;
     142             :   Bool_t Init_SM_offset()   ;
     143             :   
     144             :   //********************************************
     145             :   //convert AbsFastORIndex from type-A(B) to type-B(A)
     146             :   //********************************************
     147             :   Int_t ConvAbsFastORIndexA2B(  Int_t idA) const  ;
     148             :   Int_t ConvAbsFastORIndexB2A(  Int_t idB) const  ;
     149             : 
     150             :   //********************************************
     151             :   //SM type
     152             :   //********************************************
     153             :   Int_t   GetSMType(Int_t iSM)      const {
     154         696 :     if( iSM<0 || iSM >= fNumberOfSuperModules)return -1  ;
     155         638 :     if( iSM < 10) return kEMCAL_Standard ;
     156          78 :     if( iSM < 12) return kEMCAL_3rd      ;
     157          68 :     if( iSM < 18) return kDCAL_Standard  ;
     158          16 :     if( iSM < 20) return kDCAL_Ext       ;
     159           0 :     return -1 ;
     160         348 :   }
     161             :   Bool_t  GetSMIsCside(Int_t iSM)   const {
     162         160 :     return (iSM%2 == 1)? kTRUE : kFALSE ;
     163             :   }
     164             :     
     165         156 :   ClassDef(AliEMCALTriggerMappingV2,1)
     166             : };
     167             :  
     168             : #endif
     169             : 

Generated by: LCOV version 1.11