X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EMCAL%2FAliEMCALGeometry.h;h=1b598d73eb75a9eee50982ec2f7fedf33072d5f2;hb=ba6ac08ea3515b71d5b7067d9ef29a4613c8961a;hp=56f2c3e046911ba36631793f665ca7e215735c9a;hpb=a34b7b9fd22507ff9154f6e74622dad3c2913825;p=u%2Fmrichter%2FAliRoot.git diff --git a/EMCAL/AliEMCALGeometry.h b/EMCAL/AliEMCALGeometry.h index 56f2c3e0469..1b598d73eb7 100644 --- a/EMCAL/AliEMCALGeometry.h +++ b/EMCAL/AliEMCALGeometry.h @@ -1,6 +1,6 @@ #ifndef ALIEMCALGEOMETRY_H #define ALIEMCALGEOMETRY_H -/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * +/* Copyright(c) 1998-2004, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ /* $Id$ */ @@ -11,135 +11,260 @@ // //*-- Author: Sahal Yacoob (LBL / UCT) //*-- and : Yves Schutz (Subatech) - -#include +//*-- and : Aleksei Pavlinov (WSU) - shashlyk staff +//*-- and : Gustavo Conesa: Add TRU mapping. TRU parameters still not fixed. // --- ROOT system --- -#include "TString.h" -#include "TObjArray.h" -#include "TVector3.h" +class TString ; +class TObjArray; +class TVector3; +class TGeoMatrix; +class TParticle ; +class AliEMCALShishKebabTrd1Module; +class AliEMCALRecPoint; +class TClonesArray ; // --- AliRoot header files --- - #include "AliGeometry.h" +#include "AliEMCALAlignData.h" +#include "TArrayD.h" 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) { - // cpy ctor requested by Coding Convention but not yet needed - assert(0==1); - }; - virtual ~AliEMCALGeometry(void) ; - static AliEMCALGeometry * GetInstance(const Text_t* name, - const Text_t* title="") ; - static AliEMCALGeometry * GetInstance() ; - AliEMCALGeometry & operator = (const AliEMCALGeometry & rvalue) const { - // assignement operator requested by coding convention but not needed - assert(0==1) ; - return *(GetInstance()) ; - }; - virtual void GetGlobal(const AliRecPoint *, TVector3 &, TMatrix &) const {} - virtual void GetGlobal(const AliRecPoint *, TVector3 &) const {} - // General - Bool_t IsInitialized(void) const { return fgInit ; } - // Return EMCA geometrical parameters - // geometry - const Float_t GetAirGap() const { return fAirGap ; } - const Float_t GetAlFrontThickness() const { return fAlFrontThick;} - const Float_t GetArm1PhiMin() const { return fArm1PhiMin ; } - const Float_t GetArm1PhiMax() const { return fArm1PhiMax ; } - const Float_t GetArm1EtaMin() const { return fArm1EtaMin;} - const Float_t GetArm1EtaMax() const { return fArm1EtaMax;} - const Float_t GetIPDistance() const { return fIPDistance ; } - const Float_t GetEnvelop(Int_t index) const { return fEnvelop[index] ; } - const Float_t GetShellThickness() const { return fShellThickness ; } - const Float_t GetZLength() const { return fZLength ; } - const Float_t GetGap2Active() const {return fGap2Active ; } - const Float_t GetDeltaEta() const {return (fArm1EtaMax-fArm1EtaMin)/ - ((Float_t)fNZ);} - const Float_t GetDeltaPhi() const {return (fArm1PhiMax-fArm1PhiMin)/ - ((Float_t)fNPhi);} - const Int_t GetNLayers() const {return fNLayers ;} - const Int_t GetNZ() const {return fNZ ;} - const Int_t GetNEta() const {return fNZ ;} - const Int_t GetNPhi() const {return fNPhi ;} - const Float_t GetPbRadThick(){ // returns Pb radiator thickness in cm. - return fPbRadThickness; - } - const Float_t GetFullSintThick(){ // returns Full tower sintilator - // thickness in cm. - return fFullShowerSintThick; - } - const Float_t GetPreSintThick(){ // returns PreShower tower sintilator - // thickness in cm. - return fPreShowerSintThick; - } - Float_t AngleFromEta(Float_t eta){ // returns angle 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,Int_t ipre) const; // returns tower index - // returns tower indexs iz, iphi. - void TowerIndexes(Int_t index,Int_t &iz,Int_t &iphi,Int_t &ipre) 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; - // 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. - Int_t PreTowerIndexFromEtaPhi(Float_t eta,Float_t phi) const; - // Returns theta and phi (degree) for a given EMCAL cell indecated by relid - void PosInAlice(const Int_t *relid,Float_t &theta,Float_t &phi) const ; - // Returns an array indicating the Tower/preshower, iz, and iphi for a - // specific EMCAL indes. - Bool_t AbsToRelNumbering(Int_t AbsId, Int_t *relid) const; - /* - // Returns kTRUE if the two indexs are neighboring towers or preshowers. - Boot_t AliEMCALGeometry::AreNeighbours(Int_t index1,Int_t index2) const; - */ - - protected: - AliEMCALGeometry(const Text_t* name, const Text_t* title="") : - AliGeometry(name, title) {// ctor only for internal usage (singleton) - Init(); - }; - void Init(void) ; // initializes the parameters of EMCAL - - private: - 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 fAirGap; // Distance between envelop and active material - Float_t fAlFrontThick; // Thickness of the front Al face of the support box - Float_t fPreShowerSintThick; // Thickness of the sintilator for the - // preshower part of the calorimeter - Float_t fFullShowerSintThick;// Thickness of the sintilaor for the full - // shower part of the calorimeter - Float_t fPbRadThickness; // Thickness of Pb radiators cm. - 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 - - // It is assumed that Arm1 and Arm2 have the same following 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 fNLayers; // Number of layers of material in the R direction - Int_t fNZ; // Number of Towers in the Z direction - Int_t fNPhi; //Number of Towers in the Phi Direction - - ClassDef(AliEMCALGeometry,3) // EMCAL geometry class - -}; +public: + AliEMCALGeometry(const AliEMCALGeometry& geom):AliGeometry(geom) { + // cpy ctor requested by Coding Convention but not yet needed + Fatal("Cpy ctor", "Not implemented"); + }; + virtual ~AliEMCALGeometry(void); + + static AliEMCALGeometry * GetInstance(const Text_t* name, + const Text_t* title="") ; + static AliEMCALGeometry * GetInstance() ; + AliEMCALGeometry & operator = (const AliEMCALGeometry & /*rvalue*/) const { + // assignement operator requested by coding convention but not needed + Fatal("operator =", "not implemented"); + return *(GetInstance()); + }; + + void FillTRU(const TClonesArray * digits, TClonesArray * amptru, TClonesArray * timeRtru) ; //Fills Trigger Unit matrices with digit amplitudes and time + void GetCellPhiEtaIndexInSModuleFromTRUIndex(Int_t itru, Int_t iphitru, Int_t ietatru, Int_t &ietaSM, Int_t &iphiSM) const ; // Tranforms Eta-Phi Cell index in TRU into Eta-Phi index in Super Module + + // Have to call GetTransformationForSM() before calculation global charachteristics + void GetGlobal(const Double_t *loc, Double_t *glob, int ind) const; + void GetGlobal(const TVector3 &vloc, TVector3 &vglob, int ind) const; + void GetGlobal(Int_t absId, Double_t glob[3]) const; + void GetGlobal(Int_t absId, TVector3 &vglob) const; + // for a given tower index it returns eta and phi of center of that tower. + void EtaPhiFromIndex(Int_t absId,Float_t &eta,Float_t &phi) const; + + // virtual void GetGlobal(const AliEMCALRecPoint *rp, TVector3 &vglob) const; + + virtual void GetGlobal(const AliRecPoint *rp, TVector3 &vglob) const; + // Bool_t AreInSameTower(Int_t id1, Int_t id2) const ; + + virtual void GetGlobal(const AliRecPoint *, TVector3 &, TMatrixF &) 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 EMCAL geometrical parameters + // geometry + Char_t* GetNameOfEMCALEnvelope() const {return "XEN1";} + 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() const {return fNumberOfSuperModules;} + Float_t GetfPhiGapForSuperModules() const {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;} + + Int_t GetNTRU() const {return fNTRU ; } + Int_t GetNTRUEta() const {return fNTRUEta ; } + Int_t GetNTRUPhi() const {return fNTRUPhi ; } + + 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;} + + // TRD1 staff + void CreateListOfTrd1Modules(); + TList *GetShishKebabTrd1Modules() const {return fShishKebabTrd1Modules;} + AliEMCALShishKebabTrd1Module *GetShishKebabModule(Int_t neta); + + void GetTransformationForSM(); + Float_t *GetSuperModulesPars() {return fParSM;} + TGeoMatrix *GetTransformationForSM(int i) { + if(i>=0 && i indexes; Shish-kebab case, only TRD1 now. + // EMCAL -> Super Module -> module -> tower(or cell) - logic tree of EMCAL + // May 31, 2006; ALICE numbering scheme: + // see ALICE-INT-2003-038: ALICE Coordinate System and Software Numbering Convention + // All indexes are stared from zero now. + Int_t GetAbsCellId(Int_t nSupMod, Int_t nTower, Int_t nIphi, Int_t nIeta) const; + Bool_t CheckAbsCellId(Int_t absId) const; + Bool_t GetCellIndex(Int_t absId, Int_t &nSupMod, Int_t &nTower, Int_t &nIphi, Int_t &nIeta) const; + // Local coordinate of Super Module + void GetModulePhiEtaIndexInSModule(Int_t nSupMod, Int_t nTower, Int_t &iphim, Int_t &ietam) const; + void GetCellPhiEtaIndexInSModule(Int_t nSupMod, Int_t nTower, Int_t nIphi, Int_t nIeta, + Int_t &iphi, Int_t &ieta) const ; + Int_t GetSuperModuleNumber(Int_t absId) const; + // Methods for AliEMCALRecPoint - Feb 19, 2006 + Bool_t RelPosCellInSModule(Int_t absId, Double_t &xr, Double_t &yr, Double_t &zr) const; + Bool_t RelPosCellInSModule(Int_t absId, Double_t loc[3]) const; + Bool_t RelPosCellInSModule(Int_t absId, TVector3 &vloc) const; + // --- + 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)); + } + 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 SetNTRU(Int_t ntru) {fNTRU = ntru; printf("SetNTRU: Number of TRUs per SuperModule set to %d", fNTRU) ; } + void SetNTRUEta(Int_t ntru) {fNTRUEta = ntru; ; printf("SetNTRU: Number of TRUs per SuperModule in Etaset to %d", fNTRUEta) ;} + void SetNTRUPhi(Int_t ntru) {fNTRUPhi = ntru; ; printf("SetNTRU: Number of TRUs per SuperModule in Phi set to %d", fNTRUPhi) ;} + + void SetSampling(Float_t samp) { fSampling = samp; printf("SetSampling: Sampling factor set to %f", fSampling) ; } + + Int_t GetNCellsInSupMod() const {return fNCellsInSupMod;} + Int_t GetNCellsInTower() const {return fNCellsInTower; } + + AliEMCALGeometry(); // default ctor only for internal usage (singleton) + +protected: + AliEMCALGeometry(const Text_t* name, const Text_t* title);// ctor only for internal usage (singleton) + + AliEMCALGeometry(const Text_t* name, const Text_t* title, AliEMCALAlignData* alignData) : + AliGeometry(name, title) {// Align data in action + fgAlignData = alignData; + Init(); + CreateListOfTrd1Modules(); + }; + + void Init(void); // initializes the parameters of EMCAL + void CheckAdditionalOptions(); // + void DefineSamplingFraction(); // Jun 5, 2006 + +private: + static AliEMCALGeometry * fgGeom; // pointer to the unique instance of the singleton + static Bool_t fgInit; // Tells if geometry has been succesfully set up. + static AliEMCALAlignData *fgAlignData;// Alignment data, to be replaced by AliAlignData soon + + TString fGeoName; //geometry name + + TObjArray *fArrayOpts; //! array of geometry options + + 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; // Size of phi tile + Float_t fEtaTileSize; // Size of eta tile + Float_t fLongModuleSize; // Size of long module + 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(or module) + //TRU parameters + Int_t fNTRU ; //! Number of TRUs per module + Int_t fNTRUEta ; //! Number of cell rows per Z in one TRU + Int_t fNTRUPhi ; //! Number of cell rows per Phi in one TRU + // 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 + // Local Coordinates of SM + TArrayD fEtaCentersOfCells; // size fNEta*fNETAdiv (for TRD1 only) (eta or z in SM) + TArrayD fXCentersOfCells; // size fNEta*fNETAdiv (for TRD1 only) ( x in SM) + TArrayD fPhiCentersOfCells; // size fNPhi*fNPHIdiv (for TRD1 only) (phi or y in SM) + // Move from AliEMCALv0 - Feb 19, 2006 + TList *fShishKebabTrd1Modules; //! list of modules + // Local coordinates of SM for TRD1 + Float_t fParSM[3]; // SM sizes as in GEANT (TRD1) + TGeoMatrix* fMatrixOfSM[12]; //![fNumberOfSuperModules]; get from gGeoManager; + + char *fAdditionalOpts[4]; //! some additional options for the geometry type and name + int fNAdditionalOpts; //! size of additional options parameter + + ClassDef(AliEMCALGeometry, 10) // EMCAL geometry class + }; #endif // AliEMCALGEOMETRY_H