//
//*-- Author: Sahal Yacoob (LBL / UCT)
//*-- and : Yves Schutz (Subatech)
-
-//#include <assert.h>
+//*-- and : Aleksei Pavlinov (WSU) - shashlyk staff
+//*-- and : Gustavo Conesa: Add TRU mapping. TRU parameters still not fixed.
// --- ROOT system ---
class TString ;
-class TObjArray ;
-class TVector3 ;
+class TObjArray;
+class TVector3;
+class TGeoMatrix;
+class TArrayD;
class TParticle ;
+class AliEMCALShishKebabTrd1Module;
+class AliEMCALRecPoint;
+class TClonesArray ;
// --- AliRoot header files ---
-
#include "AliGeometry.h"
+#include "AliEMCALAlignData.h"
class AliEMCALGeometry : public AliGeometry {
public:
// cpy ctor requested by Coding Convention but not yet needed
Fatal("Cpy ctor", "Not implemented");
};
- virtual ~AliEMCALGeometry(void) ;
+ 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()) ;
+ return *(GetInstance());
};
- Bool_t AreInSameTower(Int_t id1, Int_t id2) const ;
+ // Have to call GetTransformationForSM() before calculation global charachteristics
+ void GetGlobal(const Double_t *loc, Double_t *glob, int nsm) const;
+ void GetGlobal(const TVector3 &vloc, TVector3 &vglob, int nsm) 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 index,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 ;
+
+ TClonesArray * FillTRU(const TClonesArray * digits) ;
virtual void GetGlobal(const AliRecPoint *, TVector3 &, TMatrixF &) 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
+ // 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 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 GetGap2Active() const {return fGap2Active ;}
Float_t GetDeltaEta() const {return (fArm1EtaMax-fArm1EtaMin)/
((Float_t)fNZ);}
Float_t GetDeltaPhi() const {return (fArm1PhiMax-fArm1PhiMin)/
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;}
+ 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;}
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 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(Int_t nSupMod, Int_t nTower, Int_t nIphi, Int_t nIeta);
- Bool_t GetCellIndex(Int_t absId, Int_t &nSupMod, Int_t &nTower, Int_t &nIphi, Int_t &nIeta);
- void GetTowerPhiEtaIndexInSModule(Int_t nSupMod, Int_t nTower, Int_t &iphit, Int_t &ietat);
+
+ // TRD1 staff
+ void CreateListOfTrd1Modules();
+ TList *GetShishKebabTrd1Modules() const {return fShishKebabTrd1Modules;}
+ AliEMCALShishKebabTrd1Module *GetShishKebabModule(Int_t neta=0)
+ {
+ static AliEMCALShishKebabTrd1Module* trd1=0;
+ if(fShishKebabTrd1Modules && neta>=0 && neta<fShishKebabTrd1Modules->GetSize()) {
+ trd1 = (AliEMCALShishKebabTrd1Module*)fShishKebabTrd1Modules->At(neta);
+ } else trd1 = 0;
+ return trd1;
+ }
+ void GetTransformationForSM();
+ Float_t *GetSuperModulesPars() {return fParSM;}
+ TGeoMatrix *GetTransformationForSM(int i) {
+ if(i>=0 && GetNumberOfSuperModules()) return fMatrixOfSM[i];
+ else return 0;}
+ // abs id <-> indexes; Shish-kebab case (TRD1 or TRD2)
+ Int_t GetAbsCellId(Int_t nSupMod, Int_t nTower, Int_t nIphi, Int_t nIeta) const;
+ Bool_t CheckAbsCellId(Int_t ind) const; // replace the IsInECA
+ Bool_t GetCellIndex(Int_t absId, Int_t &nSupMod, Int_t &nTower, Int_t &nIphi, Int_t &nIeta) const;
+ void GetTowerPhiEtaIndexInSModule(Int_t nSupMod, Int_t nTower, Int_t &iphit, Int_t &ietat) const;
void GetCellPhiEtaIndexInSModule(Int_t nSupMod, Int_t nTower, Int_t nIphi, Int_t nIeta,
- Int_t &iphi, Int_t &ieta);
- Bool_t CheckAbsCellId(Int_t ind); // replace the IsInECA
+ Int_t &iphi, Int_t &ieta) const ;
+ Int_t GetSuperModuleNumber(Int_t absId) const;
+ // Methods for AliEMCALRecPoint - Frb 19, 2006
+ Bool_t RelPosCellInSModule(Int_t absId, Double_t &xr, Double_t &yr, Double_t &zr);
// ---
- Float_t AngleFromEta(Float_t eta){ // returns theta in radians for a given pseudorapidity
+ 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){ // returns z in for a given
+ 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));
}
+ // These methods are obsolete but use in AliEMCALRecPoint - keep it now
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;
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 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() :
+ AliGeometry() {// ctor only for internal usage (singleton)
+ // default ctor
+ // must be kept public for root persistency purposes, but should never be called
+ // by the outside world
+ CreateListOfTrd1Modules();
+ };
+
protected:
- AliEMCALGeometry(const Text_t* name, const Text_t* title="") :
+ AliEMCALGeometry(const Text_t* name, const Text_t* title) :
AliGeometry(name, title) {// ctor only for internal usage (singleton)
Init();
+ CreateListOfTrd1Modules();
};
- AliEMCALGeometry() :
- AliGeometry() {// 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 CheckAditionalOptions(); //
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 fAlFrontThick; // Thickness of the front Al face of the support box
-
+ static AliEMCALAlignData *fgAlignData;//
+
+ 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
//
Int_t fNCells; // number of cells in calo
Int_t fNCellsInSupMod; // number cell in super module
- Int_t fNCellsInTower; // number cell in tower
+ 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
// 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;
- ClassDef(AliEMCALGeometry,9) // EMCAL geometry class
- };
+ ClassDef(AliEMCALGeometry, 10) // EMCAL geometry class
+ };
#endif // AliEMCALGEOMETRY_H