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 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
TrackHistory::bestMatchByMaxValue_
bool bestMatchByMaxValue_
Definition: TrackHistory.h:71
ESHandle.h
TrackHistory::newEvent
void newEvent(const edm::Event &, const edm::EventSetup &)
Pre-process event information (for accessing reconstruction information)
Definition: TrackHistory.cc:33
TrackHistory::recoToSim_
reco::RecoToSimCollection recoToSim_
Definition: TrackHistory.h:87
TrackHistory::enableRecoToSim_
bool enableRecoToSim_
Definition: TrackHistory.h:73
TrackHistory::trackProducer_
edm::InputTag trackProducer_
Definition: TrackHistory.h:77
TrackHistory::getMatchedTrackingParticle
const std::pair< TrackingParticleRef, double > getMatchedTrackingParticle() const
Definition: TrackHistory.h:58
TrackHistory::recoTrack
const reco::TrackBaseRef & recoTrack() const
Return a reference to the reconstructed track.
Definition: TrackHistory.h:55
edm::Ref< TrackingParticleCollection >
TrackFwd.h
HistoryBase.h
TrackHistory::trackingParticle_
TrackingParticleRef trackingParticle_
Definition: TrackHistory.h:85
TrackToTrackingParticleAssociator.h
TrackHistory::trackAssociator_
edm::InputTag trackAssociator_
Definition: TrackHistory.h:81
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
edm::AssociationMap< edm::OneToManyWithQualityGeneric< edm::View< reco::Track >, TrackingParticleCollection, double > >
TrackHistory::recotrack_
reco::TrackBaseRef recotrack_
Definition: TrackHistory.h:83
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
HistoryBase
Base class to all the history types.
Definition: HistoryBase.h:12
TrackHistory::trackingTruth_
edm::InputTag trackingTruth_
Definition: TrackHistory.h:79
edm::EventSetup
Definition: EventSetup.h:57
TrackHistory::simToReco_
reco::SimToRecoCollection simToReco_
Definition: TrackHistory.h:89
TrackHistory::enableSimToReco_
bool enableSimToReco_
Definition: TrackHistory.h:73
TrackHistory::TrackHistory
TrackHistory(const edm::ParameterSet &, edm::ConsumesCollector &&)
Constructor by pset.
Definition: TrackHistory.cc:5
TrackHistory::quality_
double quality_
Definition: TrackHistory.h:75
Utils.h
TrackHistory
This class traces the simulated and generated history of a given track.
Definition: TrackHistory.h:17
EventSetup.h
edm::RefToBase< reco::Track >
TrackHistory::evaluate
bool evaluate(TrackingParticleRef tpr)
Evaluate track history using a TrackingParticleRef.
Definition: TrackHistory.h:37
mps_fire.result
result
Definition: mps_fire.py:311
ConsumesCollector.h
ParameterSet.h
edm::Event
Definition: Event.h:73
TrackHistory::quality
double quality() const
Definition: TrackHistory.h:66
HistoryBase::evaluate
bool evaluate(TrackingParticleRef tpr)
Evaluate track history using a TrackingParticleRef.
Definition: HistoryBase.h:96
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
TrackHistory::newEvent_
bool newEvent_
Definition: TrackHistory.h:69