Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:28:27

0001 #ifndef SeedFromNuclearInteraction_H
0002 #define SeedFromNuclearInteraction_H
0003 
0004 #include "DataFormats/TrajectorySeed/interface/TrajectorySeed.h"
0005 
0006 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0007 
0008 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h"
0009 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
0010 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0011 #include "TrackingTools/PatternTools/interface/TrajectoryMeasurement.h"
0012 
0013 #include "RecoTracker/NuclearSeedGenerator/interface/TangentHelix.h"
0014 
0015 class FreeTrajectoryState;
0016 
0017 class SeedFromNuclearInteraction {
0018 private:
0019   typedef TrajectoryMeasurement TM;
0020   typedef TrajectoryStateOnSurface TSOS;
0021   typedef edm::OwnVector<TrackingRecHit> recHitContainer;
0022   typedef TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer;
0023   typedef std::vector<ConstRecHitPointer> ConstRecHitContainer;
0024 
0025 public:
0026   SeedFromNuclearInteraction(const Propagator* prop, const TrackerGeometry* geom, double ptMin);
0027 
0028   virtual ~SeedFromNuclearInteraction() {}
0029 
0030   /// Fill all data members from 2 TM's where the first one is supposed to be at the interaction point
0031   void setMeasurements(const TSOS& tsosAtInteractionPoint, ConstRecHitPointer ihit, ConstRecHitPointer ohit);
0032 
0033   /// Fill all data members from 1 TSOS and 2 rec Hits and using the circle associated to the primary track as constraint
0034   void setMeasurements(TangentHelix& primHelix,
0035                        const TSOS& inner_TSOS,
0036                        ConstRecHitPointer ihit,
0037                        ConstRecHitPointer ohit);
0038 
0039   PTrajectoryStateOnDet const& trajectoryState() const { return pTraj; }
0040 
0041   FreeTrajectoryState* stateWithError() const;
0042 
0043   FreeTrajectoryState* stateWithError(TangentHelix& helix) const;
0044 
0045   PropagationDirection direction() const { return alongMomentum; }
0046 
0047   recHitContainer hits() const;
0048 
0049   TrajectorySeed TrajSeed() const { return TrajectorySeed(trajectoryState(), hits(), direction()); }
0050 
0051   bool isValid() const { return isValid_; }
0052 
0053   const TSOS& updatedTSOS() const { return *updatedTSOS_; }
0054 
0055   const TSOS& initialTSOS() const { return *initialTSOS_; }
0056 
0057   GlobalPoint outerHitPosition() const {
0058     return theTrackerGeom->idToDet(outerHitDetId())->surface().toGlobal(outerHit_->localPosition());
0059   }
0060 
0061   DetId outerHitDetId() const { return outerHit_->geographicalId(); }
0062 
0063   ConstRecHitPointer outerHit() const { return outerHit_; }
0064 
0065   /// Return the rotation matrix to be applied to get parameters in
0066   /// a framework where the z direction is along perp
0067   AlgebraicMatrix33 rotationMatrix(const GlobalVector& perp) const;
0068 
0069 private:
0070   bool isValid_; /**< check if the seed is valid */
0071 
0072   ConstRecHitContainer theHits; /**< all the hits to be used to update the */
0073                                 /*   initial freeTS and to be fitted       */
0074 
0075   ConstRecHitPointer innerHit_; /**< Pointer to the hit of the inner TM */
0076   ConstRecHitPointer outerHit_; /**< Pointer to the outer hit */
0077 
0078   std::shared_ptr<TSOS> updatedTSOS_; /**< Final TSOS */
0079 
0080   std::shared_ptr<TSOS> initialTSOS_; /**< Initial TSOS used as input */
0081 
0082   std::shared_ptr<FreeTrajectoryState> freeTS_; /**< Initial FreeTrajectoryState */
0083 
0084   PTrajectoryStateOnDet pTraj; /**< the final persistent TSOS */
0085 
0086   // input parameters
0087 
0088   double ptMin; /**< Minimum transverse momentum of the seed */
0089 
0090   const Propagator* thePropagator;
0091   const TrackerGeometry* theTrackerGeom;
0092 
0093   bool construct();
0094 };
0095 #endif