Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:33

0001 // #include "Utilities/Configuration/interface/Architecture.h"
0002 
0003 /*
0004  *  See header file for a description of this class.
0005  *
0006  *  \author N. Amapane - INFN Torino
0007  */
0008 
0009 #include "MagneticField/Layers/interface/MagBSector.h"
0010 #include "MagneticField/Layers/interface/MagBRod.h"
0011 
0012 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0013 
0014 #include <iostream>
0015 
0016 using namespace std;
0017 
0018 MagBSector::MagBSector(vector<MagBRod*>& rods, Geom::Phi<float> phiMin) : theRods(rods), thePhiMin(phiMin) {}
0019 
0020 MagBSector::~MagBSector() {
0021   for (vector<MagBRod*>::const_iterator irod = theRods.begin(); irod != theRods.end(); ++irod) {
0022     delete (*irod);
0023   }
0024 }
0025 
0026 const MagVolume* MagBSector::findVolume(const GlobalPoint& gp, double tolerance) const {
0027   const MagVolume* result = nullptr;
0028   Geom::Phi<float> phi = gp.phi();
0029 
0030   // FIXME : use a binfinder
0031   for (vector<MagBRod*>::const_iterator irod = theRods.begin(); irod != theRods.end(); ++irod) {
0032     LogTrace("MagGeometry") << "     Trying rod at phi " << (*irod)->minPhi() << " " << phi << endl;
0033     result = (*irod)->findVolume(gp, tolerance);
0034     if (result != nullptr)
0035       return result;
0036   }
0037 
0038   return nullptr;
0039 }