]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMD3.cxx
tpc_clusters.C - return null pointer if tree can be obtained from run-loader.
[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
33 #include <TMath.h>              // ROOT_TMath
34
35 #include "AliFMD3.h"            // ALIFMD3_H 
36 #include "AliFMDDebug.h"                // ALIFMDDEBUG_H ALILOG_H
37 #include "AliFMDRing.h"         // ALIFMDRING_H 
38
39 //====================================================================
40 ClassImp(AliFMD3)
41 #if 0
42   ; // This is here to keep Emacs for indenting the next line
43 #endif
44
45 //____________________________________________________________________
46 AliFMD3::AliFMD3(AliFMDRing* inner, AliFMDRing* outer) 
47   : AliFMDDetector(3, inner, outer),
48     fNoseZ(0),
49     fNoseLowR(0),
50     fNoseHighR(0),
51     fNoseLength(0),
52     fBackLowR(0),
53     fBackHighR(0),
54     fBackLength(0),
55     fBeamThickness(0),
56     fBeamWidth(0),
57     fConeLength(0),
58     fFlangeR(0),
59     fZ(0),
60     fAlpha(0), 
61     fNBeam(0), 
62     fNFlange(0)
63 {
64   // Constructor. 
65   SetInnerZ(-62.8);
66   SetOuterZ(-75.2);
67   SetNoseZ();
68   SetNoseLowR();
69   SetNoseHighR();
70   SetNoseLength();
71   SetBackLowR();
72   SetBackHighR();
73   SetBackLength();
74   SetBeamThickness();
75   SetBeamWidth();
76   SetConeLength();
77   SetFlangeR();
78   SetNBeam();
79   SetNFlange();
80 }
81
82 //____________________________________________________________________
83 void
84 AliFMD3::Init() 
85 {
86   // Initialize 
87   AliFMDDetector::Init();
88   SetInnerHoneyHighR(GetOuterHoneyHighR());
89   Double_t zdist   = fConeLength;
90   Double_t tdist   = fBackHighR - fNoseHighR;
91   Double_t innerZh = (fInnerZ - fInner->GetRingDepth());
92   Double_t outerZh = (fOuterZ - fOuter->GetRingDepth() - 
93                       fOuter->GetHoneycombThickness());
94   Double_t minZ    = TMath::Min(fNoseZ - fConeLength, outerZh);
95   fAlpha           = tdist / zdist;
96   fZ               = fNoseZ + (minZ - fNoseZ) / 2;
97   fInnerHoneyHighR = ConeR(innerZh,"I");
98   fOuterHoneyHighR = GetBackLowR();
99 }
100
101 //____________________________________________________________________
102 Double_t
103 AliFMD3::ConeR(Double_t z, Option_t* opt) const
104 {
105   // Calculate the cone radius at Z
106   if (fAlpha < 0) {
107     AliWarning(Form("alpha not set: %lf", fAlpha));
108     return -1;
109   }
110   if (z > fNoseZ) {
111     AliWarning(Form("z=%lf is before start of cone %lf", z, fNoseZ));
112     return -1;
113   }
114   if (z < fOuterZ - fOuter->GetFullDepth()) {
115     AliWarning(Form("z=%lf is after end of cone %lf", z, 
116                     fOuterZ - fOuter->GetFullDepth()));
117     return -1;
118   }
119   Bool_t   inner = opt[0] == 'I' || opt[1] == 'i';
120   Double_t off1  = (inner ? fNoseLowR : fNoseHighR);
121   Double_t off2  = (inner ? fBackLowR : fBackHighR);
122   Double_t off3  = (inner ? 0         : fBeamThickness/fAlpha);
123   if (z > fNoseZ - fNoseLength)               return off1;
124   if (z < fNoseZ - fConeLength + fBackLength) return off2;
125   return (off1 + off3 + fAlpha * TMath::Abs(z - fNoseZ + fNoseLength));
126 }
127
128
129 //____________________________________________________________________
130 //
131 // EOF
132 //