X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EMCAL%2FAliEMCALGeometry.h;h=787ef4c86c18172f82ef762ce7879b00faf3fa96;hb=cec9e119613b992bc85052c9bb43e7b9b205068b;hp=a1bebbe27ce464bd8a79df1e58e3a57bcbceb80f;hpb=d87bd0451ba0a37ae17dc2015f4d8dcb91a6db90;p=u%2Fmrichter%2FAliRoot.git diff --git a/EMCAL/AliEMCALGeometry.h b/EMCAL/AliEMCALGeometry.h index a1bebbe27ce..787ef4c86c1 100644 --- a/EMCAL/AliEMCALGeometry.h +++ b/EMCAL/AliEMCALGeometry.h @@ -11,192 +11,174 @@ // //*-- Author: Sahal Yacoob (LBL / UCT) //*-- and : Yves Schutz (Subatech) - -//#include +//*-- and : Alexei Pavlinov (WSU) - shashlyk staff +//*-- and : Gustavo Conesa: Add TRU mapping. TRU parameters still not fixed. // --- ROOT system --- -class TString ; -class TObjArray ; -class TVector3 ; -class TParticle ; +#include +#include +#include +#include +class TVector3; // --- AliRoot header files --- +#include "AliEMCALGeoUtils.h" +#include "AliEMCALEMCGeometry.h" +//class AliRecPoint; +//class AliEMCALRecPoint; -#include "AliGeometry.h" +class AliEMCALGeometry : public AliEMCALGeoUtils { -class AliEMCALGeometry : public AliGeometry { public: - AliEMCALGeometry() { - // default ctor, must be kept public for root persistency purposes, - // but should never be called by the outside world - }; - AliEMCALGeometry(const AliEMCALGeometry& geom):AliGeometry(geom) { - // cpy ctor requested by Coding Convention but not yet needed - Fatal("Cpy ctor", "Not implemented"); - }; - virtual ~AliEMCALGeometry(void) ; + + AliEMCALGeometry(); // default ctor only for internal usage (singleton) + AliEMCALGeometry(const AliEMCALGeometry& geom); + virtual ~AliEMCALGeometry(void); + static AliEMCALGeometry * GetInstance(const Text_t* name, const Text_t* title="") ; - static AliEMCALGeometry * GetInstance() ; - AliEMCALGeometry & operator = (const AliEMCALGeometry & /*rvalue*/) const { + static AliEMCALGeometry * GetInstance(); + AliEMCALGeometry & operator = (const AliEMCALGeometry & /*rvalue*/) { // assignement operator requested by coding convention but not needed Fatal("operator =", "not implemented"); - return *(GetInstance()) ; + return *this; }; - Bool_t AreInSameTower(Int_t id1, Int_t id2) const ; - virtual void GetGlobal(const AliRecPoint *, TVector3 &, TMatrix &) const {} - virtual void GetGlobal(const AliRecPoint *, TVector3 &) const {} - virtual Bool_t Impact(const TParticle *) const {return kTRUE;} - Bool_t IsInEMCAL(Double_t x, Double_t y, Double_t z) const; + ////////// // General - Bool_t IsInitialized(void) const { return fgInit ; } - // Return EMCA geometrical parameters - // geometry - Float_t GetAlFrontThickness() const { return fAlFrontThick;} - Float_t GetArm1PhiMin() const { return fArm1PhiMin ; } - Float_t GetArm1PhiMax() const { return fArm1PhiMax ; } - Float_t GetArm1EtaMin() const { return fArm1EtaMin;} - Float_t GetArm1EtaMax() const { return fArm1EtaMax;} - Float_t GetIPDistance() const { return fIPDistance;} - Float_t GetIP2ECASection() const { return ( GetIPDistance() + GetAlFrontThickness() + GetGap2Active() ) ; } - Float_t GetEnvelop(Int_t index) const { return fEnvelop[index] ; } - Float_t GetShellThickness() const { return fShellThickness ; } - Float_t GetZLength() const { return fZLength ; } - Float_t GetGap2Active() const {return fGap2Active ; } - Float_t GetDeltaEta() const {return (fArm1EtaMax-fArm1EtaMin)/ - ((Float_t)fNZ);} - Float_t GetDeltaPhi() const {return (fArm1PhiMax-fArm1PhiMin)/ - ((Float_t)fNPhi);} - Int_t GetNECLayers() const {return fNECLayers ;} - Int_t GetNZ() const {return fNZ ;} - Int_t GetNEta() const {return fNZ ;} - Int_t GetNPhi() const {return fNPhi ;} - Int_t GetNTowers() const {return fNPhi * fNZ ;} - Float_t GetECPbRadThick()const {return fECPbRadThickness;} - Float_t GetECScintThick() const {return fECScintThick;} - Float_t GetSampling() const {return fSampling ; } - Bool_t IsInECA(Int_t index) const { if ( (index > 0 && (index <= GetNZ() * GetNPhi()))) return kTRUE; else return kFALSE ;} - - Int_t GetNumberOfSuperModules() {return fNumberOfSuperModules;} - Float_t GetfPhiGapForSuperModules() {return fPhiGapForSM;} - Float_t GetPhiModuleSize() const {return fPhiModuleSize;} - Float_t GetEtaModuleSize() const {return fEtaModuleSize;} - Float_t GetFrontSteelStrip() const {return fFrontSteelStrip;} - Float_t GetLateralSteelStrip() const {return fLateralSteelStrip;} - Float_t GetPassiveScintThick() const {return fPassiveScintThick;} - Float_t GetPhiTileSize() const {return fPhiTileSize;} - Float_t GetEtaTileSize() const {return fEtaTileSize;} - Int_t GetNPhiSuperModule() const {return fNPhiSuperModule;} - Int_t GetNPHIdiv() const {return fNPHIdiv ;} - Int_t GetNETAdiv() const {return fNETAdiv ;} - Int_t GetNCells() const {return fNCells;} - Float_t GetSteelFrontThickness() const { return fSteelFrontThick;} - Float_t GetLongModuleSize() const {return fLongModuleSize;} - - Float_t GetTrd1Angle() const {return fTrd1Angle;} - Float_t Get2Trd1Dx2() const {return f2Trd1Dx2;} - Float_t GetTrd2AngleY()const {return fTrd2AngleY;} - Float_t Get2Trd2Dy2() const {return f2Trd2Dy2;} - Float_t GetTubsR() const {return fTubsR;} - Float_t GetTubsTurnAngle() const {return fTubsTurnAngle;} - // Dabs id <-> indexes; Shish-kebab case - Int_t GetAbsCellId(const Int_t nSupMod, const Int_t nTower, const Int_t nIphi, const Int_t nIeta); - Bool_t GetCellIndex(const Int_t absId, Int_t &nSupMod, Int_t &nTower, Int_t &nIphi, Int_t &nIeta); - void GetTowerPhiEtaIndexInSModule(const Int_t nSupMod, const Int_t nTower, Int_t &iphit, Int_t &ietat); - void GetCellPhiEtaIndexInSModule(const Int_t nSupMod, const Int_t nTower, const Int_t nIphi, const Int_t nIeta, - Int_t &iphi, Int_t &ieta); - Bool_t CheckAbsCellId(Int_t ind); // replace the IsInECA - // --- - Float_t AngleFromEta(Float_t eta){ // 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){ // returns z in for a given - // pseudorapidity and r=sqrt(x*x+y*y). - return r/TMath::Tan(AngleFromEta(eta)); - } - Int_t TowerIndex(Int_t iz,Int_t iphi) const; // returns tower index - // returns tower indexs iz, iphi. - void TowerIndexes(Int_t index,Int_t &iz,Int_t &iphi) const; - // for a given tower index it returns eta and phi of center of that tower. - void EtaPhiFromIndex(Int_t index,Float_t &eta,Float_t &phi) const; - // returns x, y, and z (cm) on the inner surface of a given EMCAL Cell specified by relid. - void XYZFromIndex(const Int_t *relid,Float_t &x,Float_t &y, Float_t &z) const; - void XYZFromIndex(Int_t absid, TVector3 &v) const; - // for a given eta and phi in the EMCAL it returns the tower index. - Int_t TowerIndexFromEtaPhi(Float_t eta,Float_t phi) const; - // for a given eta and phi in the EMCAL it returns the pretower index. - void PosInAlice(const Int_t *relid, Float_t &theta, Float_t &phi) const ; - void PosInAlice(Int_t absid, Float_t &theta, Float_t &phi) const ; - Bool_t AbsToRelNumbering(Int_t AbsId, Int_t *relid) const; - void SetNZ(Int_t nz) { fNZ= nz ; printf("SetNZ: Number of modules in Z set to %d", fNZ) ; } - void SetNPhi(Int_t nphi) { fNPhi= nphi ; printf("SetNPhi: Number of modules in Phi set to %d", fNPhi) ; } - void SetSampling(Float_t samp) { fSampling = samp; printf("SetSampling: Sampling factor set to %f", fSampling) ; } + // + Bool_t IsInitialized(void) const { return AliEMCALEMCGeometry::fgInit ; } + static const Char_t* GetDefaultGeometryName() {return AliEMCALEMCGeometry::fgkDefaultGeometryName;} + + ////////////////////////// + // Global geometry methods + // + using AliEMCALGeoUtils::GetGlobal; + +// virtual void GetGlobal(const AliRecPoint *rp, TVector3 & gpos, TMatrixF & /* gmat */) +// const {GetGlobal(rp,gpos); } +// virtual void GetGlobalEMCAL(const AliEMCALRecPoint *rp, TVector3 &vglob) const; +// virtual void GetGlobalEMCAL(const AliEMCALRecPoint *rp, TVector3 & gpos, TMatrixF & /* gmat */) +// const {GetGlobalEMCAL(rp,gpos); } + + // Return EMC geometry parameters + AliEMCALEMCGeometry * GetEMCGeometry() const {return fEMCGeometry ;} + + ////////////////////////////////////// + // Return EMCAL geometrical parameters + // + const Char_t* GetNameOfEMCALEnvelope(void) const {return fEMCGeometry->GetNameOfEMCALEnvelope();} + Float_t GetArm1PhiMin(void) const { return fEMCGeometry->GetArm1PhiMin(); } + Float_t GetArm1PhiMax(void) const { return fEMCGeometry->GetArm1PhiMax(); } + Float_t GetArm1EtaMin(void) const { return fEMCGeometry->GetArm1EtaMin();} + Float_t GetArm1EtaMax(void) const { return fEMCGeometry->GetArm1EtaMax();} + Float_t GetIPDistance(void) const { return fEMCGeometry->GetIPDistance();} + Float_t GetEnvelop(Int_t index) const { return fEMCGeometry->GetEnvelop(index); } + Float_t GetShellThickness(void) const { return fEMCGeometry->GetShellThickness(); } + Float_t GetZLength(void) const { return fEMCGeometry->GetZLength(); } + Int_t GetNECLayers(void) const {return fEMCGeometry->GetNECLayers();} + Int_t GetNZ(void) const {return fEMCGeometry->GetNZ();} + Int_t GetNEta(void) const {return fEMCGeometry->GetNEta();} + Int_t GetNPhi(void) const {return fEMCGeometry->GetNPhi();} + Float_t GetECPbRadThick(void)const {return fEMCGeometry->GetECPbRadThick();} + Float_t GetECScintThick(void) const {return fEMCGeometry->GetECScintThick();} + Float_t GetSampling(void) const {return fEMCGeometry->GetSampling(); } + Int_t GetNumberOfSuperModules(void) const {return fEMCGeometry->GetNumberOfSuperModules();} + Float_t GetfPhiGapForSuperModules(void) const {return fEMCGeometry->GetfPhiGapForSuperModules();} + Float_t GetPhiModuleSize(void) const {return fEMCGeometry->GetPhiModuleSize();} + Float_t GetEtaModuleSize(void) const {return fEMCGeometry->GetEtaModuleSize();} + Float_t GetFrontSteelStrip(void) const {return fEMCGeometry->GetFrontSteelStrip();} + Float_t GetLateralSteelStrip(void) const {return fEMCGeometry->GetLateralSteelStrip();} + Float_t GetPassiveScintThick(void) const {return fEMCGeometry->GetPassiveScintThick();} + Float_t GetPhiTileSize(void) const {return fEMCGeometry->GetPhiTileSize();} + Float_t GetEtaTileSize(void) const {return fEMCGeometry->GetEtaTileSize();} + Int_t GetNPhiSuperModule(void) const {return fEMCGeometry->GetNPhiSuperModule();} + Int_t GetNPHIdiv(void) const {return fEMCGeometry->GetNPHIdiv();} + Int_t GetNETAdiv(void) const {return fEMCGeometry->GetNETAdiv();} + Int_t GetNCells(void) const {return fEMCGeometry->GetNCells();} + Float_t GetLongModuleSize(void) const {return fEMCGeometry->GetLongModuleSize();} + Float_t GetTrd1Angle(void) const {return fEMCGeometry->GetTrd1Angle();} + Float_t Get2Trd1Dx2(void) const {return fEMCGeometry->Get2Trd1Dx2();} + Float_t GetTrd1AlFrontThick() const {return fEMCGeometry->GetTrd1AlFrontThick();} + Float_t GetTrd1BondPaperThick() const {return fEMCGeometry->GetTrd1BondPaperThick();} + // -- + Int_t GetNCellsInSupMod(void) const {return fEMCGeometry->GetNCellsInSupMod();} + Int_t GetNCellsInModule(void) const {return fEMCGeometry->GetNCellsInModule(); } + Int_t GetKey110DEG(void) const {return fEMCGeometry->GetKey110DEG();} + Int_t GetILOSS(void) const {return fEMCGeometry->GetILOSS();} + Int_t GetIHADR(void) const {return fEMCGeometry->GetIHADR();} + // For gamma(Jet) trigger simulations + Int_t GetNTRU() const {return fEMCGeometry->GetNTRU(); } + Int_t GetNTRUEta() const {return fEMCGeometry->GetNTRUEta(); } + Int_t GetNTRUPhi() const {return fEMCGeometry->GetNTRUPhi(); } + Int_t GetNEtaSubOfTRU() const {return fEMCGeometry->GetNEtaSubOfTRU();} + Int_t GetNModulesInTRU() const {return fEMCGeometry->GetNModulesInTRU(); } + Int_t GetNModulesInTRUEta() const {return fEMCGeometry->GetNModulesInTRUEta(); } + Int_t GetNModulesInTRUPhi() const {return fEMCGeometry->GetNModulesInTRUPhi(); } + + // -- + Float_t GetDeltaEta(void) const {return fEMCGeometry->GetDeltaEta();} + Float_t GetDeltaPhi(void) const {return fEMCGeometry->GetDeltaPhi();} + Int_t GetNTowers(void) const {return fEMCGeometry->GetNTowers();} + // + Double_t GetPhiCenterOfSM(Int_t nsupmod) const {return fEMCGeometry->GetPhiCenterOfSM(nsupmod);} + Float_t *GetSuperModulesPars(void) const {return fEMCGeometry->GetSuperModulesPars();} + // + Bool_t GetPhiBoundariesOfSM(Int_t nSupMod, Double_t &phiMin, Double_t &phiMax) const {return fEMCGeometry->GetPhiBoundariesOfSM(nSupMod, phiMin, phiMax);} + Bool_t GetPhiBoundariesOfSMGap(Int_t nPhiSec, Double_t &phiMin, Double_t &phiMax) const {return fEMCGeometry->GetPhiBoundariesOfSMGap(nPhiSec, phiMin, phiMax);} + // + + // Methods for AliEMCALRecPoint with taking into account energy of rec.point - Jul 30. 2007 + using AliEMCALGeoUtils::RelPosCellInSModule; + Bool_t RelPosCellInSModule(Int_t absId,Double_t distEff,Double_t &xr,Double_t &yr, + Double_t & zr) const; + + //Not in use, comment for the moment + //Bool_t RelPosCellInSModule(Int_t absId,Int_t maxAbsId,Double_t distEff,Double_t &xr, + // Double_t &yr,Double_t &zr) const; + + /////////////////////////////// + //Geometry data member setters + // + void SetNZ(Int_t nz) { fEMCGeometry->SetNZ(nz);} + void SetNPhi(Int_t nphi) { fEMCGeometry->SetNPhi(nphi);} + + void SetNTRUEta(Int_t ntru) { fEMCGeometry->SetNTRUEta(ntru);} + void SetNTRUPhi(Int_t ntru) { fEMCGeometry->SetNTRUPhi(ntru);} + void SetSampling(Float_t samp) { fEMCGeometry->SetSampling(samp);} + + void PrintGeometry() {fEMCGeometry->PrintGeometry();} //*MENU* + + ////////////////////////////////////////////////// + // Obsolete methods to be thrown out when feasible + Float_t GetGap2Active(void) const {return fEMCGeometry->GetGap2Active();} + Float_t GetSteelFrontThickness(void) const { return fEMCGeometry->GetSteelFrontThickness();} + Float_t GetTrd2AngleY(void) const {return fEMCGeometry->GetTrd2AngleY();} + Float_t Get2Trd2Dy2(void) const {return fEMCGeometry->Get2Trd2Dy2();} + Float_t GetTubsR(void) const {return fEMCGeometry->GetTubsR();} + Float_t GetTubsTurnAngle(void) const {return fEMCGeometry->GetTubsTurnAngle();} + //Float_t GetAlFrontThickness(void) const { return fEMCGeometry->GetAlFrontThickness();} + // Float_t GetIP2ECASection(void) const { return fEMCGeometry->GetIP2ECASection(); } + ////////////////////////////////////////////////// protected: - AliEMCALGeometry(const Text_t* name, const Text_t* title="") : - AliGeometry(name, title) {// ctor only for internal usage (singleton) - Init(); - }; + + // ctor only for internal usage (singleton) + AliEMCALGeometry(const Text_t* name, const Text_t* title); + void Init(void); // initializes the parameters of EMCAL private: + + //Member data static AliEMCALGeometry * fgGeom; // pointer to the unique instance of the singleton - static Bool_t fgInit; // Tells if geometry has been succesfully set up. - Float_t fAlFrontThick; // Thickness of the front Al face of the support box - - Float_t fECPbRadThickness; // cm, Thickness of the Pb radiators - Float_t fECScintThick; // cm, Thickness of the scintillators - Int_t fNECLayers; // number of scintillator layers - - Float_t fArm1PhiMin; // Minimum angular position of EMCAL in Phi (degrees) - Float_t fArm1PhiMax; // Maximum angular position of EMCAL in Phi (degrees) - Float_t fArm1EtaMin; // Minimum pseudorapidity position of EMCAL in Eta - Float_t fArm1EtaMax; // Maximum pseudorapidity position of EMCAL in Eta - - // Geometry Parameters - Float_t fEnvelop[3]; // the GEANT TUB for the detector - Float_t fIPDistance; // Radial Distance of the inner surface of the EMCAL - Float_t fShellThickness; // Total thickness in (x,y) direction - Float_t fZLength; // Total length in z direction - Float_t fGap2Active; // Gap between the envelop and the active material - Int_t fNZ; // Number of Towers in the Z direction - Int_t fNPhi; // Number of Towers in the PHI direction - Float_t fSampling; // Sampling factor - - // Shish-kebab option - 23-aug-04 by PAI; COMPACT, TWIST, TRD1 and TRD2 - Int_t fNumberOfSuperModules; // default is 12 = 6 * 2 - Float_t fSteelFrontThick; // Thickness of the front stell face of the support box - 9-sep-04 - Float_t fFrontSteelStrip; // 13-may-05 - Float_t fLateralSteelStrip; // 13-may-05 - Float_t fPassiveScintThick; // 13-may-05 - Float_t fPhiModuleSize; // Phi -> X - Float_t fEtaModuleSize; // Eta -> Y - Float_t fPhiTileSize; // - Float_t fEtaTileSize; // - Float_t fLongModuleSize; // - Int_t fNPhiSuperModule; // 6 - number supermodule in phi direction - Int_t fNPHIdiv; // number phi divizion of module - Int_t fNETAdiv; // number eta divizion of module - // - Int_t fNCells; // number of cells in calo - Int_t fNCellsInSupMod; // number cell in super module - Int_t fNCellsInTower; // number cell in tower - // TRD1 options - 30-sep-04 - Float_t fTrd1Angle; // angle in x-z plane (in degree) - Float_t f2Trd1Dx2; // 2*dx2 for TRD1 - Float_t fPhiGapForSM; // Gap betweeen supermodules in phi direction - Int_t fKey110DEG; // for calculation abs cell id; 19-oct-05 - // TRD2 options - 27-jan-07 - Float_t fTrd2AngleY; // angle in y-z plane (in degree) - Float_t f2Trd2Dy2; // 2*dy2 for TRD2 - Float_t fEmptySpace; // 2mm om fred drawing - // Super module as TUBS - Float_t fTubsR; // radius of tubs - Float_t fTubsTurnAngle; // turn angle of tubs in degree - - ClassDef(AliEMCALGeometry,9) // EMCAL geometry class - }; + // static Bool_t fgInit; // Tells if geometry has been succesfully set up. + static const Char_t* fgkDefaultGeometryName; // Default name of geometry + + /////////////////////////////////////////////////////////// + + ClassDef(AliEMCALGeometry, 15) // EMCAL geometry class +}; #endif // AliEMCALGEOMETRY_H