Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "MagneticField/Layers/interface/MagBSector.h"
00012 #include "MagneticField/Layers/interface/MagBRod.h"
00013
00014 #include "MagneticField/Layers/interface/MagVerbosity.h"
00015
00016 #include <iostream>
00017
00018 using namespace std;
00019
00020 MagBSector::MagBSector(vector<MagBRod*>& rods, Geom::Phi<float> phiMin) :
00021 theRods(rods),
00022 thePhiMin(phiMin)
00023 {}
00024
00025 MagBSector::~MagBSector(){
00026 for (vector<MagBRod *>::const_iterator irod = theRods.begin();
00027 irod != theRods.end(); ++irod) {
00028 delete (*irod);
00029 }
00030 }
00031
00032 MagVolume * MagBSector::findVolume(const GlobalPoint & gp, double tolerance) const {
00033 MagVolume * result = 0;
00034 Geom::Phi<float> phi = gp.phi();
00035
00036
00037 for(vector<MagBRod*>::const_iterator irod = theRods.begin();
00038 irod != theRods.end(); ++irod) {
00039
00040 if (verbose::debugOut) cout << " Trying rod at phi " << (*irod)->minPhi()
00041 << " " << phi << endl ;
00042 result = (*irod)->findVolume(gp, tolerance);
00043 if (result!=0) return result;
00044 }
00045
00046 return 0;
00047 }
00048
00049
00050