]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDDetector.cxx
correct for omission
[u/mrichter/AliRoot.git] / FMD / AliFMDDetector.cxx
index baa1dd0b5a8d3d36907d49bb424d91fb35cc3d79..b9d636f11a29834968d0141409bb8bfa55ed57a2 100644 (file)
@@ -56,8 +56,6 @@ AliFMDDetector::AliFMDDetector(Int_t id, AliFMDRing* inner, AliFMDRing* outer)
     fId(id), 
     fInnerZ(0.),
     fOuterZ(0.),
-    fHoneycombThickness(0.),
-    fAlThickness(0.),
     fInnerHoneyLowR(0.),
     fInnerHoneyHighR(0.),
     fOuterHoneyLowR(0.),
@@ -73,8 +71,6 @@ AliFMDDetector::AliFMDDetector(Int_t id, AliFMDRing* inner, AliFMDRing* outer)
   //   INNER      Inner ring geometry 
   //   OUTER      Outer ring geometry (if any)
   // 
-  SetHoneycombThickness();
-  SetAlThickness();
   SetInnerHoneyLowR(0);
   SetInnerHoneyHighR(0);
   SetInnerZ(0);
@@ -89,8 +85,6 @@ AliFMDDetector::AliFMDDetector(const AliFMDDetector& other)
     fId(other.fId),
     fInnerZ(0.),
     fOuterZ(0.),
-    fHoneycombThickness(0.),
-    fAlThickness(0.),
     fInnerHoneyLowR(0.),
     fInnerHoneyHighR(0.),
     fOuterHoneyLowR(0.),
@@ -101,8 +95,6 @@ AliFMDDetector::AliFMDDetector(const AliFMDDetector& other)
     fOuterTransforms(other.fOuterTransforms)
 {
   // Copy constructor 
-  SetHoneycombThickness(other.GetHoneycombThickness());
-  SetAlThickness(other.GetAlThickness());
   SetInnerHoneyLowR(other.GetInnerHoneyLowR());
   SetInnerHoneyHighR(other.GetInnerHoneyHighR());
   SetInnerZ(other.GetInnerZ());
@@ -123,8 +115,6 @@ AliFMDDetector::operator=(const AliFMDDetector& other)
   fOuter           = other.fOuter;
   fInnerTransforms = other.fInnerTransforms;
   fOuterTransforms = other.fOuterTransforms;
-  SetHoneycombThickness(other.GetHoneycombThickness());
-  SetAlThickness(other.GetAlThickness());
   SetInnerHoneyLowR(other.GetInnerHoneyLowR());
   SetInnerHoneyHighR(other.GetInnerHoneyHighR());
   SetInnerZ(other.GetInnerZ());
@@ -166,8 +156,10 @@ AliFMDDetector::HasAllTransforms(Char_t ring) const
 #define IS_NODE_THIS(name) \
   (name[0] == 'F' && name[2] == 'M' && name[1] == Char_t(48+fId) && \
    (name[3] == 'T' || name[3] == 'B'))
-#define IS_NODE_SENSOR(name) \
-  (name[0] == 'F' && name[2] == 'S' && name[3] == 'E')
+#define IS_NODE_SENSOR(name)                           \
+  (name[0] == 'F' && (name[2] == 'B' || name[2] == 'F') && name[3] == 'H')
+//#define IS_NODE_SENSOR(name)                         
+//  (name[0] == 'F' && name[2] == 'S' && name[3] == 'E')
 #define IS_NODE_HALF(name) \
   (name[0] == 'F' && name[2] == 'M' && (name[3] == 'B' || name[3] == 'T'))
 #define HALF_FORMAT   "FMD/FMD%d_%c"
@@ -196,6 +188,27 @@ AliFMDDetector::InitTransformations()
   if (fOuter && !fOuterTransforms) 
     fOuterTransforms = new TObjArray(fOuter->GetNModules());
   
+  // Loop over bottom/top 
+  for (size_t ihalf = 0; ihalf < 2; ihalf++) {
+    char  half = (ihalf == 0 ? 'T' : 'B');
+    TString path(Form(HALF_FORMAT, fId, half));
+    TGeoPNEntry* entry = gGeoManager->GetAlignableEntry(path.Data());
+    if (!entry) {
+      AliError(Form("Alignable entry for half-detector \"%s\" not found!", 
+                   path.Data()));
+      continue;
+    }
+    TGeoPhysicalNode* pn = entry->GetPhysicalNode();
+    if (!pn) {
+      AliWarning(Form("Making physical volume for \"%s\"", path.Data()));
+      pn = gGeoManager->MakeAlignablePN(entry);
+      if (!pn) {
+       AliError(Form("No physical node for \"%s\"", path.Data()));
+       continue;
+      }
+    }
+  }
+  
   // Loop over rings 
   for (size_t iring = 0; iring < 2; iring++) {
     char ring = (iring == 0 ? 'I' : 'O');
@@ -243,7 +256,7 @@ AliFMDDetector::InitTransformations()
        // Get transformation matrix for this node, and store it. 
        TGeoMatrix*  t = new TGeoHMatrix(*pm);
        trans->AddAt(t, base+imod);
-       AliFMDDebug(1, ("Found matrix for path \"%s\": %p",path.Data(),pm));
+       AliFMDDebug(5, ("Found matrix for path \"%s\": %p",path.Data(),pm));
       }
     }
   }
@@ -387,7 +400,7 @@ AliFMDDetector::SetAlignableVolumes() const
       case 'T': hasTop = true; break;
       case 'B': hasBottom = true; break;
       default:  
-       AliWarning(Form("Unknown part '%c' of FMD%d", fId));
+       AliWarning(Form("Unknown part '%c' of FMD%d", thisHalf, fId));
        continue; // because the node is unknown. 
       }
       
@@ -529,22 +542,30 @@ AliFMDDetector::Detector2XYZ(Char_t   ring,
   // Translate detector coordinates (this,ring,sector,strip) into
   // (x,y,z) coordinates (in global reference frame)
   AliFMDRing* r = GetRing(ring);
-  if (!r) return;
+  if (!r) { 
+    AliWarning(Form("No such ring FMD%d%c ", fId, ring));
+    return;
+  }
   TGeoMatrix* m = FindTransform(ring, sector);
-  if (!m) return;
+  if (!m) { 
+    AliWarning(Form("No transfrmation found for FMD%d%c[%02d]", 
+                   fId, ring, sector));
+    return;
+  }
   Double_t rho      = r->GetStripRadius(strip);
   Double_t phi      = ((sector % 2) - .5) * r->GetTheta();
   Double_t siThick  = r->GetSiThickness();
+#if 0 
   Double_t modThick = (siThick
                       + r->GetPrintboardThickness()
                       + r->GetCopperThickness()
                       + r->GetChipThickness()
                       + r->GetSpacing());
+#endif
   AliFMDDebug(30, ("Rho %7.3f, angle %7.3f", rho, phi));
-# define DEGRAD TMath::Pi() / 180. 
-  Double_t local[]  = { rho * TMath::Cos(phi * DEGRAD), 
-                       rho * TMath::Sin(phi * DEGRAD), 
-                       -modThick + siThick / 2 };
+  Double_t local[]  = { rho * TMath::Cos(phi * TMath::DegToRad()), 
+                       rho * TMath::Sin(phi * TMath::DegToRad()), 
+                       /* -modThick + */ siThick / 2 };
   Double_t master[3];
   AliFMDDebug(30, ("Local (%7.3f,%7.3f,%7.3f)",local[0], local[1], local[2]));
   m->LocalToMaster(local, master);