]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - FMD/AliFMD3.cxx
Removing memory leak
[u/mrichter/AliRoot.git] / FMD / AliFMD3.cxx
... / ...
CommitLineData
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
18//____________________________________________________________________
19//
20// Concrete implementation of AliFMDDetector
21//
22// This implements the geometry for FMD3
23//
24#include "AliFMD3.h" // ALIFMD3_H
25#include "AliLog.h" // ALILOG_H
26#include "AliFMDRing.h" // ALIFMDRING_H
27#include <TMath.h> // ROOT_TMath
28
29//====================================================================
30ClassImp(AliFMD3)
31#if 0
32 ; // This is here to keep Emacs for indenting the next line
33#endif
34
35//____________________________________________________________________
36AliFMD3::AliFMD3(AliFMDRing* inner, AliFMDRing* outer)
37 : AliFMDDetector(3, inner, outer)
38{
39 SetInnerZ(-62.8);
40 SetOuterZ(-75.2);
41 SetNoseZ();
42 SetNoseLowR();
43 SetNoseHighR();
44 SetNoseLength();
45 SetBackLowR();
46 SetBackHighR();
47 SetBackLength();
48 SetBeamThickness();
49 SetBeamWidth();
50 SetConeLength();
51 SetFlangeR();
52 SetNBeam();
53 SetNFlange();
54}
55
56//____________________________________________________________________
57void
58AliFMD3::Init()
59{
60 AliFMDDetector::Init();
61 SetInnerHoneyHighR(GetOuterHoneyHighR());
62 Double_t zdist = fConeLength - fBackLength - fNoseLength;
63 Double_t tdist = fBackHighR - fNoseHighR;
64 Double_t innerZh = fInnerZ - fInner->GetRingDepth() - fHoneycombThickness;
65 Double_t outerZh = fOuterZ - fOuter->GetRingDepth() - fHoneycombThickness;
66 Double_t minZ = TMath::Min(fNoseZ - fConeLength, outerZh);
67 fAlpha = tdist / zdist;
68 fZ = fNoseZ + (minZ - fNoseZ) / 2;
69 fInnerHoneyHighR = ConeR(innerZh + fHoneycombThickness,"O") - 1;
70 fOuterHoneyHighR = GetBackLowR();
71}
72
73//____________________________________________________________________
74Double_t
75AliFMD3::ConeR(Double_t z, Option_t* opt) const
76{
77 // Calculate the cone radius at Z
78 if (fAlpha < 0) {
79 Warning("ConeR", "alpha not set: %lf", fAlpha);
80 return -1;
81 }
82 if (z > fNoseZ) {
83 Warning("ConeR", "z=%lf is before start of cone %lf", z, fNoseZ);
84 return -1;
85 }
86 if (z < fOuterZ - fOuter->GetRingDepth() - fHoneycombThickness) {
87 Warning("ConeR", "z=%lf is after end of cone %lf", z,
88 fOuterZ - fOuter->GetRingDepth() - fHoneycombThickness);
89 return -1;
90 }
91 Double_t e = fBeamThickness / TMath::Cos(TMath::ATan(fAlpha));
92 if (opt[0] == 'I' || opt[1] == 'i') e *= -1;
93 if (z > fNoseZ - fNoseLength) return fNoseHighR + e;
94 if (z < fNoseZ - fConeLength + fBackLength) return fBackHighR + e;
95 Double_t r = fNoseHighR + fAlpha * TMath::Abs(z - fNoseZ + fNoseLength) + e;
96 return r;
97}
98
99
100//____________________________________________________________________
101//
102// EOF
103//