1 /**************************************************************************
2 * Copyright(c) 2004, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //____________________________________________________________________
20 // Concrete implementation of AliFMDSubDetector
22 // This implements the geometry for FMD3
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
33 //____________________________________________________________________
36 //____________________________________________________________________
38 : AliFMDSubDetector(3),
42 // Default constructor for the FMD3 sub-detector
46 //____________________________________________________________________
49 // Destructor - does nothing
53 //____________________________________________________________________
55 AliFMD3::SetupGeometry(Int_t airId, Int_t kaptionId)
57 // Setup the FMD3 sub-detector geometry
61 // airId Id # of the Air medium
62 // kaptionId Id # of the Aluminium medium
64 fInnerHoneyLowR = fInner->GetLowR() + 1;
65 fInnerHoneyHighR = fInner->GetHighR() + 1;
66 fOuterHoneyLowR = fOuter->GetLowR() + 1;
67 fOuterHoneyHighR = fOuter->GetHighR() + 1;
71 par[0] = fInner->GetLowR();
72 par[1] = fOuterHoneyHighR;
74 fVolumeId = gMC->Gsvolu("FMD3", "TUBE", airId, par, 3);
76 gMC->Matrix(fRotationId, 90, 0, 90, 90, 0, 0);
77 //0, 180, 90, 90, 180, 0);
79 AliFMDSubDetector::SetupGeometry(airId, kaptionId);
82 //____________________________________________________________________
84 AliFMD3::Geometry(const char* mother, Int_t pbRotId,
85 Int_t idRotId, Double_t z)
87 // Position the FMD3 sub-detector volume
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)
97 gMC->Gspos("FMD3", 1, mother, 0, 0, z, fRotationId);
99 AliFMDSubDetector::Geometry("FMD3", pbRotId, idRotId, z);
103 //____________________________________________________________________
105 AliFMD3::SimpleGeometry(TList* nodes,
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.
120 // For the outer line, we have the two equations
122 // fOuterHoneyHighR = a * x1 + b;
123 // fInnerHoneyHighR = a * x2 + b;
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)
135 // a = (fOuterHoneyHighR - fInnerHoneyHighR) / (x1 - x2)
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()));
149 Double_t ao1 = (fOuterHoneyHighR - fInnerHoneyHighR) / (x1 - x2);
150 Double_t ao2 = ((fOuter->GetHighR() - fInner->GetHighR())
151 / (fOuterZ - fInnerZ));
154 // std::cout << "Wafer determinds the size" << std::endl;
156 bo = fInner->GetHighR() - ao * fInnerZ;
160 bo = fOuterHoneyHighR - ao * x1;
163 Double_t y1o = ao * (fInnerZ - 2 * fDz) + bo;
164 Double_t y2o = ao * fInnerZ + bo;
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, */
172 zMother = fInnerZ - fDz;
173 TNode* node = new TNode("FMD3", "FMD3", shape, 0, 0, zMother, 0);
174 node->SetVisibility(0);
176 AliFMDSubDetector::SimpleGeometry(nodes, node, colour, zMother);
179 //____________________________________________________________________
181 AliFMD3::CalculateDz()
184 fDz = (TMath::Abs(fInnerZ - fOuterZ)
185 + fOuter->GetSiThickness()
186 + fOuter->GetPrintboardThickness()
187 + fOuter->GetLegLength()
188 + fOuter->GetModuleSpacing()
189 + fHoneycombThickness) / 2;
192 //____________________________________________________________________