CMS 3D CMS Logo

TrackHistory.h
Go to the documentation of this file.
1 #ifndef TrackHistory_h
2 #define TrackHistory_h
3 
5 
11 
15 
17 class TrackHistory : public HistoryBase
18 {
19 
20 public:
21 
23  /* Creates a TrackHistory with association given by pset.
24 
25  /param[in] pset with the configuration values
26  */
29 
31  void newEvent(const edm::Event &, const edm::EventSetup &);
32 
34  /* Return false when the history cannot be determined upto a given depth.
35  If not depth is pass to the function no restriction are apply to it.
36 
37  /param[in] TrackingParticleRef of a simulated track
38  /param[in] depth of the track history
39  /param[out] boolean that is true when history can be determined
40  */
42  {
43  if ( enableSimToReco_ )
44  {
45  std::pair<reco::TrackBaseRef, double> result = match(tpr, simToReco_, bestMatchByMaxValue_);
46  recotrack_ = result.first;
47  quality_ = result.second;
48  }
49  return HistoryBase::evaluate(tpr);
50  }
51 
52 
54  /* Return false when the track association is not possible (fake track).
55 
56  /param[in] TrackRef to a reco::track
57  /param[out] boolean that is false when a fake track is detected
58  */
60 
62  const reco::TrackBaseRef & recoTrack() const
63  {
64  return recotrack_;
65  }
66 
67  // return the TrackingParticle to which the Track was matched
68  const std::pair<TrackingParticleRef, double> getMatchedTrackingParticle() const
69  {
70  std::pair<TrackingParticleRef, double> result;
71  result.first = trackingParticle_;
72  result.second = quality_;
73 
74  return result;
75  }
76 
77  double quality() const
78  {
79  return quality_;
80  }
81 
82 private:
83 
84  bool newEvent_;
85 
87 
89 
90  double quality_;
91 
93 
95 
97 
99 
101 
103 
105 
106 };
107 
108 #endif
void newEvent(const edm::Event &, const edm::EventSetup &)
Pre-process event information (for accessing reconstruction information)
Definition: TrackHistory.cc:39
bool enableSimToReco_
Definition: TrackHistory.h:88
reco::SimToRecoCollection simToReco_
Definition: TrackHistory.h:104
edm::InputTag trackProducer_
Definition: TrackHistory.h:92
reco::RecoToSimCollection recoToSim_
Definition: TrackHistory.h:102
TrackingParticleRef trackingParticle_
Definition: TrackHistory.h:100
This class traces the simulated and generated history of a given track.
Definition: TrackHistory.h:17
bool enableRecoToSim_
Definition: TrackHistory.h:88
edm::InputTag trackAssociator_
Definition: TrackHistory.h:96
TrackHistory(const edm::ParameterSet &, edm::ConsumesCollector &&)
Constructor by pset.
Definition: TrackHistory.cc:6
double quality_
Definition: TrackHistory.h:90
Base class to all the history types.
Definition: HistoryBase.h:12
bool evaluate(TrackingParticleRef tpr)
Evaluate track history using a TrackingParticleRef.
Definition: HistoryBase.h:122
bool evaluate(TrackingParticleRef tpr)
Evaluate track history using a TrackingParticleRef.
Definition: TrackHistory.h:41
bool bestMatchByMaxValue_
Definition: TrackHistory.h:86
edm::InputTag trackingTruth_
Definition: TrackHistory.h:94
double quality() const
Definition: TrackHistory.h:77
const reco::TrackBaseRef & recoTrack() const
Return a reference to the reconstructed track.
Definition: TrackHistory.h:62
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
const std::pair< TrackingParticleRef, double > getMatchedTrackingParticle() const
Definition: TrackHistory.h:68
reco::TrackBaseRef recotrack_
Definition: TrackHistory.h:98