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 // Utility class to help implement the FMD geometry. This provides
21 // the interface for the concrete geometry implementations of the FMD
24 // The AliFMDGeometry object owns the AliFMDDetector objects
26 // Latest changes by Christian Holm Christensen
28 #include "AliFMDDetector.h" // ALIFMDSUBDETECTOR_H
29 #include "AliFMDRing.h" // ALIFMDRING_H
31 //====================================================================
32 ClassImp(AliFMDDetector)
34 ; // This is here to keep Emacs for indenting the next line
37 //____________________________________________________________________
38 AliFMDDetector::AliFMDDetector(Int_t id, AliFMDRing* inner, AliFMDRing* outer)
39 : TNamed(Form("FMD%d", id), "Forward multiplicity ring"),
46 // ID Id of detector (1,2, or 3)
47 // INNER Inner ring geometry
48 // OUTER Outer ring geometry (if any)
50 SetHoneycombThickness();
53 SetInnerHoneyHighR(0);
57 SetOuterHoneyHighR(0);
60 //____________________________________________________________________
61 AliFMDDetector::AliFMDDetector(const AliFMDDetector& other)
68 SetHoneycombThickness(other.GetHoneycombThickness());
69 SetAlThickness(other.GetAlThickness());
70 SetInnerHoneyLowR(other.GetInnerHoneyLowR());
71 SetInnerHoneyHighR(other.GetInnerHoneyHighR());
72 SetInnerZ(other.GetInnerZ());
73 SetOuterZ(other.GetOuterZ());
74 SetOuterHoneyLowR(other.GetOuterHoneyLowR());
75 SetOuterHoneyHighR(other.GetOuterHoneyHighR());
78 //____________________________________________________________________
80 AliFMDDetector::operator=(const AliFMDDetector& other)
82 // Assignment operator
83 SetName(other.GetName());
84 SetTitle(other.GetTitle());
86 fInner = other.fInner;
87 fOuter = other.fOuter;
88 SetHoneycombThickness(other.GetHoneycombThickness());
89 SetAlThickness(other.GetAlThickness());
90 SetInnerHoneyLowR(other.GetInnerHoneyLowR());
91 SetInnerHoneyHighR(other.GetInnerHoneyHighR());
92 SetInnerZ(other.GetInnerZ());
93 SetOuterZ(other.GetOuterZ());
94 SetOuterHoneyLowR(other.GetOuterHoneyLowR());
95 SetOuterHoneyHighR(other.GetOuterHoneyHighR());
99 //____________________________________________________________________
101 AliFMDDetector::Init()
105 SetInnerHoneyLowR(fInner->GetLowR() + 1.);
106 SetInnerHoneyHighR(fInner->GetHighR() + 1.);
109 SetOuterHoneyLowR(fOuter->GetLowR() + 1.);
110 SetOuterHoneyHighR(fOuter->GetHighR() + 1.);
115 //____________________________________________________________________
117 AliFMDDetector::GetRing(Char_t id) const
119 // Get the specified ring
121 // ID Id of ring ('I' or 'O')
125 case 'I': return GetInner();
127 case 'O': return GetOuter();
132 //____________________________________________________________________
134 AliFMDDetector::GetRingZ(Char_t id) const
136 // Get the z-coordinate specified ring
138 // ID Id of ring ('I' or 'O')
142 case 'I': return GetInnerZ();
144 case 'O': return GetOuterZ();
148 //____________________________________________________________________
150 AliFMDDetector::Detector2XYZ(Char_t ring,
157 // Translate detector coordinates (this,ring,sector,strip) into
158 // (x,y,z) coordinates (in global reference frame)
159 AliFMDRing* r = GetRing(ring);
162 r->Detector2XYZ(sector, strip, x, y, z);
165 //____________________________________________________________________
167 AliFMDDetector::XYZ2Detector(Double_t x,
172 UShort_t& strip) const
174 // Translate (x,y,z) coordinates (in global reference frame) into
175 // detector coordinates (this,ring,sector,strip).
178 for (int j = 0; j < 2; j++) {
179 rng = GetRing(j == 0 ? 'I' : 'O');
181 Double_t ringZ = GetRingZ(j == 0 ? 'I' : 'O');
182 Double_t modSpace = TMath::Sign(rng->GetModuleSpacing(), ringZ);
183 if (TMath::Abs(z - ringZ) < 0.01 ||
184 TMath::Abs(z - ringZ + modSpace) < 0.01) break;
187 if (rng && rng->XYZ2Detector(x, y, z - GetRingZ(rng->GetId()),
197 //____________________________________________________________________