47 produces< TrajectoryCollection >();
48 produces< TrajectoryToTrajectoryMap >();
50 produces< reco::TrackExtraCollection >();
51 produces< reco::TrackCollection >();
52 produces< TrackToTrajectoryMap >();
54 produces< TrackToTrackMap >();
67 auto Output_traj = std::make_unique<TrajectoryCollection>();
68 auto Output_trajmap = std::make_unique<TrajectoryToTrajectoryMap>();
70 auto Output_trackextra = std::make_unique<reco::TrackExtraCollection>();
71 auto Output_track = std::make_unique<reco::TrackCollection>();
72 auto Output_trackmap = std::make_unique<TrackToTrajectoryMap>();
112 <<
"Number of trajectories = "<<m_TrajectoryCollection.size() <<std::endl
113 <<
"Number of nuclear interactions = "<<m_NuclearInteractionCollection.size();
116 std::map<reco::TrackRef,TrajectoryRef> m_TrackToTrajMap;
117 swap_map(temp_m_TrajectoryCollection, m_TrackToTrajMap);
119 for(
unsigned int i = 0 ;
i < m_NuclearInteractionCollection.size() ;
i++)
136 pair<unsigned int, unsigned int> tempory_pair;
137 tempory_pair.first = Output_track->size();
138 tempory_pair.second =
i;
143 (algoResults[0].track)->setExtra( teref );
145 Output_track->push_back(*algoResults[0].
track);
146 Output_trackextra->push_back( newTrackExtra );
147 Output_traj->push_back(newTraj);
153 Output_track->push_back(*primTrackRef);
154 Output_trackextra->push_back( *primTrackRef->extra() );
155 Output_traj->push_back(*trajRef);
166 if(Handle_tracks->size() != Handle_traj->size() )
168 printf(
"ERROR Handle_tracks->size() != Handle_traj->size() \n");
180 Output_trajmap ->insert(OutTrajRef,InTrajRef);
181 Output_trackmap->insert(TrackRef,InTrajRef);
185 Output_tracktrackmap->
insert(TrackRef,PrimaryTrackRef);
194 if(
verbosity>=3)printf(
"-----------------------\n");
204 bool needNewTraj=
false;
206 double vtx_pos_mag =
sqrt (vtx_pos.X()*vtx_pos.X()+vtx_pos.Y()*vtx_pos.Y()+vtx_pos.Z()*vtx_pos.Z());
207 if(
verbosity>=2) printf(
"Nuclear Interaction pos = %f\n",vtx_pos_mag );
214 if(
verbosity>=2)
LogDebug(
"NuclearTrackCorrector")<<
"Size of Measurements = "<<Measurements.size();
216 for(
unsigned int m=Measurements.size()-1 ;
m!=(
unsigned int)-1 ;
m--){
218 if(!Measurements[
m].
recHit()->isValid() )
continue;
223 if(hit_pos.
mag()>vtx_pos_mag){
227 newtrajectory.
push(Measurements[
m]);
245 for(
unsigned int h=0 ;
h<hits.size() ;
h++)
247 if( hits[
h]->isValid() )
249 ndof = ndof + hits[
h]->dimension() * hits[
h]->weight();
252 LogDebug(
"NuclearSeedGenerator") <<
" HIT IS INVALID ???";
259 LogDebug(
"NuclearSeedGenerator") <<
" TrackCorrector - number of valid hits" << hits.size() <<
"\n" 260 <<
" - number of hits from Track " << theT->recHitsSize() <<
"\n" 261 <<
" - number of valid hits from initial track " << theT->numberOfValidHits();
264 if( hits.size() > 1){
277 Trajectory* theTraj = algoResults[0].trajectory;
282 unsigned int innerId, outerId;
324 innerStateFromTrack: outerStateFromTrack;
330 initialStateFromTrack.
surface(),
332 return theInitialStateForRefitting;
336 for(
unsigned int i = 0 ;
i < trajColl->size() ;
i++)
340 result[ PrimaryTrackRef ] = InTrajRef;
void rescaleError(double factor)
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
ConstRecHitPointer const & recHit() const
~NuclearTrackCorrector() override
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
const LocalTrajectoryParameters & localParameters() const
NuclearTrackCorrector(const edm::ParameterSet &)
edm::ESHandle< MagneticField > theMF
const edm::RefToBase< reco::Track > & primaryTrack() const
return the base reference to the primary track
void produce(edm::Event &, const edm::EventSetup &) override
const CurvilinearTrajectoryError & curvilinearError() const
std::vector< std::pair< unsigned int, unsigned int > > Indice_Map
std::vector< ConstRecHitPointer > RecHitContainer
GlobalPoint globalPosition() const
bool getTrackFromTrajectory(const Trajectory &newTraj, const TrajectoryRef &initialTrajRef, AlgoProductCollection &algoResults)
Get the refitted track from the Trajectory.
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
int KeepOnlyCorrectedTracks
const Plane & surface() const
The nominal surface of the GeomDet.
const Point & position() const
position
bool buildTrack(const TrajectoryFitter *, const Propagator *, AlgoProductCollection &, TransientTrackingRecHit::RecHitContainer &, TrajectoryStateOnSurface &, const TrajectorySeed &, float, const reco::BeamSpot &, SeedRef seedRef=SeedRef(), int qualityMask=0, signed char nLoops=0)
Construct Tracks to be put in the event.
PropagationDirection const & direction() const
U second(std::pair< T, U > const &p)
const SurfaceType & surface() const
std::vector< TrajectoryMeasurement > DataContainer
const ref_type & refProd() const
return ref-prod structure
edm::ESHandle< TrackerGeometry > theG
TrajectoryMeasurement const & lastMeasurement() const
GlobalVector momentum() const
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
void validRecHits(ConstRecHitContainer &cont) const
std::vector< NuclearInteraction > NuclearInteractionCollection
collection of NuclearInteractions
TrackProducerAlgorithm< reco::Track > * theAlgo
math::XYZPoint Point
point in the space
const LocalTrajectoryError & localError() const
double likelihood() const
return the likelihood ~ probability that the vertex is a real nuclear interaction ...
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
RefProd< PROD > getRefBeforePut()
edm::ESHandle< Propagator > thePropagator
GlobalPoint position() const
edm::ESHandle< TrajectoryFitter > theFitter
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
TrajectoryMeasurement const & firstMeasurement() const
T const * product() const
void insert(const key_type &k, const data_type &v)
insert an association
const GlobalTrajectoryParameters & globalParameters() const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
reco::TrackExtra getNewTrackExtra(const AlgoProductCollection &algoresults)
get a new TrackExtra from an AlgoProductCollection
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
bool newTrajNeeded(Trajectory &newtrajectory, const TrajectoryRef &trajRef, const reco::NuclearInteraction &ni)
check if the trajectory has to be refitted and get the new trajectory
std::vector< Trajectory > TrajectoryCollection
const TrajTrackAssociationCollection * m_TrajToTrackCollection
const reco::Vertex & vertex() const
return the vertex
const TrackerGeomDet * idToDet(DetId) const override
TrajectoryStateOnSurface const & updatedState() const
void swap_map(const edm::Handle< TrajectoryCollection > &trajColl, std::map< reco::TrackRef, edm::Ref< TrajectoryCollection > > &result)
T const * product() const
void push(const TrajectoryMeasurement &tm)
TrackProducerAlgorithm< reco::Track >::AlgoProductCollection AlgoProductCollection
TrajectoryStateOnSurface getInitialState(const reco::Track *theT, TransientTrackingRecHit::RecHitContainer &hits, const TrackingGeometry *theG, const MagneticField *theMF)
Calculate the inital state to be used to buil the track.
std::string str_Input_Trajectory
std::string str_Input_NuclearInteraction