CMS 3D CMS Logo

LinearSearchNavSurfaceImpl.cc
Go to the documentation of this file.
3 
5  SurfaceOrientation::Side side) const
6 {
8  return findVolume( point, thePosVolumes);
9  }
10  else if (side == SurfaceOrientation::negativeSide) {
11  return findVolume( point, theNegVolumes);
12  }
13  else return nullptr; // should not be called with SurfaceOrientation::onSurface
14 }
15 
17  const VolumeContainer& vols) const
18 {
19 // simple linear search for volume who's bounds contain the point
20 
21 //MM:return 0 if no volume was defined on this side!
22  if (vols.empty()) return nullptr;
23 
24  for (VolumeContainer::const_iterator i=vols.begin(); i!=vols.end(); i++) {
25  if (i->second->inside(point)) return i->first;
26  }
27  return nullptr; // if point outside of all bounds on this side
28 }
29 
31 {
32  for (VolumeContainer::const_iterator i=thePosVolumes.begin(); i!=thePosVolumes.end(); i++) {
33  if (i->first == vol) return i->second;
34  }
35  for (VolumeContainer::const_iterator i=theNegVolumes.begin(); i!=theNegVolumes.end(); i++) {
36  if (i->first == vol) return i->second;
37  }
38  return nullptr; // if volume not found
39 }
40 
43 {
45  thePosVolumes.push_back( VolumeAndBounds( vol, bounds->clone()));
46  }
47  else {
48  theNegVolumes.push_back( VolumeAndBounds( vol, bounds->clone()));
49  }
50 }
virtual Bounds * clone() const =0
std::vector< VolumeAndBounds > VolumeContainer
const Bounds * bounds(const NavVolume *vol)
const NavVolume * nextVolume(const NavSurface::LocalPoint &point, SurfaceOrientation::Side side) const
std::pair< const NavVolume *, const Bounds * > VolumeAndBounds
Definition: Bounds.h:22
const NavVolume * findVolume(const NavSurface::LocalPoint &point, const VolumeContainer &volumes) const
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
void addVolume(const NavVolume *vol, const Bounds *bounds, SurfaceOrientation::Side side)