changed default value for fGeVcharge
[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//____________________________________________________________________
925e6570 34ClassImp(AliFMD3)
4347b38f 35
36//____________________________________________________________________
37AliFMD3::AliFMD3()
ba224443 38 : AliFMDSubDetector(3),
a16179cb 39 fVolumeId(0)
ba224443 40{
41 // Default constructor for the FMD3 sub-detector
824466d5 42 AliDebug(10, "\t\tDefault CTOR");
ba224443 43}
44
4347b38f 45
46//____________________________________________________________________
47AliFMD3::~AliFMD3()
ba224443 48{
49 // Destructor - does nothing
824466d5 50 AliDebug(10, "\t\tDTOR");
ba224443 51}
52
4347b38f 53
54//____________________________________________________________________
55void
a16179cb 56AliFMD3::SetupGeometry(Int_t airId, Int_t alId, Int_t carbonId)
4347b38f 57{
ba224443 58 // Setup the FMD3 sub-detector geometry
59 //
60 // Parameters:
61 //
62 // airId Id # of the Air medium
63 // kaptionId Id # of the Aluminium medium
64 //
824466d5 65 AliDebug(10, "\tSetting up the geometry for FMD3");
a16179cb 66 Double_t innerZl = fInnerZ;
67 Double_t innerZh = (fInnerZ
68 - fInner->GetModuleSpacing()
69 - fInner->GetLegLength()
70 - fInner->GetSiThickness()
71 - fInner->GetPrintboardThickness()
72 - fHoneycombThickness);
73 Double_t innerRl = fInner->GetLowR();
74 Double_t outerZl = fOuterZ;
75 Double_t outerZh = (fOuterZ
76 - fOuter->GetModuleSpacing()
77 - fOuter->GetLegLength()
78 - fOuter->GetSiThickness()
79 - fOuter->GetPrintboardThickness()
80 - fHoneycombThickness);
81 Double_t outerRl = fOuter->GetLowR();
82
83 fSupport.SetupGeometry(airId, carbonId,
84 innerZl, innerZh, innerRl,
85 outerZl, outerZh, outerRl);
86
4347b38f 87 fInnerHoneyLowR = fInner->GetLowR() + 1;
a16179cb 88 fInnerHoneyHighR = fSupport.ConeR(innerZh + fHoneycombThickness, "I");
4347b38f 89 fOuterHoneyLowR = fOuter->GetLowR() + 1;
a16179cb 90 fOuterHoneyHighR = fSupport.GetBackLowR();
4347b38f 91
a16179cb 92 // Identity matrix
4347b38f 93 gMC->Matrix(fRotationId, 90, 0, 90, 90, 0, 0);
94 //0, 180, 90, 90, 180, 0);
95
824466d5 96
a16179cb 97 AliFMDSubDetector::SetupGeometry(airId, alId, carbonId);
4347b38f 98}
99
100//____________________________________________________________________
101void
102AliFMD3::Geometry(const char* mother, Int_t pbRotId,
103 Int_t idRotId, Double_t z)
104{
ba224443 105 // Position the FMD3 sub-detector volume
106 //
107 // Parameters
108 //
109 // mother name of the mother volume
110 // pbRotId Printboard roation matrix ID
111 // idRotId Identity rotation matrix ID
112 // z Z position (not really used here, but passed down)
113 //
a16179cb 114 z = fSupport.GetZ();
a16179cb 115 fSupport.Geometry(mother, fRotationId, z);
824466d5 116 AliDebug(10, Form("\t\tPassing z=%lf to ring volumes", z));
117 AliFMDSubDetector::Geometry("FMD3", pbRotId, idRotId, z);
4347b38f 118}
119
120
ba224443 121//____________________________________________________________________
122void
123AliFMD3::SimpleGeometry(TList* nodes,
124 TNode* mother,
125 Int_t colour,
126 Double_t zMother)
127{
128 // We need to get the equation for the line that connects the
129 // outer circumfrences of the two rings, as well as for the line
130 // that connects the inner curcumfrences, so that we can project to
131 // where the honey-comb actually ends.
132 //
133 // we have
134 //
135 // y = a * x + b
136 // b = y - a * x;
137 //
138 // For the outer line, we have the two equations
139 //
140 // fOuterHoneyHighR = a * x1 + b;
141 // fInnerHoneyHighR = a * x2 + b;
142 //
143 // where
144 //
145 // x1 = (fOuterZ + fOuter->fSiThickness + fOuter->fPrintboardThickness
146 // + fOuter->fLegLength + fModuleSpacing)
147 // = fInner - fDz + fHoneycombThickness
148 // x2 = (fInnerZ + fInner->fSiThickness + fInner->fPrintboardThickness
149 // + fInner->fLegLength + fModuleSpacing)
150 //
151 // and
152 //
153 // a = (fOuterHoneyHighR - fInnerHoneyHighR) / (x1 - x2)
154 //
155 //
824466d5 156 AliDebug(10, "\tCreating simplified geometry for FMD3");
a16179cb 157 Double_t dz = (TMath::Abs(fInnerZ - fOuterZ)
158 + fOuter->GetSiThickness()
159 + fOuter->GetPrintboardThickness()
160 + fOuter->GetLegLength()
161 + fOuter->GetModuleSpacing()
162 + fHoneycombThickness) / 2;
ba224443 163#if 1
164 Double_t x1 = (fOuterZ - (fOuter->GetSiThickness()
165 + fOuter->GetPrintboardThickness()
166 + fOuter->GetLegLength()
167 + fOuter->GetModuleSpacing()));
168 Double_t x2 = (fInnerZ - (fInner->GetSiThickness()
169 + fInner->GetPrintboardThickness()
170 + fInner->GetLegLength()
171 + fInner->GetModuleSpacing()));
172 Double_t ao = 0;
173 Double_t ao1 = (fOuterHoneyHighR - fInnerHoneyHighR) / (x1 - x2);
174 Double_t ao2 = ((fOuter->GetHighR() - fInner->GetHighR())
175 / (fOuterZ - fInnerZ));
176 Double_t bo = 0;
177 if (ao2 > ao1) {
e802be3e 178 // std::cout << "Wafer determinds the size" << std::endl;
ba224443 179 ao = ao2;
180 bo = fInner->GetHighR() - ao * fInnerZ;
181 }
182 else {
183 ao = ao1;
184 bo = fOuterHoneyHighR - ao * x1;
185 }
186
a16179cb 187 Double_t y1o = ao * (fInnerZ - 2 * dz) + bo;
ba224443 188 Double_t y2o = ao * fInnerZ + bo;
189#endif
190 // We probably need to make a PCON here.
a16179cb 191 TShape* shape = new TCONS("FMD3", "FMD3", "", dz,
ba224443 192 fOuter->GetLowR(), y1o, /* fOuterHoneyHighR, */
193 fInner->GetLowR(), y2o, /* fInnerHoneyHighR, */
194 0, 360);
195 mother->cd();
a16179cb 196 zMother = fInnerZ - dz;
ba224443 197 TNode* node = new TNode("FMD3", "FMD3", shape, 0, 0, zMother, 0);
198 node->SetVisibility(0);
199 nodes->Add(node);
200 AliFMDSubDetector::SimpleGeometry(nodes, node, colour, zMother);
201}
202
203//____________________________________________________________________
204void
824466d5 205AliFMD3::Gsatt() const
ba224443 206{
824466d5 207 // Set draw attributes for the FMD3
208 AliDebug(10, "Setting drawing attributes for FMD3");
a16179cb 209 AliFMDSubDetector::Gsatt();
210 fSupport.Gsatt();
ba224443 211}
4347b38f 212
213//____________________________________________________________________
214//
215// EOF
216//