CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MagBSlab.cc
Go to the documentation of this file.
1 // #include "Utilities/Configuration/interface/Architecture.h"
2 
3 /*
4  * See header file for a description of this class.
5  *
6  * \author N. Amapane - INFN Torino
7  */
8 
12 
14 #include <iostream>
15 
16 using namespace std;
17 
18 MagBSlab::MagBSlab(const vector<MagVolume*>& volumes, double zMin) : theVolumes(volumes), theZMin(zMin) {}
19 
21  for (vector<MagVolume*>::const_iterator ivol = theVolumes.begin(); ivol != theVolumes.end(); ++ivol) {
22  delete (*ivol);
23  }
24 }
25 
26 const MagVolume* MagBSlab::findVolume(const GlobalPoint& gp, double tolerance) const {
27  for (vector<MagVolume*>::const_iterator ivol = theVolumes.begin(); ivol != theVolumes.end(); ++ivol) {
28  // FIXME : use a binfinder
29  LogTrace("MagGeometry") << " Trying volume " << (static_cast<MagVolume6Faces*>(*ivol))->volumeNo << endl;
30  if ((*ivol)->inside(gp, tolerance))
31  return (*ivol);
32  }
33 
34  return nullptr;
35 }
MagBSlab(const std::vector< MagVolume * > &volumes, double zMin)
Constructor.
Definition: MagBSlab.cc:18
const double tolerance
const MagVolume * findVolume(const GlobalPoint &gp, double tolerance) const
Find the volume containing a point, with a given tolerance.
Definition: MagBSlab.cc:26
#define LogTrace(id)
virtual ~MagBSlab()
Destructor.
Definition: MagBSlab.cc:20
std::vector< MagVolume * > theVolumes
Definition: MagBSlab.h:38