UgliDbiStructHash Class Reference

#include <UgliDbiStructHash.h>

List of all members.

Classes

struct  viewcover

Public Member Functions

 UgliDbiStructHash ()
 UgliDbiStructHash (Detector::Detector_t det, PlaneView::PlaneView_t view, PlaneCoverage::PlaneCoverage_t cover, UShort_t part)
 UgliDbiStructHash (PlexPlaneId pln)
 UgliDbiStructHash (PlexScintMdlId mdl)
 UgliDbiStructHash (PlexStripEndId strip)
virtual ~UgliDbiStructHash ()
Detector::Detector_t GetDetector () const
PlaneView::PlaneView_t GetPlaneView () const
PlaneCoverage::PlaneCoverage_t GetPlaneCoverage () const
UShort_t GetPart () const
UInt_t HashAsPlane () const
UInt_t HashAsScintMdl () const
UInt_t HashAsStrip () const

Protected Types

typedef struct
UgliDbiStructHash::viewcover 
viewcover_t

Protected Member Functions

UInt_t HashToIndex (UShort_t maxpart) const
UInt_t HashToIndex (viewcover_t *vclist, UShort_t nlist, UShort_t maxpart) const

Protected Attributes

Detector::Detector_t fDetector
PlaneView::PlaneView_t fPlaneView
PlaneCoverage::PlaneCoverage_t fPlaneCoverage
UShort_t fPart

Friends

bool operator== (const viewcover_t &, const viewcover_t &)

Detailed Description

Definition at line 28 of file UgliDbiStructHash.h.


Member Typedef Documentation


Constructor & Destructor Documentation

UgliDbiStructHash::UgliDbiStructHash (  )  [inline]

Definition at line 35 of file UgliDbiStructHash.h.

References LEA_CTOR.

UgliDbiStructHash::UgliDbiStructHash ( Detector::Detector_t  det,
PlaneView::PlaneView_t  view,
PlaneCoverage::PlaneCoverage_t  cover,
UShort_t  part 
) [inline]

Definition at line 40 of file UgliDbiStructHash.h.

References LEA_CTOR.

00043                                     :
00044      fDetector(det), fPlaneView(view),
00045      fPlaneCoverage(cover), fPart(part)
00046      { LEA_CTOR; };

UgliDbiStructHash::UgliDbiStructHash ( PlexPlaneId  pln  )  [inline]

Definition at line 48 of file UgliDbiStructHash.h.

References LEA_CTOR.

00048                                       :
00049      fDetector(pln.GetDetector()), fPlaneView(pln.GetPlaneView()),
00050      fPlaneCoverage(pln.GetPlaneCoverage()), fPart(0)
00051      { LEA_CTOR; };

UgliDbiStructHash::UgliDbiStructHash ( PlexScintMdlId  mdl  )  [inline]

Definition at line 53 of file UgliDbiStructHash.h.

References LEA_CTOR.

00053                                          :
00054      fDetector(mdl.GetDetector()), fPlaneView(mdl.GetPlaneView()),
00055      fPlaneCoverage(mdl.GetPlaneCoverage()), fPart(mdl.GetModule())
00056      { LEA_CTOR; };

UgliDbiStructHash::UgliDbiStructHash ( PlexStripEndId  strip  )  [inline]

Definition at line 58 of file UgliDbiStructHash.h.

References LEA_CTOR.

00058                                            :
00059      fDetector(strip.GetDetector()), fPlaneView(strip.GetPlaneView()),
00060      fPlaneCoverage(strip.GetPlaneCoverage()), fPart(strip.GetStrip())
00061      { LEA_CTOR; };

virtual UgliDbiStructHash::~UgliDbiStructHash (  )  [inline, virtual]

Definition at line 63 of file UgliDbiStructHash.h.

References LEA_DTOR.

00063 { LEA_DTOR; };


Member Function Documentation

Detector::Detector_t UgliDbiStructHash::GetDetector ( void   )  const [inline]
UShort_t UgliDbiStructHash::GetPart (  )  const [inline]

Definition at line 107 of file UgliDbiStructHash.h.

References fPart.

Referenced by UgliDbiScintMdlStruct::GetModule(), UgliDbiStripStruct::GetStrip(), and UgliDbiScintMdlStruct::Store().

00108 { return fPart; }

PlaneCoverage::PlaneCoverage_t UgliDbiStructHash::GetPlaneCoverage (  )  const [inline]
PlaneView::PlaneView_t UgliDbiStructHash::GetPlaneView ( void   )  const [inline]
UInt_t UgliDbiStructHash::HashAsPlane (  )  const

Definition at line 52 of file UgliDbiStructHash.cxx.

References HashToIndex().

Referenced by GeoGeometry::BuildModules(), and UgliDbiScintPlnStruct::GetIndex().

00053 { UShort_t maxpart = 0; return HashToIndex(maxpart); }

UInt_t UgliDbiStructHash::HashAsScintMdl (  )  const

Definition at line 55 of file UgliDbiStructHash.cxx.

References arbitraryPln(), fDetector, fPlaneCoverage, fPlaneView, PlexPlaneId::GetNumScintMdls(), and HashToIndex().

Referenced by GeoScintMdlVolume::Build4Corners(), GeoScintMdlVolume::BuildHalfY(), GeoGeometry::BuildStrips(), and UgliDbiScintMdlStruct::GetIndex().

00056 { 
00057   UInt_t apln = arbitraryPln(fDetector,fPlaneView,fPlaneCoverage);
00058   PlexPlaneId plnid(fDetector,apln,false,fPlaneView,fPlaneCoverage);
00059   UShort_t maxpart = plnid.GetNumScintMdls();
00060   return HashToIndex(maxpart); 
00061 }

UInt_t UgliDbiStructHash::HashAsStrip (  )  const

Definition at line 63 of file UgliDbiStructHash.cxx.

References arbitraryPln(), fDetector, fPlaneCoverage, fPlaneView, PlexPlaneId::GetNumStrips(), and HashToIndex().

Referenced by UgliDbiStripStruct::GetIndex().

00064 { 
00065   UInt_t apln = arbitraryPln(fDetector,fPlaneView,fPlaneCoverage);
00066   PlexPlaneId plnid(fDetector,apln,false,fPlaneView,fPlaneCoverage);
00067   UShort_t maxpart = plnid.GetNumStrips();
00068   return HashToIndex(maxpart); 
00069 }

UInt_t UgliDbiStructHash::HashToIndex ( viewcover_t vclist,
UShort_t  nlist,
UShort_t  maxpart 
) const [protected]

Definition at line 215 of file UgliDbiStructHash.cxx.

References bfld::AsString(), UgliDbiStructHash::viewcover::cover, fDetector, fPart, fPlaneCoverage, fPlaneView, Msg::kWarning, MSG, and UgliDbiStructHash::viewcover::view.

00217 {
00218 
00219   viewcover_t thisvc;
00220   thisvc.view  = fPlaneView;
00221   thisvc.cover = fPlaneCoverage;
00222 
00223   int indx_fnd = -1;
00224   for (unsigned int indx = 0; indx<nlist; ++indx) {
00225     if (thisvc == vclist[indx]) 
00226       { indx_fnd = indx; break; }
00227   }
00228   if (indx_fnd == -1) {
00229      MSG("Ugli",Msg::kWarning)
00230        << "Hash det " << Detector::AsString(fDetector) 
00231        << " view " << PlaneView::AsString(fPlaneView)
00232        << " cover " << PlaneCoverage::AsString(fPlaneCoverage)
00233        << " breaks hashing scheme" << endl;
00234      indx_fnd = 0;
00235   }
00236 
00237   UInt_t hvalue = fPart*nlist + indx_fnd;
00238   return hvalue;
00239 
00240 }

UInt_t UgliDbiStructHash::HashToIndex ( UShort_t  maxpart  )  const [protected]

Definition at line 71 of file UgliDbiStructHash.cxx.

References fDetector, PlaneView::kA, PlaneView::kB, Detector::kCalDet, PlaneCoverage::kComplete, Detector::kFar, Detector::kNear, PlaneCoverage::kNearFull, PlaneCoverage::kNearPartial, PlaneCoverage::kNoActive, PlaneView::kU, PlaneCoverage::kUnknown, PlaneView::kUnknown, PlaneView::kV, PlaneCoverage::kVScN, PlaneCoverage::kVSCN, PlaneCoverage::kVSCS, PlaneCoverage::kVScS, PlaneCoverage::kVSeN, PlaneCoverage::kVSEN, PlaneCoverage::kVSeS, PlaneCoverage::kVSES, PlaneView::kVSTopEastSlant, PlaneView::kVSTopFlat, PlaneView::kVSTopWestSlant, PlaneView::kVSWallEastSlant, PlaneView::kVSWallOnEdge, and PlaneView::kVSWallWestSlant.

Referenced by HashAsPlane(), HashAsScintMdl(), and HashAsStrip().

00072 {
00073    // make a natural index where the "part" takes on values [0..maxpart]
00074 
00075    // Different hashes based on detector
00076 
00077   static viewcover_t gNearCombos[] = {
00078     {PlaneView::kUnknown,PlaneCoverage::kNoActive},
00079     {PlaneView::kUnknown,PlaneCoverage::kUnknown},
00080     {PlaneView::kU,PlaneCoverage::kNearPartial},
00081     {PlaneView::kU,PlaneCoverage::kNearFull},
00082     {PlaneView::kV,PlaneCoverage::kNearPartial},
00083     {PlaneView::kV,PlaneCoverage::kNearFull}
00084   };
00085   static unsigned int gNumNearCombos =
00086     sizeof(gNearCombos)/sizeof(viewcover_t);
00087 
00088   static viewcover_t gFarCombos[] = {
00089     {PlaneView::kUnknown,PlaneCoverage::kNoActive},
00090     {PlaneView::kUnknown,PlaneCoverage::kUnknown},
00091     {PlaneView::kU,PlaneCoverage::kComplete},
00092     {PlaneView::kV,PlaneCoverage::kComplete},
00093 
00094     // veto shield top (C/c-N, E/e-S)
00095 
00096     {PlaneView::kVSTopFlat,       PlaneCoverage::kVScN},
00097     {PlaneView::kVSTopEastSlant,  PlaneCoverage::kVScN},
00098     {PlaneView::kVSTopWestSlant,  PlaneCoverage::kVScN},
00099 
00100     {PlaneView::kVSTopFlat,       PlaneCoverage::kVSCN},
00101     {PlaneView::kVSTopEastSlant,  PlaneCoverage::kVSCN},
00102     {PlaneView::kVSTopWestSlant,  PlaneCoverage::kVSCN},
00103 
00104     {PlaneView::kVSTopFlat,       PlaneCoverage::kVSeS},
00105     {PlaneView::kVSTopEastSlant,  PlaneCoverage::kVSeS},
00106     {PlaneView::kVSTopWestSlant,  PlaneCoverage::kVSeS},
00107 
00108     {PlaneView::kVSTopFlat,       PlaneCoverage::kVSES},
00109     {PlaneView::kVSTopEastSlant,  PlaneCoverage::kVSES},
00110     {PlaneView::kVSTopWestSlant,  PlaneCoverage::kVSES},
00111 
00112     // veto shield walls (C/c-N, E/e-S)
00113 
00114     {PlaneView::kVSWallOnEdge,    PlaneCoverage::kVScN},
00115     {PlaneView::kVSWallEastSlant, PlaneCoverage::kVScN},
00116     {PlaneView::kVSWallWestSlant, PlaneCoverage::kVScN},
00117 
00118     {PlaneView::kVSWallOnEdge,    PlaneCoverage::kVSCN},
00119     {PlaneView::kVSWallEastSlant, PlaneCoverage::kVSCN},
00120     {PlaneView::kVSWallWestSlant, PlaneCoverage::kVSCN},
00121 
00122     {PlaneView::kVSWallOnEdge,    PlaneCoverage::kVSeS},
00123     {PlaneView::kVSWallEastSlant, PlaneCoverage::kVSeS},
00124     {PlaneView::kVSWallWestSlant, PlaneCoverage::kVSeS},
00125 
00126     {PlaneView::kVSWallOnEdge,    PlaneCoverage::kVSES},
00127     {PlaneView::kVSWallEastSlant, PlaneCoverage::kVSES},
00128     {PlaneView::kVSWallWestSlant, PlaneCoverage::kVSES},
00129 
00130     // veto shield top (C/c-S, E/e-N)
00131 
00132     {PlaneView::kVSTopFlat,       PlaneCoverage::kVScS},
00133     {PlaneView::kVSTopEastSlant,  PlaneCoverage::kVScS},
00134     {PlaneView::kVSTopWestSlant,  PlaneCoverage::kVScS},
00135 
00136     {PlaneView::kVSTopFlat,       PlaneCoverage::kVSCS},
00137     {PlaneView::kVSTopEastSlant,  PlaneCoverage::kVSCS},
00138     {PlaneView::kVSTopWestSlant,  PlaneCoverage::kVSCS},
00139 
00140     {PlaneView::kVSTopFlat,       PlaneCoverage::kVSeN},
00141     {PlaneView::kVSTopEastSlant,  PlaneCoverage::kVSeN},
00142     {PlaneView::kVSTopWestSlant,  PlaneCoverage::kVSeN},
00143 
00144     {PlaneView::kVSTopFlat,       PlaneCoverage::kVSEN},
00145     {PlaneView::kVSTopEastSlant,  PlaneCoverage::kVSEN},
00146     {PlaneView::kVSTopWestSlant,  PlaneCoverage::kVSEN},
00147 
00148     // veto shield walls (C/c-S, E/e-N)
00149 
00150     {PlaneView::kVSWallOnEdge,    PlaneCoverage::kVScS},
00151     {PlaneView::kVSWallEastSlant, PlaneCoverage::kVScS},
00152     {PlaneView::kVSWallWestSlant, PlaneCoverage::kVScS},
00153 
00154     {PlaneView::kVSWallOnEdge,    PlaneCoverage::kVSCS},
00155     {PlaneView::kVSWallEastSlant, PlaneCoverage::kVSCS},
00156     {PlaneView::kVSWallWestSlant, PlaneCoverage::kVSCS},
00157 
00158     {PlaneView::kVSWallOnEdge,    PlaneCoverage::kVSeN},
00159     {PlaneView::kVSWallEastSlant, PlaneCoverage::kVSeN},
00160     {PlaneView::kVSWallWestSlant, PlaneCoverage::kVSeN},
00161 
00162     {PlaneView::kVSWallOnEdge,    PlaneCoverage::kVSEN},
00163     {PlaneView::kVSWallEastSlant, PlaneCoverage::kVSEN},
00164     {PlaneView::kVSWallWestSlant, PlaneCoverage::kVSEN},
00165 
00166 
00167   };
00168   static unsigned int gNumFarCombos =
00169     sizeof(gFarCombos)/sizeof(viewcover_t);
00170 
00171 
00172   static viewcover_t gCalDetCombos[] = {
00173     {PlaneView::kUnknown,PlaneCoverage::kNoActive},
00174     {PlaneView::kUnknown,PlaneCoverage::kUnknown},
00175     {PlaneView::kU,PlaneCoverage::kComplete},
00176     {PlaneView::kV,PlaneCoverage::kComplete},
00177     {PlaneView::kA,PlaneCoverage::kComplete},
00178     {PlaneView::kB,PlaneCoverage::kComplete}
00179   };
00180   static unsigned int gNumCalDetCombos =
00181     sizeof(gCalDetCombos)/sizeof(viewcover_t);
00182 
00183 
00184   static viewcover_t gAllCombos[] = {
00185     {PlaneView::kUnknown,PlaneCoverage::kNoActive},
00186     {PlaneView::kUnknown,PlaneCoverage::kUnknown},
00187     {PlaneView::kU,PlaneCoverage::kComplete},
00188     {PlaneView::kV,PlaneCoverage::kComplete},
00189     {PlaneView::kA,PlaneCoverage::kComplete},
00190     {PlaneView::kB,PlaneCoverage::kComplete}
00191   };
00192   static unsigned int gNumAllCombos =
00193     sizeof(gAllCombos)/sizeof(viewcover_t);
00194 
00195    switch (fDetector) {
00196    case (Detector::kNear):   
00197      return HashToIndex(gNearCombos,
00198                         gNumNearCombos,
00199                         maxpart);
00200    case (Detector::kFar):    
00201      return HashToIndex(gFarCombos,
00202                         gNumFarCombos,
00203                         maxpart);
00204    case (Detector::kCalDet): 
00205      return HashToIndex(gCalDetCombos,
00206                         gNumCalDetCombos,
00207                         maxpart);
00208    default:                 
00209      return HashToIndex(gAllCombos,
00210                         gNumAllCombos,
00211                         maxpart);
00212    }
00213 }


Friends And Related Function Documentation

bool operator== ( const viewcover_t vc1,
const viewcover_t vc2 
) [friend]

Definition at line 40 of file UgliDbiStructHash.cxx.

00041                                                          {
00042   if ( vc1.view  != vc2.view  ) return false;
00043   if ( vc1.cover != vc2.cover ) return false;
00044   return true;
00045 }


Member Data Documentation

Definition at line 89 of file UgliDbiStructHash.h.

Referenced by GetDetector(), HashAsScintMdl(), HashAsStrip(), and HashToIndex().

UShort_t UgliDbiStructHash::fPart [protected]

Definition at line 92 of file UgliDbiStructHash.h.

Referenced by GetPart(), and HashToIndex().

Definition at line 91 of file UgliDbiStructHash.h.

Referenced by GetPlaneCoverage(), HashAsScintMdl(), HashAsStrip(), and HashToIndex().

Definition at line 90 of file UgliDbiStructHash.h.

Referenced by GetPlaneView(), HashAsScintMdl(), HashAsStrip(), and HashToIndex().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1