File indexing completed on 2023-03-17 11:14:35
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "MagneticField/Layers/interface/MagELayer.h"
0010 #include "MagneticField/VolumeGeometry/interface/MagVolume.h"
0011 #include "MagneticField/VolumeGeometry/interface/MagVolume6Faces.h"
0012
0013 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0014 #include <iostream>
0015
0016 using namespace std;
0017
0018 MagELayer::MagELayer(const vector<MagVolume*>& volumes, double zMin, double zMax)
0019 : theVolumes(volumes), theZMin(zMin), theZMax(zMax) {}
0020
0021 MagELayer::~MagELayer() {
0022 for (vector<MagVolume*>::const_iterator ivol = theVolumes.begin(); ivol != theVolumes.end(); ++ivol) {
0023 delete (*ivol);
0024 }
0025 }
0026
0027 const MagVolume* MagELayer::findVolume(const GlobalPoint& gp, double tolerance) const {
0028 for (vector<MagVolume*>::const_iterator ivol = theVolumes.begin(); ivol != theVolumes.end(); ++ivol) {
0029
0030 #ifdef EDM_ML_DEBUG
0031 {
0032 MagVolume6Faces* mv = static_cast<MagVolume6Faces*>(*ivol);
0033 LogTrace("MagGeometry") << " Trying volume " << mv->volumeNo << " " << int(mv->copyno) << endl;
0034 }
0035 #endif
0036 if ((*ivol)->inside(gp, tolerance))
0037 return (*ivol);
0038 }
0039
0040 return nullptr;
0041 }