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  * \author N. Amapane - INFN Torino
7  */
8 
12 
13 // #include "MagneticField/MagLayers/interface/MagVerbosity.h"
14 #include <iostream>
15 
16 using namespace std;
17 
18 
19 MagELayer::MagELayer(const vector<MagVolume*>& volumes, double zMin, double zMax) :
20  theVolumes(volumes),
21  theZMin(zMin),
22  theZMax(zMax)
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 *
34 MagELayer::findVolume(const GlobalPoint & gp, double tolerance) const {
35  for(vector<MagVolume*>::const_iterator ivol = theVolumes.begin();
36  ivol != theVolumes.end(); ++ivol) {
37  // FIXME : use a binfinder
38  // TOFIX
39 // if (verbose.debugOut) cout << " Trying volume "
40 // << (static_cast<MagVolume6Faces*> (*ivol))->name << endl;
41  if ( (*ivol)->inside(gp,tolerance) ) return (*ivol);
42  }
43 
44  return 0;
45 }
46 
MagELayer(const std::vector< MagVolume * > &volumes, double zMin, double zMax)
Constructor.
Definition: MagELayer.cc:19
std::vector< MagVolume * > theVolumes
Definition: MagELayer.h:34
virtual ~MagELayer()
Destructor.
Definition: MagELayer.cc:25
MagVolume * findVolume(const GlobalPoint &gp, double tolerance) const
Find the volume containing a point, with a given tolerance.
Definition: MagELayer.cc:34