]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMD3.cxx
Removing extra semicolons (FedoraCore3, gcc 3.4.2)
[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   AliDebug(10, "\t\tDefault CTOR");
43 }
44
45
46 //____________________________________________________________________
47 AliFMD3::~AliFMD3() 
48 {
49   // Destructor - does nothing 
50   AliDebug(10, "\t\tDTOR");
51 }
52
53
54 //____________________________________________________________________
55 void 
56 AliFMD3::SetupGeometry(Int_t airId, Int_t alId, Int_t carbonId) 
57 {
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   // 
65   AliDebug(10, "\tSetting up the geometry for FMD3");
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
87   fInnerHoneyLowR  = fInner->GetLowR() + 1;
88   fInnerHoneyHighR = fSupport.ConeR(innerZh + fHoneycombThickness, "I");
89   fOuterHoneyLowR  = fOuter->GetLowR() + 1;
90   fOuterHoneyHighR = fSupport.GetBackLowR();
91
92   // Identity matrix
93   gMC->Matrix(fRotationId, 90, 0, 90, 90, 0, 0); 
94   //0, 180, 90, 90, 180, 0);
95
96
97   AliFMDSubDetector::SetupGeometry(airId, alId, carbonId);
98 }
99
100 //____________________________________________________________________
101 void 
102 AliFMD3::Geometry(const char* mother, Int_t pbRotId, 
103                   Int_t idRotId, Double_t z) 
104 {
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   //
114   z = fSupport.GetZ();
115   fSupport.Geometry(mother, fRotationId, z);
116   AliDebug(10, Form("\t\tPassing z=%lf to ring volumes", z));
117   AliFMDSubDetector::Geometry("FMD3", pbRotId, idRotId, z);
118 }
119
120   
121 //____________________________________________________________________
122 void 
123 AliFMD3::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   // 
156   AliDebug(10, "\tCreating simplified geometry for FMD3");
157   Double_t dz = (TMath::Abs(fInnerZ - fOuterZ) 
158                  + fOuter->GetSiThickness() 
159                  + fOuter->GetPrintboardThickness() 
160                  + fOuter->GetLegLength() 
161                  + fOuter->GetModuleSpacing() 
162                  + fHoneycombThickness) / 2;
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) {
178     // std::cout << "Wafer determinds the size" << std::endl;
179     ao  = ao2;
180     bo  = fInner->GetHighR() - ao * fInnerZ;
181   }
182   else {
183     ao = ao1;
184     bo = fOuterHoneyHighR - ao * x1;
185   }
186   
187   Double_t y1o = ao * (fInnerZ - 2 * dz) + bo;
188   Double_t y2o = ao * fInnerZ + bo;
189 #endif
190   // We probably need to make a PCON here. 
191   TShape* shape = new TCONS("FMD3", "FMD3", "", dz, 
192                             fOuter->GetLowR(),  y1o, /* fOuterHoneyHighR, */
193                             fInner->GetLowR(),  y2o, /* fInnerHoneyHighR, */
194                             0, 360);
195   mother->cd();
196   zMother = fInnerZ - dz;  
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 //____________________________________________________________________
204 void 
205 AliFMD3::Gsatt() const
206 {
207   // Set draw attributes for the FMD3
208   AliDebug(10, "Setting drawing attributes for FMD3");
209   AliFMDSubDetector::Gsatt();
210   fSupport.Gsatt();
211 }
212
213 //____________________________________________________________________
214 //
215 // EOF
216 //