CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/MagneticField/Layers/src/MagBSector.cc

Go to the documentation of this file.
00001 // #include "Utilities/Configuration/interface/Architecture.h"
00002 
00003 /*
00004  *  See header file for a description of this class.
00005  *
00006  *  $Date: 2007/02/03 16:15:59 $
00007  *  $Revision: 1.4 $
00008  *  \author N. Amapane - INFN Torino
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   // FIXME : use a binfinder
00037   for(vector<MagBRod*>::const_iterator irod = theRods.begin();
00038         irod != theRods.end(); ++irod) {
00039     // TOFIX
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