/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
MagneticField/Layers/src/MagBSector.cc
39 строк
1 KB
Nicola Amapane
Minor optmization proposed by @amadio: compute barrel dimensions at construction time. Improves 0.4% CPU for non-cached calls. Also migrate debug couts to MessageLogger
24 апр 2020, 11:50
24 апр 2020, 11:50
9db8f5f
Код
Авторство
О чём код?
// #include "Utilities/Configuration/interface/Architecture.h" /* * See header file for a description of this class. * * \author N. Amapane - INFN Torino */ #include "MagneticField/Layers/interface/MagBSector.h" #include "MagneticField/Layers/interface/MagBRod.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include <iostream> using namespace std; MagBSector::MagBSector(vector<MagBRod*>& rods, Geom::Phi<float> phiMin) : theRods(rods), thePhiMin(phiMin) {} MagBSector::~MagBSector() { for (vector<MagBRod*>::const_iterator irod = theRods.begin(); irod != theRods.end(); ++irod) { delete (*irod); } } const MagVolume* MagBSector::findVolume(const GlobalPoint& gp, double tolerance) const { const MagVolume* result = nullptr; Geom::Phi<float> phi = gp.phi(); // FIXME : use a binfinder for (vector<MagBRod*>::const_iterator irod = theRods.begin(); irod != theRods.end(); ++irod) { LogTrace("MagGeometry") << " Trying rod at phi " << (*irod)->minPhi() << " " << phi << endl; result = (*irod)->findVolume(gp, tolerance); if (result != nullptr) return result; } return nullptr; }