CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
NuclearTrackCorrector Class Reference

#include <RecoTracker/NuclearSeedGenerator/interface/NuclearTrackCorrector.h>

Inheritance diagram for NuclearTrackCorrector:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

using AlgoProductCollection = TrackProducerAlgorithm< reco::Track >::AlgoProductCollection
 
typedef TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
 
typedef edm::Ref< TrackCandidateCollectionTrackCandidateRef
 
typedef edm::Ref< TrajectoryCollectionTrajectoryRef
 
typedef edm::RefVector< TrajectorySeedCollectionTrajectorySeedRefVector
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 NuclearTrackCorrector (const edm::ParameterSet &)
 
 ~NuclearTrackCorrector () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void endJob () override
 
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. More...
 
reco::TrackExtra getNewTrackExtra (const AlgoProductCollection &algoresults)
 get a new TrackExtra from an AlgoProductCollection More...
 
bool getTrackFromTrajectory (const Trajectory &newTraj, const TrajectoryRef &initialTrajRef, AlgoProductCollection &algoResults)
 Get the refitted track from the Trajectory. More...
 
bool newTrajNeeded (Trajectory &newtrajectory, const TrajectoryRef &trajRef, const reco::NuclearInteraction &ni)
 check if the trajectory has to be refitted and get the new trajectory More...
 
void produce (edm::Event &, const edm::EventSetup &) override
 
void swap_map (const edm::Handle< TrajectoryCollection > &trajColl, std::map< reco::TrackRef, edm::Ref< TrajectoryCollection > > &result)
 

Private Attributes

edm::ParameterSet conf_
 
std::vector< std::pair< unsigned int, unsigned int > > Indice_Map
 
int int_Input_Hit_Distance
 
int KeepOnlyCorrectedTracks
 
const TrajTrackAssociationCollectionm_TrajToTrackCollection
 
std::string str_Input_NuclearInteraction
 
std::string str_Input_Trajectory
 
TrackProducerAlgorithm< reco::Track > * theAlgo
 
edm::ESHandle< TrajectoryFittertheFitter
 
edm::ESHandle< TrackerGeometrytheG
 
TransientInitialStateEstimatortheInitialState
 
edm::ESHandle< MagneticFieldtheMF
 
edm::ESHandle< PropagatorthePropagator
 
int verbosity
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 67 of file NuclearTrackCorrector.h.

Member Typedef Documentation

◆ AlgoProductCollection

Definition at line 74 of file NuclearTrackCorrector.h.

◆ ConstRecHitContainer

Definition at line 72 of file NuclearTrackCorrector.h.

◆ TrackCandidateRef

Definition at line 71 of file NuclearTrackCorrector.h.

◆ TrajectoryRef

Definition at line 70 of file NuclearTrackCorrector.h.

◆ TrajectorySeedRefVector

Definition at line 69 of file NuclearTrackCorrector.h.

Constructor & Destructor Documentation

◆ NuclearTrackCorrector()

NuclearTrackCorrector::NuclearTrackCorrector ( const edm::ParameterSet iConfig)
explicit

Definition at line 34 of file NuclearTrackCorrector.cc.

35  : conf_(iConfig), theInitialState(nullptr) {
36  str_Input_Trajectory = iConfig.getParameter<std::string>("InputTrajectory");
37  str_Input_NuclearInteraction = iConfig.getParameter<std::string>("InputNuclearInteraction");
38  verbosity = iConfig.getParameter<int>("Verbosity");
39  KeepOnlyCorrectedTracks = iConfig.getParameter<bool>("KeepOnlyCorrectedTracks");
40 
42 
43  produces<TrajectoryCollection>();
44  produces<TrajectoryToTrajectoryMap>();
45 
46  produces<reco::TrackExtraCollection>();
47  produces<reco::TrackCollection>();
48  produces<TrackToTrajectoryMap>();
49 
50  produces<TrackToTrackMap>();
51 }

References edm::ParameterSet::getParameter(), KeepOnlyCorrectedTracks, str_Input_NuclearInteraction, str_Input_Trajectory, AlCaHLTBitMon_QueryRunRegistry::string, theAlgo, and verbosity.

◆ ~NuclearTrackCorrector()

NuclearTrackCorrector::~NuclearTrackCorrector ( )
override

Definition at line 53 of file NuclearTrackCorrector.cc.

53 {}

Member Function Documentation

◆ endJob()

void NuclearTrackCorrector::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 177 of file NuclearTrackCorrector.cc.

177 {}

◆ getInitialState()

TrajectoryStateOnSurface NuclearTrackCorrector::getInitialState ( const reco::Track theT,
TransientTrackingRecHit::RecHitContainer hits,
const TrackingGeometry theG,
const MagneticField theMF 
)
private

Calculate the inital state to be used to buil the track.

Definition at line 304 of file NuclearTrackCorrector.cc.

307  {
308  TrajectoryStateOnSurface theInitialStateForRefitting;
309  //the starting state is the state closest to the first hit along seedDirection.
310 
311  //avoiding to use transientTrack, it should be faster;
314  TrajectoryStateOnSurface initialStateFromTrack =
315  ((innerStateFromTrack.globalPosition() - hits.front()->globalPosition()).mag2() <
316  (outerStateFromTrack.globalPosition() - hits.front()->globalPosition()).mag2())
317  ? innerStateFromTrack
318  : outerStateFromTrack;
319 
320  // error is rescaled, but correlation are kept.
321  initialStateFromTrack.rescaleError(100);
322  theInitialStateForRefitting = TrajectoryStateOnSurface(initialStateFromTrack.localParameters(),
323  initialStateFromTrack.localError(),
324  initialStateFromTrack.surface(),
325  theMF);
326  return theInitialStateForRefitting;
327 }

References TrajectoryStateOnSurface::globalPosition(), hfClusterShapes_cfi::hits, trajectoryStateTransform::innerStateOnSurface(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localParameters(), mag2(), trajectoryStateTransform::outerStateOnSurface(), TrajectoryStateOnSurface::rescaleError(), TrajectoryStateOnSurface::surface(), theG, and theMF.

Referenced by getTrackFromTrajectory().

◆ getNewTrackExtra()

reco::TrackExtra NuclearTrackCorrector::getNewTrackExtra ( const AlgoProductCollection algoresults)
private

get a new TrackExtra from an AlgoProductCollection

Definition at line 263 of file NuclearTrackCorrector.cc.

263  {
264  Trajectory* theTraj = algoResults[0].trajectory;
265  PropagationDirection seedDir = algoResults[0].pDir;
266 
267  TrajectoryStateOnSurface outertsos;
268  TrajectoryStateOnSurface innertsos;
269  unsigned int innerId, outerId;
270  if (theTraj->direction() == alongMomentum) {
271  outertsos = theTraj->lastMeasurement().updatedState();
272  innertsos = theTraj->firstMeasurement().updatedState();
273  outerId = theTraj->lastMeasurement().recHit()->geographicalId().rawId();
274  innerId = theTraj->firstMeasurement().recHit()->geographicalId().rawId();
275  } else {
276  outertsos = theTraj->firstMeasurement().updatedState();
277  innertsos = theTraj->lastMeasurement().updatedState();
278  outerId = theTraj->firstMeasurement().recHit()->geographicalId().rawId();
279  innerId = theTraj->lastMeasurement().recHit()->geographicalId().rawId();
280  }
281 
282  GlobalPoint v = outertsos.globalParameters().position();
283  GlobalVector p = outertsos.globalParameters().momentum();
284  math::XYZVector outmom(p.x(), p.y(), p.z());
285  math::XYZPoint outpos(v.x(), v.y(), v.z());
286  v = innertsos.globalParameters().position();
287  p = innertsos.globalParameters().momentum();
288  math::XYZVector inmom(p.x(), p.y(), p.z());
289  math::XYZPoint inpos(v.x(), v.y(), v.z());
290 
291  return reco::TrackExtra(outpos,
292  outmom,
293  true,
294  inpos,
295  inmom,
296  true,
297  outertsos.curvilinearError(),
298  outerId,
299  innertsos.curvilinearError(),
300  innerId,
301  seedDir);
302 }

References alongMomentum, TrajectoryStateOnSurface::curvilinearError(), Trajectory::direction(), Trajectory::firstMeasurement(), TrajectoryStateOnSurface::globalParameters(), Trajectory::lastMeasurement(), GlobalTrajectoryParameters::momentum(), AlCaHLTBitMon_ParallelJobs::p, GlobalTrajectoryParameters::position(), TrajectoryMeasurement::recHit(), TrajectoryMeasurement::updatedState(), and findQualityFiles::v.

Referenced by produce().

◆ getTrackFromTrajectory()

bool NuclearTrackCorrector::getTrackFromTrajectory ( const Trajectory newTraj,
const TrajectoryRef initialTrajRef,
AlgoProductCollection algoResults 
)
private

Get the refitted track from the Trajectory.

Definition at line 220 of file NuclearTrackCorrector.cc.

222  {
223  const Trajectory* it = &newTraj;
224 
226  it->validRecHits(hits);
227 
228  float ndof = 0;
229  for (unsigned int h = 0; h < hits.size(); h++) {
230  if (hits[h]->isValid()) {
231  ndof = ndof + hits[h]->dimension() * hits[h]->weight();
232  } else {
233  LogDebug("NuclearSeedGenerator") << " HIT IS INVALID ???";
234  }
235  }
236 
237  ndof = ndof - 5;
238  reco::TrackRef theT = m_TrajToTrackCollection->operator[](initialTrajRef);
239  LogDebug("NuclearSeedGenerator") << " TrackCorrector - number of valid hits" << hits.size() << "\n"
240  << " - number of hits from Track " << theT->recHitsSize() << "\n"
241  << " - number of valid hits from initial track "
242  << theT->numberOfValidHits();
243 
244  if (hits.size() > 1) {
245  TrajectoryStateOnSurface theInitialStateForRefitting =
246  getInitialState(&(*theT), hits, theG.product(), theMF.product());
247 
251  algoResults,
252  hits,
253  theInitialStateForRefitting,
254  it->seed(),
255  ndof,
256  bs,
257  theT->seedRef());
258  }
259 
260  return false;
261 }

References cms::cuda::bs, TrackProducerAlgorithm< T >::buildTrack(), getInitialState(), h, hfClusterShapes_cfi::hits, LogDebug, m_TrajToTrackCollection, ndof, edm::ESHandle< T >::product(), Trajectory::seed(), theAlgo, theFitter, theG, theMF, thePropagator, and Trajectory::validRecHits().

Referenced by produce().

◆ newTrajNeeded()

bool NuclearTrackCorrector::newTrajNeeded ( Trajectory newtrajectory,
const TrajectoryRef trajRef,
const reco::NuclearInteraction ni 
)
private

check if the trajectory has to be refitted and get the new trajectory

Definition at line 179 of file NuclearTrackCorrector.cc.

181  {
182  bool needNewTraj = false;
183  reco::Vertex::Point vtx_pos = ni.vertex().position();
184  double vtx_pos_mag = sqrt(vtx_pos.X() * vtx_pos.X() + vtx_pos.Y() * vtx_pos.Y() + vtx_pos.Z() * vtx_pos.Z());
185  if (verbosity >= 2)
186  printf("Nuclear Interaction pos = %f\n", vtx_pos_mag);
187 
188  newtrajectory = Trajectory(trajRef->seed(), alongMomentum);
189 
190  // Look all the Hits of the trajectory and keep only Hits before seeds
191  Trajectory::DataContainer Measurements = trajRef->measurements();
192  if (verbosity >= 2)
193  LogDebug("NuclearTrackCorrector") << "Size of Measurements = " << Measurements.size();
194 
195  for (unsigned int m = Measurements.size() - 1; m != (unsigned int)-1; m--) {
196  if (!Measurements[m].recHit()->isValid())
197  continue;
198  GlobalPoint hit_pos = theG->idToDet(Measurements[m].recHit()->geographicalId())
199  ->surface()
200  .toGlobal(Measurements[m].recHit()->localPosition());
201 
202  if (verbosity >= 2)
203  printf("Hit pos = %f", hit_pos.mag());
204 
205  if (hit_pos.mag() > vtx_pos_mag) {
206  if (verbosity >= 2)
207  printf(" X ");
208  needNewTraj = true;
209  } else {
210  newtrajectory.push(Measurements[m]);
211  }
212  if (verbosity >= 2)
213  printf("\n");
214  }
215 
216  return needNewTraj;
217 }

References alongMomentum, TrackerGeometry::idToDet(), createfilelist::int, LogDebug, visualization-live-secondInstance_cfg::m, PV3DBase< T, PVType, FrameType >::mag(), reco::Vertex::position(), Trajectory::push(), rpcPointValidation_cfi::recHit, mathSSE::sqrt(), GeomDet::surface(), theG, Surface::toGlobal(), verbosity, and reco::NuclearInteraction::vertex().

Referenced by produce().

◆ produce()

void NuclearTrackCorrector::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 55 of file NuclearTrackCorrector.cc.

55  {
56  // Create Output Collections
57  // --------------------------------------------------------------------------------------------------
58  auto Output_traj = std::make_unique<TrajectoryCollection>();
59  auto Output_trajmap = std::make_unique<TrajectoryToTrajectoryMap>();
60 
61  auto Output_trackextra = std::make_unique<reco::TrackExtraCollection>();
62  auto Output_track = std::make_unique<reco::TrackCollection>();
63  auto Output_trackmap = std::make_unique<TrackToTrajectoryMap>();
64 
65  // Load Reccord
66  // --------------------------------------------------------------------------------------------------
67  std::string fitterName = conf_.getParameter<std::string>("Fitter");
68  iSetup.get<TrajectoryFitter::Record>().get(fitterName, theFitter);
69 
72 
74 
75  reco::TrackExtraRefProd rTrackExtras = iEvent.getRefBeforePut<reco::TrackExtraCollection>();
76 
78 
79  // Load Inputs
80  // --------------------------------------------------------------------------------------------------
81  edm::Handle<TrajectoryCollection> temp_m_TrajectoryCollection;
82  iEvent.getByLabel(str_Input_Trajectory, temp_m_TrajectoryCollection);
83  const TrajectoryCollection m_TrajectoryCollection = *(temp_m_TrajectoryCollection.product());
84 
85  edm::Handle<NuclearInteractionCollection> temp_m_NuclearInteractionCollection;
86  iEvent.getByLabel(str_Input_NuclearInteraction, temp_m_NuclearInteractionCollection);
87  const NuclearInteractionCollection m_NuclearInteractionCollection = *(temp_m_NuclearInteractionCollection.product());
88 
89  edm::Handle<TrajTrackAssociationCollection> h_TrajToTrackCollection;
90  iEvent.getByLabel(str_Input_Trajectory, h_TrajToTrackCollection);
91  m_TrajToTrackCollection = h_TrajToTrackCollection.product();
92 
93  // Correct the trajectories (Remove trajectory's hits that are located after the nuclear interacion)
94  // --------------------------------------------------------------------------------------------------
95  if (verbosity >= 1) {
96  LogDebug("NuclearTrackCorrector") << "Number of trajectories = " << m_TrajectoryCollection.size()
97  << std::endl
98  << "Number of nuclear interactions = "
99  << m_NuclearInteractionCollection.size();
100  }
101 
102  std::map<reco::TrackRef, TrajectoryRef> m_TrackToTrajMap;
103  swap_map(temp_m_TrajectoryCollection, m_TrackToTrajMap);
104 
105  for (unsigned int i = 0; i < m_NuclearInteractionCollection.size(); i++) {
106  reco::NuclearInteraction ni = m_NuclearInteractionCollection[i];
107  if (ni.likelihood() < 0.4)
108  continue;
109 
110  reco::TrackRef primTrackRef = ni.primaryTrack().castTo<reco::TrackRef>();
111 
112  TrajectoryRef trajRef = m_TrackToTrajMap[primTrackRef];
113 
114  Trajectory newTraj;
115  if (newTrajNeeded(newTraj, trajRef, ni)) {
116  AlgoProductCollection algoResults;
117  bool isOK = getTrackFromTrajectory(newTraj, trajRef, algoResults);
118 
119  if (isOK) {
120  pair<unsigned int, unsigned int> tempory_pair;
121  tempory_pair.first = Output_track->size();
122  tempory_pair.second = i;
123  Indice_Map.push_back(tempory_pair);
124 
125  reco::TrackExtraRef teref = reco::TrackExtraRef(rTrackExtras, i);
126  reco::TrackExtra newTrackExtra = getNewTrackExtra(algoResults);
127  (algoResults[0].track)->setExtra(teref);
128 
129  Output_track->push_back(*algoResults[0].track);
130  Output_trackextra->push_back(newTrackExtra);
131  Output_traj->push_back(newTraj);
132  }
133  } else {
135  Output_track->push_back(*primTrackRef);
136  Output_trackextra->push_back(*primTrackRef->extra());
137  Output_traj->push_back(*trajRef);
138  }
139  }
140  }
141  const edm::OrphanHandle<TrajectoryCollection> Handle_traj = iEvent.put(std::move(Output_traj));
142  const edm::OrphanHandle<reco::TrackCollection> Handle_tracks = iEvent.put(std::move(Output_track));
143  iEvent.put(std::move(Output_trackextra));
144 
145  // Make Maps between elements
146  // --------------------------------------------------------------------------------------------------
147  if (Handle_tracks->size() != Handle_traj->size()) {
148  printf("ERROR Handle_tracks->size() != Handle_traj->size() \n");
149  return;
150  }
151 
152  auto Output_tracktrackmap = std::make_unique<TrackToTrackMap>(Handle_tracks, m_TrajToTrackCollection->refProd().val);
153 
154  for (unsigned int i = 0; i < Indice_Map.size(); i++) {
155  TrajectoryRef InTrajRef(temp_m_TrajectoryCollection, Indice_Map[i].second);
156  TrajectoryRef OutTrajRef(Handle_traj, Indice_Map[i].first);
157  reco::TrackRef TrackRef(Handle_tracks, Indice_Map[i].first);
158 
159  Output_trajmap->insert(OutTrajRef, InTrajRef);
160  Output_trackmap->insert(TrackRef, InTrajRef);
161 
162  try {
163  reco::TrackRef PrimaryTrackRef = m_TrajToTrackCollection->operator[](InTrajRef);
164  Output_tracktrackmap->insert(TrackRef, PrimaryTrackRef);
165  } catch (edm::Exception const&) {
166  }
167  }
168  iEvent.put(std::move(Output_trajmap));
169  iEvent.put(std::move(Output_trackmap));
170  iEvent.put(std::move(Output_tracktrackmap));
171 
172  if (verbosity >= 3)
173  printf("-----------------------\n");
174 }

References edm::RefToBase< T >::castTo(), conf_, dqmdumpme::first, edm::EventSetup::get(), get, getNewTrackExtra(), edm::ParameterSet::getParameter(), getTrackFromTrajectory(), mps_fire::i, iEvent, Indice_Map, edm::AssociationMap< Tag >::insert(), KeepOnlyCorrectedTracks, reco::NuclearInteraction::likelihood(), LogDebug, m_TrajToTrackCollection, eostools::move(), newTrajNeeded(), reco::NuclearInteraction::primaryTrack(), edm::Handle< T >::product(), HLT_2018_cff::propagatorName, edm::AssociationMap< Tag >::refProd(), edm::second(), str_Input_NuclearInteraction, str_Input_Trajectory, AlCaHLTBitMon_QueryRunRegistry::string, swap_map(), theFitter, theG, theMF, thePropagator, HLT_2018_cff::track, and verbosity.

◆ swap_map()

void NuclearTrackCorrector::swap_map ( const edm::Handle< TrajectoryCollection > &  trajColl,
std::map< reco::TrackRef, edm::Ref< TrajectoryCollection > > &  result 
)
private

Definition at line 329 of file NuclearTrackCorrector.cc.

330  {
331  for (unsigned int i = 0; i < trajColl->size(); i++) {
332  TrajectoryRef InTrajRef(trajColl, i);
333  reco::TrackRef PrimaryTrackRef = m_TrajToTrackCollection->operator[](InTrajRef);
334  result[PrimaryTrackRef] = InTrajRef;
335  }
336 }

References mps_fire::i, m_TrajToTrackCollection, and mps_fire::result.

Referenced by produce().

Member Data Documentation

◆ conf_

edm::ParameterSet NuclearTrackCorrector::conf_
private

Definition at line 119 of file NuclearTrackCorrector.h.

Referenced by produce().

◆ Indice_Map

std::vector<std::pair<unsigned int, unsigned int> > NuclearTrackCorrector::Indice_Map
private

Definition at line 113 of file NuclearTrackCorrector.h.

Referenced by produce().

◆ int_Input_Hit_Distance

int NuclearTrackCorrector::int_Input_Hit_Distance
private

Definition at line 108 of file NuclearTrackCorrector.h.

◆ KeepOnlyCorrectedTracks

int NuclearTrackCorrector::KeepOnlyCorrectedTracks
private

Definition at line 111 of file NuclearTrackCorrector.h.

Referenced by NuclearTrackCorrector(), and produce().

◆ m_TrajToTrackCollection

const TrajTrackAssociationCollection* NuclearTrackCorrector::m_TrajToTrackCollection
private

Definition at line 123 of file NuclearTrackCorrector.h.

Referenced by getTrackFromTrajectory(), produce(), and swap_map().

◆ str_Input_NuclearInteraction

std::string NuclearTrackCorrector::str_Input_NuclearInteraction
private

Definition at line 107 of file NuclearTrackCorrector.h.

Referenced by NuclearTrackCorrector(), and produce().

◆ str_Input_Trajectory

std::string NuclearTrackCorrector::str_Input_Trajectory
private

Definition at line 106 of file NuclearTrackCorrector.h.

Referenced by NuclearTrackCorrector(), and produce().

◆ theAlgo

TrackProducerAlgorithm<reco::Track>* NuclearTrackCorrector::theAlgo
private

Definition at line 122 of file NuclearTrackCorrector.h.

Referenced by getTrackFromTrajectory(), and NuclearTrackCorrector().

◆ theFitter

edm::ESHandle<TrajectoryFitter> NuclearTrackCorrector::theFitter
private

Definition at line 117 of file NuclearTrackCorrector.h.

Referenced by getTrackFromTrajectory(), and produce().

◆ theG

edm::ESHandle<TrackerGeometry> NuclearTrackCorrector::theG
private

◆ theInitialState

TransientInitialStateEstimator* NuclearTrackCorrector::theInitialState
private

Definition at line 120 of file NuclearTrackCorrector.h.

◆ theMF

edm::ESHandle<MagneticField> NuclearTrackCorrector::theMF
private

Definition at line 116 of file NuclearTrackCorrector.h.

Referenced by getInitialState(), getTrackFromTrajectory(), and produce().

◆ thePropagator

edm::ESHandle<Propagator> NuclearTrackCorrector::thePropagator
private

Definition at line 118 of file NuclearTrackCorrector.h.

Referenced by getTrackFromTrajectory(), and produce().

◆ verbosity

int NuclearTrackCorrector::verbosity
private

Definition at line 110 of file NuclearTrackCorrector.h.

Referenced by newTrajNeeded(), NuclearTrackCorrector(), and produce().

Vector3DBase
Definition: Vector3DBase.h:8
edm::RefProd< TrackExtraCollection >
TrackerGeometry::idToDet
const TrackerGeomDet * idToDet(DetId) const override
Definition: TrackerGeometry.cc:193
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
NuclearTrackCorrector::KeepOnlyCorrectedTracks
int KeepOnlyCorrectedTracks
Definition: NuclearTrackCorrector.h:111
mps_fire.i
i
Definition: mps_fire.py:355
edm::Handle::product
T const * product() const
Definition: Handle.h:70
NuclearTrackCorrector::swap_map
void swap_map(const edm::Handle< TrajectoryCollection > &trajColl, std::map< reco::TrackRef, edm::Ref< TrajectoryCollection > > &result)
Definition: NuclearTrackCorrector.cc:329
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
NuclearTrackCorrector::theAlgo
TrackProducerAlgorithm< reco::Track > * theAlgo
Definition: NuclearTrackCorrector.h:122
GlobalTrajectoryParameters::position
GlobalPoint position() const
Definition: GlobalTrajectoryParameters.h:60
Trajectory::direction
PropagationDirection const & direction() const
Definition: Trajectory.cc:133
NuclearTrackCorrector::m_TrajToTrackCollection
const TrajTrackAssociationCollection * m_TrajToTrackCollection
Definition: NuclearTrackCorrector.h:123
NuclearTrackCorrector::conf_
edm::ParameterSet conf_
Definition: NuclearTrackCorrector.h:119
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: L1TUtmAlgorithmRcd.h:4
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
reco::Vertex::position
const Point & position() const
position
Definition: Vertex.h:114
TrajectoryMeasurement::updatedState
TrajectoryStateOnSurface const & updatedState() const
Definition: TrajectoryMeasurement.h:184
findQualityFiles.v
v
Definition: findQualityFiles.py:179
NuclearTrackCorrector::getTrackFromTrajectory
bool getTrackFromTrajectory(const Trajectory &newTraj, const TrajectoryRef &initialTrajRef, AlgoProductCollection &algoResults)
Get the refitted track from the Trajectory.
Definition: NuclearTrackCorrector.cc:220
edm::Handle
Definition: AssociativeIterator.h:50
dqmdumpme.first
first
Definition: dqmdumpme.py:55
NuclearTrackCorrector::theG
edm::ESHandle< TrackerGeometry > theG
Definition: NuclearTrackCorrector.h:115
NuclearTrackCorrector::AlgoProductCollection
TrackProducerAlgorithm< reco::Track >::AlgoProductCollection AlgoProductCollection
Definition: NuclearTrackCorrector.h:74
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
edm::Ref< TrackCollection >
trajectoryStateTransform::outerStateOnSurface
TrajectoryStateOnSurface outerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:118
edm::Exception
Definition: EDMException.h:77
ndof
Definition: HIMultiTrackSelector.h:49
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
reco::TrackExtra
Definition: TrackExtra.h:26
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
cms::cuda::bs
bs
Definition: HistoContainer.h:127
h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
TrackingRecHit::RecHitContainer
std::vector< ConstRecHitPointer > RecHitContainer
Definition: TrackingRecHit.h:31
edm::AssociationMap::refProd
const ref_type & refProd() const
return ref-prod structure
Definition: AssociationMap.h:217
Trajectory::DataContainer
std::vector< TrajectoryMeasurement > DataContainer
Definition: Trajectory.h:40
HLT_2018_cff.propagatorName
propagatorName
Definition: HLT_2018_cff.py:8200
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
reco::BeamSpot
Definition: BeamSpot.h:21
reco::NuclearInteractionCollection
std::vector< NuclearInteraction > NuclearInteractionCollection
collection of NuclearInteractions
Definition: NuclearInteractionFwd.h:8
TrajectoryFitterRecord
Definition: TrajectoryFitterRecord.h:12
reco::TrackExtraCollection
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
Definition: TrackExtraFwd.h:10
Trajectory::validRecHits
void validRecHits(ConstRecHitContainer &cont) const
Definition: Trajectory.cc:126
Point3DBase< float, GlobalTag >
NuclearTrackCorrector::getNewTrackExtra
reco::TrackExtra getNewTrackExtra(const AlgoProductCollection &algoresults)
get a new TrackExtra from an AlgoProductCollection
Definition: NuclearTrackCorrector.cc:263
GlobalTrajectoryParameters::momentum
GlobalVector momentum() const
Definition: GlobalTrajectoryParameters.h:65
reco::TrackRef
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TrajectoryStateOnSurface::localParameters
const LocalTrajectoryParameters & localParameters() const
Definition: TrajectoryStateOnSurface.h:73
NuclearTrackCorrector::Indice_Map
std::vector< std::pair< unsigned int, unsigned int > > Indice_Map
Definition: NuclearTrackCorrector.h:113
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
reco::NuclearInteraction::primaryTrack
const edm::RefToBase< reco::Track > & primaryTrack() const
return the base reference to the primary track
Definition: NuclearInteraction.h:27
NuclearTrackCorrector::getInitialState
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.
Definition: NuclearTrackCorrector.cc:304
Trajectory::lastMeasurement
TrajectoryMeasurement const & lastMeasurement() const
Definition: Trajectory.h:150
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
TrackProducerAlgorithm< reco::Track >
reco::TrackExtraRef
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
Definition: TrackExtraFwd.h:16
NuclearTrackCorrector::theFitter
edm::ESHandle< TrajectoryFitter > theFitter
Definition: NuclearTrackCorrector.h:117
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
NuclearTrackCorrector::theInitialState
TransientInitialStateEstimator * theInitialState
Definition: NuclearTrackCorrector.h:120
mag2
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
Definition: Basic3DVectorLD.h:124
edm::RefToBase::castTo
REF castTo() const
Definition: RefToBase.h:257
reco::NuclearInteraction::vertex
const reco::Vertex & vertex() const
return the vertex
Definition: NuclearInteraction.h:51
get
#define get
Trajectory::push
void push(const TrajectoryMeasurement &tm)
Definition: Trajectory.cc:50
Trajectory::measurements
DataContainer const & measurements() const
Definition: Trajectory.h:178
TrajectoryStateOnSurface::rescaleError
void rescaleError(double factor)
Definition: TrajectoryStateOnSurface.h:82
NuclearTrackCorrector::str_Input_NuclearInteraction
std::string str_Input_NuclearInteraction
Definition: NuclearTrackCorrector.h:107
TrajectoryMeasurement::recHit
ConstRecHitPointer const & recHit() const
Definition: TrajectoryMeasurement.h:190
PV3DBase::mag
T mag() const
Definition: PV3DBase.h:64
edm::AssociationMap::insert
void insert(const key_type &k, const data_type &v)
insert an association
Definition: AssociationMap.h:166
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
NuclearTrackCorrector::theMF
edm::ESHandle< MagneticField > theMF
Definition: NuclearTrackCorrector.h:116
NuclearTrackCorrector::str_Input_Trajectory
std::string str_Input_Trajectory
Definition: NuclearTrackCorrector.h:106
reco::Vertex::Point
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::OrphanHandle
Definition: EDProductfwd.h:39
Trajectory::firstMeasurement
TrajectoryMeasurement const & firstMeasurement() const
Definition: Trajectory.h:166
Trajectory
Definition: Trajectory.h:38
NuclearTrackCorrector::TrajectoryRef
edm::Ref< TrajectoryCollection > TrajectoryRef
Definition: NuclearTrackCorrector.h:70
TrajectoryStateOnSurface::curvilinearError
const CurvilinearTrajectoryError & curvilinearError() const
Definition: TrajectoryStateOnSurface.h:72
PropagationDirection
PropagationDirection
Definition: PropagationDirection.h:4
Trajectory::seed
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
Definition: Trajectory.h:263
TrajectoryStateOnSurface::surface
const SurfaceType & surface() const
Definition: TrajectoryStateOnSurface.h:78
reco::NuclearInteraction::likelihood
double likelihood() const
return the likelihood ~ probability that the vertex is a real nuclear interaction
Definition: NuclearInteraction.h:54
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
mps_fire.result
result
Definition: mps_fire.py:303
TrackProducerAlgorithm::buildTrack
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.
TrajectoryStateOnSurface::globalParameters
const GlobalTrajectoryParameters & globalParameters() const
Definition: TrajectoryStateOnSurface.h:64
trajectoryStateTransform::innerStateOnSurface
TrajectoryStateOnSurface innerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:110
TrajectoryCollection
std::vector< Trajectory > TrajectoryCollection
Definition: TrajectoryToSeedMap.h:17
TrajectoryStateOnSurface::localError
const LocalTrajectoryError & localError() const
Definition: TrajectoryStateOnSurface.h:77
NuclearTrackCorrector::thePropagator
edm::ESHandle< Propagator > thePropagator
Definition: NuclearTrackCorrector.h:118
alongMomentum
Definition: PropagationDirection.h:4
NuclearTrackCorrector::verbosity
int verbosity
Definition: NuclearTrackCorrector.h:110
NuclearTrackCorrector::newTrajNeeded
bool newTrajNeeded(Trajectory &newtrajectory, const TrajectoryRef &trajRef, const reco::NuclearInteraction &ni)
check if the trajectory has to be refitted and get the new trajectory
Definition: NuclearTrackCorrector.cc:179
reco::NuclearInteraction
Definition: NuclearInteraction.h:11
TrackingComponentsRecord
Definition: TrackingComponentsRecord.h:12