CMS 3D CMS Logo

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  // TOFIX
31  cout << " Trying volume " << (static_cast<MagVolume6Faces*>(*ivol))->volumeNo << endl;
32  if ((*ivol)->inside(gp, tolerance))
33  return (*ivol);
34  }
35 
36  return nullptr;
37 }
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
virtual ~MagBSlab()
Destructor.
Definition: MagBSlab.cc:20
std::vector< MagVolume * > theVolumes
Definition: MagBSlab.h:38
static constexpr bool debugOut
Definition: MagVerbosity.h:17