* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDGeometry.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:40:37 2006
+ @brief Geometry mananger for the FMD
+*/
//____________________________________________________________________
//
// Forward Multiplicity Detector based on Silicon wafers.
#include "AliFMD2.h" // ALIFMD2_H
#include "AliFMD3.h" // ALIFMD2_H
#include "AliRecPoint.h" // ALIRECPOINT_H
-#include "AliLog.h" // ALIRECPOINT_H
+#include "AliFMDDebug.h" // ALILOG_H
#include <TVector3.h> // ROOT_TVector3
-#include <TMatrix.h> // ROOT_TMatrix
-#include <TParticle.h> // ROOT_TParticle
+// #include <TMatrix.h> // ROOT_TMatrix
+// #include <TParticle.h> // ROOT_TParticle
#include <Riostream.h>
-#ifndef USE_PRE_MOVE
#include "AliFMDGeometryBuilder.h"
-#include <TArrayI.h>
+// #include <TArrayI.h>
#include <TGeoManager.h>
#include <TGeoVolume.h>
#include <TGeoNode.h>
static Int_t FindNodeDepth(const char* name, const char* volname);
-#endif
//====================================================================
//____________________________________________________________________
AliFMDGeometry::AliFMDGeometry()
: AliGeometry("FMD", "Forward multiplicity"),
- fBuilder(0)
+ fIsInitialized(kFALSE),
+ fInner(0),
+ fOuter(0),
+ fFMD1(0),
+ fFMD2(0),
+ fFMD3(0),
+ fUseFMD1(kFALSE),
+ fUseFMD2(kFALSE),
+ fUseFMD3(kFALSE),
+ fBuilder(0),
+ fDetectorOff(0),
+ fModuleOff(0),
+ fRingOff(0),
+ fSectorOff(0),
+ fActive(2),
+ fDetailed(kFALSE),
+ fUseAssembly(kFALSE)
{
// PROTECTED
// Default constructor
fUseFMD1 = kTRUE;
fUseFMD2 = kTRUE;
fUseFMD3 = kTRUE;
-#ifndef USE_PRE_MOVE
fDetailed = kTRUE;
fUseAssembly = kTRUE;
-#endif
fInner = new AliFMDRing('I');
fOuter = new AliFMDRing('O');
fFMD1 = new AliFMD1(fInner);
fFMD2 = new AliFMD2(fInner, fOuter);
fFMD3 = new AliFMD3(fInner, fOuter);
fIsInitialized = kFALSE;
- // fActive.Set(4);
-#ifndef USE_PRE_MOVE
fActive.Reset(-1);
-#endif
}
//____________________________________________________________________
fFMD3(other.fFMD3),
fUseFMD1(other.fUseFMD1),
fUseFMD2(other.fUseFMD2),
- fUseFMD3(other.fUseFMD3)
-#ifndef USE_PRE_MOVE
- , fActive(other.fActive),
+ fUseFMD3(other.fUseFMD3),
+ fBuilder(other.fBuilder),
+ fDetectorOff(other.fDetectorOff),
+ fModuleOff(other.fModuleOff),
+ fRingOff(other.fRingOff),
+ fSectorOff(other.fSectorOff),
+ fActive(other.fActive),
fDetailed(other.fDetailed),
fUseAssembly(other.fUseAssembly)
-#endif
{
// PROTECTED
// Copy constructor
fFMD3->Init();
}
-#ifndef USE_PRE_MOVE
+//____________________________________________________________________
+void
+AliFMDGeometry::InitTransformations()
+{
+ // Find all local <-> global transforms
+ if (!gGeoManager) {
+ AliError("No TGeoManager defined");
+ return;
+ }
+ AliFMDDebug(0, ("Initialising transforms for FMD geometry"));
+ if (fFMD1) fFMD1->InitTransformations();
+ if (fFMD2) fFMD2->InitTransformations();
+ if (fFMD3) fFMD3->InitTransformations();
+}
+
//____________________________________________________________________
void
AliFMDGeometry::Build()
{
+ // Build the geometry
if (!fBuilder) fBuilder = new AliFMDGeometryBuilder(fDetailed);
fBuilder->SetDetailed(fDetailed);
fBuilder->UseAssembly(fUseAssembly);
void
AliFMDGeometry::SetActive(Int_t* active, Int_t n)
{
+ // Set active volumes
fActive.Set(n);
- for (Int_t i = 0; i < n; i++) fActive[i] = active[i];
+ for (Int_t i = 0; i < n; i++) {
+ AliFMDDebug(1, ("Active vol id # %d: %d", i, active[i]));
+ fActive[i] = active[i];
+ }
}
//____________________________________________________________________
void
AliFMDGeometry::AddActive(Int_t active)
{
+ // Add an active volume
Int_t n = fActive.fN;
fActive.Set(n+1);
fActive[n] = active;
Bool_t
AliFMDGeometry::IsActive(Int_t vol) const
{
+ // Check if a volume is active
for (Int_t i = 0; i < fActive.fN; i++)
if (fActive[i] == vol) return kTRUE;
return kFALSE;
}
-
-#endif
//____________________________________________________________________
AliFMDDetector*
// spatial coordinates (x, y, z) in the master reference frame of
// ALICE.
AliFMDDetector* det = GetDetector(detector);
- if (!det) return;
+ if (!det) {
+ AliWarning(Form("Unknown detector %d", detector));
+ return;
+ }
det->Detector2XYZ(ring, sector, strip, x, y, z);
}
void
AliFMDGeometry::GetGlobal(const AliRecPoint* p,
TVector3& pos,
- TMatrix& /* mat */) const
+ TMatrixF& /* mat */) const
{
// Get the global coordinates cooresponding to the reconstructed
// point p. The coordiates is returned in the 3-vector pos passed
return kFALSE;
}
-#ifndef USE_PRE_MOVE
+//____________________________________________________________________
+void
+AliFMDGeometry::SetAlignableVolumes() const
+{
+ // Declare alignable volumes
+ for (Int_t d = 1; d <= 3; d++)
+ if (GetDetector(d)) GetDetector(d)->SetAlignableVolumes();
+}
+
+
//____________________________________________________________________
void
AliFMDGeometry::ExtractGeomInfo()
Int_t moduleDepth = FindNodeDepth("FIFV_0", "ALIC");
Int_t sectorDepth = FindNodeDepth("FISE_1", "ALIC");
fActive.Reset(-1);
- AliDebug(1, Form("Geometry depths:\n"
+ AliFMDDebug(1, ("Geometry depths:\n"
" Sector: %d\n"
" Module: %d\n"
" Ring: %d\n"
if (striVol) AddActive(striVol->GetNumber());
if (stroVol) AddActive(stroVol->GetNumber());
}
- AliDebug(1, Form("Geometry offsets:\n"
+ AliFMDDebug(1, ("Geometry offsets:\n"
" Sector: %d\n"
" Module: %d\n"
" Ring: %d\n"
Int_t
FindNodeDepth(const char* name, const char* volname)
{
+ // Find the depth of a node
TGeoVolume* vol = gGeoManager->GetVolume(volname);
if (!vol) {
std::cerr << "No top volume defined" << std::endl;
if (CheckNodes(node, name, lvl) >= 0) return lvl;
return -1;
}
-#endif
//____________________________________________________________________
//