File indexing completed on 2023-03-17 11:14:31
0001
0002
0003
0004
0005
0006
0007 #include "eLayer.h"
0008 #include "MagneticField/VolumeGeometry/interface/MagVolume6Faces.h"
0009 #include "MagneticField/Layers/interface/MagELayer.h"
0010
0011 #include "Utilities/General/interface/precomputed_value_sort.h"
0012
0013 using namespace SurfaceOrientation;
0014 using namespace std;
0015 using namespace magneticfield;
0016
0017
0018 eLayer::eLayer(handles::const_iterator begin, handles::const_iterator end) : theVolumes(begin, end), mlayer(nullptr) {
0019
0020
0021
0022 precomputed_value_sort(theVolumes.begin(), theVolumes.end(), ExtractR());
0023
0024
0025
0026
0027
0028 }
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 MagELayer* eLayer::buildMagELayer() const {
0041 if (mlayer == nullptr) {
0042
0043
0044 double zmin = 1e19;
0045 double zmax = -1e19;
0046 vector<MagVolume*> mVols;
0047 for (handles::const_iterator vol = theVolumes.begin(); vol != theVolumes.end(); ++vol) {
0048 mVols.push_back((*vol)->magVolume);
0049 zmin = min(zmin, (*vol)->minZ());
0050 zmax = max(zmax, (*vol)->maxZ());
0051 }
0052 mlayer = new MagELayer(mVols, zmin, zmax);
0053 }
0054 return mlayer;
0055 }