File indexing completed on 2024-04-06 12:28:27
0001 #ifndef CD_NuclearTrackCorrector_H_
0002 #define CD_NuclearTrackCorrector_H_
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #include <memory>
0024 #include <string>
0025 #include <cstdio>
0026
0027
0028
0029 #include "FWCore/Framework/interface/ESHandle.h"
0030
0031 #include "FWCore/Framework/interface/Frameworkfwd.h"
0032 #include "FWCore/Framework/interface/stream/EDProducer.h"
0033
0034 #include "FWCore/Framework/interface/Event.h"
0035 #include "FWCore/Framework/interface/MakerMacros.h"
0036
0037 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0038
0039 #include "TrackingTools/PatternTools/interface/Trajectory.h"
0040 #include "DataFormats/TrackCandidate/interface/TrackCandidate.h"
0041 #include "DataFormats/TrackCandidate/interface/TrackCandidateCollection.h"
0042 #include "DataFormats/VertexReco/interface/NuclearInteraction.h"
0043 #include "DataFormats/VertexReco/interface/NuclearInteractionFwd.h"
0044 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0045 #include "DataFormats/TrackReco/interface/Track.h"
0046 #include "DataFormats/TrackReco/interface/TrackBase.h"
0047 #include "TrackingTools/PatternTools/interface/TrajectoryMeasurement.h"
0048 #include "RecoTracker/NuclearSeedGenerator/interface/TrajectoryToSeedMap.h"
0049 #include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h"
0050 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0051 #include "RecoTracker/NuclearSeedGenerator/interface/TrackCandidateToTrajectoryMap.h"
0052 #include "RecoTracker/TrackProducer/interface/TrackProducerBase.h"
0053 #include "FWCore/Framework/interface/EventSetup.h"
0054 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0055 #include "RecoTracker/CkfPattern/interface/TransientInitialStateEstimator.h"
0056 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
0057 #include "TrackingTools/Records/interface/TrackingComponentsRecord.h"
0058
0059 #include "RecoTracker/TrackProducer/interface/TrackProducerAlgorithm.h"
0060
0061 class TransientInitialStateEstimator;
0062
0063
0064
0065
0066
0067 class NuclearTrackCorrector : public edm::stream::EDProducer<> {
0068 public:
0069 typedef edm::RefVector<TrajectorySeedCollection> TrajectorySeedRefVector;
0070 typedef edm::Ref<TrajectoryCollection> TrajectoryRef;
0071 typedef edm::Ref<TrackCandidateCollection> TrackCandidateRef;
0072 typedef TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer;
0073
0074 using AlgoProductCollection = TrackProducerAlgorithm<reco::Track>::AlgoProductCollection;
0075
0076 public:
0077 explicit NuclearTrackCorrector(const edm::ParameterSet&);
0078 ~NuclearTrackCorrector() override;
0079
0080 private:
0081 void produce(edm::Event&, const edm::EventSetup&) override;
0082
0083
0084 bool newTrajNeeded(Trajectory& newtrajectory, const TrajectoryRef& trajRef, const reco::NuclearInteraction& ni);
0085
0086
0087 reco::TrackExtra getNewTrackExtra(const AlgoProductCollection& algoresults);
0088
0089
0090 bool getTrackFromTrajectory(const Trajectory& newTraj,
0091 const TrajectoryRef& initialTrajRef,
0092 AlgoProductCollection& algoResults);
0093
0094
0095 TrajectoryStateOnSurface getInitialState(const reco::Track* theT,
0096 TransientTrackingRecHit::RecHitContainer& hits,
0097 const TrackingGeometry* theG,
0098 const MagneticField* theMF);
0099
0100 void swap_map(const edm::Handle<TrajectoryCollection>& trajColl,
0101 std::map<reco::TrackRef, edm::Ref<TrajectoryCollection> >& result);
0102
0103
0104
0105 std::string str_Input_Trajectory;
0106 std::string str_Input_NuclearInteraction;
0107 int int_Input_Hit_Distance;
0108
0109 int verbosity;
0110 int KeepOnlyCorrectedTracks;
0111
0112 std::vector<std::pair<unsigned int, unsigned int> > Indice_Map;
0113
0114 edm::ESHandle<TrackerGeometry> theG;
0115 edm::ESHandle<MagneticField> theMF;
0116 edm::ESHandle<TrajectoryFitter> theFitter;
0117 edm::ESHandle<Propagator> thePropagator;
0118 edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> theGToken;
0119 edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> theMFToken;
0120 edm::ESGetToken<TrajectoryFitter, TrajectoryFitter::Record> theFitterToken;
0121 edm::ESGetToken<Propagator, TrackingComponentsRecord> thePropagatorToken;
0122 TransientInitialStateEstimator* theInitialState;
0123
0124 TrackProducerAlgorithm<reco::Track>* theAlgo;
0125 const TrajTrackAssociationCollection* m_TrajToTrackCollection;
0126 };
0127
0128 #endif