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) : theVolumes(volumes), theZMin(zMin) {}
19 
21  for (vector<MagVolume*>::const_iterator ivol = theVolumes.begin(); ivol != theVolumes.end(); ++ivol) {
22  delete (*ivol);
23  }
24 }
25 
26 const MagVolume* MagBSlab::findVolume(const GlobalPoint& gp, double tolerance) const {
27  for (vector<MagVolume*>::const_iterator ivol = theVolumes.begin(); ivol != theVolumes.end(); ++ivol) {
28  // FIXME : use a binfinder
29  LogTrace("MagGeometry") << " Trying volume " << (static_cast<MagVolume6Faces*>(*ivol))->volumeNo << endl;
30  if ((*ivol)->inside(gp, tolerance))
31  return (*ivol);
32  }
33 
34  return nullptr;
35 }
MagVolume.h
MagBSlab::~MagBSlab
virtual ~MagBSlab()
Destructor.
Definition: MagBSlab.cc:20
MessageLogger.h
MagBSlab::theVolumes
std::vector< MagVolume * > theVolumes
Definition: MagBSlab.h:38
MagBSlab::findVolume
const MagVolume * findVolume(const GlobalPoint &gp, double tolerance) const
Find the volume containing a point, with a given tolerance.
Definition: MagBSlab.cc:26
volumeBasedMagneticField_160812_cfi.volumes
volumes
Definition: volumeBasedMagneticField_160812_cfi.py:57
Point3DBase< float, GlobalTag >
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
photonAnalyzer_cfi.zMin
zMin
Definition: photonAnalyzer_cfi.py:94
MagBSlab::MagBSlab
MagBSlab(const std::vector< MagVolume * > &volumes, double zMin)
Constructor.
Definition: MagBSlab.cc:18
MagVolume
Definition: MagVolume.h:13
tolerance
const double tolerance
Definition: HGCalGeomParameters.cc:26
MagBSlab.h
MagVolume6Faces.h
std
Definition: JetResolutionObject.h:76
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224