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 
10 
14 
16 class TrackHistory : public HistoryBase
17 {
18 
19 public:
20 
22  /* Creates a TrackHistory with association given by pset.
23 
24  /param[in] pset with the configuration values
25  */
27 
29  void newEvent(const edm::Event &, const edm::EventSetup &);
30 
32  /* Return false when the history cannot be determined upto a given depth.
33  If not depth is pass to the function no restriction are apply to it.
34 
35  /param[in] TrackingParticleRef of a simulated track
36  /param[in] depth of the track history
37  /param[out] boolean that is true when history can be determined
38  */
40  {
41  if ( enableSimToReco_ )
42  {
43  std::pair<reco::TrackBaseRef, double> result = match(tpr, simToReco_, bestMatchByMaxValue_);
44  recotrack_ = result.first;
45  quality_ = result.second;
46  }
47  return HistoryBase::evaluate(tpr);
48  }
49 
50 
52  /* Return false when the track association is not possible (fake track).
53 
54  /param[in] TrackRef to a reco::track
55  /param[out] boolean that is false when a fake track is detected
56  */
58 
60  const reco::TrackBaseRef & recoTrack() const
61  {
62  return recotrack_;
63  }
64 
65  double quality() const
66  {
67  return quality_;
68  }
69 
70 private:
71 
72  bool newEvent_;
73 
75 
77 
78  double quality_;
79 
81 
83 
85 
87 
89 
91 
92 };
93 
94 #endif
void newEvent(const edm::Event &, const edm::EventSetup &)
Pre-process event information (for accessing reconstruction information)
Definition: TrackHistory.cc:32
TrackHistory(const edm::ParameterSet &)
Constructor by pset.
Definition: TrackHistory.cc:6
bool enableSimToReco_
Definition: TrackHistory.h:76
reco::SimToRecoCollection simToReco_
Definition: TrackHistory.h:90
tuple result
Definition: query.py:137
edm::InputTag trackProducer_
Definition: TrackHistory.h:80
reco::RecoToSimCollection recoToSim_
Definition: TrackHistory.h:88
This class traces the simulated and generated history of a given track.
Definition: TrackHistory.h:16
bool enableRecoToSim_
Definition: TrackHistory.h:76
double quality_
Definition: TrackHistory.h:78
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:39
bool bestMatchByMaxValue_
Definition: TrackHistory.h:74
edm::InputTag trackingTruth_
Definition: TrackHistory.h:82
double quality() const
Definition: TrackHistory.h:65
const reco::TrackBaseRef & recoTrack() const
Return a reference to the reconstructed track.
Definition: TrackHistory.h:60
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
std::string trackAssociator_
Definition: TrackHistory.h:84
reco::TrackBaseRef recotrack_
Definition: TrackHistory.h:86