1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 **************************************************************************/
16 //*************************************************************************
17 // This class Defines the Geometry of the Beam Pipe
18 // for the ITS Upgrade using TGeo
20 // Mario Sitta <sitta@to.infn.it>
21 //*************************************************************************
24 /* $Id: AliITSv11GeomBeamPipe.cxx */
25 // General Root includes
27 // Root Geometry includes
29 #include <TGeoManager.h>
30 #include <TGeoVolume.h>
33 #include <TGeoTube.h> // contaings TGeoTubeSeg
34 #include <TGeoMatrix.h>
35 #include "AliITSv11GeomBeamPipe.h"
37 ClassImp(AliITSv11GeomBeamPipe)
39 //________________________________________________________________________
40 AliITSv11GeomBeamPipe::AliITSv11GeomBeamPipe():
47 // Standard constructor
51 //________________________________________________________________________
52 AliITSv11GeomBeamPipe::AliITSv11GeomBeamPipe(Double_t rmin, Double_t rmax, Double_t zlen, Int_t debug):
53 AliITSv11Geometry(debug),
59 // Constructor setting parameters and debugging level
63 //________________________________________________________________________
64 AliITSv11GeomBeamPipe::AliITSv11GeomBeamPipe(const AliITSv11GeomBeamPipe &s):
65 AliITSv11Geometry(s.GetDebug()),
66 fBeamPipeRmin(s.fBeamPipeRmin),
67 fBeamPipeRmax(s.fBeamPipeRmax),
68 fBeamPipeZlen(s.fBeamPipeZlen)
75 //________________________________________________________________________
76 AliITSv11GeomBeamPipe& AliITSv11GeomBeamPipe::operator=(const AliITSv11GeomBeamPipe &s)
79 // Assignment operator
81 if(&s == this) return *this;
83 fBeamPipeRmin = s.fBeamPipeRmin;
84 fBeamPipeRmax = s.fBeamPipeRmax;
85 fBeamPipeZlen = s.fBeamPipeZlen;
90 //________________________________________________________________________
91 AliITSv11GeomBeamPipe::~AliITSv11GeomBeamPipe() {
97 //________________________________________________________________________
98 void AliITSv11GeomBeamPipe::CreateBeamPipe(TGeoVolume *moth,
99 const TGeoManager *mgr){
101 // Creates the actual Beam Pipe and places it inside the mother volume
104 // moth : the TGeoVolume owing the volume structure
105 // mgr : the GeoManager (used only to get the proper material)
111 // Created: 03 Mar 2012 Mario Sitta
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));
126 if (fBeamPipeRmin >= fBeamPipeRmax)
127 AliFatal(Form("Internal beam pipe radius (%f) greater than external radius (%f)",fBeamPipeRmin,fBeamPipeRmax));
130 // The shape of the beam pipe: a simple cylinder
131 TGeoTube *bpShape = new TGeoTube(fBeamPipeRmin,fBeamPipeRmax,fBeamPipeZlen);
134 // We have all shapes: now create the real volumes
135 TGeoMedium *medBe = mgr->GetMedium("ITS_BERILLIUM$");
137 TGeoVolume *bpVolume = new TGeoVolume("UpgradeBeamPipe", bpShape, medBe);
140 // Finally put everything in the mother volume
141 moth->AddNode(bpVolume, 1, 0);
144 // Upgrade beam pipe geometry is served