Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

GeoShield Class Reference

#include <GeoShield.h>

List of all members.

Public Types

typedef std::map< EGroupType,
GeoShieldGroup * >::iterator 
GroupMapItr
typedef std::map< EGroupType,
GeoShieldGroup * >::const_iterator 
GroupMapConstItr
enum  EGroupType {
  kFarInnerE, kFarInnerW, kFarOuterE, kFarOuterW,
  kFarTop, kUnknown
}

Public Member Functions

 GeoShield ()
virtual ~GeoShield ()
std::list< const TGeoVolume * > GetListOfVolumes (EGroupType group) const
virtual void Print (Option_t *option="") const
EGroupType AddVolume (const TGeoVolume *volume, PlexPlaneId steelId, const UgliDbiSteelPln *stRow)

Static Public Member Functions

const char * AsString (EGroupType group)

Protected Member Functions

 GeoShield (GeoGeometry *geo)
void BuildGroupNodes (TGeoVolume *hallVol)

Private Member Functions

 GeoShield (const GeoShield &that)
GeoShieldoperator= (const GeoShield &that)

Private Attributes

GeoGeometryfGeoGeometry
std::map< EGroupType, GeoShieldGroup * > fGroupMap
 reference link to geometry creator, not owned

Friends

class GeoGeometry


Member Typedef Documentation

typedef std::map<EGroupType,GeoShieldGroup*>::const_iterator GeoShield::GroupMapConstItr
 

Definition at line 45 of file GeoShield.h.

Referenced by BuildGroupNodes(), GetListOfVolumes(), and Print().

typedef std::map<EGroupType,GeoShieldGroup*>::iterator GeoShield::GroupMapItr
 

Definition at line 43 of file GeoShield.h.

Referenced by ~GeoShield().


Member Enumeration Documentation

enum GeoShield::EGroupType
 

Enumeration values:
kFarInnerE 
kFarInnerW 
kFarOuterE 
kFarOuterW 
kFarTop 
kUnknown 

Definition at line 31 of file GeoShield.h.

Referenced by AddVolume().

00031                   {
00032     // Shield group. Every shield volume is assigned to only one group
00033     // and all shield volumes within a group are enclosed by a common
00034     // mother volume. 
00035     kFarInnerE, // Inner vertical(|) planes hugging east side of detector
00036     kFarInnerW, // Inner vertical(|) planes hugging west side of detector
00037     kFarOuterE, // Outer wall planes of both vertical(|) and slant(e) on east 
00038     kFarOuterW, // Outer wall planes of both vertical(|) and slant(w) on west 
00039     kFarTop,    // Planes of type -,/,\ overlaying top of detector
00040     kUnknown    
00041   };


Constructor & Destructor Documentation

GeoShield::GeoShield  )  [inline]
 

Definition at line 48 of file GeoShield.h.

References fGeoGeometry.

00048 : fGeoGeometry(0) {} // def ctor

GeoShield::~GeoShield  )  [virtual]
 

Definition at line 34 of file GeoShield.cxx.

References fGroupMap, GroupMapItr, and MSG.

00034                       {
00035   // Destructor, delete all owned objects
00036   MSG("Geo",Msg::kDebug) << "GeoShield dtor @ " << this << endl;
00037 
00038   // reference geometry is not owned
00039 
00040   // Shield groups stored in map *are* owned
00041   GroupMapItr mapitr;
00042   for ( mapitr = fGroupMap.begin(); mapitr != fGroupMap.end(); mapitr++ ) {
00043     GeoShieldGroup* shieldgrp = mapitr -> second;
00044     // reclaim group memory before map is destructed
00045     if ( shieldgrp ) delete shieldgrp; shieldgrp = 0;
00046   }
00047 
00048 }

GeoShield::GeoShield GeoGeometry geo  )  [protected]
 

Definition at line 26 of file GeoShield.cxx.

References MSG.

00026                                      : fGeoGeometry(geo) {
00027 
00028   // Normal constructor
00029   MSG("Geo",Msg::kDebug) << "GeoShield normal ctor @ " << this << endl;
00030 
00031 }

GeoShield::GeoShield const GeoShield that  )  [private]
 


Member Function Documentation

GeoShield::EGroupType GeoShield::AddVolume const TGeoVolume *  volume,
PlexPlaneId  steelId,
const UgliDbiSteelPln stRow
 

Definition at line 111 of file GeoShield.cxx.

References PlaneView::AsString(), EGroupType, fGeoGeometry, fGroupMap, PlexPlaneId::GetPlaneView(), UgliDbiSteelPln::GetX0(), PlexPlaneId::IsVetoShield(), and MSG.

Referenced by GeoGeometry::BuildPlanePairVolumes().

00113                                                                          {
00114   // The stRow is used to extract positional information in order to
00115   // determine size of bounding box.  Return the shield group to which
00116   // this volume belongs.
00117 
00118   if ( !steelId.IsVetoShield() ) {
00119     MSG("Geo",Msg::kFatal) 
00120       << "GeoShield::AddVolume called with non-vetoshield volume!" << endl;
00121     abort();
00122   }
00123   // Determine the type of veto-shield plane from the placement and
00124   // db data
00125   GeoShield::EGroupType shieldgrp = kUnknown;
00126   switch ( steelId.GetPlaneView() ) {
00127 
00128   case PlaneView::kVSTopFlat:
00129   case PlaneView::kVSTopEastSlant:
00130   case PlaneView::kVSTopWestSlant:
00131     shieldgrp = kFarTop;
00132     break;
00133 
00134   case PlaneView::kVSWallEastSlant:
00135     shieldgrp = kFarOuterE;
00136     break;
00137 
00138   case PlaneView::kVSWallWestSlant:
00139     shieldgrp = kFarOuterW;
00140     break;
00141     
00142   case PlaneView::kVSWallOnEdge: 
00143     {
00144       Float_t x0 = stRow->GetX0(); // meters
00145       if ( TMath::Abs(x0) < 5. ) {
00146         // inner
00147         if ( x0 < 0. ) shieldgrp = kFarInnerE;
00148         else shieldgrp = kFarInnerW;
00149       }
00150       else {
00151         // outer
00152         if ( x0 < 0. ) shieldgrp = kFarOuterE;
00153         else shieldgrp = kFarOuterW;
00154       }
00155     }
00156     break;
00157     
00158   default:
00159     MSG("Geo",Msg::kFatal) << "PlaneView " 
00160                            << PlaneView::AsString(steelId.GetPlaneView())
00161                            << " unknown!. Abort." << endl;
00162     abort();
00163 
00164   } // end of plane view switch
00165 
00166   GeoShieldGroup* grp = fGroupMap[shieldgrp];
00167   if ( grp == 0 ) { 
00168     grp = new GeoShieldGroup(fGeoGeometry,shieldgrp);
00169     fGroupMap[shieldgrp] = grp;
00170   }
00171   grp -> AddVolume(vol,stRow);
00172   
00173   return shieldgrp;
00174   
00175 }

const char * GeoShield::AsString EGroupType  group  )  [static]
 

Definition at line 81 of file GeoShield.cxx.

References kFarInnerE, kFarInnerW, kFarOuterE, kFarOuterW, kFarTop, and MSG.

Referenced by GeoShieldGroup::AddVolume(), GeoShieldGroup::BuildNode(), GeoGeometry::BuildPlanePairVolumes(), and GeoShieldGroup::Print().

00081                                                     {
00082   // Convert enumerated shield group type to a string
00083 
00084   switch (shieldgrp ) {
00085   case kFarInnerE:
00086     return "FarInnerE";
00087     
00088   case kFarInnerW:
00089     return "FarInnerW";
00090 
00091   case kFarOuterE:
00092     return "FarOuterE";
00093 
00094   case kFarOuterW:
00095     return "FarOuterW";
00096 
00097   case kFarTop:
00098     return "FarTop";
00099 
00100   default:
00101     MSG("GeoShield",Msg::kWarning) 
00102     << "GeoShield::AsString called with unknown shield group type "
00103     << (int)shieldgrp << "." << endl;
00104     return "UNKNOWN";
00105 
00106   } // end of switch
00107   
00108 }

void GeoShield::BuildGroupNodes TGeoVolume *  hallVol  )  [protected]
 

Definition at line 178 of file GeoShield.cxx.

References fGroupMap, and GroupMapConstItr.

Referenced by GeoGeometry::BuildDetector().

00178                                                    {
00179   // Build shield group nodes.  Protected method called by GeoGeometry
00180   // when all shield volumes have been added with GeoShield::AddVolume()
00181   // Shield group nodes will be added to hall volume
00182 
00183   
00184   GroupMapConstItr mapitr;
00185   for ( mapitr=fGroupMap.begin(); mapitr!=fGroupMap.end(); mapitr++ ) {
00186     GeoShieldGroup* grp = mapitr -> second;
00187     grp -> BuildNode(hallVol);
00188   }
00189   
00190   return;
00191   
00192 }

std::list< const TGeoVolume * > GeoShield::GetListOfVolumes EGroupType  group  )  const
 

Definition at line 64 of file GeoShield.cxx.

References fGroupMap, and GroupMapConstItr.

00064                                                                       {
00065    // retrieve list of volumes in group from map
00066 
00067   GroupMapConstItr mapitr;
00068   std::list<const TGeoVolume*> vollist; // empty list
00069   
00070   mapitr = fGroupMap.find(shieldgrp);
00071   if ( mapitr != fGroupMap.end() ) {
00072     GeoShieldGroup* shieldgrp = mapitr->second;
00073     return (shieldgrp -> GetListOfVolumes()); // return a copy to the caller
00074   }
00075 
00076   return vollist; // retun empty list if group not found in map
00077   
00078 }

GeoShield& GeoShield::operator= const GeoShield that  )  [private]
 

void GeoShield::Print Option_t *  option = ""  )  const [virtual]
 

Definition at line 51 of file GeoShield.cxx.

References fGroupMap, and GroupMapConstItr.

00051                                                   {
00052    // print to cout
00053 
00054   GroupMapConstItr mapitr;
00055   for ( mapitr=fGroupMap.begin(); mapitr != fGroupMap.end(); mapitr++ ) {
00056     GeoShieldGroup* shieldgrp = mapitr -> second;
00057     shieldgrp -> Print();
00058   }
00059   
00060 }


Friends And Related Function Documentation

friend class GeoGeometry [friend]
 

Definition at line 26 of file GeoShield.h.


Member Data Documentation

GeoGeometry* GeoShield::fGeoGeometry [private]
 

Definition at line 74 of file GeoShield.h.

Referenced by AddVolume(), and GeoShield().

std::map<EGroupType, GeoShieldGroup* > GeoShield::fGroupMap [private]
 

reference link to geometry creator, not owned

Definition at line 75 of file GeoShield.h.

Referenced by AddVolume(), BuildGroupNodes(), GetListOfVolumes(), Print(), and ~GeoShield().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:09:14 2010 for loon by  doxygen 1.3.9.1