// can be easily implemented
// The title is used to identify the version of CPV used.
//
-//*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC "KI" & SUBATECH)
+// -- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC "KI" & SUBATECH)
// --- ROOT system ---
ClassImp(AliPHOSGeometry)
// these initialisations are needed for a singleton
-AliPHOSGeometry * AliPHOSGeometry::fgGeom = 0 ;
-Bool_t AliPHOSGeometry::fgInit = kFALSE ;
+AliPHOSGeometry * AliPHOSGeometry::fgGeom = 0 ;
+Bool_t AliPHOSGeometry::fgInit = kFALSE ;
+AliPHOSAlignData * AliPHOSGeometry::fgAlignData = 0 ;
//____________________________________________________________________________
AliPHOSGeometry::AliPHOSGeometry() {
}
fgInit = kTRUE ;
-
- fNModules = 5;
- fAngle = 20;
-
+
+ // YK 23.02.2006
+ if(fgAlignData != NULL) {
+ // Number of modules is read from Alignment DB if exists
+ fNModules = fgAlignData->GetNModules();
+ }
+ else {
+ // Number of modules is fixed if Alignment DB does not exist
+ fNModules = 5;
+ fAngle = 20;
+ }
+
fGeometryEMCA = new AliPHOSEMCAGeometry();
fGeometryCPV = new AliPHOSCPVGeometry ();
for ( index = 0; index < fNModules; index++ )
fPHOSAngle[index] = 0.0 ; // Module position angles are set in CreateGeometry()
- this->SetPHOSAngles() ;
fRotMatrixArray = new TObjArray(fNModules) ;
-
+
+ // YK 23.02.2006
+ if(fgAlignData) {
+ // Geometry parameters are read from Alignment DB if exists
+
+ for (Int_t iModule=0; iModule<fNModules; iModule++) {
+ for (Int_t iXYZ=0; iXYZ<3; iXYZ++) {
+ fModuleCenter[iModule][iXYZ] =
+ fgAlignData->GetModuleCenter(iModule,iXYZ);
+ fModuleAngle[iModule][iXYZ][0] =
+ fgAlignData->GetModuleAngle(iModule,iXYZ,0);
+ fModuleAngle[iModule][iXYZ][1] =
+ fgAlignData->GetModuleAngle(iModule,iXYZ,1);
+ }
+ }
+ }
+ else {
+ // Geometry parameters are calculated if Alignment DB does not exist
+
+ SetPHOSAngles();
+ Double_t const kRADDEG = 180.0 / TMath::Pi() ;
+ Float_t r = GetIPtoOuterCoverDistance() + fPHOSParams[3] - GetCPVBoxSize(1) ;
+ for (Int_t iModule=0; iModule<fNModules; iModule++) {
+ fModuleCenter[iModule][0] = r * TMath::Sin(fPHOSAngle[iModule] / kRADDEG );
+ fModuleCenter[iModule][1] =-r * TMath::Cos(fPHOSAngle[iModule] / kRADDEG );
+ fModuleCenter[iModule][2] = 0.;
+
+ fModuleAngle[iModule][0][0] = 90;
+ fModuleAngle[iModule][0][1] = fPHOSAngle[iModule];
+ fModuleAngle[iModule][1][0] = 0;
+ fModuleAngle[iModule][1][1] = 0;
+ fModuleAngle[iModule][2][0] = 90;
+ fModuleAngle[iModule][2][1] = 270 + fPHOSAngle[iModule];
+ }
+ }
+
}
//____________________________________________________________________________
return rv ;
}
+//____________________________________________________________________________
+AliPHOSGeometry * AliPHOSGeometry::GetInstance(const Text_t* name, const Text_t* title,
+ AliPHOSAlignData *alignda)
+{
+ // Returns the pointer of the unique instance
+ // Creates it with the specified options (name, title) if it does not exist yet
+
+ fgAlignData = alignda;
+ return GetInstance(name,title);
+}
+
//____________________________________________________________________________
void AliPHOSGeometry::SetPHOSAngles()
{
#include "AliPHOSEMCAGeometry.h"
#include "AliPHOSCPVGeometry.h"
#include "AliPHOSSupportGeometry.h"
+#include "AliPHOSAlignData.h"
class AliPHOSGeometry : public AliGeometry {
virtual ~AliPHOSGeometry(void) ;
static AliPHOSGeometry * GetInstance(const Text_t* name, const Text_t* title="") ;
+ static AliPHOSGeometry * GetInstance(const Text_t* name, const Text_t* title,
+ AliPHOSAlignData *alignda) ;
static AliPHOSGeometry * GetInstance() ;
virtual void GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos, TMatrixF & gmat) const ;
virtual void GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos) const ;
Float_t GetCellStep(void) const { return 2*(fGeometryEMCA->GetAirCellHalfSize()[0] +
fGeometryEMCA->GetStripWallWidthOut()) ;}
+ Float_t GetModuleCenter(Int_t module, Int_t axis) const {
+ return fModuleCenter[module][axis];}
+ Float_t GetModuleAngle(Int_t module, Int_t axis, Int_t angle) const {
+ return fModuleAngle[module][axis][angle];}
+
+
// Return EMCA geometry parameters
AliPHOSEMCAGeometry * GetEMCAGeometry() const {return fGeometryEMCA ;}
Float_t GetCradleWallThickness(void) const { return fGeometrySUPP->GetCradleWallThickness();}
Float_t GetCradleWall (Int_t index) const { return fGeometrySUPP->GetCradleWall (index); }
Float_t GetCradleWheel (Int_t index) const { return fGeometrySUPP->GetCradleWheel (index); }
+ void Init(void) ; // steering method for PHOS and PPSD/CPV
+
+
+ void SetAlignData(AliPHOSAlignData* alignda) { fgAlignData = alignda; }
+ AliPHOSAlignData * AlignData() {return fgAlignData;}
protected:
// ctor only for internal usage (singleton)
Init() ;
}
- void Init(void) ; // steering method for PHOS and PPSD/CPV
-
private:
Int_t fNModules ; // Number of modules constituing PHOS
AliPHOSEMCAGeometry *fGeometryEMCA ; // Geometry object for Electromagnetic calorimeter
AliPHOSCPVGeometry *fGeometryCPV ; // Geometry object for CPV (IHEP)
AliPHOSSupportGeometry *fGeometrySUPP ; // Geometry object for PHOS support
+ Float_t fModuleCenter[5][3]; // xyz-position of the module center
+ Float_t fModuleAngle[5][3][2]; // polar and azymuth angles for 3 axes of modules
void SetPHOSAngles(); // calculates the PHOS modules PHI angle
static AliPHOSGeometry * fgGeom ; // pointer to the unique instance of the singleton
static Bool_t fgInit ; // Tells if geometry has been succesfully set up
+ static AliPHOSAlignData * fgAlignData; // PHOS alignment data
- ClassDef(AliPHOSGeometry,1) // PHOS geometry class
+ ClassDef(AliPHOSGeometry,2) // PHOS geometry class
} ;
/* History of cvs commits:
*
* $Log$
+ * Revision 1.80 2005/06/17 07:39:07 hristov
+ * Removing GetDebug and SetDebug from AliRun and AliModule. Using AliLog for the messages
+ *
* Revision 1.79 2005/05/28 14:19:05 schutz
* Compilation warnings fixed by T.P.
*
// --- Position PHOS mdules in ALICE setup ---
Int_t idrotm[99] ;
- Double_t const kRADDEG = 180.0 / TMath::Pi() ;
- Float_t * phosParams = geom->GetPHOSParams() ;
-
- Float_t r = geom->GetIPtoOuterCoverDistance() + phosParams[3] - geom->GetCPVBoxSize(1) ;
- Int_t i;
- for( i = 1; i <= geom->GetNModules() ; i++ ) {
+ Int_t iXYZ,iAngle;
+ for (Int_t iModule = 0; iModule < geom->GetNModules(); iModule++ ) {
- Float_t angle = geom->GetPHOSAngle(i) ;
- AliMatrix(idrotm[i-1], 90.,angle, 0., 0., 90., 270. +angle) ;
-
- Float_t xP1 = r * TMath::Sin( angle / kRADDEG ) ;
- Float_t yP1 = -r * TMath::Cos( angle / kRADDEG ) ;
+ Float_t angle[3][2];
+ for (iXYZ=0; iXYZ<3; iXYZ++)
+ for (iAngle=0; iAngle<2; iAngle++)
+ angle[iXYZ][iAngle] = geom->GetModuleAngle(iModule,iXYZ, iAngle);
+ AliMatrix(idrotm[iModule],
+ angle[0][0],angle[0][1],
+ angle[1][0],angle[1][1],
+ angle[2][0],angle[2][1]) ;
- gMC->Gspos("PHOS", i, "ALIC", xP1, yP1, 0.0, idrotm[i-1], "ONLY") ;
-
- }
+ Float_t pos[3];
+ for (iXYZ=0; iXYZ<3; iXYZ++)
+ pos[iXYZ] = geom->GetModuleCenter(iModule,iXYZ);
+ gMC->Gspos("PHOS", iModule+1, "ALIC", pos[0], pos[1], pos[2],
+ idrotm[iModule], "ONLY") ;
+ }
}