Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-29 23:32:29

0001 #ifndef CD_NuclearInteractionFinder_H_
0002 #define CD_NuclearInteractionFinder_H_
0003 
0004 //----------------------------------------------------------------------------
0005 //! \class NuclearInteractionFinder
0006 //! \brief Class used to obtain vector of all compatible TMs associated to a trajectory to be used by the NuclearTester.
0007 //!
0008 //!
0009 //! \description The method run gets all compatible TMs of all TMs associated of a trajectory.
0010 //! Then it uses the NuclearTester class to decide whether the trajectory has interacted nuclearly or not.
0011 //! It finally returns a pair of the TM where the nuclear interaction occurs and all compatible TMs associated.
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   /// get the seeds at the interaction point
0045   void fillSeeds(const std::pair<TrajectoryMeasurement, std::vector<TrajectoryMeasurement> >& tmPairs);
0046 
0047   /// Find compatible TM of a TM with error rescaled by rescaleFactor
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   /// Calculate the parameters of the circle representing the primary track at the interaction point
0057   void definePrimaryHelix(std::vector<TrajectoryMeasurement>::const_iterator it_meas);
0058 
0059 public:
0060   struct Config {
0061     double rescaleErrorFactor;
0062     double ptMin;  //passed to SeedFromNuclearInteraction
0063     unsigned int maxHits;
0064     bool checkCompletedTrack; /**< If set to true check all the tracks, even those reaching the edge of the tracker */
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   /// Run the Finder
0076   bool run(const Trajectory& traj, const MeasurementTrackerEvent& event);
0077 
0078   /// Improve the seeds with a third RecHit
0079   void improveSeeds(const MeasurementTrackerEvent& event);
0080 
0081   /// Fill 'output' with persistent nuclear seeds
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   // parameters
0101   unsigned int maxHits;
0102   double rescaleErrorFactor;
0103   bool checkCompletedTrack; /**< If set to true check all the tracks, even those reaching the edge of the tracker */
0104 };
0105 #endif