]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMD3.cxx
Removing memory leak
[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//
22// This implements the geometry for FMD3
23//
e802be3e 24#include "AliFMD3.h" // ALIFMD3_H
25#include "AliLog.h" // ALILOG_H
26#include "AliFMDRing.h" // ALIFMDRING_H
1a1fdef7 27#include <TMath.h> // ROOT_TMath
4347b38f 28
1a1fdef7 29//====================================================================
925e6570 30ClassImp(AliFMD3)
1a1fdef7 31#if 0
32 ; // This is here to keep Emacs for indenting the next line
33#endif
4347b38f 34
35//____________________________________________________________________
1a1fdef7 36AliFMD3::AliFMD3(AliFMDRing* inner, AliFMDRing* outer)
37 : AliFMDDetector(3, inner, outer)
4347b38f 38{
1a1fdef7 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();
4347b38f 54}
55
56//____________________________________________________________________
1a1fdef7 57void
58AliFMD3::Init()
4347b38f 59{
1a1fdef7 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();
4347b38f 71}
72
ba224443 73//____________________________________________________________________
1a1fdef7 74Double_t
75AliFMD3::ConeR(Double_t z, Option_t* opt) const
ba224443 76{
1a1fdef7 77 // Calculate the cone radius at Z
78 if (fAlpha < 0) {
79 Warning("ConeR", "alpha not set: %lf", fAlpha);
80 return -1;
ba224443 81 }
1a1fdef7 82 if (z > fNoseZ) {
83 Warning("ConeR", "z=%lf is before start of cone %lf", z, fNoseZ);
84 return -1;
ba224443 85 }
1a1fdef7 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;
ba224443 97}
98
4347b38f 99
100//____________________________________________________________________
101//
102// EOF
103//