Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-04 02:55:41

0001 #ifndef SeedForPhotonConversion1Leg_H
0002 #define SeedForPhotonConversion1Leg_H
0003 
0004 #include "RecoTracker/TkSeedingLayers/interface/SeedingHitSet.h"
0005 #include "PrintRecoObjects.h"
0006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0007 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
0008 #include "FWCore/Framework/interface/EventSetup.h"
0009 #include "FWCore/Framework/interface/ConsumesCollector.h"
0010 #include "MagneticField/Engine/interface/MagneticField.h"
0011 #include "FWCore/Utilities/interface/Visibility.h"
0012 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0013 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0014 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0015 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0016 #include "TrackingTools/Records/interface/TrackingComponentsRecord.h"
0017 #include "TrackingTools/Records/interface/TransientRecHitRecord.h"
0018 
0019 #include "RecoTracker/TransientTrackingRecHit/interface/TkTransientTrackingRecHitBuilder.h"
0020 
0021 class FreeTrajectoryState;
0022 
0023 //
0024 // this class need to be cleaned and optimized as those in RecoTracker/TkSeedGenerator
0025 //
0026 class dso_hidden SeedForPhotonConversion1Leg {
0027 public:
0028   static const int cotTheta_Max = 99999;
0029 
0030   SeedForPhotonConversion1Leg(const edm::ParameterSet& cfg, edm::ConsumesCollector iC)
0031       : theBfieldToken(iC.esConsumes()),
0032         theTrackerToken(iC.esConsumes()),
0033         thePropagatorToken(iC.esConsumes(edm::ESInputTag("", cfg.getParameter<std::string>("propagator")))),
0034         theTTRHBuilderToken(iC.esConsumes(edm::ESInputTag("", cfg.getParameter<std::string>("TTRHBuilder")))),
0035         theBOFFMomentum(cfg.getParameter<double>("SeedMomentumForBOFF")) {}
0036 
0037   //dtor
0038   ~SeedForPhotonConversion1Leg() {}
0039 
0040   const TrajectorySeed* trajectorySeed(TrajectorySeedCollection& seedCollection,
0041                                        const SeedingHitSet& hits,
0042                                        const GlobalPoint& vertex,
0043                                        const GlobalVector& vertexBounds,
0044                                        float ptmin,
0045                                        const edm::EventSetup& es,
0046                                        float cotTheta,
0047                                        std::stringstream& ss);
0048 
0049 protected:
0050   bool checkHit(const TrajectoryStateOnSurface&,
0051                 const SeedingHitSet::ConstRecHitPointer& hit,
0052                 const edm::EventSetup& es) const {
0053     return true;
0054   }
0055 
0056   GlobalTrajectoryParameters initialKinematic(const SeedingHitSet& hits,
0057                                               const GlobalPoint& vertexPos,
0058                                               const edm::EventSetup& es,
0059                                               const float cotTheta) const;
0060 
0061   CurvilinearTrajectoryError initialError(const GlobalVector& vertexBounds, float ptMin, float sinTheta) const;
0062 
0063   const TrajectorySeed* buildSeed(TrajectorySeedCollection& seedCollection,
0064                                   const SeedingHitSet& hits,
0065                                   const FreeTrajectoryState& fts,
0066                                   const edm::EventSetup& es) const;
0067 
0068   SeedingHitSet::RecHitPointer refitHit(SeedingHitSet::ConstRecHitPointer hit,
0069                                         const TrajectoryStateOnSurface& state,
0070                                         const TkClonerImpl& cloner) const;
0071 
0072 protected:
0073   edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> theBfieldToken;
0074   edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> theTrackerToken;
0075   edm::ESGetToken<Propagator, TrackingComponentsRecord> thePropagatorToken;
0076   edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> theTTRHBuilderToken;
0077   double theBOFFMomentum;
0078 
0079   std::stringstream* pss;
0080   PrintRecoObjects po;
0081 };
0082 #endif