Fixed memory leak
[u/mrichter/AliRoot.git] / MUON / AliMUONSt1GeometryBuilderV2.h
CommitLineData
d1cd2474 1/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
3
4// $Id$
30178c30 5// Revision of includes 07/05/2004
d1cd2474 6//
5398f946 7/// \ingroup sim
090443dd 8/// \class AliMUONSt1GeometryBuilderV2
9/// \brief MUON Station1 detailed geometry construction class
10///
11/// \author David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay
d1cd2474 12
13#ifndef ALI_MUON_ST1_GEOMETRY_BUILDER_V2_H
14#define ALI_MUON_ST1_GEOMETRY_BUILDER_V2_H
15
86488ea7 16
d1cd2474 17#include "AliMUONVGeometryBuilder.h"
18
630711ed 19#include <TExMap.h>
86488ea7 20
71a2d3aa 21// typedef Float_t GReal_t; // for AliGeant3
d1cd2474 22typedef Double_t GReal_t; // for VirtualMC
23
adbabf6d 24class AliMUON;
25class AliMpSector;
26
d1cd2474 27class TTree;
28class TVector2;
29class TVector3;
30
d1cd2474 31class AliMUONSt1GeometryBuilderV2 : public AliMUONVGeometryBuilder
32{
33 public:
34 AliMUONSt1GeometryBuilderV2(AliMUON* muon);
d1cd2474 35 AliMUONSt1GeometryBuilderV2();
36 virtual ~AliMUONSt1GeometryBuilderV2();
37
38 virtual void CreateMaterials();
39 virtual void CreateGeometry();
b96f7067 40 virtual void SetVolumes();
d1cd2474 41 virtual void SetTransformations();
42 virtual void SetSensitiveVolumes();
43
44 protected:
d1cd2474 45
46 private:
71a2d3aa 47 /// Not implemented
161d3338 48 AliMUONSt1GeometryBuilderV2(const AliMUONSt1GeometryBuilderV2& rMUON);
71a2d3aa 49 /// Not implemented
161d3338 50 AliMUONSt1GeometryBuilderV2& operator = (const AliMUONSt1GeometryBuilderV2& rhs);
71a2d3aa 51
d1cd2474 52 // Constants
53 //
ab3b76f1 54 static const GReal_t fgkHzPadPlane; ///< Pad plane
55 static const GReal_t fgkHzFoam; ///< Foam of mechanicalplane
56 static const GReal_t fgkHzFR4; ///< FR4 of mechanical plane
57 static const GReal_t fgkHzSnPb; ///< Pad/Kapton connection (66 pt)
58 static const GReal_t fgkHzKapton; ///< Kapton
59 static const GReal_t fgkHzBergPlastic; ///< Berg connector
60 static const GReal_t fgkHzBergCopper; ///< Berg connector (80 pt)
61 static const GReal_t fgkHzDaughter; ///< Daughter board
62 static const GReal_t fgkHzGas; ///< ArCO2 Gas
d1cd2474 63
64 // Sensitive copper pads, foam layer, PCB and electronics model parameters
ab3b76f1 65 static const GReal_t fgkHxHole; ///< foam hole paremeter
66 static const GReal_t fgkHyHole; ///< foam hole paremeter
67 static const GReal_t fgkHxBergPlastic; ///< Berg connector parameter
68 static const GReal_t fgkHyBergPlastic; ///< Berg connector parameter
69 static const GReal_t fgkHxBergCopper; ///< Berg connector parameter
70 static const GReal_t fgkHyBergCopper; ///< Berg connector parameter
71 static const GReal_t fgkHxKapton; ///< Kapton parameter
72 static const GReal_t fgkHyKapton; ///< Kapton parameter
73 static const GReal_t fgkHxDaughter; ///< Electronics parameter
74 static const GReal_t fgkHyDaughter; ///< Electronics parameter
75 static const GReal_t fgkOffsetX; ///< Offset X
76 static const GReal_t fgkOffsetY; ///< Offset Y
77 static const GReal_t fgkDeltaFilleEtamX; ///< Electronics parameter
78 static const GReal_t fgkDeltaFilleEtamY; ///< Electronics parameter
79
80 static const GReal_t fgkDeltaQuadLHC; ///< LHC Origin wrt Quadrant Origin
81 static const GReal_t fgkFrameOffset; ///< Frame offset
d1cd2474 82
b367fd8f 83 // Pad planes offsets
ab3b76f1 84 static const GReal_t fgkPadXOffsetBP; ///< Horizontal offset in bending plane
85 static const GReal_t fgkPadYOffsetBP; ///< Vertical offset in bending plane
86
87 // Quadrant Mother volume - TUBS1
88 static const GReal_t fgkMotherIR1; ///< Middle Layer Rin
89 static const GReal_t fgkMotherOR1; ///< Middle Layer Rout
90 static const GReal_t fgkMotherThick1; ///< Middle Layer Hz
91 static const GReal_t fgkMotherPhiL1; ///< Middle Layer Sphi
92 static const GReal_t fgkMotherPhiU1; ///< Middle Layer Endphi
93
94 // Quadrant Mother volume - TUBS2 (2 copies at different Z's)
95 static const GReal_t fgkMotherIR2; ///< Near and Far Layer Rin
96 static const GReal_t fgkMotherOR2; ///< Near and Far Layer Rout
97 static const GReal_t fgkMotherThick2; ///< Near and Far Layer Hz
98 static const GReal_t fgkMotherPhiL2; ///< Near and Far Layer Sphi
99 static const GReal_t fgkMotherPhiU2; ///< Near and Far Layer Endphi
18b6b8c7 100
101 static const char* fgkHoleName; ///< prefix for automatic volume naming
102 static const char* fgkQuadrantEnvelopeName; ///< prefix for automatic volume naming
103 static const char* fgkQuadrantMLayerName;///< prefix for automatic volume naming
104 static const char* fgkQuadrantNLayerName;///< prefix for automatic volume naming
105 static const char* fgkQuadrantFLayerName;///< prefix for automatic volume naming
5ae5869b 106 static const char* fgkQuadrantMFLayerName; ///< prefix for automatic volume naming
18b6b8c7 107 static const char* fgkDaughterName; ///< prefix for automatic volume naming
ab3b76f1 108 static const Int_t fgkFoamBoxNameOffset; ///< coefficient for automatic volume naming
109 static const Int_t fgkFR4BoxNameOffset; ///< coefficient for automatic volume naming
110 static const Int_t fgkDaughterCopyNoOffset; ///< \brief copy number offset for daughter
111 /// boards positions in non-bending plane
d1cd2474 112
113 // Methods
114 //
115 void CreateHole();
116 void CreateDaughterBoard();
117 void CreateInnerLayers();
fdbaed6e 118 void CreateSpacer0();
119 void CreateSpacer();
d1cd2474 120 void CreateQuadrant(Int_t chamber);
62c708bf 121 void CreateFoamBox(Int_t segNumber, const TVector2& dimensions);
122 void CreatePlaneSegment(Int_t segNumber, const TVector2& dimensions,
d1cd2474 123 Int_t nofHoles);
5ae5869b 124 void CreateQuadrantLayersAsVolumes(Int_t chamber);
125 void CreateQuadrantLayersAsAssemblies(Int_t chamber);
d1cd2474 126 void CreateFrame(Int_t chamber);
127
128 void PlaceInnerLayers(Int_t chamber);
fdbaed6e 129 void PlaceSpacer0(Int_t chamber);
5ae5869b 130 void PlaceSector(const AliMpSector* sector, TExMap specialMap,
d1cd2474 131 const TVector3& where, Bool_t reflectZ, Int_t chamber);
132
b367fd8f 133 TString QuadrantEnvelopeName(Int_t chamber, Int_t quadrant) const;
d1cd2474 134 TString QuadrantMLayerName(Int_t chamber) const;
135 TString QuadrantNLayerName(Int_t chamber) const;
136 TString QuadrantFLayerName(Int_t chamber) const;
5ae5869b 137 TString QuadrantMFLayerName(Int_t chamber) const;
62c708bf 138 TString PlaneSegmentName(Int_t segNumber) const;
139 TString FoamBoxName(Int_t segNumber) const;
140 TString FR4BoxName(Int_t segNumber) const;
d1cd2474 141 TString GasVolumeName(const TString& name, Int_t chamber) const;
142
5398f946 143 GReal_t TotalHzPlane() const ;
144 GReal_t TotalHzDaughter() const ;
145 GReal_t TotalHz() const ;
d1cd2474 146
147 // Data members
148 //
149 //Float_t fRadlCopper; //! copper computed radiation length
150 //Float_t fRadlFoam; //! foam computed radiation length
151 //Float_t fRadlFR4; //! FR4 computed radiation length
18b6b8c7 152 AliMUON* fMUON; ///< the MUON detector class
d1cd2474 153
154 ClassDef(AliMUONSt1GeometryBuilderV2,1) // MUON Detector base class
155};
156
157// inline functions
158
5398f946 159/// Return total mechanical plane half Size
d1cd2474 160inline GReal_t AliMUONSt1GeometryBuilderV2::TotalHzPlane() const
161//{ return fgkHzPadPlane + fgkHzFoam + fgkHzFR4; }
162{ return fgkHzFoam + fgkHzFR4; }
163
5398f946 164/// Return total daughter plane half Size
d1cd2474 165inline GReal_t AliMUONSt1GeometryBuilderV2::TotalHzDaughter() const
166{ return fgkHzBergPlastic + fgkHzDaughter; }
167
5398f946 168/// Return total plane half Size
d1cd2474 169inline GReal_t AliMUONSt1GeometryBuilderV2::TotalHz() const
170{ return TotalHzPlane() + TotalHzDaughter(); }
171
5398f946 172/// Return middle quadrant layer name for chamber \a chamber
d1cd2474 173inline TString AliMUONSt1GeometryBuilderV2::QuadrantMLayerName(Int_t chamber) const
174{ return Form("%s%d",fgkQuadrantMLayerName,chamber); }
5ae5869b 175
176/// Return middle quadrant frame layer name for chamber \a chamber
177inline TString AliMUONSt1GeometryBuilderV2::QuadrantMFLayerName(Int_t chamber) const
178{ return Form("%s%d",fgkQuadrantMFLayerName,chamber); }
d1cd2474 179
5398f946 180/// Return nearer quadrant layer name for chamber \a chamber
d1cd2474 181inline TString AliMUONSt1GeometryBuilderV2::QuadrantNLayerName(Int_t chamber) const
182{ return Form("%s%d",fgkQuadrantNLayerName,chamber); }
183
5398f946 184/// Return farther quadrant layer name for chamber \a chamber
d1cd2474 185inline TString AliMUONSt1GeometryBuilderV2::QuadrantFLayerName(Int_t chamber) const
186{ return Form("%s%d",fgkQuadrantFLayerName,chamber); }
187
5398f946 188/// Return plane segment name for segment \a segNumber
62c708bf 189inline TString AliMUONSt1GeometryBuilderV2::PlaneSegmentName(Int_t segNumber) const
190{ return Form("S%.3d", segNumber); }
191
5398f946 192/// Return foam box name for segment \a segNumber
62c708bf 193inline TString AliMUONSt1GeometryBuilderV2::FoamBoxName(Int_t segNumber) const
194{ return Form("S%.3d", segNumber + fgkFoamBoxNameOffset); }
195
5398f946 196/// Return FR4 box name for segment \a segNumber
62c708bf 197inline TString AliMUONSt1GeometryBuilderV2::FR4BoxName(Int_t segNumber) const
198{ return Form("S%.3d", segNumber + fgkFR4BoxNameOffset); }
199
d1cd2474 200#endif //ALI_MUON_ST1_GEOMETRY_BUILDER_V2_H