]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDGeometry.cxx
New treatment of the cluster coordinate (Christoph)
[u/mrichter/AliRoot.git] / FMD / AliFMDGeometry.cxx
index aa637539e806b2e36ea1a3b3923ea1b871082250..2be2bcf867430cdc334d9436a573bef6b49cdc90 100644 (file)
  * 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>
 #include "AliFMDGeometryBuilder.h"
-#include <TArrayI.h>
+// #include <TArrayI.h>
 #include <TGeoManager.h>
 #include <TGeoVolume.h>
 #include <TGeoNode.h>
@@ -97,7 +100,23 @@ AliFMDGeometry::Instance()
 //____________________________________________________________________
 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 
@@ -127,6 +146,11 @@ AliFMDGeometry::AliFMDGeometry(const AliFMDGeometry& other)
     fUseFMD1(other.fUseFMD1), 
     fUseFMD2(other.fUseFMD2), 
     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)
@@ -172,11 +196,12 @@ AliFMDGeometry::Init()
 void
 AliFMDGeometry::InitTransformations()
 {
+  // Find all local <-> global transforms 
   if (!gGeoManager) {
     AliError("No TGeoManager defined");
     return;
   }
-  AliDebug(0, "Initialising transforms for FMD geometry");
+  AliFMDDebug(0, ("Initialising transforms for FMD geometry"));
   if (fFMD1) fFMD1->InitTransformations();
   if (fFMD2) fFMD2->InitTransformations();
   if (fFMD3) fFMD3->InitTransformations();
@@ -186,6 +211,7 @@ AliFMDGeometry::InitTransformations()
 void
 AliFMDGeometry::Build()
 {
+  // Build the geometry 
   if (!fBuilder) fBuilder = new AliFMDGeometryBuilder(fDetailed);
   fBuilder->SetDetailed(fDetailed);
   fBuilder->UseAssembly(fUseAssembly);
@@ -196,9 +222,10 @@ AliFMDGeometry::Build()
 void
 AliFMDGeometry::SetActive(Int_t* active, Int_t n) 
 {
+  // Set active volumes 
   fActive.Set(n);
   for (Int_t i = 0; i < n; i++) { 
-    AliDebug(1, Form("Active vol id # %d: %d", i, active[i]));
+    AliFMDDebug(1, ("Active vol id # %d: %d", i, active[i]));
     fActive[i] = active[i];
   }
 }
@@ -207,6 +234,7 @@ AliFMDGeometry::SetActive(Int_t* active, Int_t n)
 void
 AliFMDGeometry::AddActive(Int_t active)
 {
+  // Add an active volume 
   Int_t n = fActive.fN;
   fActive.Set(n+1);
   fActive[n] = active;
@@ -216,6 +244,7 @@ AliFMDGeometry::AddActive(Int_t 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;
@@ -371,6 +400,16 @@ AliFMDGeometry::Impact(const TParticle* /* particle */) const
   return kFALSE; 
 }
 
+//____________________________________________________________________ 
+void  
+AliFMDGeometry::SetAlignableVolumes() const
+{
+  // Declare alignable volumes
+  for (Int_t d = 1; d <= 3; d++) 
+    if (GetDetector(d)) GetDetector(d)->SetAlignableVolumes();
+}
+
+
 //____________________________________________________________________ 
 void  
 AliFMDGeometry::ExtractGeomInfo()
@@ -389,7 +428,7 @@ 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"
@@ -429,7 +468,7 @@ AliFMDGeometry::ExtractGeomInfo()
     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"
@@ -471,6 +510,7 @@ CheckNodes(TGeoNode* node, const char* name, Int_t& lvl)
 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;