VGM Version 5.3
Loading...
Searching...
No Matches
Cons.cxx
Go to the documentation of this file.
1// $Id$
2
3// -----------------------------------------------------------------------
4// The RootGM package of the Virtual Geometry Model
5// Copyright (C) 2007, Ivana Hrivnacova
6// All rights reserved.
7//
8// For the licensing terms see vgm/LICENSE.
9// Contact: ivana@ipno.in2p3.fr
10// -----------------------------------------------------------------------
11
12//
13// Class Cons
14// ---------------
15// VGM implementation for Root cons solid.
16//
17// Author: Ivana Hrivnacova; IPN Orsay
18
19#include "RootGM/solids/Cons.h"
20#include "RootGM/common/Units.h"
22
23#include "TGeoCone.h"
24#include "TGeoShape.h"
25
26//_____________________________________________________________________________
27RootGM::Cons::Cons(const std::string& name, double rin1, double rout1,
28 double rin2, double rout2, double hz, double sphi, double dphi)
29 : VGM::ISolid(),
30 VGM::ICons(),
31 BaseVGM::VCons(),
32 fCons(new TGeoConeSeg(name.data(), hz / RootGM::Units::Length(),
33 rin1 / RootGM::Units::Length(), rout1 / RootGM::Units::Length(),
34 rin2 / RootGM::Units::Length(), rout2 / RootGM::Units::Length(),
35 sphi / RootGM::Units::Angle(), (sphi + dphi) / RootGM::Units::Angle()))
36{
45
47}
48
49//_____________________________________________________________________________
50RootGM::Cons::Cons(TGeoCone* cons)
51 : VGM::ISolid(), VGM::ICons(), BaseVGM::VCons(), fCons(cons)
52{
54
56}
57
58//_____________________________________________________________________________
59RootGM::Cons::Cons() : VGM::ISolid(), VGM::ICons(), BaseVGM::VCons()
60{
62}
63
64//_____________________________________________________________________________
66 : VGM::ISolid(rhs), VGM::ICons(rhs), BaseVGM::VCons(rhs)
67{
69}
70
71//_____________________________________________________________________________
73{
74 //
75}
76
77//_____________________________________________________________________________
78std::string RootGM::Cons::Name() const { return fCons->GetName(); }
79
80//_____________________________________________________________________________
82{
83 return fCons->GetRmin1() * RootGM::Units::Length();
84}
85
86//_____________________________________________________________________________
88{
89 return fCons->GetRmax1() * RootGM::Units::Length();
90}
91
92//_____________________________________________________________________________
94{
95 return fCons->GetRmin2() * RootGM::Units::Length();
96}
97
98//_____________________________________________________________________________
100{
101 return fCons->GetRmax2() * RootGM::Units::Length();
102}
103
104//_____________________________________________________________________________
106{
107 return fCons->GetDz() * RootGM::Units::Length();
108}
109
110//_____________________________________________________________________________
112{
113 if (fCons->TestShapeBit(TGeoShape::kGeoConeSeg))
114 return ((TGeoConeSeg*)fCons)->GetPhi1() * RootGM::Units::Angle();
115 else
116 return 0. * RootGM::Units::Angle();
117}
118
119//_____________________________________________________________________________
121{
122 if (fCons->TestShapeBit(TGeoShape::kGeoConeSeg)) {
123 return (((TGeoConeSeg*)fCons)->GetPhi2() -
124 ((TGeoConeSeg*)fCons)->GetPhi1()) *
126 }
127 else
128 return 360. * RootGM::Units::Angle();
129}
VGM implementation for Root cons solid.
Definition Cons.h:32
virtual double InnerRadiusMinusZ() const
Return the innner radius at -z in mm.
Definition Cons.cxx:81
virtual double ZHalfLength() const
Return the half-length along the z axis in mm.
Definition Cons.cxx:105
virtual double InnerRadiusPlusZ() const
Return the innner radius at +z in mm.
Definition Cons.cxx:93
virtual double OuterRadiusPlusZ() const
Return the outer radius at -z in mm.
Definition Cons.cxx:99
virtual std::string Name() const
Return the name of this solid.
Definition Cons.cxx:78
virtual ~Cons()
Definition Cons.cxx:72
virtual double OuterRadiusMinusZ() const
Return the outer radius at -z in mm.
Definition Cons.cxx:87
virtual double StartPhi() const
Return the starting phi angle of the segment in deg.
Definition Cons.cxx:111
virtual double DeltaPhi() const
Return the opening phi angle of the segment in deg.
Definition Cons.cxx:120
void AddSolid(VGM::ISolid *, TGeoShape *)
Definition SolidMap.cxx:59
static SolidMap * Instance()
Definition SolidMap.cxx:28
Conversion from Root physical units to VGM units.
Definition Units.h:28
static double Length()
Return Root length unit in VGM units.
Definition Units.h:84
static double Angle()
Return Root angle unit in VGM units.
Definition Units.h:85
BaseVGM utilities.
Definition utilities.h:23
VGM implementation for Root.
Definition axis.h:28
VGM interfaces.
Definition VMedium.h:28