CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MagBSector.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 
11 
13 
14 #include <iostream>
15 
16 using namespace std;
17 
18 MagBSector::MagBSector(vector<MagBRod*>& rods, Geom::Phi<float> phiMin) : theRods(rods), thePhiMin(phiMin) {}
19 
21  for (vector<MagBRod*>::const_iterator irod = theRods.begin(); irod != theRods.end(); ++irod) {
22  delete (*irod);
23  }
24 }
25 
27  const MagVolume* result = nullptr;
28  Geom::Phi<float> phi = gp.phi();
29 
30  // FIXME : use a binfinder
31  for (vector<MagBRod*>::const_iterator irod = theRods.begin(); irod != theRods.end(); ++irod) {
32  LogTrace("MagGeometry") << " Trying rod at phi " << (*irod)->minPhi() << " " << phi << endl;
33  result = (*irod)->findVolume(gp, tolerance);
34  if (result != nullptr)
35  return result;
36  }
37 
38  return nullptr;
39 }
MagBSector(std::vector< MagBRod * > &rods, Geom::Phi< float > phiMin)
Constructor.
Definition: MagBSector.cc:18
const MagVolume * findVolume(const GlobalPoint &gp, double tolerance) const
Find the volume containing a point, with a given tolerance.
Definition: MagBSector.cc:26
const double tolerance
std::vector< MagBRod * > theRods
Definition: MagBSector.h:39
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
#define LogTrace(id)
tuple result
Definition: mps_fire.py:311
virtual ~MagBSector()
Destructor.
Definition: MagBSector.cc:20