CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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  * $Date: 2007/02/03 16:15:59 $
7  * $Revision: 1.3 $
8  * \author N. Amapane - INFN Torino
9  */
10 
14 
16 #include <iostream>
17 
18 using namespace std;
19 
20 MagBSlab::MagBSlab(vector<MagVolume*> volumes, double zMin) :
21  theVolumes(volumes),
22  theZMin(zMin)
23 {}
24 
26  for (vector<MagVolume *>::const_iterator ivol = theVolumes.begin();
27  ivol != theVolumes.end(); ++ivol) {
28  delete (*ivol);
29  }
30 }
31 
32 
33 MagVolume* MagBSlab::findVolume(const GlobalPoint & gp, double tolerance) const {
34  for(vector<MagVolume*>::const_iterator ivol = theVolumes.begin();
35  ivol != theVolumes.end(); ++ivol) {
36  // FIXME : use a binfinder
37  // TOFIX
38  if (verbose::debugOut) cout << " Trying volume "
39  << (static_cast<MagVolume6Faces*>(*ivol))->name << endl;
40  if ( (*ivol)->inside(gp,tolerance) ) return (*ivol);
41  }
42 
43  return 0;
44 }
static bool debugOut
Definition: MagVerbosity.h:14
MagVolume * findVolume(const GlobalPoint &gp, double tolerance) const
Find the volume containing a point, with a given tolerance.
Definition: MagBSlab.cc:33
virtual ~MagBSlab()
Destructor.
Definition: MagBSlab.cc:25
std::vector< MagVolume * > theVolumes
Definition: MagBSlab.h:40
tuple cout
Definition: gather_cfg.py:121
MagBSlab(std::vector< MagVolume * > volumes, double zMin)
Constructor.
Definition: MagBSlab.cc:20