CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 0; // 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.size()==0) return 0;
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 0; // 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 0; // if volume not found
39 }
40 
41 void LinearSearchNavSurfaceImpl::addVolume( const NavVolume* vol, const Bounds* bounds,
43 {
45  thePosVolumes.push_back( VolumeAndBounds( vol, bounds->clone()));
46  }
47  else {
48  theNegVolumes.push_back( VolumeAndBounds( vol, bounds->clone()));
49  }
50 }
int i
Definition: DBlmapReader.cc:9
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:18
virtual Bounds * clone() const =0
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)