]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMD3.cxx
Corrected the FMD3 mother volume. I had defined it with decreasing
[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
16 /* $Id$ */
17
18 //____________________________________________________________________
19 //                                                                          
20 // Concrete implementation of AliFMDSubDetector 
21 //
22 // This implements the geometry for FMD3
23 //
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
32
33 //____________________________________________________________________
34 ClassImp(AliFMD3);
35
36 //____________________________________________________________________
37 AliFMD3::AliFMD3() 
38   : AliFMDSubDetector(3), 
39     fVolumeId(0)
40 {
41   // Default constructor for the FMD3 sub-detector 
42 }
43
44
45 //____________________________________________________________________
46 AliFMD3::~AliFMD3() 
47 {
48   // Destructor - does nothing 
49 }
50
51
52 //____________________________________________________________________
53 void 
54 AliFMD3::SetupGeometry(Int_t airId, Int_t alId, Int_t carbonId) 
55 {
56   // Setup the FMD3 sub-detector geometry 
57   // 
58   // Parameters:
59   // 
60   //     airId         Id # of the Air medium 
61   //     kaptionId     Id # of the Aluminium medium 
62   // 
63   Double_t innerZl = fInnerZ;
64   Double_t innerZh = (fInnerZ 
65                       - fInner->GetModuleSpacing() 
66                       - fInner->GetLegLength() 
67                       - fInner->GetSiThickness() 
68                       - fInner->GetPrintboardThickness()
69                       - fHoneycombThickness);
70   Double_t innerRl = fInner->GetLowR();
71   Double_t outerZl = fOuterZ;
72   Double_t outerZh = (fOuterZ 
73                       - fOuter->GetModuleSpacing() 
74                       - fOuter->GetLegLength() 
75                       - fOuter->GetSiThickness() 
76                       - fOuter->GetPrintboardThickness()                      
77                       - fHoneycombThickness);
78   Double_t outerRl = fOuter->GetLowR();
79   
80   fSupport.SetupGeometry(airId, carbonId, 
81                          innerZl, innerZh, innerRl,
82                          outerZl, outerZh, outerRl);
83
84   fInnerHoneyLowR  = fInner->GetLowR() + 1;
85   fInnerHoneyHighR = fSupport.ConeR(innerZh + fHoneycombThickness, "I");
86   fOuterHoneyLowR  = fOuter->GetLowR() + 1;
87   fOuterHoneyHighR = fSupport.GetBackLowR();
88
89   // Identity matrix
90   gMC->Matrix(fRotationId, 90, 0, 90, 90, 0, 0); 
91   //0, 180, 90, 90, 180, 0);
92
93   AliFMDSubDetector::SetupGeometry(airId, alId, carbonId);
94 }
95
96 //____________________________________________________________________
97 void 
98 AliFMD3::Geometry(const char* mother, Int_t pbRotId, 
99                   Int_t idRotId, Double_t z) 
100 {
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   //
110   z = fSupport.GetZ();
111   AliDebug(10, Form("Passing z=%lf to ring volumes", z));
112   AliFMDSubDetector::Geometry("FMD3", pbRotId, idRotId, z);
113   fSupport.Geometry(mother, fRotationId, z);
114 }
115
116   
117 //____________________________________________________________________
118 void 
119 AliFMD3::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   Double_t dz = (TMath::Abs(fInnerZ - fOuterZ) 
153                  + fOuter->GetSiThickness() 
154                  + fOuter->GetPrintboardThickness() 
155                  + fOuter->GetLegLength() 
156                  + fOuter->GetModuleSpacing() 
157                  + fHoneycombThickness) / 2;
158 #if 1
159   Double_t x1  = (fOuterZ - (fOuter->GetSiThickness() 
160                              + fOuter->GetPrintboardThickness() 
161                              + fOuter->GetLegLength() 
162                              + fOuter->GetModuleSpacing()));
163   Double_t x2  = (fInnerZ - (fInner->GetSiThickness() 
164                              + fInner->GetPrintboardThickness() 
165                              + fInner->GetLegLength() 
166                              + fInner->GetModuleSpacing()));
167   Double_t ao   = 0;
168   Double_t ao1  = (fOuterHoneyHighR - fInnerHoneyHighR) / (x1 - x2);
169   Double_t ao2  = ((fOuter->GetHighR() - fInner->GetHighR()) 
170                    / (fOuterZ - fInnerZ));
171   Double_t bo   = 0;
172   if (ao2 > ao1) {
173     // std::cout << "Wafer determinds the size" << std::endl;
174     ao  = ao2;
175     bo  = fInner->GetHighR() - ao * fInnerZ;
176   }
177   else {
178     ao = ao1;
179     bo = fOuterHoneyHighR - ao * x1;
180   }
181   
182   Double_t y1o = ao * (fInnerZ - 2 * dz) + bo;
183   Double_t y2o = ao * fInnerZ + bo;
184 #endif
185   // We probably need to make a PCON here. 
186   TShape* shape = new TCONS("FMD3", "FMD3", "", dz, 
187                             fOuter->GetLowR(),  y1o, /* fOuterHoneyHighR, */
188                             fInner->GetLowR(),  y2o, /* fInnerHoneyHighR, */
189                             0, 360);
190   mother->cd();
191   zMother = fInnerZ - dz;  
192   TNode* node = new TNode("FMD3", "FMD3", shape, 0, 0, zMother, 0);
193   node->SetVisibility(0);
194   nodes->Add(node);
195   AliFMDSubDetector::SimpleGeometry(nodes, node, colour, zMother);
196 }
197
198 //____________________________________________________________________
199 void 
200 AliFMD3::Gsatt() 
201 {
202   AliFMDSubDetector::Gsatt();
203   fSupport.Gsatt();
204 }
205
206 //____________________________________________________________________
207 //
208 // EOF
209 //