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