]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/UPGRADE/AliITSv11GeomBeamPipe.cxx
cleanup
[u/mrichter/AliRoot.git] / ITS / UPGRADE / AliITSv11GeomBeamPipe.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, 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 //*************************************************************************
17 // This class Defines the Geometry of the Beam Pipe
18 // for the ITS Upgrade using TGeo
19 //
20 //  Mario Sitta <sitta@to.infn.it>
21 //*************************************************************************
22
23
24 /* $Id: AliITSv11GeomBeamPipe.cxx  */
25 // General Root includes
26 #include <TMath.h>
27 // Root Geometry includes
28 //#include <AliLog.h>
29 #include <TGeoManager.h>
30 #include <TGeoVolume.h>
31 #include <TGeoPcon.h>
32 #include <TGeoCone.h>
33 #include <TGeoTube.h> // contaings TGeoTubeSeg
34 #include <TGeoMatrix.h>
35 #include "AliITSv11GeomBeamPipe.h"
36
37 ClassImp(AliITSv11GeomBeamPipe)
38
39 //________________________________________________________________________
40 AliITSv11GeomBeamPipe::AliITSv11GeomBeamPipe(): 
41   AliITSv11Geometry(),
42   fBeamPipeRmin(0),
43   fBeamPipeRmax(0),
44   fBeamPipeZlen(0)
45 {
46   //
47   // Standard constructor
48   //
49 }
50
51 //________________________________________________________________________
52 AliITSv11GeomBeamPipe::AliITSv11GeomBeamPipe(Double_t rmin, Double_t rmax, Double_t zlen, Int_t debug): 
53   AliITSv11Geometry(debug),
54   fBeamPipeRmin(rmin),
55   fBeamPipeRmax(rmax),
56   fBeamPipeZlen(zlen)
57 {
58   //
59   // Constructor setting parameters and debugging level
60   //
61 }
62
63 //________________________________________________________________________
64 AliITSv11GeomBeamPipe::AliITSv11GeomBeamPipe(const AliITSv11GeomBeamPipe &s):
65   AliITSv11Geometry(s.GetDebug()),
66   fBeamPipeRmin(s.fBeamPipeRmin),
67   fBeamPipeRmax(s.fBeamPipeRmax),
68   fBeamPipeZlen(s.fBeamPipeZlen)
69 {
70   //
71   // Copy constructor
72   //
73 }
74
75 //________________________________________________________________________
76 AliITSv11GeomBeamPipe& AliITSv11GeomBeamPipe::operator=(const AliITSv11GeomBeamPipe &s)
77 {
78   //
79   // Assignment operator 
80   //
81   if(&s == this) return *this;
82
83   fBeamPipeRmin = s.fBeamPipeRmin;
84   fBeamPipeRmax = s.fBeamPipeRmax;
85   fBeamPipeZlen = s.fBeamPipeZlen;
86
87   return *this;
88 }
89
90 //________________________________________________________________________
91 AliITSv11GeomBeamPipe::~AliITSv11GeomBeamPipe() {
92   //
93   // Destructor
94   //
95 }
96
97 //________________________________________________________________________
98 void AliITSv11GeomBeamPipe::CreateBeamPipe(TGeoVolume *moth,
99                                            const TGeoManager *mgr){
100 //
101 // Creates the actual Beam Pipe and places it inside the mother volume
102 //
103 // Input:
104 //         moth : the TGeoVolume owing the volume structure
105 //         mgr  : the GeoManager (used only to get the proper material)
106 //
107 // Output:
108 //
109 // Return:
110 //
111 // Created:      03 Mar 2012  Mario Sitta
112 //
113
114
115   // Local variables
116 //none
117
118   // Check if the user set the proper parameters
119   if (fBeamPipeRmin <= 0)
120     AliFatal(Form("Wrong beam pipe internal radius (%f)",fBeamPipeRmin));
121   if (fBeamPipeRmax <= 0)
122     AliFatal(Form("Wrong beam pipe external radius (%f)",fBeamPipeRmax));
123   if (fBeamPipeZlen <= 0)
124     AliFatal(Form("Wrong beam pipe half length (%f)",fBeamPipeZlen));
125
126   if (fBeamPipeRmin >= fBeamPipeRmax)
127     AliFatal(Form("Internal beam pipe radius (%f) greater than external radius (%f)",fBeamPipeRmin,fBeamPipeRmax));
128
129
130   // The shape of the beam pipe: a simple cylinder
131   TGeoTube *bpShape = new TGeoTube(fBeamPipeRmin,fBeamPipeRmax,fBeamPipeZlen);
132
133
134   // We have all shapes: now create the real volumes
135   TGeoMedium *medBe = mgr->GetMedium("ITS_BERILLIUM$");
136
137   TGeoVolume *bpVolume = new TGeoVolume("UpgradeBeamPipe", bpShape, medBe);
138
139
140   // Finally put everything in the mother volume
141   moth->AddNode(bpVolume, 1, 0);
142
143
144   // Upgrade beam pipe geometry is served
145   return;
146 }
147