//____________________________________________________________________
AliFMD3::AliFMD3()
: AliFMDSubDetector(3),
- fVolumeId(0),
- fDz(0)
+ fVolumeId(0)
{
// Default constructor for the FMD3 sub-detector
}
//____________________________________________________________________
void
-AliFMD3::SetupGeometry(Int_t airId, Int_t kaptionId)
+AliFMD3::SetupGeometry(Int_t airId, Int_t alId, Int_t carbonId)
{
// Setup the FMD3 sub-detector geometry
//
// airId Id # of the Air medium
// kaptionId Id # of the Aluminium medium
//
+ Double_t innerZl = fInnerZ;
+ Double_t innerZh = (fInnerZ
+ - fInner->GetModuleSpacing()
+ - fInner->GetLegLength()
+ - fInner->GetSiThickness()
+ - fInner->GetPrintboardThickness()
+ - fHoneycombThickness);
+ Double_t innerRl = fInner->GetLowR();
+ Double_t outerZl = fOuterZ;
+ Double_t outerZh = (fOuterZ
+ - fOuter->GetModuleSpacing()
+ - fOuter->GetLegLength()
+ - fOuter->GetSiThickness()
+ - fOuter->GetPrintboardThickness()
+ - fHoneycombThickness);
+ Double_t outerRl = fOuter->GetLowR();
+
+ fSupport.SetupGeometry(airId, carbonId,
+ innerZl, innerZh, innerRl,
+ outerZl, outerZh, outerRl);
+
fInnerHoneyLowR = fInner->GetLowR() + 1;
- fInnerHoneyHighR = fInner->GetHighR() + 1;
+ fInnerHoneyHighR = fSupport.ConeR(innerZh + fHoneycombThickness, "I");
fOuterHoneyLowR = fOuter->GetLowR() + 1;
- fOuterHoneyHighR = fOuter->GetHighR() + 1;
-
- CalculateDz();
- Double_t par[3];
- par[0] = fInner->GetLowR();
- par[1] = fOuterHoneyHighR;
- par[2] = fDz;
- fVolumeId = gMC->Gsvolu("FMD3", "TUBE", airId, par, 3);
+ fOuterHoneyHighR = fSupport.GetBackLowR();
+ // Identity matrix
gMC->Matrix(fRotationId, 90, 0, 90, 90, 0, 0);
//0, 180, 90, 90, 180, 0);
- AliFMDSubDetector::SetupGeometry(airId, kaptionId);
+ AliFMDSubDetector::SetupGeometry(airId, alId, carbonId);
}
//____________________________________________________________________
// idRotId Identity rotation matrix ID
// z Z position (not really used here, but passed down)
//
- z = fInnerZ - fDz;
- gMC->Gspos("FMD3", 1, mother, 0, 0, z, fRotationId);
-
+ z = fSupport.GetZ();
+ AliDebug(10, Form("Passing z=%lf to ring volumes", z));
AliFMDSubDetector::Geometry("FMD3", pbRotId, idRotId, z);
+ fSupport.Geometry(mother, fRotationId, z);
}
// a = (fOuterHoneyHighR - fInnerHoneyHighR) / (x1 - x2)
//
//
- CalculateDz();
+ Double_t dz = (TMath::Abs(fInnerZ - fOuterZ)
+ + fOuter->GetSiThickness()
+ + fOuter->GetPrintboardThickness()
+ + fOuter->GetLegLength()
+ + fOuter->GetModuleSpacing()
+ + fHoneycombThickness) / 2;
#if 1
Double_t x1 = (fOuterZ - (fOuter->GetSiThickness()
+ fOuter->GetPrintboardThickness()
bo = fOuterHoneyHighR - ao * x1;
}
- Double_t y1o = ao * (fInnerZ - 2 * fDz) + bo;
+ Double_t y1o = ao * (fInnerZ - 2 * dz) + bo;
Double_t y2o = ao * fInnerZ + bo;
#endif
// We probably need to make a PCON here.
- TShape* shape = new TCONS("FMD3", "FMD3", "", fDz,
+ TShape* shape = new TCONS("FMD3", "FMD3", "", dz,
fOuter->GetLowR(), y1o, /* fOuterHoneyHighR, */
fInner->GetLowR(), y2o, /* fInnerHoneyHighR, */
0, 360);
mother->cd();
- zMother = fInnerZ - fDz;
+ zMother = fInnerZ - dz;
TNode* node = new TNode("FMD3", "FMD3", shape, 0, 0, zMother, 0);
node->SetVisibility(0);
nodes->Add(node);
//____________________________________________________________________
void
-AliFMD3::CalculateDz()
+AliFMD3::Gsatt()
{
- if (fDz > 0) return;
- fDz = (TMath::Abs(fInnerZ - fOuterZ)
- + fOuter->GetSiThickness()
- + fOuter->GetPrintboardThickness()
- + fOuter->GetLegLength()
- + fOuter->GetModuleSpacing()
- + fHoneycombThickness) / 2;
+ AliFMDSubDetector::Gsatt();
+ fSupport.Gsatt();
}
//____________________________________________________________________
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 2004, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/* $Id$ */
+
+//____________________________________________________________________
+//
+// Concrete implementation of AliFMDSubDetector
+//
+// This implements the geometry for FMD3
+//
+#include "TVirtualMC.h" // ROOT_TVirtualMC
+#include "AliFMD3Support.h" // ALIFMD3SUPPORT_H
+#include "AliLog.h" // ALILOG_H
+#include <Riostream.h> // ROOT_Riostream
+// #define FMD3_COMPLICATED_MOTHER
+//____________________________________________________________________
+ClassImp(AliFMD3Support);
+
+//____________________________________________________________________
+const Char_t* AliFMD3Support::fgkNoseName = "F3SN";
+const Char_t* AliFMD3Support::fgkBackName = "F3SB";
+const Char_t* AliFMD3Support::fgkBeamName = "F3SL";
+const Char_t* AliFMD3Support::fgkFlangeName = "F3SF";
+
+//____________________________________________________________________
+AliFMD3Support::AliFMD3Support()
+ : fZ(0),
+ fAlpha(-1),
+ fNoseId(-1),
+ fBeamId(-1),
+ fBackId(-1),
+ fFlangeId(-1)
+{
+ // Default constructor for the support of FMD3 sub-detector
+ SetNoseZ();
+ SetNoseLowR();
+ SetNoseHighR();
+ SetNoseLength();
+ SetBackLowR();
+ SetBackHighR();
+ SetBackLength();
+ SetBeamThickness();
+ SetBeamWidth();
+ SetConeLength();
+ SetFlangeR();
+ SetNBeam();
+ SetNFlange();
+}
+
+
+//____________________________________________________________________
+AliFMD3Support::~AliFMD3Support()
+{
+ // Destructor - does nothing
+}
+
+
+//____________________________________________________________________
+void
+AliFMD3Support::SetupGeometry(Int_t airId,
+ Int_t cId,
+ Double_t innerZl,
+ Double_t innerZh,
+ Double_t innerRl,
+ Double_t outerZl,
+ Double_t outerZh,
+ Double_t outerRl)
+{
+ // Setup the FMD3 sub-detector geometry
+ //
+ // Parameters:
+ //
+ // airId Id # of the Air medium
+ // cId Id # of the Carbon fibre medium
+ //
+
+ // Global stuff we need
+ Double_t zdist = fConeLength - fBackLength - fNoseLength;
+ Double_t tdist = fBackHighR - fNoseHighR;
+ Double_t beaml = TMath::Sqrt(zdist * zdist + tdist * tdist);
+ Double_t theta = -180. * TMath::ATan2(tdist, zdist) / TMath::Pi();
+ Double_t minZ = TMath::Min(fNoseZ - fConeLength, outerZh);
+ fAlpha = tdist / zdist;
+ fZ = fNoseZ + (minZ - fNoseZ) / 2;
+ AliDebug(10, Form("Theta = %lf", theta));
+
+ const Char_t* mother = "FMD3";
+#ifdef FMD3_COMPLICATED_MOTHER
+ // ------------- Mother volume -------------------------------------
+ Double_t p[3 + 9 * 3];
+ Double_t eps = 0;
+ // fZ -= eps;
+ // Global parameters
+ p[0] = 0;
+ p[1] = 360;
+ p[2] = 8;
+ // First plane (at start of nose)
+ p[3] = fNoseZ - fZ + eps;
+ p[4] = fNoseLowR - eps;
+ p[5] = fNoseHighR + eps;
+ // Second plane (at end of nose)
+ p[6] = fNoseZ - fNoseLength - fZ - eps;
+ p[7] = fNoseLowR - eps;
+ p[8] = ConeR(p[6] + fZ) + eps; // fNoseHighR;
+ // Third plane (at front of inner ring)
+ p[9] = innerZl - fZ + eps;
+ p[10] = innerRl - eps;
+ p[11] = ConeR(p[9] + fZ) + eps;
+ // Fourth plane (at back of inner ring)
+ p[12] = innerZh - fZ - eps;
+ p[13] = p[10];
+ p[14] = ConeR(p[12] + fZ) + eps;
+ // Fifth plane (at back of inner ring)
+ p[15] = p[12] - eps/2;
+ p[16] = outerRl - eps;
+ p[17] = ConeR(p[15] + fZ) + eps;
+ // Sixth plane (at front of back)
+ p[18] = fNoseZ - zdist - fNoseLength - fZ + eps;
+ p[19] = outerRl - eps;
+ p[20] = ConeR(p[18] + fZ) + eps;
+ // Seventh plane (at front of back, at end of flanges)
+ p[21] = p[18] - eps/2;
+ p[22] = p[19];
+ p[23] = fFlangeR + eps;
+ // Eight (and final) plane (at back of back or outer ring)
+ p[24] = minZ - fZ - eps;
+ p[25] = p[19];
+ p[26] = p[23];
+ // The volume
+ gMC->Gsvolu(mother, "PCON", airId, p, 27);
+ if (outerZh - fZ < p[24])
+ Warning("SetupGeometry", "Outer ring back is at %f (%f), "
+ "but support ends %f", outerZh, outerZl,
+ p[24] + fZ);
+#else
+ Double_t p[3];
+ // The simple mother
+ p[0] = 0;
+ p[1] = fFlangeR;
+ p[2] = TMath::Abs((minZ - fNoseZ) / 2);
+ gMC->Gsvolu(mother, "TUBE", airId, p, 3);
+ (void)innerZl;
+ (void)innerZh;
+ (void)innerRl;
+ (void)outerZl;
+ (void)outerRl;
+#endif
+
+ // ------------- Support Structures --------------------------------
+ fRotations.Set(fNBeam + fNFlange);
+ Double_t par[3];
+
+ // The nose
+ par[0] = fNoseLowR;
+ par[1] = fNoseHighR;
+ par[2] = fNoseLength / 2;
+ fNoseId = gMC->Gsvolu(fgkNoseName, "TUBE", cId, par, 3);
+
+ // The Back
+ par[0] = fBackLowR;
+ par[1] = fBackHighR;
+ par[2] = fBackLength / 2;
+ fBackId = gMC->Gsvolu(fgkBackName, "TUBE", cId, par, 3);
+
+ // The Beams
+ par[0] = fBeamThickness / 2;
+ par[1] = fBeamWidth / 2;
+ par[2] = beaml / 2;
+ fBeamId = gMC->Gsvolu(fgkBeamName, "BOX", cId, par, 3);
+ for (Int_t i = 0; i < fNBeam; i++) {
+ // cout << "Making beam # " << i << endl;
+ Double_t phi = 360. / fNBeam * i;
+ Int_t id;
+ gMC->Matrix(id, 180 - theta, phi, 90, 90 + phi, theta, phi);
+ fRotations[i] = id;
+ }
+
+ // The Flanges
+ par[0] = (fFlangeR - fBackHighR) / 2;
+ par[1] = fBeamWidth / 2;
+ par[2] = fBackLength / 2;
+ fFlangeId = gMC->Gsvolu(fgkFlangeName, "BOX", cId, par, 3);
+ for (Int_t i = 0; i < fNFlange; i++) {
+ Double_t phi = 360. / fNFlange * i + 180. / fNFlange;
+ Int_t id;
+ gMC->Matrix(id, 90, phi, 90, 90+phi, 0, 0);
+ fRotations[fNBeam + i] = id;
+ }
+}
+
+//____________________________________________________________________
+void
+AliFMD3Support::Geometry(const char* mother, Int_t idRotId, Double_t zTop)
+{
+ // Position the FMD3 sub-detector volume
+ //
+ // Parameters
+ //
+ // mother name of the mother volume
+ // idRotId Identity rotation matrix ID
+ // z Z position
+ //
+
+ // Common parameters
+ Double_t zdist = fConeLength - fBackLength - fNoseLength;
+ Double_t tdist = fBackHighR - fNoseHighR;
+ const Char_t* name = "FMD3";
+ Double_t z = zTop;
+
+ // Placing mother volume
+ AliDebug(10, Form("Putting %s in %s at z=%lf", name, mother, zTop));
+ gMC->Gspos(name, 1, mother, 0, 0, zTop, idRotId);
+
+ // Placing the nose
+ z = fNoseZ - fNoseLength / 2 - fZ;
+ AliDebug(10, Form("Putting %s in %s at z=%lf-%lf/2-%lf=%lf",
+ fgkNoseName, name, fNoseZ, fNoseLength, fZ, z));
+ gMC->Gspos(fgkNoseName, 1, name, 0., 0., z, idRotId, "");
+
+ // Placing the back
+ z = fNoseZ - fNoseLength - zdist - fBackLength / 2 - fZ;
+ AliDebug(10, Form("Putting %s in %s at z=%lf-%lf-%lf-%lf/2-%lf=%lf",
+ fgkBackName, name, fNoseZ, fNoseLength, zdist,
+ fBackLength, fZ, z));
+ gMC->Gspos(fgkBackName, 1, name, 0., 0., z, idRotId, "");
+
+ // Placing the beams
+ z = fNoseZ - fNoseLength - zdist / 2 - fZ;
+ Double_t r = fNoseHighR + tdist / 2;
+ AliDebug(10, Form("Putting %s's in %s at z=%lf-%lf-%lf/2-%lf=%lf",
+ fgkBeamName, name, fNoseZ, fNoseLength, zdist, fZ, z));
+ for (Int_t i = 0; i < fNBeam; i++) {
+ // cout << "Making beam # " << i << endl;
+ Double_t phi = 360. / fNBeam * i;
+ gMC->Gspos(fgkBeamName, i, name,
+ r * TMath::Cos(TMath::Pi() / 180 * phi),
+ r * TMath::Sin(TMath::Pi() / 180 * phi),
+ z, fRotations[i], "");
+ }
+
+ // Placing the flanges
+ r = fBackHighR + (fFlangeR - fBackHighR) / 2;
+ z = fNoseZ - fNoseLength - zdist - fBackLength / 2 - fZ;
+ AliDebug(10, Form("Putting %s in %s at z=%lf-%lf-%lf-%lf/2-%lf=%lf",
+ fgkFlangeName, name, fNoseZ, fNoseLength, zdist,
+ fBackLength, fZ, z));
+ for (Int_t i = 0; i < fNFlange; i++) {
+ Double_t phi = 360. / fNFlange * i + 180. / fNFlange;
+ gMC->Gspos(fgkFlangeName, i, name,
+ r * TMath::Cos(TMath::Pi() / 180 * phi),
+ r * TMath::Sin(TMath::Pi() / 180 * phi),
+ z, fRotations[fNBeam + i], "");
+ }
+}
+
+//____________________________________________________________________
+Double_t
+AliFMD3Support::ConeR(Double_t z, Option_t* opt) const
+{
+ // Calculate the cone radius at Z
+ if (fAlpha < 0) {
+ Warning("ConeR", "alpha not set: %lf", fAlpha);
+ return -1;
+ }
+ if (z > fNoseZ) {
+ Warning("ConeR", "z=%lf is before start of cone %lf", z, fNoseZ);
+ return -1;
+ }
+ Double_t e = fBeamThickness / TMath::Cos(TMath::ATan(fAlpha));
+ if (opt[0] == 'I' || opt[1] == 'i') e *= -1;
+ if (z > fNoseZ - fNoseLength) return fNoseHighR + e;
+ if (z < fNoseZ - fConeLength + fBackLength) return fBackHighR + e;
+ Double_t r = fNoseHighR + fAlpha * TMath::Abs(z - fNoseZ + fNoseLength) + e;
+ return r;
+}
+
+//____________________________________________________________________
+void
+AliFMD3Support::Gsatt()
+{
+ // Set drawing attributes for the FMD3 Support
+ gMC->Gsatt(fgkNoseName, "SEEN", 1);
+ gMC->Gsatt(fgkBeamName, "SEEN", 1);
+ gMC->Gsatt(fgkBackName, "SEEN", 1);
+ gMC->Gsatt(fgkFlangeName, "SEEN", 1);
+}
+
+
+//____________________________________________________________________
+//
+// EOF
+//
--- /dev/null
+//
+// $Id$
+//
+#ifndef ALIFMD3SUPPORT_H
+#define ALIFMD3SUPPORT_H
+
+#ifndef ROOT_TObject
+# include <TObject.h>
+#endif
+#ifndef ROOT_TArrayI
+# include <TArrayI.h>
+#endif
+
+class AliFMD3Support : public TObject
+{
+public:
+ AliFMD3Support();
+ virtual ~AliFMD3Support();
+ virtual void SetupGeometry(Int_t airId, Int_t cId,
+ Double_t innerZl, Double_t innerZh,
+ Double_t innerRl, Double_t outerZl,
+ Double_t outerZh, Double_t outerRl);
+ virtual void Geometry(const char* mother, Int_t idRotId, Double_t z=0);
+ virtual void Gsatt();
+
+ void SetNoseZ(Double_t x=-46) { fNoseZ = x; }
+ void SetNoseLowR(Double_t x=5.5) { fNoseLowR = x; }
+ void SetNoseHighR(Double_t x=6.7) { fNoseHighR = x; }
+ void SetNoseLength(Double_t x=2.8) { fNoseLength = x; }
+ void SetBackLowR(Double_t x=61./2) { fBackLowR = x; }
+ void SetBackHighR(Double_t x=66.8/2) { fBackHighR = x; }
+ void SetBackLength(Double_t x=1.4) { fBackLength = x; }
+ void SetBeamThickness(Double_t x=.5) { fBeamThickness = x; }
+ void SetBeamWidth(Double_t x=6) { fBeamWidth = x; }
+ void SetConeLength(Double_t x=30.9) { fConeLength = x; }
+ void SetFlangeR(Double_t x=49.25) { fFlangeR = x; }
+ void SetNBeam(Int_t n=8) { fNBeam = n; }
+ void SetNFlange(Int_t n=4) { fNFlange = n; }
+
+ Double_t GetNoseZ() const { return fNoseZ; }
+ Double_t GetNoseLowR() const { return fNoseLowR; }
+ Double_t GetNoseHighR() const { return fNoseHighR; }
+ Double_t GetNoseLength() const { return fNoseLength; }
+ Double_t GetBackLowR() const { return fBackLowR; }
+ Double_t GetBackHighR() const { return fBackHighR; }
+ Double_t GetBackLength() const { return fBackLength; }
+ Double_t GetBeamThickness() const { return fBeamThickness; }
+ Double_t GetBeamWidth() const { return fBeamWidth; }
+ Double_t GetConeLength() const { return fConeLength; }
+ Double_t GetFlangeR() const { return fFlangeR; }
+ Int_t GetNBeam() const { return fNBeam; }
+ Int_t GetNFlange() const { return fNFlange; }
+ Double_t GetZ() const { return fZ; }
+ Double_t ConeR(Double_t z, Option_t* opt="O") const;
+protected:
+ Double_t fNoseZ; // Z position of front of nose
+ Double_t fNoseLowR; // Nose inner radius
+ Double_t fNoseHighR; // Nose outer radius
+ Double_t fNoseLength; // Length of nose in Z
+ Double_t fBackLowR; // Inner radius of base of cone
+ Double_t fBackHighR; // Outer radius of base of cone
+ Double_t fBackLength; // Length of base of cone in Z
+ Double_t fBeamThickness; // Thickness of support beams
+ Double_t fBeamWidth; // Width of support beams
+ Double_t fConeLength; // Length of the cone in Z
+ Double_t fFlangeR; // Outer radius of flanges
+ Double_t fZ; // Midpoint of mother volume
+ Double_t fAlpha; // Slope of cone
+
+ Int_t fNBeam; // Number of support beams
+ Int_t fNFlange; // Number of support flanges
+ Int_t fNoseId; // Id of nose volume
+ Int_t fBeamId; // Id of beam volumes
+ Int_t fBackId; // Id of base volume
+ Int_t fFlangeId; // Id of flange volume
+ TArrayI fRotations;
+
+ static const Char_t* fgkNoseName; // Name of nose volume
+ static const Char_t* fgkBeamName; // Name of beam volumes
+ static const Char_t* fgkBackName; // Name of base volume
+ static const Char_t* fgkFlangeName; // Name of flange volume
+
+ ClassDef(AliFMD3Support,1); // Geometry of Support for the FMD3
+};
+
+#endif
+//____________________________________________________________________
+//
+// Local Variables:
+// mode: C++
+// End:
+//
+//
+// EOF
+//