X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=FMD%2FAliFMD3.cxx;h=83efcab8633ecc5e53cc775a8a12f4ade57dfca0;hb=d750130ac6a69ac0b6ba55dc6474025a53856127;hp=706e1dece8960631fa5075446300c36461b28841;hpb=0d0e69953f8454e6bab7169b95440ec351979811;p=u%2Fmrichter%2FAliRoot.git diff --git a/FMD/AliFMD3.cxx b/FMD/AliFMD3.cxx index 706e1dece89..83efcab8633 100644 --- a/FMD/AliFMD3.cxx +++ b/FMD/AliFMD3.cxx @@ -15,76 +15,92 @@ /* $Id$ */ -////////////////////////////////////////////////////////////////////////////// +//____________________________________________________________________ // -// 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. // -////////////////////////////////////////////////////////////////////////////// -#ifndef ALIFMD3_H -# include "AliFMD3.h" -#endif -#ifndef ROOT_TVirtualMC -# include -#endif -#ifndef ALILOG_H -# include "AliLog.h" -#endif -#ifndef ALIFMDRING_H -# include "AliFMDRing.h" -#endif +#include "AliFMD3.h" // ALIFMD3_H +#include "AliLog.h" // ALILOG_H +#include "AliFMDRing.h" // ALIFMDRING_H +#include // ROOT_TMath -//____________________________________________________________________ -ClassImp(AliFMD3); - -//____________________________________________________________________ -AliFMD3::AliFMD3() - : AliFMDSubDetector(3) -{} +//==================================================================== +ClassImp(AliFMD3) +#if 0 + ; // This is here to keep Emacs for indenting the next line +#endif //____________________________________________________________________ -AliFMD3::~AliFMD3() -{} +AliFMD3::AliFMD3(AliFMDRing* inner, AliFMDRing* outer) + : AliFMDDetector(3, inner, outer) +{ + // Constructor. + SetInnerZ(-62.8); + SetOuterZ(-75.2); + SetNoseZ(); + SetNoseLowR(); + SetNoseHighR(); + SetNoseLength(); + SetBackLowR(); + SetBackHighR(); + SetBackLength(); + SetBeamThickness(); + SetBeamWidth(); + SetConeLength(); + SetFlangeR(); + SetNBeam(); + SetNFlange(); +} //____________________________________________________________________ -void -AliFMD3::SetupGeometry(Int_t airId, Int_t kaptionId) +void +AliFMD3::Init() { - fInnerHoneyLowR = fInner->GetLowR() + 1; - fInnerHoneyHighR = fInner->GetHighR() + 1; - fOuterHoneyLowR = fOuter->GetLowR() + 1; - fOuterHoneyHighR = fOuter->GetHighR() + 1; - - Double_t par[3]; - par[0] = fInner->GetLowR(); - par[1] = fOuterHoneyHighR; - par[2] = fDz = (TMath::Abs(fInnerZ - fOuterZ) - + fInner->GetSiThickness() - + fInner->GetPrintboardThickness() - + fInner->GetLegLength() - + fInner->GetModuleSpacing() - + fHoneycombThickness) / 2; - fVolumeId = gMC->Gsvolu("FMD3", "TUBE", airId, par, 3); - - gMC->Matrix(fRotationId, 90, 0, 90, 90, 0, 0); - //0, 180, 90, 90, 180, 0); - - AliFMDSubDetector::SetupGeometry(airId, kaptionId); + // Initialize + AliFMDDetector::Init(); + SetInnerHoneyHighR(GetOuterHoneyHighR()); + Double_t zdist = fConeLength - fBackLength - fNoseLength; + Double_t tdist = fBackHighR - fNoseHighR; + Double_t innerZh = fInnerZ - fInner->GetRingDepth() - fHoneycombThickness; + Double_t outerZh = fOuterZ - fOuter->GetRingDepth() - fHoneycombThickness; + Double_t minZ = TMath::Min(fNoseZ - fConeLength, outerZh); + fAlpha = tdist / zdist; + fZ = fNoseZ + (minZ - fNoseZ) / 2; + fInnerHoneyHighR = ConeR(innerZh + fHoneycombThickness,"O") - 1; + fOuterHoneyHighR = GetBackLowR(); } //____________________________________________________________________ -void -AliFMD3::Geometry(const char* mother, Int_t pbRotId, - Int_t idRotId, Double_t z) +Double_t +AliFMD3::ConeR(Double_t z, Option_t* opt) const { - z = fInnerZ - fDz; - gMC->Gspos("FMD3", 1, mother, 0, 0, z, fRotationId); - - AliFMDSubDetector::Geometry("FMD3", pbRotId, idRotId, z); + // Calculate the cone radius at Z + if (fAlpha < 0) { + AliWarning(Form("alpha not set: %lf", fAlpha)); + return -1; + } + if (z > fNoseZ) { + AliWarning(Form("z=%lf is before start of cone %lf", z, fNoseZ)); + return -1; + } + if (z < fOuterZ - fOuter->GetRingDepth() - fHoneycombThickness) { + AliWarning(Form("z=%lf is after end of cone %lf", z, + fOuterZ - fOuter->GetRingDepth() - fHoneycombThickness)); + return -1; + } + Double_t e = fBeamThickness / TMath::Cos(TMath::ATan(fAlpha)); + if (opt[0] == 'I' || opt[1] == 'i') e *= -1; + if (z > fNoseZ - fNoseLength) return fNoseHighR + e; + if (z < fNoseZ - fConeLength + fBackLength) return fBackHighR + e; + Double_t r = fNoseHighR + fAlpha * TMath::Abs(z - fNoseZ + fNoseLength) + e; + return r; } - //____________________________________________________________________ //