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: 2013/05/30 21:57:40 $
7  * $Revision: 1.5 $
8  * \author N. Amapane - INFN Torino
9  */
10 
14 
16 #include <iostream>
17 
18 using namespace std;
19 
20 MagBSlab::MagBSlab(const 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))->volumeNo << endl;
40  if ( (*ivol)->inside(gp,tolerance) ) return (*ivol);
41  }
42 
43  return 0;
44 }
MagBSlab(const std::vector< MagVolume * > &volumes, double zMin)
Constructor.
Definition: MagBSlab.cc:20
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