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
 kFarInnerE
 kFarInnerW
 kFarOuterE
 kFarOuterW
 kFarTop
 kUnknown
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

static 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


Detailed Description

Definition at line 24 of file GeoShield.h.


Member Typedef Documentation

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

Definition at line 45 of file GeoShield.h.

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

Definition at line 43 of file GeoShield.h.


Member Enumeration Documentation

enum GeoShield::EGroupType

Enumerator:
kFarInnerE 
kFarInnerW 
kFarOuterE 
kFarOuterW 
kFarTop 
kUnknown 

Definition at line 31 of file GeoShield.h.

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.

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

GeoShield::~GeoShield (  )  [virtual]

Definition at line 35 of file GeoShield.cxx.

References fGroupMap, Msg::kDebug, MSG, and Munits::second.

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

GeoShield::GeoShield ( GeoGeometry geo  )  [protected]

Definition at line 27 of file GeoShield.cxx.

References Msg::kDebug, and MSG.

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

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


Member Function Documentation

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

Definition at line 112 of file GeoShield.cxx.

References PlaneView::AsString(), fGeoGeometry, fGroupMap, PlexPlaneId::GetPlaneView(), UgliDbiSteelPln::GetX0(), PlexPlaneId::IsVetoShield(), kFarInnerE, kFarInnerW, kFarOuterE, kFarOuterW, kFarTop, Msg::kFatal, kUnknown, PlaneView::kVSTopEastSlant, PlaneView::kVSTopFlat, PlaneView::kVSTopWestSlant, PlaneView::kVSWallEastSlant, PlaneView::kVSWallOnEdge, PlaneView::kVSWallWestSlant, and MSG.

Referenced by GeoGeometry::BuildPlanePairVolumes().

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

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

Definition at line 82 of file GeoShield.cxx.

References kFarInnerE, kFarInnerW, kFarOuterE, kFarOuterW, kFarTop, Msg::kWarning, and MSG.

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

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

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

Definition at line 179 of file GeoShield.cxx.

References fGroupMap, and Munits::second.

Referenced by GeoGeometry::BuildDetector().

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

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

Definition at line 65 of file GeoShield.cxx.

References fGroupMap.

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

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

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

Definition at line 52 of file GeoShield.cxx.

References fGroupMap, and Munits::second.

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


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().

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 Sep 1 00:51:36 2014 for loon by  doxygen 1.4.7