File indexing completed on 2024-04-06 12:31:27
0001 #include "TrackingTools/DetLayers/interface/ForwardDetRingOneZ.h"
0002 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0003 #include "TrackingTools/DetLayers/interface/ForwardRingDiskBuilderFromDet.h"
0004
0005
0006 #include <Utilities/General/interface/precomputed_value_sort.h>
0007 #include <Geometry/CommonDetUnit/interface/DetSorting.h>
0008
0009 #include <algorithm>
0010 #include <cmath>
0011
0012 using namespace std;
0013
0014 ForwardDetRingOneZ::~ForwardDetRingOneZ() {}
0015
0016 ForwardDetRingOneZ::ForwardDetRingOneZ(vector<const GeomDet*>::const_iterator first,
0017 vector<const GeomDet*>::const_iterator last)
0018 : ForwardDetRing(false), theDets(first, last) {
0019 initialize();
0020 }
0021
0022 ForwardDetRingOneZ::ForwardDetRingOneZ(const vector<const GeomDet*>& dets) : ForwardDetRing(false), theDets(dets) {
0023 initialize();
0024 }
0025
0026 void ForwardDetRingOneZ::initialize() {
0027
0028
0029 precomputed_value_sort(theDets.begin(), theDets.end(), geomsort::DetPhi());
0030 setDisk(ForwardRingDiskBuilderFromDet()(theDets));
0031 }
0032
0033 bool ForwardDetRingOneZ::add(int idet,
0034 vector<DetWithState>& result,
0035 const TrajectoryStateOnSurface& tsos,
0036 const Propagator& prop,
0037 const MeasurementEstimator& est) const {
0038 pair<bool, TrajectoryStateOnSurface> compat = theCompatibilityChecker.isCompatible(theDets[idet], tsos, prop, est);
0039
0040 if (compat.first) {
0041 result.push_back(DetWithState(theDets[idet], compat.second));
0042 }
0043
0044 return compat.first;
0045 }