CMS 3D CMS Logo

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