00001
00002
00003
00004
00005
00006
00007
00008
00010 #include <TGeoManager.h>
00011 #include <TGeoBBox.h>
00012
00013 #include "MessageService/MsgService.h"
00014 #include "GeoGeometry/GeoPlnNode.h"
00015 #include "GeoGeometry/GeoGeometry.h"
00016
00017 ClassImp(GeoPlnNode)
00018 CVSID("$Id: GeoPlnNode.cxx,v 1.5 2005/06/12 14:42:30 schubert Exp $");
00019
00020
00021 GeoPlnNode::GeoPlnNode(GeoGeometry* geo, TGeoVolume* plnvol,
00022 TGeoMatrix* plnmatrix, TGeoVolume* parVol,
00023 std::string globalpath, std::string nodename,
00024 const PlexPlaneId& planeid)
00025 : GeoNode(geo,plnvol,plnmatrix,parVol,globalpath,nodename),
00026 fPlaneId(planeid) {
00027
00028
00029 UpdateGlobalManager();
00030
00031 }
00032
00033
00034 GeoPlnNode::~GeoPlnNode() {
00035
00036
00037 UpdateGlobalManager();
00038
00039 if ( CountRef() ) {
00040 MSG("Geo",Msg::kWarning)
00041 << "GeoPlnNode destructor " << GetPlexPlaneId()
00042 << " still had " << CountRef()
00043 << " outstanding references " << endl;
00044 }
00045
00046 }
00047
00048
00049 Float_t GeoPlnNode::GetHalfThickness() const {
00050
00051
00052 UpdateGlobalManager();
00053
00054 Float_t halfdz = dynamic_cast<TGeoBBox*>(GetVolume()->GetShape())->GetDZ();
00055
00056 return halfdz;
00057 }
00058
00059
00060
00061 TVector3 GeoPlnNode::GetCenter() const {
00062
00063
00064 UpdateGlobalManager();
00065
00066 Double_t lxyz[3] = {0., 0., 0.};
00067 Double_t gxyz[3];
00068
00069 LocalToGlobal(lxyz,gxyz);
00070 return TVector3(gxyz[0],gxyz[1],gxyz[2]);
00071 }
00072
00073
00074 Float_t GeoPlnNode::GetX0() const {
00075
00076
00077 UpdateGlobalManager();
00078
00079 Double_t lxyz[3] = {0., 0., 0.};
00080 Double_t gxyz[3];
00081
00082 LocalToGlobal(lxyz,gxyz);
00083 return gxyz[0];
00084 }
00085
00086
00087 Float_t GeoPlnNode::GetY0() const {
00088
00089
00090 UpdateGlobalManager();
00091
00092 Double_t lxyz[3] = {0., 0., 0.};
00093 Double_t gxyz[3];
00094
00095 LocalToGlobal(lxyz,gxyz);
00096 return gxyz[1];
00097 }
00098
00099
00100 Float_t GeoPlnNode::GetZ0() const {
00101
00102
00103 UpdateGlobalManager();
00104
00105 Double_t lxyz[3] = {0., 0., 0.};
00106 Double_t gxyz[3];
00107
00108 LocalToGlobal(lxyz,gxyz);
00109 return gxyz[2];
00110 }
00111
00112