]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDGeometryBuilder.cxx
In NtupleTrigger(): added loading mappig from CDB (now required)
[u/mrichter/AliRoot.git] / FMD / AliFMDGeometryBuilder.cxx
index ed1e37aa45974e9b229a707dbc9ade5560325bcf..114da15599a27ce4b0f36aaf578d3bb677cb9c59 100644 (file)
 // which has 1 or 2 rings of silicon sensors. 
 //                                                       
 // 
+
+#include <TArrayD.h>           // ROOT_TArrayD
+#include <TGeoManager.h>       // ROOT_TGeoManager
+#include <TGeoTube.h>          // ROOT_TGeoTube
+#include <TGeoTube.h>          // ROOT_TGeoTube
+#include <TGeoVolume.h>                // ROOT_TGeoVolume
+#include <TGeoXtru.h>          // ROOT_TGeoXtru
+#include <TMath.h>
+#include <TVector2.h>          // ROOT_TVector2
+//#include <TGeoMaterial.h>    // ROOT_TGeoMaterial
+//#include <TGeoMedium.h>              // ROOT_TGeoMedium
+//#include <TGeoPcon.h>                // ROOT_TGeoPcon
+//#include <TGeoPolygon.h>     // ROOT_TGeoPolygon
+
 #include "AliFMDGeometryBuilder.h"     // ALIFMDGEOSIMULATOR_H
 #include "AliFMDGeometry.h"    // ALIFMDGEOMETRY_H
 #include "AliFMDDetector.h"    // ALIFMDDETECTOR_H
 #include "AliFMD2.h"           // ALIFMD2_H
 #include "AliFMD3.h"           // ALIFMD3_H
 // #include "AliFMD.h"         // ALIFMD_H
-#include "AliLog.h"            // ALILOG_H
-#include <TGeoVolume.h>                // ROOT_TGeoVolume
-#include <TGeoTube.h>          // ROOT_TGeoTube
-//#include <TGeoPcon.h>                // ROOT_TGeoPcon
-//#include <TGeoMaterial.h>    // ROOT_TGeoMaterial
-//#include <TGeoMedium.h>              // ROOT_TGeoMedium
-#include <TGeoXtru.h>          // ROOT_TGeoXtru
-//#include <TGeoPolygon.h>     // ROOT_TGeoPolygon
-#include <TGeoTube.h>          // ROOT_TGeoTube
-#include <TGeoManager.h>       // ROOT_TGeoManager
-#include <TVector2.h>          // ROOT_TVector2
-#include <TArrayD.h>           // ROOT_TArrayD
+#include "AliFMDDebug.h"               // ALILOG_H
 
 //====================================================================
 ClassImp(AliFMDGeometryBuilder)
@@ -82,14 +85,22 @@ const Char_t* AliFMDGeometryBuilder::fgkFMDName         = "F%dM%c";
 
 //____________________________________________________________________
 AliFMDGeometryBuilder::AliFMDGeometryBuilder() 
-  : fDetailed(kTRUE),
+  : TTask("FMD", "Geomtry builder"),
+    fActiveId(0),
+    fDetailed(kTRUE),
     fUseAssembly(kTRUE),
+    fSectorOff(0),
+    fModuleOff(0),
+    fRingOff(0),
+    fDetectorOff(0),
     fSi(0),
     fC(0),
     fAl(0),
     fPCB(0),
     fChip(0),
-    fPlastic(0)
+    fAir(0),
+    fPlastic(0),
+    fCopper(0)
 {
   // Default constructor
   fActiveId.Set(2);
@@ -98,14 +109,21 @@ AliFMDGeometryBuilder::AliFMDGeometryBuilder()
 //____________________________________________________________________
 AliFMDGeometryBuilder::AliFMDGeometryBuilder(Bool_t detailed) 
   : TTask("FMD", "Geometry builder"),
+    fActiveId(0),
     fDetailed(detailed),
     fUseAssembly(kTRUE),
+    fSectorOff(0),
+    fModuleOff(0),
+    fRingOff(0),
+    fDetectorOff(0),
     fSi(0),
     fC(0),
     fAl(0),
     fPCB(0),
     fChip(0),
-    fPlastic(0)
+    fAir(0),
+    fPlastic(0),
+    fCopper(0)
 {
   // Normal constructor
   // 
@@ -294,7 +312,7 @@ AliFMDGeometryBuilder::RingGeometry(AliFMDRing* r)
 
   // Adding modules to half-rings
   Int_t    nmod =  r->GetNModules();
-  AliDebug(10, Form("making %d modules in ring %c", nmod, id));
+  AliFMDDebug(10, ("making %d modules in ring %c", nmod, id));
   for (Int_t i = 0; i < nmod; i++) {
     if (i == nmod / 2) halfRing = ringBotVolume;
     Bool_t      front =  (i % 2 == 0);
@@ -302,7 +320,7 @@ AliFMDGeometryBuilder::RingGeometry(AliFMDRing* r)
     Double_t    z2    =  z1 + siThick / 2 + space;
     Double_t    th    =  (2 * i + 1) * theta;
     TGeoVolume* vol   =  (front ? frontVolume : backVolume);
-    AliDebug(20, Form("Placing copy %d of %s and %s in %s at z=%f and %f, "
+    AliFMDDebug(20, ("Placing copy %d of %s and %s in %s at z=%f and %f, "
                      "and theta=%f", i, sensorVolume->GetName(), 
                      vol->GetName(), halfRing->GetName(), z1, z2, th));
     TGeoMatrix* mat1  =  new TGeoCombiTrans(0,0,z1,0); 
@@ -377,7 +395,7 @@ AliFMDGeometryBuilder::DetectorGeometry(AliFMDDetector* d,
 
     // Place ring in mother volume
     // TGeoMatrix*matrix=new TGeoTranslation(Form("FMD%d%c trans",id,c),0,0,0);
-    AliDebug(5, Form("Placing volumes %s and %s in %s and %s at z=%f", 
+    AliFMDDebug(5, ("Placing volumes %s and %s in %s and %s at z=%f", 
                     tvol->GetName(), bvol->GetName(), 
                     topMother->GetName(), botMother->GetName(), z));
     topMother->AddNode(tvol, Int_t(c), new TGeoTranslation(0,0,z));
@@ -403,7 +421,7 @@ AliFMDGeometryBuilder::DetectorGeometry(AliFMDDetector* d,
          r->GetLegLength() + 
          hcThick / 2); 
 
-    AliDebug(15, Form("Placing a copy of %s in %s and %s at z=%f", 
+    AliFMDDebug(15, ("Placing a copy of %s in %s and %s at z=%f", 
                      hcVol->GetName(), topMother->GetName(), 
                      botMother->GetName(), z));
     // Add to top 
@@ -442,7 +460,7 @@ AliFMDGeometryBuilder::FMD1Geometry(AliFMD1* fmd1,
   // Must add this after filling the assembly.
   TGeoVolume* top    = gGeoManager->GetVolume("ALIC");
   TGeoMatrix* matrix = new TGeoTranslation("FMD1 trans", 0, 0, z);
-  AliDebug(5, Form("Placing volumes %s and %s in ALIC at z=%f", 
+  AliFMDDebug(5, ("Placing volumes %s and %s in ALIC at z=%f", 
                   fmd1TopVolume->GetName(), fmd1BotVolume->GetName(), z));
   top->AddNode(fmd1TopVolume, fmd1->GetId(), matrix);
   top->AddNode(fmd1BotVolume, fmd1->GetId(), matrix);
@@ -476,7 +494,7 @@ AliFMDGeometryBuilder::FMD2Geometry(AliFMD2* fmd2,
   // Must be done after filling the assemblies 
   TGeoVolume* top = gGeoManager->GetVolume("ALIC");
   TGeoMatrix* matrix = new TGeoTranslation("FMD2 trans", 0, 0, z);
-  AliDebug(5, Form("Placing volumes %s and %s in ALIC at z=%f", 
+  AliFMDDebug(5, ("Placing volumes %s and %s in ALIC at z=%f", 
                   fmd2TopVolume->GetName(), fmd2BotVolume->GetName(), z));
   top->AddNode(fmd2TopVolume, fmd2->GetId(), matrix);
   top->AddNode(fmd2BotVolume, fmd2->GetId(), matrix);
@@ -560,7 +578,7 @@ AliFMDGeometryBuilder::FMD3Geometry(AliFMD3* fmd3,
     Double_t phi       = 360. / n * i + 180. / n;
     Double_t x         = r * TMath::Cos(TMath::Pi() / 180 * phi);
     Double_t y         = r * TMath::Sin(TMath::Pi() / 180 * phi);
-    AliDebug(15, Form("Placing flange %d in %s at (%f,%f,%f) r=%f, phi=%f", 
+    AliFMDDebug(15, ("Placing flange %d in %s at (%f,%f,%f) r=%f, phi=%f", 
                      i, mother->GetName(), x, y, zi, r, phi));
     TGeoRotation* rot    = new TGeoRotation;
     rot->RotateZ(phi);
@@ -596,7 +614,7 @@ AliFMDGeometryBuilder::FMD3Geometry(AliFMD3* fmd3,
   rot->RotateY(180);
   TGeoVolume* top = gGeoManager->GetVolume("ALIC");
   TGeoMatrix* mmatrix = new TGeoCombiTrans("FMD3 trans", 0, 0, z, rot);
-  AliDebug(5, Form("Placing volumes %s and %s in ALIC at z=%f", 
+  AliFMDDebug(5, ("Placing volumes %s and %s in ALIC at z=%f", 
                   fmd3TopVolume->GetName(), fmd3BotVolume->GetName(), z));
   top->AddNode(fmd3TopVolume, fmd3->GetId(), mmatrix);
   top->AddNode(fmd3BotVolume, fmd3->GetId(), mmatrix);
@@ -609,7 +627,7 @@ void
 AliFMDGeometryBuilder::Exec(Option_t*) 
 {
   // Setup up the FMD geometry. 
-  AliDebug(1,  Form("\tGeometry options: %s",
+  AliFMDDebug(1, ("\tGeometry options: %s",
                    (fDetailed  ? "divided into strips" : "one volume")));
   if (!gGeoManager) {
     AliFatal("No TGeoManager defined");