Added AliMpStringObjMap, AliMpDEIterator, AliMpDEManager, AliMpSegFactory
[u/mrichter/AliRoot.git] / FMD / AliFMD3.cxx
CommitLineData
4347b38f 1/**************************************************************************
2 * Copyright(c) 2004, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/* $Id$ */
17
ba224443 18//____________________________________________________________________
4347b38f 19//
1a1fdef7 20// Concrete implementation of AliFMDDetector
4347b38f 21//
088f8e79 22// This implements the geometry for FMD3.
23// This has 2 rings.
24// The support of the FMD3 is a carbon-fibre cone, attached to the ITS
25// support via flanges. The cone also supports the beam-pipe.
4347b38f 26//
e802be3e 27#include "AliFMD3.h" // ALIFMD3_H
28#include "AliLog.h" // ALILOG_H
29#include "AliFMDRing.h" // ALIFMDRING_H
1a1fdef7 30#include <TMath.h> // ROOT_TMath
4347b38f 31
1a1fdef7 32//====================================================================
925e6570 33ClassImp(AliFMD3)
1a1fdef7 34#if 0
35 ; // This is here to keep Emacs for indenting the next line
36#endif
4347b38f 37
38//____________________________________________________________________
1a1fdef7 39AliFMD3::AliFMD3(AliFMDRing* inner, AliFMDRing* outer)
40 : AliFMDDetector(3, inner, outer)
4347b38f 41{
088f8e79 42 // Constructor.
1a1fdef7 43 SetInnerZ(-62.8);
44 SetOuterZ(-75.2);
45 SetNoseZ();
46 SetNoseLowR();
47 SetNoseHighR();
48 SetNoseLength();
49 SetBackLowR();
50 SetBackHighR();
51 SetBackLength();
52 SetBeamThickness();
53 SetBeamWidth();
54 SetConeLength();
55 SetFlangeR();
56 SetNBeam();
57 SetNFlange();
4347b38f 58}
59
60//____________________________________________________________________
1a1fdef7 61void
62AliFMD3::Init()
4347b38f 63{
088f8e79 64 // Initialize
1a1fdef7 65 AliFMDDetector::Init();
66 SetInnerHoneyHighR(GetOuterHoneyHighR());
67 Double_t zdist = fConeLength - fBackLength - fNoseLength;
68 Double_t tdist = fBackHighR - fNoseHighR;
69 Double_t innerZh = fInnerZ - fInner->GetRingDepth() - fHoneycombThickness;
70 Double_t outerZh = fOuterZ - fOuter->GetRingDepth() - fHoneycombThickness;
71 Double_t minZ = TMath::Min(fNoseZ - fConeLength, outerZh);
72 fAlpha = tdist / zdist;
73 fZ = fNoseZ + (minZ - fNoseZ) / 2;
74 fInnerHoneyHighR = ConeR(innerZh + fHoneycombThickness,"O") - 1;
75 fOuterHoneyHighR = GetBackLowR();
4347b38f 76}
77
ba224443 78//____________________________________________________________________
1a1fdef7 79Double_t
80AliFMD3::ConeR(Double_t z, Option_t* opt) const
ba224443 81{
1a1fdef7 82 // Calculate the cone radius at Z
83 if (fAlpha < 0) {
088f8e79 84 AliWarning(Form("alpha not set: %lf", fAlpha));
1a1fdef7 85 return -1;
ba224443 86 }
1a1fdef7 87 if (z > fNoseZ) {
088f8e79 88 AliWarning(Form("z=%lf is before start of cone %lf", z, fNoseZ));
1a1fdef7 89 return -1;
ba224443 90 }
1a1fdef7 91 if (z < fOuterZ - fOuter->GetRingDepth() - fHoneycombThickness) {
088f8e79 92 AliWarning(Form("z=%lf is after end of cone %lf", z,
93 fOuterZ - fOuter->GetRingDepth() - fHoneycombThickness));
1a1fdef7 94 return -1;
95 }
96 Double_t e = fBeamThickness / TMath::Cos(TMath::ATan(fAlpha));
97 if (opt[0] == 'I' || opt[1] == 'i') e *= -1;
98 if (z > fNoseZ - fNoseLength) return fNoseHighR + e;
99 if (z < fNoseZ - fConeLength + fBackLength) return fBackHighR + e;
100 Double_t r = fNoseHighR + fAlpha * TMath::Abs(z - fNoseZ + fNoseLength) + e;
101 return r;
ba224443 102}
103
4347b38f 104
105//____________________________________________________________________
106//
107// EOF
108//