File indexing completed on 2024-04-06 12:28:27
0001 #ifndef CD_NuclearInteractionFinder_H_
0002 #define CD_NuclearInteractionFinder_H_
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0015 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0016 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
0017 #include "TrackingTools/PatternTools/interface/TrajectoryStateUpdator.h"
0018 #include "TrackingTools/PatternTools/interface/Trajectory.h"
0019 #include "TrackingTools/TrackFitters/interface/TrajectoryFitter.h"
0020 #include "TrackingTools/PatternTools/interface/TrajectoryMeasurement.h"
0021 #include "TrackingTools/DetLayers/interface/MeasurementEstimator.h"
0022 #include "TrackingTools/MeasurementDet/interface/LayerMeasurements.h"
0023
0024 #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h"
0025 #include "RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h"
0026 #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h"
0027
0028 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
0029
0030 #include "RecoTracker/NuclearSeedGenerator/interface/NuclearTester.h"
0031 #include "RecoTracker/NuclearSeedGenerator/interface/SeedFromNuclearInteraction.h"
0032 #include "RecoTracker/NuclearSeedGenerator/interface/TangentHelix.h"
0033
0034 #include "TrackingTools/DetLayers/interface/NavigationSchool.h"
0035
0036 class NuclearInteractionFinder {
0037 private:
0038 typedef TrajectoryStateOnSurface TSOS;
0039 typedef FreeTrajectoryState FTS;
0040 typedef TrajectoryMeasurement TM;
0041 typedef std::vector<Trajectory> TrajectoryContainer;
0042 typedef TrajectoryMeasurement::ConstRecHitPointer ConstRecHitPointer;
0043
0044
0045 void fillSeeds(const std::pair<TrajectoryMeasurement, std::vector<TrajectoryMeasurement> >& tmPairs);
0046
0047
0048 std::vector<TrajectoryMeasurement> findCompatibleMeasurements(const TM& lastMeas,
0049 double rescaleFactor,
0050 const LayerMeasurements& layerMeasurements) const;
0051
0052 std::vector<TrajectoryMeasurement> findMeasurementsFromTSOS(const TSOS& currentState,
0053 DetId detid,
0054 const LayerMeasurements& layerMeasurements) const;
0055
0056
0057 void definePrimaryHelix(std::vector<TrajectoryMeasurement>::const_iterator it_meas);
0058
0059 public:
0060 struct Config {
0061 double rescaleErrorFactor;
0062 double ptMin;
0063 unsigned int maxHits;
0064 bool checkCompletedTrack;
0065 };
0066
0067 NuclearInteractionFinder(const Config& iConfig,
0068 const TrackerGeometry* theTrckerGeom,
0069 const Propagator* thePropagator,
0070 const MeasurementEstimator* theEstimator,
0071 const MeasurementTracker* theMeasurementTracker,
0072 const GeometricSearchTracker* theGeomSearchTracker,
0073 const NavigationSchool* theNavigationSchool);
0074
0075
0076 bool run(const Trajectory& traj, const MeasurementTrackerEvent& event);
0077
0078
0079 void improveSeeds(const MeasurementTrackerEvent& event);
0080
0081
0082 std::unique_ptr<TrajectorySeedCollection> getPersistentSeeds();
0083
0084 TrajectoryStateOnSurface rescaleError(float rescale, const TSOS& state) const;
0085
0086 const NavigationSchool* nav() const { return theNavigationSchool; }
0087
0088 private:
0089 const Propagator* thePropagator;
0090 const MeasurementEstimator* theEstimator;
0091 const MeasurementTracker* theMeasurementTracker;
0092 const GeometricSearchTracker* theGeomSearchTracker;
0093 const NavigationSchool* theNavigationSchool;
0094
0095 std::unique_ptr<NuclearTester> nuclTester;
0096 std::unique_ptr<SeedFromNuclearInteraction> currentSeed;
0097 std::vector<SeedFromNuclearInteraction> allSeeds;
0098 std::unique_ptr<TangentHelix> thePrimaryHelix;
0099
0100
0101 unsigned int maxHits;
0102 double rescaleErrorFactor;
0103 bool checkCompletedTrack;
0104 };
0105 #endif