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) :
19  theVolumes(volumes),
20  theZMin(zMin)
21 {}
22 
24  for (vector<MagVolume *>::const_iterator ivol = theVolumes.begin();
25  ivol != theVolumes.end(); ++ivol) {
26  delete (*ivol);
27  }
28 }
29 
30 
31 const MagVolume* MagBSlab::findVolume(const GlobalPoint & gp, double tolerance) const {
32  for(vector<MagVolume*>::const_iterator ivol = theVolumes.begin();
33  ivol != theVolumes.end(); ++ivol) {
34  // FIXME : use a binfinder
35  // TOFIX
36  if (verbose::debugOut) cout << " Trying volume "
37  << (static_cast<MagVolume6Faces*>(*ivol))->volumeNo << endl;
38  if ( (*ivol)->inside(gp,tolerance) ) return (*ivol);
39  }
40 
41  return nullptr;
42 }
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:31
virtual ~MagBSlab()
Destructor.
Definition: MagBSlab.cc:23
std::vector< MagVolume * > theVolumes
Definition: MagBSlab.h:38
static constexpr bool debugOut
Definition: MagVerbosity.h:17