GeoNode Class Reference

#include <GeoNode.h>

Inheritance diagram for GeoNode:
GeoRefCnt GeoPlnNode GeoScintMdlNode GeoStripNode GeoScintPlnNode GeoSteelPlnNode

List of all members.

Public Member Functions

 GeoNode ()
virtual ~GeoNode ()
virtual void UpdateGlobalManager () const
virtual GeoGeometryGetGeoGeometry () const
virtual std::string GetGlobalPath () const
virtual TVector3 LocalToGlobal (const TVector3 &local) const
virtual TVector3 GlobalToLocal (const TVector3 &global) const
virtual void LocalToGlobal (Double_t *lxyz, Double_t *gxyz) const
virtual void GlobalToLocal (Double_t *gxyz, Double_t *lxyz) const
virtual TVector3 LocalToGlobalVect (const TVector3 &local) const
virtual TVector3 GlobalToLocalVect (const TVector3 &global) const
virtual void LocalToGlobalVect (Double_t *lxyz, Double_t *gxyz) const
virtual void GlobalToLocalVect (Double_t *gxyz, Double_t *lxyz) const

Protected Member Functions

 GeoNode (GeoGeometry *geoGeometry, TGeoVolume *vol, TGeoMatrix *matrix, TGeoVolume *parVol, std::string globalpath, std::string nodename)
virtual void UpdateGlobalMatrix ()
virtual void IncrementRef ()
virtual void DecrementRef ()

Private Member Functions

void SetParent (TGeoVolume *parent)
 GeoNode (const GeoNode &that)
GeoNodeoperator= (const GeoNode &that)

Private Attributes

GeoGeometryfGeoGeometry
std::string fGlobalPath
 reference link to geometry creator
TGeoCombiTrans * fGlobalMatrix

Friends

class GeoGeometry

Detailed Description

Definition at line 24 of file GeoNode.h.


Constructor & Destructor Documentation

GeoNode::GeoNode (  )  [inline]

Definition at line 32 of file GeoNode.h.

00032 : fGeoGeometry(0),fGlobalPath(""),fGlobalMatrix(0) {} 

GeoNode::~GeoNode (  )  [virtual]

Definition at line 44 of file GeoNode.cxx.

References GeoRefCnt::CountRef(), fGlobalMatrix, Msg::kWarning, MSG, and UpdateGlobalManager().

00044                   {
00045   // Destructor should delete any owned objects
00046 
00047   UpdateGlobalManager();
00048 
00049   if ( CountRef() ) {
00050     MSG("Geo",Msg::kWarning)
00051       << "GeoNode destructor " << CountRef()
00052       << " outstanding references " << endl;
00053   }
00054 
00055   if ( fGlobalMatrix ) delete fGlobalMatrix; fGlobalMatrix = 0;
00056 
00057 }

GeoNode::GeoNode ( GeoGeometry geoGeometry,
TGeoVolume *  vol,
TGeoMatrix *  matrix,
TGeoVolume *  parVol,
std::string  globalpath,
std::string  nodename 
) [protected]

Definition at line 26 of file GeoNode.cxx.

00028                                      : 
00029                  TGeoNodeMatrix(vol,matrix), fGeoGeometry(geom),
00030                  fGlobalPath(globalpath),fGlobalMatrix(0) {
00031   
00032   // Normal constructor - Protected.
00033 
00034   UpdateGlobalManager();
00035   this -> SetName(nodename.c_str());
00036   this -> SetParent(parVol);
00037   
00038   matrix -> RegisterYourself();
00039   
00040 }

GeoNode::GeoNode ( const GeoNode that  )  [private]

Member Function Documentation

void GeoNode::DecrementRef (  )  [protected, virtual]

Reimplemented from GeoRefCnt.

Definition at line 72 of file GeoNode.cxx.

References GeoRefCnt::CountRef(), GeoRefCnt::DecrementRef(), fGeoGeometry, GeoRefCnt::fRef, and UpdateGlobalManager().

Referenced by UgliPlnHandle::operator=(), UgliScintMdlHandle::operator=(), UgliStripHandle::operator=(), UgliPlnHandle::~UgliPlnHandle(), UgliScintMdlHandle::~UgliScintMdlHandle(), and UgliStripHandle::~UgliStripHandle().

00072                            {
00073   // Decrement reference count to this node
00074 
00075   UpdateGlobalManager();
00076 
00077   fRef--; // decrement own reference count
00078   fGeoGeometry->DecrementRef(); // and that of GeoGeometry
00079   if (!CountRef() )SetVisibility(0);
00080 }

virtual GeoGeometry* GeoNode::GetGeoGeometry (  )  const [inline, virtual]
virtual std::string GeoNode::GetGlobalPath (  )  const [inline, virtual]

Definition at line 42 of file GeoNode.h.

References fGlobalPath.

Referenced by GeoGeometry::BuildModules().

00042 { return fGlobalPath; }

void GeoNode::GlobalToLocal ( Double_t *  gxyz,
Double_t *  lxyz 
) const [virtual]

Definition at line 209 of file GeoNode.cxx.

References fGlobalMatrix, Nav::GetName(), Msg::kFatal, MSG, and UpdateGlobalManager().

00209                                                                 {
00210   
00211   UpdateGlobalManager();
00212 
00213   if ( !fGlobalMatrix ) {
00214     MSG("Geo",Msg::kFatal) << "GlobalToLocal for node "
00215                           << this->GetName() << " has null fGlobalMatrix ptr." 
00216                           << endl;
00217     abort();
00218   }
00219   
00220   fGlobalMatrix -> MasterToLocal(gxyz,lxyz);
00221    
00222 }

TVector3 GeoNode::GlobalToLocal ( const TVector3 &  global  )  const [virtual]

Definition at line 177 of file GeoNode.cxx.

References UpdateGlobalManager().

Referenced by GeoGeometry::GetPlaneIdFromZ(), UgliSteelPlnHandle::GlobalToLocal(), UgliScintMdlHandle::GlobalToLocal(), UgliStripHandle::GlobalToLocal(), and UgliScintPlnHandle::GlobalToLocal().

00177                                                             {
00178   // Convert from local to global (MARS) coordinates
00179 
00180   UpdateGlobalManager();
00181   
00182   Double_t gxyz[3] = {global.X(),global.Y(),global.Z()};
00183   Double_t lxyz[3] = {0};
00184   
00185   GlobalToLocal(gxyz,lxyz);
00186   
00187   return TVector3(lxyz[0],lxyz[1],lxyz[2]);
00188   
00189 }

void GeoNode::GlobalToLocalVect ( Double_t *  gxyz,
Double_t *  lxyz 
) const [virtual]

Definition at line 271 of file GeoNode.cxx.

References fGlobalMatrix, Nav::GetName(), Msg::kFatal, MSG, and UpdateGlobalManager().

00271                                                                     {
00272   
00273   UpdateGlobalManager();
00274 
00275   if ( !fGlobalMatrix ) {
00276     MSG("Geo",Msg::kFatal) << "GlobalToLocalVect for node "
00277                           << this->GetName() << " has null fGlobalMatrix ptr." 
00278                           << endl;
00279     abort();
00280   }
00281   
00282   fGlobalMatrix -> MasterToLocalVect(gxyz,lxyz);
00283    
00284 }

TVector3 GeoNode::GlobalToLocalVect ( const TVector3 &  global  )  const [virtual]

Definition at line 240 of file GeoNode.cxx.

References UpdateGlobalManager().

Referenced by UgliSteelPlnHandle::GlobalToLocalVect().

00240                                                                 {
00241   // Convert from local to global (MARS) direction vector
00242 
00243   UpdateGlobalManager();
00244   
00245   Double_t gxyz[3] = {global.X(),global.Y(),global.Z()};
00246   Double_t lxyz[3] = {0};
00247   
00248   GlobalToLocalVect(gxyz,lxyz);
00249   
00250   return TVector3(lxyz[0],lxyz[1],lxyz[2]);
00251   
00252 }

void GeoNode::IncrementRef (  )  [protected, virtual]

Reimplemented from GeoRefCnt.

Definition at line 60 of file GeoNode.cxx.

References fGeoGeometry, GeoRefCnt::fRef, GeoRefCnt::IncrementRef(), and UpdateGlobalManager().

Referenced by UgliPlnHandle::operator=(), UgliScintMdlHandle::operator=(), UgliStripHandle::operator=(), UgliPlnHandle::UgliPlnHandle(), UgliScintMdlHandle::UgliScintMdlHandle(), and UgliStripHandle::UgliStripHandle().

00060                            {
00061   // Increment reference count to this node
00062 
00063   UpdateGlobalManager();
00064 
00065   fRef++; // increment own reference count
00066   fGeoGeometry->IncrementRef(); // and that of GeoGeometry
00067   SetVisibility(1);
00068   
00069 }

void GeoNode::LocalToGlobal ( Double_t *  lxyz,
Double_t *  gxyz 
) const [virtual]

Definition at line 192 of file GeoNode.cxx.

References fGlobalMatrix, Nav::GetName(), Msg::kFatal, MSG, and UpdateGlobalManager().

00192                                                                 {
00193   
00194   UpdateGlobalManager();
00195 
00196   if ( !fGlobalMatrix ) {
00197     MSG("Geo",Msg::kFatal) << "LocalToGlobal for node "
00198                           << this->GetName() << " has null fGlobalMatrix ptr." 
00199                           << endl;
00200     abort();
00201   }
00202   
00203   fGlobalMatrix -> LocalToMaster(lxyz,gxyz);
00204   
00205   
00206 }

TVector3 GeoNode::LocalToGlobal ( const TVector3 &  local  )  const [virtual]

Definition at line 162 of file GeoNode.cxx.

References UpdateGlobalManager().

Referenced by GeoPlnNode::GetCenter(), GeoPlnNode::GetX0(), GeoPlnNode::GetY0(), GeoPlnNode::GetZ0(), GeoStripNode::GlobalPos(), UgliSteelPlnHandle::LocalToGlobal(), UgliScintMdlHandle::LocalToGlobal(), UgliScintPlnHandle::LocalToGlobal(), and UgliStripHandle::LocalToGlobal().

00162                                                            {
00163   // Convert from local to global (MARS) coordinates
00164 
00165   UpdateGlobalManager();
00166   
00167   Double_t lxyz[3] = {local.X(),local.Y(),local.Z()};
00168   Double_t gxyz[3] = {0};
00169   
00170   LocalToGlobal(lxyz,gxyz);
00171   
00172   return TVector3(gxyz[0],gxyz[1],gxyz[2]);
00173   
00174 }

void GeoNode::LocalToGlobalVect ( Double_t *  lxyz,
Double_t *  gxyz 
) const [virtual]

Definition at line 255 of file GeoNode.cxx.

References fGlobalMatrix, Nav::GetName(), Msg::kFatal, MSG, and UpdateGlobalManager().

00255                                                                     {
00256   
00257   UpdateGlobalManager();
00258 
00259   if ( !fGlobalMatrix ) {
00260     MSG("Geo",Msg::kFatal) << "LocalToGlobalVect for node "
00261                           << this->GetName() << " has null fGlobalMatrix ptr." 
00262                           << endl;
00263     abort();
00264   }
00265   
00266   fGlobalMatrix -> LocalToMasterVect(lxyz,gxyz);
00267   
00268 }

TVector3 GeoNode::LocalToGlobalVect ( const TVector3 &  local  )  const [virtual]

Definition at line 225 of file GeoNode.cxx.

References UpdateGlobalManager().

Referenced by UgliSteelPlnHandle::LocalToGlobalVect().

00225                                                                {
00226   // Convert from local to global (MARS) direction vector
00227 
00228   UpdateGlobalManager();
00229   
00230   Double_t lxyz[3] = {local.X(),local.Y(),local.Z()};
00231   Double_t gxyz[3] = {0};
00232   
00233   LocalToGlobalVect(lxyz,gxyz);
00234   
00235   return TVector3(gxyz[0],gxyz[1],gxyz[2]);
00236   
00237 }

GeoNode& GeoNode::operator= ( const GeoNode that  )  [private]
void GeoNode::SetParent ( TGeoVolume *  parent  )  [private]

Definition at line 83 of file GeoNode.cxx.

References Msg::kWarning, MSG, and UpdateGlobalManager().

00083                                              {
00084   // Set the node in its parent volume and update the parent list of
00085   // child nodes
00086   // Private method used during geometry build.
00087 
00088   UpdateGlobalManager();
00089 
00090   if ( !parentvol ) {
00091     MSG("Geo",Msg::kWarning) << "Null parent volume arg" 
00092                              << "\n No action taken" << endl;
00093     return;
00094   }
00095 
00096   this -> SetMotherVolume(parentvol);
00097   TObjArray* listofnodes = parentvol->GetNodes();
00098    
00099   if (!listofnodes) { 
00100     listofnodes = new TObjArray();
00101     parentvol -> SetNodes(listofnodes); // SetBit(kVolumeImportNodes) called 
00102     ((TObject*)parentvol) -> 
00103               ResetBit(TGeoVolume::kVolumeImportNodes); // mark to be deleted
00104   }
00105   
00106   listofnodes -> Add(this);
00107   this -> SetNumber(1);
00108   
00109   return;
00110 
00111 }

virtual void GeoNode::UpdateGlobalManager (  )  const [inline, virtual]

Definition at line 37 of file GeoNode.h.

References fGeoGeometry, gGeoManager, and GeoGeometry::UpdateGlobalManager().

Referenced by GeoStripNode::ClearFiber(), DecrementRef(), GeoStripNode::DistanceAlong(), GeoPlnNode::GetCenter(), GeoScintPlnNode::GetClosestStrip(), GeoStripNode::GetHalfLength(), GeoStripNode::GetHalfThickness(), GeoPlnNode::GetHalfThickness(), GeoStripNode::GetHalfWidth(), GeoStripNode::GetLPosRelMdl(), GeoScintMdlNode::GetLPosRelPln(), GeoScintPlnNode::GetScintMdlNodePtrVector(), GeoStripNode::GetScintPlnNode(), GeoScintMdlNode::GetStripNode(), GeoScintPlnNode::GetStripNode(), GeoScintPlnNode::GetStripNodePtrVector(), GeoScintMdlNode::GetStripNodePtrVector(), GeoStripNode::GetTPos(), GeoStripNode::GetTPosRelMdl(), GeoScintMdlNode::GetTPosRelPln(), GeoPlnNode::GetX0(), GeoScintPlnNode::GetX0RelSteel(), GeoPlnNode::GetY0(), GeoScintPlnNode::GetY0RelSteel(), GeoPlnNode::GetZ0(), GeoStripNode::GetZRotRelMdlRad(), GeoScintMdlNode::GetZRotRelPlnRad(), GeoScintPlnNode::GetZRotRelSteelRad(), GeoStripNode::GlobalPos(), GlobalToLocal(), GlobalToLocalVect(), IncrementRef(), GeoStripNode::Intersection(), GeoStripNode::IsMirrored(), LocalToGlobal(), LocalToGlobalVect(), GeoScintPlnNode::NumberOfModules(), GeoScintPlnNode::NumberOfStrips(), GeoStripNode::PartialLength(), GeoStripNode::SetLTPosRelMdl(), GeoScintMdlNode::SetLTPosRelPln(), SetParent(), GeoScintPlnNode::SetXY0RelSteel(), GeoStripNode::SetZRotRelMdlRad(), GeoScintMdlNode::SetZRotRelPlnRad(), GeoScintPlnNode::SetZRotRelSteelRad(), GeoStripNode::TotalAttenuation(), UpdateGlobalMatrix(), GeoStripNode::WlsBypass(), GeoStripNode::WlsPigtail(), ~GeoNode(), GeoPlnNode::~GeoPlnNode(), GeoScintMdlNode::~GeoScintMdlNode(), and GeoStripNode::~GeoStripNode().

00038     { if ( fGeoGeometry ) fGeoGeometry->UpdateGlobalManager();
00039       else gGeoManager = 0; }

void GeoNode::UpdateGlobalMatrix (  )  [protected, virtual]

Definition at line 114 of file GeoNode.cxx.

References fGlobalMatrix, fGlobalPath, Nav::GetName(), gGeoManager, Msg::kFatal, Msg::kWarning, MSG, and UpdateGlobalManager().

00114                                  {
00115   // Stores a copy of the matrix to perform local-to-global(MARS) 
00116   // and global-to-local transformations with this node.  Protected method
00117   // called by GeoGeometry after geometry is closed.
00118 
00119   UpdateGlobalManager();
00120 
00121   if ( fGlobalMatrix ) {
00122     // In principal this should only be called once at geometry closure.
00123     MSG("Geo",Msg::kWarning) << "UpdateGlobalMatrix deleting previous matrix\n"
00124                              << " for node " << this->GetName() << "." << endl;
00125     delete fGlobalMatrix;
00126     fGlobalMatrix = 0;
00127   }
00128   
00129   if ( fGlobalPath.empty() ) {
00130     MSG("Geo",Msg::kFatal) 
00131             << "UpdateGlobalMatrix called with empty path. Abort." << endl;
00132     abort();
00133   }
00134 
00135   if ( !gGeoManager->cd(fGlobalPath.c_str()) ) {
00136     MSG("Geo",Msg::kFatal)
00137       << "UpdateGlobalMatrix unable to cd to global path\n" 
00138       << fGlobalPath.c_str() << ". Abort." << endl;
00139     abort();
00140   }
00141   
00142   TGeoHMatrix* currentmatrix = gGeoManager->GetCurrentMatrix();
00143   if ( currentmatrix ) {
00144     // Take a copy to store with node. Store as TGeoCombiTrans to
00145     // avoid storing additional bytes associated with TGeoHMatrix::fScale 
00146     // since this is not used.
00147     fGlobalMatrix = new TGeoCombiTrans(*currentmatrix);
00148   }
00149   else {
00150     // should never happen
00151     MSG("Geo",Msg::kFatal) 
00152     << "UpdateGlobalMatrix retrieved null matrix ptr from TGeoManager." 
00153     << " Abort." << endl;
00154     abort();
00155   }
00156 
00157   return;
00158   
00159 }


Friends And Related Function Documentation

friend class GeoGeometry [friend]

Reimplemented in GeoScintMdlNode, GeoScintPlnNode, GeoSteelPlnNode, and GeoStripNode.

Definition at line 26 of file GeoNode.h.


Member Data Documentation

Definition at line 77 of file GeoNode.h.

Referenced by DecrementRef(), GetGeoGeometry(), IncrementRef(), and UpdateGlobalManager().

TGeoCombiTrans* GeoNode::fGlobalMatrix [private]
std::string GeoNode::fGlobalPath [private]

reference link to geometry creator

Definition at line 78 of file GeoNode.h.

Referenced by GetGlobalPath(), and UpdateGlobalMatrix().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1