]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMD3.cxx
Compilation warnings
[u/mrichter/AliRoot.git] / FMD / AliFMD3.cxx
index 899a7b7b7caa77a01f15c1f15d720532937a8bc4..e41e113ba8ae9ee2aa729b77f41ac1221c29371a 100644 (file)
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
-
 /* $Id$ */
-
+/** @file    AliFMD3.cxx
+    @author  Christian Holm Christensen <cholm@nbi.dk>
+    @date    Sun Mar 26 18:26:12 2006
+    @brief   Concrete implementation of AliFMDDetector for FMD3
+*/
 //____________________________________________________________________
 //                                                                          
-// Concrete implementation of AliFMDSubDetector 
+// Concrete implementation of AliFMDDetector 
 //
-// This implements the geometry for FMD3
+// This implements the geometry for FMD3.
+// This has 2 rings.
+// The support of the FMD3 is a carbon-fibre cone, attached to the ITS
+// support via flanges.  The cone also supports the beam-pipe.
+// The support is a special cone of carbon-fibre made by a Danish
+// Yacht company.
 //
-#include "TVirtualMC.h"                // ROOT_TVirtualMC
-#include "TCONS.h"             // ROOT_TCONS
-#include "TNode.h"             // ROOT_TNode
-#include "TList.h"             // ROOT_TList
+
+#include <TMath.h>             // ROOT_TMath
+
 #include "AliFMD3.h"           // ALIFMD3_H 
-#include "AliLog.h"            // ALILOG_H
+#include "AliFMDDebug.h"               // ALIFMDDEBUG_H ALILOG_H
 #include "AliFMDRing.h"                // ALIFMDRING_H 
-#include <Riostream.h>         // ROOT_Riostream
 
-//____________________________________________________________________
+//====================================================================
 ClassImp(AliFMD3)
+#if 0
+  ; // This is here to keep Emacs for indenting the next line
+#endif
 
 //____________________________________________________________________
-AliFMD3::AliFMD3() 
-  : AliFMDSubDetector(3), 
-    fVolumeId(0)
-{
-  // Default constructor for the FMD3 sub-detector 
-  AliDebug(10, "\t\tDefault CTOR");
-}
-
-
-//____________________________________________________________________
-AliFMD3::~AliFMD3() 
-{
-  // Destructor - does nothing 
-  AliDebug(10, "\t\tDTOR");
-}
-
-
-//____________________________________________________________________
-void 
-AliFMD3::SetupGeometry(Int_t airId, Int_t alId, Int_t carbonId) 
+AliFMD3::AliFMD3(AliFMDRing* inner, AliFMDRing* outer) 
+  : AliFMDDetector(3, inner, outer),
+    fNoseZ(0),
+    fNoseLowR(0),
+    fNoseHighR(0),
+    fNoseLength(0),
+    fBackLowR(0),
+    fBackHighR(0),
+    fBackLength(0),
+    fBeamThickness(0),
+    fBeamWidth(0),
+    fConeLength(0),
+    fFlangeR(0),
+    fZ(0),
+    fAlpha(0), 
+    fNBeam(0), 
+    fNFlange(0)
 {
-  // Setup the FMD3 sub-detector geometry 
-  // 
-  // Parameters:
-  // 
-  //     airId         Id # of the Air medium 
-  //     kaptionId     Id # of the Aluminium medium 
-  // 
-  AliDebug(10, "\tSetting up the geometry for FMD3");
-  Double_t innerZl = fInnerZ;
-  Double_t innerZh = (fInnerZ 
-                     - fInner->GetModuleSpacing() 
-                     - fInner->GetLegLength() 
-                     - fInner->GetSiThickness() 
-                     - fInner->GetPrintboardThickness()
-                     - fHoneycombThickness);
-  Double_t innerRl = fInner->GetLowR();
-  Double_t outerZl = fOuterZ;
-  Double_t outerZh = (fOuterZ 
-                     - fOuter->GetModuleSpacing() 
-                     - fOuter->GetLegLength() 
-                     - fOuter->GetSiThickness() 
-                     - fOuter->GetPrintboardThickness()                      
-                     - fHoneycombThickness);
-  Double_t outerRl = fOuter->GetLowR();
-  
-  fSupport.SetupGeometry(airId, carbonId, 
-                        innerZl, innerZh, innerRl,
-                        outerZl, outerZh, outerRl);
-
-  fInnerHoneyLowR  = fInner->GetLowR() + 1;
-  fInnerHoneyHighR = fSupport.ConeR(innerZh + fHoneycombThickness, "I");
-  fOuterHoneyLowR  = fOuter->GetLowR() + 1;
-  fOuterHoneyHighR = fSupport.GetBackLowR();
-
-  // Identity matrix
-  gMC->Matrix(fRotationId, 90, 0, 90, 90, 0, 0); 
-  //0, 180, 90, 90, 180, 0);
-
-
-  AliFMDSubDetector::SetupGeometry(airId, alId, carbonId);
+  // Constructor. 
+  SetInnerZ(-62.8);
+  SetOuterZ(-75.2);
+  SetNoseZ();
+  SetNoseLowR();
+  SetNoseHighR();
+  SetNoseLength();
+  SetBackLowR();
+  SetBackHighR();
+  SetBackLength();
+  SetBeamThickness();
+  SetBeamWidth();
+  SetConeLength();
+  SetFlangeR();
+  SetNBeam();
+  SetNFlange();
 }
 
 //____________________________________________________________________
-void 
-AliFMD3::Geometry(const char* mother, Int_t pbRotId, 
-                 Int_t idRotId, Double_t z) 
+void
+AliFMD3::Init() 
 {
-  // Position the FMD3 sub-detector volum
-  // 
-  // Parameters 
-  //
-  //     mother     name of the mother volume 
-  //     pbRotId    Printboard roation matrix ID 
-  //     idRotId    Identity rotation matrix ID 
-  //     z          Z position (not really used here, but passed down)
-  //
-  z = fSupport.GetZ();
-  fSupport.Geometry(mother, fRotationId, z);
-  AliDebug(10, Form("\t\tPassing z=%lf to ring volumes", z));
-  AliFMDSubDetector::Geometry("FMD3", pbRotId, idRotId, z);
+  // Initializ
+  AliFMDDetector::Init();
+  SetInnerHoneyHighR(GetOuterHoneyHighR());
+  Double_t zdist   = fConeLength;
+  Double_t tdist   = fBackHighR - fNoseHighR;
+  Double_t innerZh = (fInnerZ - fInner->GetRingDepth());
+  Double_t outerZh = (fOuterZ - fOuter->GetRingDepth() - 
+                     fOuter->GetHoneycombThickness());
+  Double_t minZ    = TMath::Min(fNoseZ - fConeLength, outerZh);
+  fAlpha           = tdist / zdist;
+  fZ               = fNoseZ + (minZ - fNoseZ) / 2;
+  fInnerHoneyHighR = ConeR(innerZh,"I");
+  fOuterHoneyHighR = GetBackLowR();
 }
 
-  
 //____________________________________________________________________
-void 
-AliFMD3::SimpleGeometry(TList* nodes, 
-                       TNode* mother, 
-                       Int_t colour, 
-                       Double_t zMother) 
+Double_t
+AliFMD3::ConeR(Double_t z, Option_t* opt) const
 {
-  // We need to get the equation for the line that connects the 
-  // outer circumfrences of the two rings, as  well as for the line
-  // that connects the inner curcumfrences, so that we can project to
-  // where the honey-comb actually ends. 
-  // 
-  // we have 
-  //   
-  //   y = a * x + b 
-  //   b = y - a * x;
-  // 
-  // For the outer line, we have the two equations 
-  // 
-  //    fOuterHoneyHighR = a * x1 + b;
-  //    fInnerHoneyHighR = a * x2 + b; 
-  // 
-  // where 
-  // 
-  //    x1 = (fOuterZ + fOuter->fSiThickness + fOuter->fPrintboardThickness 
-  //          + fOuter->fLegLength + fModuleSpacing) 
-  //       = fInner - fDz + fHoneycombThickness
-  //    x2 = (fInnerZ + fInner->fSiThickness + fInner->fPrintboardThickness 
-  //          + fInner->fLegLength + fModuleSpacing)
-  // 
-  // and 
-  //
-  //    a  = (fOuterHoneyHighR - fInnerHoneyHighR) / (x1 - x2)
-  //    
-  // 
-  AliDebug(10, "\tCreating simplified geometry for FMD3");
-  Double_t dz = (TMath::Abs(fInnerZ - fOuterZ) 
-                + fOuter->GetSiThickness() 
-                + fOuter->GetPrintboardThickness() 
-                + fOuter->GetLegLength() 
-                + fOuter->GetModuleSpacing() 
-                + fHoneycombThickness) / 2;
-#if 1
-  Double_t x1  = (fOuterZ - (fOuter->GetSiThickness() 
-                            + fOuter->GetPrintboardThickness() 
-                            + fOuter->GetLegLength() 
-                            + fOuter->GetModuleSpacing()));
-  Double_t x2  = (fInnerZ - (fInner->GetSiThickness() 
-                            + fInner->GetPrintboardThickness() 
-                            + fInner->GetLegLength() 
-                            + fInner->GetModuleSpacing()));
-  Double_t ao   = 0;
-  Double_t ao1  = (fOuterHoneyHighR - fInnerHoneyHighR) / (x1 - x2);
-  Double_t ao2  = ((fOuter->GetHighR() - fInner->GetHighR()) 
-                  / (fOuterZ - fInnerZ));
-  Double_t bo   = 0;
-  if (ao2 > ao1) {
-    // std::cout << "Wafer determinds the size" << std::endl;
-    ao  = ao2;
-    bo  = fInner->GetHighR() - ao * fInnerZ;
+  // Calculate the cone radius at Z
+  if (fAlpha < 0) {
+    AliWarning(Form("alpha not set: %lf", fAlpha));
+    return -1;
   }
-  else {
-    ao = ao1;
-    bo = fOuterHoneyHighR - ao * x1;
+  if (z > fNoseZ) {
+    AliWarning(Form("z=%lf is before start of cone %lf", z, fNoseZ));
+    return -1;
   }
-  
-  Double_t y1o = ao * (fInnerZ - 2 * dz) + bo;
-  Double_t y2o = ao * fInnerZ + bo;
-#endif
-  // We probably need to make a PCON here. 
-  TShape* shape = new TCONS("FMD3", "FMD3", "", dz, 
-                           fOuter->GetLowR(),  y1o, /* fOuterHoneyHighR, */
-                           fInner->GetLowR(),  y2o, /* fInnerHoneyHighR, */
-                           0, 360);
-  mother->cd();
-  zMother = fInnerZ - dz;  
-  TNode* node = new TNode("FMD3", "FMD3", shape, 0, 0, zMother, 0);
-  node->SetVisibility(0);
-  nodes->Add(node);
-  AliFMDSubDetector::SimpleGeometry(nodes, node, colour, zMother);
+  if (z < fOuterZ - fOuter->GetFullDepth()) {
+    AliWarning(Form("z=%lf is after end of cone %lf", z, 
+                   fOuterZ - fOuter->GetFullDepth()));
+    return -1;
+  }
+  Bool_t   inner = opt[0] == 'I' || opt[1] == 'i';
+  Double_t off1  = (inner ? fNoseLowR : fNoseHighR);
+  Double_t off2  = (inner ? fBackLowR : fBackHighR);
+  Double_t off3  = (inner ? 0         : fBeamThickness/fAlpha);
+  if (z > fNoseZ - fNoseLength)               return off1;
+  if (z < fNoseZ - fConeLength + fBackLength) return off2;
+  return (off1 + off3 + fAlpha * TMath::Abs(z - fNoseZ + fNoseLength));
 }
 
-//____________________________________________________________________
-void 
-AliFMD3::Gsatt() const
-{
-  // Set draw attributes for the FMD3
-  AliDebug(10, "Setting drawing attributes for FMD3");
-  AliFMDSubDetector::Gsatt();
-  fSupport.Gsatt();
-}
 
 //____________________________________________________________________
 //