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