CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 public:
20  /* Creates a TrackHistory with association given by pset.
21 
22  /param[in] pset with the configuration values
23  */
25 
27  void newEvent(const edm::Event &, const edm::EventSetup &);
28 
30  /* Return false when the history cannot be determined upto a given depth.
31  If not depth is pass to the function no restriction are apply to it.
32 
33  /param[in] TrackingParticleRef of a simulated track
34  /param[in] depth of the track history
35  /param[out] boolean that is true when history can be determined
36  */
38  if (enableSimToReco_) {
39  std::pair<reco::TrackBaseRef, double> result = match(tpr, simToReco_, bestMatchByMaxValue_);
40  recotrack_ = result.first;
41  quality_ = result.second;
42  }
43  return HistoryBase::evaluate(tpr);
44  }
45 
47  /* Return false when the track association is not possible (fake track).
48 
49  /param[in] TrackRef to a reco::track
50  /param[out] boolean that is false when a fake track is detected
51  */
53 
55  const reco::TrackBaseRef &recoTrack() const { return recotrack_; }
56 
57  // return the TrackingParticle to which the Track was matched
58  const std::pair<TrackingParticleRef, double> getMatchedTrackingParticle() const {
59  std::pair<TrackingParticleRef, double> result;
60  result.first = trackingParticle_;
61  result.second = quality_;
62 
63  return result;
64  }
65 
66  double quality() const { return quality_; }
67 
68 private:
69  bool newEvent_;
70 
72 
74 
75  double quality_;
76 
78 
80 
82 
84 
86 
88 
90 };
91 
92 #endif
void newEvent(const edm::Event &, const edm::EventSetup &)
Pre-process event information (for accessing reconstruction information)
Definition: TrackHistory.cc:32
bool enableSimToReco_
Definition: TrackHistory.h:73
reco::SimToRecoCollection simToReco_
Definition: TrackHistory.h:89
tuple result
Definition: mps_fire.py:311
edm::InputTag trackProducer_
Definition: TrackHistory.h:77
reco::RecoToSimCollection recoToSim_
Definition: TrackHistory.h:87
TrackingParticleRef trackingParticle_
Definition: TrackHistory.h:85
This class traces the simulated and generated history of a given track.
Definition: TrackHistory.h:17
bool enableRecoToSim_
Definition: TrackHistory.h:73
edm::InputTag trackAssociator_
Definition: TrackHistory.h:81
TrackHistory(const edm::ParameterSet &, edm::ConsumesCollector &&)
Constructor by pset.
Definition: TrackHistory.cc:4
double quality_
Definition: TrackHistory.h:75
Base class to all the history types.
Definition: HistoryBase.h:12
bool evaluate(TrackingParticleRef tpr)
Evaluate track history using a TrackingParticleRef.
Definition: HistoryBase.h:96
bool evaluate(TrackingParticleRef tpr)
Evaluate track history using a TrackingParticleRef.
Definition: TrackHistory.h:37
bool bestMatchByMaxValue_
Definition: TrackHistory.h:71
edm::InputTag trackingTruth_
Definition: TrackHistory.h:79
double quality() const
Definition: TrackHistory.h:66
const reco::TrackBaseRef & recoTrack() const
Return a reference to the reconstructed track.
Definition: TrackHistory.h:55
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:58
reco::TrackBaseRef recotrack_
Definition: TrackHistory.h:83