CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  double quality() const
68  {
69  return quality_;
70  }
71 
72 private:
73 
74  bool newEvent_;
75 
77 
79 
80  double quality_;
81 
83 
85 
87 
89 
91 
93 
94 };
95 
96 #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:78
reco::SimToRecoCollection simToReco_
Definition: TrackHistory.h:92
tuple result
Definition: query.py:137
edm::InputTag trackProducer_
Definition: TrackHistory.h:82
reco::RecoToSimCollection recoToSim_
Definition: TrackHistory.h:90
This class traces the simulated and generated history of a given track.
Definition: TrackHistory.h:17
bool enableRecoToSim_
Definition: TrackHistory.h:78
edm::InputTag trackAssociator_
Definition: TrackHistory.h:86
TrackHistory(const edm::ParameterSet &, edm::ConsumesCollector &&)
Constructor by pset.
Definition: TrackHistory.cc:6
double quality_
Definition: TrackHistory.h:80
Base class to all the history types.
Definition: HistoryBase.h:12
bool evaluate(TrackingParticleRef tpr)
Evaluate track history using a TrackingParticleRef.
Definition: HistoryBase.h:114
bool evaluate(TrackingParticleRef tpr)
Evaluate track history using a TrackingParticleRef.
Definition: TrackHistory.h:41
bool bestMatchByMaxValue_
Definition: TrackHistory.h:76
edm::InputTag trackingTruth_
Definition: TrackHistory.h:84
double quality() const
Definition: TrackHistory.h:67
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
reco::TrackBaseRef recotrack_
Definition: TrackHistory.h:88