/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
MagneticField/Layers/src/MagBSlab.cc
35 строк
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/MagBSlab.h" #include "MagneticField/VolumeGeometry/interface/MagVolume.h" #include "MagneticField/VolumeGeometry/interface/MagVolume6Faces.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include <iostream> using namespace std; MagBSlab::MagBSlab(const vector<MagVolume*>& volumes, double zMin) : theVolumes(volumes), theZMin(zMin) {} MagBSlab::~MagBSlab() { for (vector<MagVolume*>::const_iterator ivol = theVolumes.begin(); ivol != theVolumes.end(); ++ivol) { delete (*ivol); } } const MagVolume* MagBSlab::findVolume(const GlobalPoint& gp, double tolerance) const { for (vector<MagVolume*>::const_iterator ivol = theVolumes.begin(); ivol != theVolumes.end(); ++ivol) { // FIXME : use a binfinder LogTrace("MagGeometry") << " Trying volume " << (static_cast<MagVolume6Faces*>(*ivol))->volumeNo << endl; if ((*ivol)->inside(gp, tolerance)) return (*ivol); } return nullptr; }