+ //
+ // Tranforms Eta-Phi Module index in TRU into Eta-Phi index in Super Module
+ void GetModulePhiEtaIndexInSModuleFromTRUIndex(Int_t itru, Int_t iphitru, Int_t ietatru,
+ Int_t &ietaSM, Int_t &iphiSM) const;
+ Int_t GetAbsTRUNumberFromNumberInSm(const Int_t row, const Int_t col, const Int_t sm) const ;
+
+
+ void BuildFastOR2DMap();
+ Bool_t GetAbsFastORIndexFromTRU(const Int_t iTRU, const Int_t iADC, Int_t& id) const;
+ Bool_t GetAbsFastORIndexFromPositionInTRU(const Int_t iTRU, const Int_t iEta, const Int_t iPhi, Int_t& id) const;
+ Bool_t GetAbsFastORIndexFromPositionInSM( const Int_t iSM, const Int_t iEta, const Int_t iPhi, Int_t& id) const;
+ Bool_t GetAbsFastORIndexFromPositionInEMCAL( const Int_t iEta, const Int_t iPhi, Int_t& id) const;
+ Bool_t GetTRUFromAbsFastORIndex(const Int_t id, Int_t& iTRU, Int_t& iADC) const;
+ Bool_t GetPositionInTRUFromAbsFastORIndex(const Int_t id, Int_t& iTRU, Int_t& iEta, Int_t& iPhi) const;
+ Bool_t GetPositionInSMFromAbsFastORIndex(const Int_t id, Int_t& iSM, Int_t& iEta, Int_t& iPhi) const;
+ Bool_t GetPositionInEMCALFromAbsFastORIndex(const Int_t id, Int_t& iEta, Int_t& iPhi) const;
+ Bool_t GetFastORIndexFromCellIndex(const Int_t id, Int_t& idx) const;
+ Bool_t GetCellIndexFromFastORIndex(const Int_t id, Int_t idx[4]) const;
+ Bool_t GetTRUIndexFromSTUIndex(const Int_t id, Int_t& idx) const;
+ Int_t GetTRUIndexFromSTUIndex(const Int_t id) const;
+ Bool_t GetFastORIndexFromL0Index(const Int_t iTRU, const Int_t id, Int_t idx[], const Int_t size) const;
+
+ ///////////////////
+ // useful utilities
+ //
+ Float_t AngleFromEta(Float_t eta) const { // returns theta in radians for a given pseudorapidity
+ return 2.0*TMath::ATan(TMath::Exp(-eta));
+ }
+ Float_t ZFromEtaR(Float_t r,Float_t eta) const { // returns z in for a given
+ // pseudorapidity and r=sqrt(x*x+y*y).
+ return r/TMath::Tan(AngleFromEta(eta));
+ }
+
+ //Method to set shift-rotational matrixes from ESDHeader
+ void SetMisalMatrix(const TGeoHMatrix * m, Int_t smod) {
+ fUseExternalMatrices = kTRUE;
+ if (smod >= 0 && smod < fEMCGeometry->GetNumberOfSuperModules()){
+ if(!fkSModuleMatrix[smod]) fkSModuleMatrix[smod] = new TGeoHMatrix(*m) ; //Set only if not set yet
+ }
+ else AliFatal(Form("Wrong supermodule index -> %d",smod));
+ }
+
+ //Alternate geometry that allows to calculate tower position for different particles and different alignments
+ void RecalculateTowerPosition(Float_t drow, Float_t dcol, const Int_t sm, const Float_t depth,
+ const Float_t misaligTransShifts[15], const Float_t misaligRotShifts[15],Float_t global[3]) const;