]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMD3.cxx
Got rid of class template AliFMD<Type> on request of Federico, who
[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//
20// Concrete implementation of AliFMDSubDetector
21//
22// This implements the geometry for FMD3
23//
e802be3e 24#include "TVirtualMC.h" // ROOT_TVirtualMC
25#include "TCONS.h" // ROOT_TCONS
26#include "TNode.h" // ROOT_TNode
27#include "TList.h" // ROOT_TList
28#include "AliFMD3.h" // ALIFMD3_H
29#include "AliLog.h" // ALILOG_H
30#include "AliFMDRing.h" // ALIFMDRING_H
31#include <Riostream.h> // ROOT_Riostream
4347b38f 32
33//____________________________________________________________________
34ClassImp(AliFMD3);
35
36//____________________________________________________________________
37AliFMD3::AliFMD3()
ba224443 38 : AliFMDSubDetector(3),
39 fVolumeId(0),
40 fDz(0)
41{
42 // Default constructor for the FMD3 sub-detector
43}
44
4347b38f 45
46//____________________________________________________________________
47AliFMD3::~AliFMD3()
ba224443 48{
49 // Destructor - does nothing
50}
51
4347b38f 52
53//____________________________________________________________________
54void
55AliFMD3::SetupGeometry(Int_t airId, Int_t kaptionId)
56{
ba224443 57 // Setup the FMD3 sub-detector geometry
58 //
59 // Parameters:
60 //
61 // airId Id # of the Air medium
62 // kaptionId Id # of the Aluminium medium
63 //
4347b38f 64 fInnerHoneyLowR = fInner->GetLowR() + 1;
65 fInnerHoneyHighR = fInner->GetHighR() + 1;
66 fOuterHoneyLowR = fOuter->GetLowR() + 1;
67 fOuterHoneyHighR = fOuter->GetHighR() + 1;
68
ba224443 69 CalculateDz();
4347b38f 70 Double_t par[3];
71 par[0] = fInner->GetLowR();
72 par[1] = fOuterHoneyHighR;
ba224443 73 par[2] = fDz;
4347b38f 74 fVolumeId = gMC->Gsvolu("FMD3", "TUBE", airId, par, 3);
75
76 gMC->Matrix(fRotationId, 90, 0, 90, 90, 0, 0);
77 //0, 180, 90, 90, 180, 0);
78
79 AliFMDSubDetector::SetupGeometry(airId, kaptionId);
80}
81
82//____________________________________________________________________
83void
84AliFMD3::Geometry(const char* mother, Int_t pbRotId,
85 Int_t idRotId, Double_t z)
86{
ba224443 87 // Position the FMD3 sub-detector volume
88 //
89 // Parameters
90 //
91 // mother name of the mother volume
92 // pbRotId Printboard roation matrix ID
93 // idRotId Identity rotation matrix ID
94 // z Z position (not really used here, but passed down)
95 //
4347b38f 96 z = fInnerZ - fDz;
97 gMC->Gspos("FMD3", 1, mother, 0, 0, z, fRotationId);
98
99 AliFMDSubDetector::Geometry("FMD3", pbRotId, idRotId, z);
100}
101
102
ba224443 103//____________________________________________________________________
104void
105AliFMD3::SimpleGeometry(TList* nodes,
106 TNode* mother,
107 Int_t colour,
108 Double_t zMother)
109{
110 // We need to get the equation for the line that connects the
111 // outer circumfrences of the two rings, as well as for the line
112 // that connects the inner curcumfrences, so that we can project to
113 // where the honey-comb actually ends.
114 //
115 // we have
116 //
117 // y = a * x + b
118 // b = y - a * x;
119 //
120 // For the outer line, we have the two equations
121 //
122 // fOuterHoneyHighR = a * x1 + b;
123 // fInnerHoneyHighR = a * x2 + b;
124 //
125 // where
126 //
127 // x1 = (fOuterZ + fOuter->fSiThickness + fOuter->fPrintboardThickness
128 // + fOuter->fLegLength + fModuleSpacing)
129 // = fInner - fDz + fHoneycombThickness
130 // x2 = (fInnerZ + fInner->fSiThickness + fInner->fPrintboardThickness
131 // + fInner->fLegLength + fModuleSpacing)
132 //
133 // and
134 //
135 // a = (fOuterHoneyHighR - fInnerHoneyHighR) / (x1 - x2)
136 //
137 //
138 CalculateDz();
139#if 1
140 Double_t x1 = (fOuterZ - (fOuter->GetSiThickness()
141 + fOuter->GetPrintboardThickness()
142 + fOuter->GetLegLength()
143 + fOuter->GetModuleSpacing()));
144 Double_t x2 = (fInnerZ - (fInner->GetSiThickness()
145 + fInner->GetPrintboardThickness()
146 + fInner->GetLegLength()
147 + fInner->GetModuleSpacing()));
148 Double_t ao = 0;
149 Double_t ao1 = (fOuterHoneyHighR - fInnerHoneyHighR) / (x1 - x2);
150 Double_t ao2 = ((fOuter->GetHighR() - fInner->GetHighR())
151 / (fOuterZ - fInnerZ));
152 Double_t bo = 0;
153 if (ao2 > ao1) {
e802be3e 154 // std::cout << "Wafer determinds the size" << std::endl;
ba224443 155 ao = ao2;
156 bo = fInner->GetHighR() - ao * fInnerZ;
157 }
158 else {
159 ao = ao1;
160 bo = fOuterHoneyHighR - ao * x1;
161 }
162
163 Double_t y1o = ao * (fInnerZ - 2 * fDz) + bo;
164 Double_t y2o = ao * fInnerZ + bo;
165#endif
166 // We probably need to make a PCON here.
167 TShape* shape = new TCONS("FMD3", "FMD3", "", fDz,
168 fOuter->GetLowR(), y1o, /* fOuterHoneyHighR, */
169 fInner->GetLowR(), y2o, /* fInnerHoneyHighR, */
170 0, 360);
171 mother->cd();
172 zMother = fInnerZ - fDz;
173 TNode* node = new TNode("FMD3", "FMD3", shape, 0, 0, zMother, 0);
174 node->SetVisibility(0);
175 nodes->Add(node);
176 AliFMDSubDetector::SimpleGeometry(nodes, node, colour, zMother);
177}
178
179//____________________________________________________________________
180void
181AliFMD3::CalculateDz()
182{
183 if (fDz > 0) return;
184 fDz = (TMath::Abs(fInnerZ - fOuterZ)
185 + fOuter->GetSiThickness()
186 + fOuter->GetPrintboardThickness()
187 + fOuter->GetLegLength()
188 + fOuter->GetModuleSpacing()
189 + fHoneycombThickness) / 2;
190}
4347b38f 191
192//____________________________________________________________________
193//
194// EOF
195//