]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMD3.cxx
Fixes for compilation warnings (Christian)
[u/mrichter/AliRoot.git] / FMD / AliFMD3.cxx
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 /* $Id$ */
16 /** @file    AliFMD3.cxx
17     @author  Christian Holm Christensen <cholm@nbi.dk>
18     @date    Sun Mar 26 18:26:12 2006
19     @brief   Concrete implementation of AliFMDDetector for FMD3
20 */
21 //____________________________________________________________________
22 //                                                                          
23 // Concrete implementation of AliFMDDetector 
24 //
25 // This implements the geometry for FMD3.
26 // This has 2 rings.
27 // The support of the FMD3 is a carbon-fibre cone, attached to the ITS
28 // support via flanges.  The cone also supports the beam-pipe.
29 // The support is a special cone of carbon-fibre made by a Danish
30 // Yacht company.
31 //
32 #include "AliFMD3.h"            // ALIFMD3_H 
33 #include "AliLog.h"             // ALILOG_H
34 #include "AliFMDRing.h"         // ALIFMDRING_H 
35 // #include <TMath.h>           // ROOT_TMath
36
37 //====================================================================
38 ClassImp(AliFMD3)
39 #if 0
40   ; // This is here to keep Emacs for indenting the next line
41 #endif
42
43 //____________________________________________________________________
44 AliFMD3::AliFMD3(AliFMDRing* inner, AliFMDRing* outer) 
45   : AliFMDDetector(3, inner, outer)
46 {
47   // Constructor. 
48   SetInnerZ(-62.8);
49   SetOuterZ(-75.2);
50   SetNoseZ();
51   SetNoseLowR();
52   SetNoseHighR();
53   SetNoseLength();
54   SetBackLowR();
55   SetBackHighR();
56   SetBackLength();
57   SetBeamThickness();
58   SetBeamWidth();
59   SetConeLength();
60   SetFlangeR();
61   SetNBeam();
62   SetNFlange();
63 }
64
65 //____________________________________________________________________
66 void
67 AliFMD3::Init() 
68 {
69   // Initialize 
70   AliFMDDetector::Init();
71   SetInnerHoneyHighR(GetOuterHoneyHighR());
72   Double_t zdist   = fConeLength - fBackLength - fNoseLength;
73   Double_t tdist   = fBackHighR - fNoseHighR;
74   Double_t innerZh = fInnerZ - fInner->GetRingDepth() - fHoneycombThickness;
75   Double_t outerZh = fOuterZ - fOuter->GetRingDepth() - fHoneycombThickness;
76   Double_t minZ    = TMath::Min(fNoseZ - fConeLength, outerZh);
77   fAlpha           = tdist / zdist;
78   fZ               = fNoseZ + (minZ - fNoseZ) / 2;
79   fInnerHoneyHighR = ConeR(innerZh + fHoneycombThickness,"O") - 1;
80   fOuterHoneyHighR = GetBackLowR();
81 }
82
83 //____________________________________________________________________
84 Double_t
85 AliFMD3::ConeR(Double_t z, Option_t* opt) const
86 {
87   // Calculate the cone radius at Z
88   if (fAlpha < 0) {
89     AliWarning(Form("alpha not set: %lf", fAlpha));
90     return -1;
91   }
92   if (z > fNoseZ) {
93     AliWarning(Form("z=%lf is before start of cone %lf", z, fNoseZ));
94     return -1;
95   }
96   if (z < fOuterZ - fOuter->GetRingDepth() - fHoneycombThickness) {
97     AliWarning(Form("z=%lf is after end of cone %lf", z, 
98                     fOuterZ - fOuter->GetRingDepth() - fHoneycombThickness));
99     return -1;
100   }
101   Double_t e = fBeamThickness / TMath::Cos(TMath::ATan(fAlpha));
102   if (opt[0] == 'I' || opt[1] == 'i') e *= -1;
103   if (z > fNoseZ - fNoseLength) return fNoseHighR + e;
104   if (z < fNoseZ - fConeLength + fBackLength) return fBackHighR + e;
105   Double_t r = fNoseHighR + fAlpha * TMath::Abs(z - fNoseZ + fNoseLength) + e;
106   return r;
107 }
108
109
110 //____________________________________________________________________
111 //
112 // EOF
113 //