CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
TransientTrackBuilder Class Reference

#include <TransientTrackBuilder.h>

Public Member Functions

reco::TransientTrack build (const reco::Track *p) const
 
reco::TransientTrack build (const reco::Track &p) const
 
reco::TransientTrack build (const reco::GsfTrack *p) const
 
reco::TransientTrack build (const reco::GsfTrack &p) const
 
reco::TransientTrack build (const reco::TrackRef *p) const
 
reco::TransientTrack build (const reco::TrackRef &p) const
 
reco::TransientTrack build (const reco::GsfTrackRef *p) const
 
reco::TransientTrack build (const reco::GsfTrackRef &p) const
 
reco::TransientTrack build (const reco::CandidatePtr *p) const
 
reco::TransientTrack build (const reco::CandidatePtr &p) const
 
std::vector< reco::TransientTrackbuild (const edm::Handle< reco::TrackCollection > &trkColl) const
 
std::vector< reco::TransientTrackbuild (const edm::Handle< reco::GsfTrackCollection > &trkColl) const
 
std::vector< reco::TransientTrackbuild (const edm::Handle< edm::View< reco::Track > > &trkColl) const
 
std::vector< reco::TransientTrackbuild (const edm::Handle< reco::TrackCollection > &trkColl, const edm::ValueMap< float > &trackTimes, const edm::ValueMap< float > &trackTimeResos) const
 
std::vector< reco::TransientTrackbuild (const edm::Handle< reco::GsfTrackCollection > &trkColl, const edm::ValueMap< float > &trackTimes, const edm::ValueMap< float > &trackTimeResos) const
 
std::vector< reco::TransientTrackbuild (const edm::Handle< edm::View< reco::Track > > &trkColl, const edm::ValueMap< float > &trackTimes, const edm::ValueMap< float > &trackTimeResos) const
 
std::vector< reco::TransientTrackbuild (const edm::Handle< reco::TrackCollection > &trkColl, const reco::BeamSpot &beamSpot) const
 
std::vector< reco::TransientTrackbuild (const edm::Handle< reco::GsfTrackCollection > &trkColl, const reco::BeamSpot &beamSpot) const
 
std::vector< reco::TransientTrackbuild (const edm::Handle< edm::View< reco::Track > > &trkColl, const reco::BeamSpot &beamSpot) const
 
std::vector< reco::TransientTrackbuild (const edm::Handle< reco::TrackCollection > &trkColl, const reco::BeamSpot &beamSpot, const edm::ValueMap< float > &trackTimes, const edm::ValueMap< float > &trackTimeResos) const
 
std::vector< reco::TransientTrackbuild (const edm::Handle< reco::GsfTrackCollection > &trkColl, const reco::BeamSpot &beamSpot, const edm::ValueMap< float > &trackTimes, const edm::ValueMap< float > &trackTimeResos) const
 
std::vector< reco::TransientTrackbuild (const edm::Handle< edm::View< reco::Track > > &trkColl, const reco::BeamSpot &beamSpot, const edm::ValueMap< float > &trackTimes, const edm::ValueMap< float > &trackTimeResos) const
 
reco::TransientTrack build (const FreeTrajectoryState &fts) const
 
const MagneticFieldfield () const
 
const edm::ESHandle< GlobalTrackingGeometrytrackingGeometry () const
 
 TransientTrackBuilder (const MagneticField *field, const edm::ESHandle< GlobalTrackingGeometry > &trackingGeometry)
 

Private Attributes

const MagneticFieldtheField
 
edm::ESHandle< GlobalTrackingGeometrytheTrackingGeometry
 

Detailed Description

Helper class to build TransientTrack from the persistent Track. This is obtained from the eventSetup, as given in the example in the test directory.

Definition at line 16 of file TransientTrackBuilder.h.

Constructor & Destructor Documentation

TransientTrackBuilder::TransientTrackBuilder ( const MagneticField field,
const edm::ESHandle< GlobalTrackingGeometry > &  trackingGeometry 
)
inline

Definition at line 18 of file TransientTrackBuilder.h.

References ecalDrivenElectronSeedsParameters_cff::beamSpot, build(), and AlCaHLTBitMon_ParallelJobs::p.

19  :
20  theField(field) , theTrackingGeometry(trackingGeometry) {}
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry

Member Function Documentation

TransientTrack TransientTrackBuilder::build ( const reco::Track p) const

Definition at line 20 of file TransientTrackBuilder.cc.

Referenced by dqm::TrackAnalyzer::analyze(), MuonEnergyDepositAnalyzer::analyze(), SiPixelTrackResidualSource::analyze(), BDHadronTrackMonitoringAnalyzer::analyze(), PrimaryVertexValidation::analyze(), HIPTwoBodyDecayAnalyzer::analyzeTrackCollection(), pat::helper::VertexingHelper::associate(), CaloRecoTauAlgorithm::buildCaloTau(), ConversionProducer::buildCollection(), PFRecoTauAlgorithm::buildPFTau(), HPSPFRecoTauAlgorithm::buildPFTau(), btagbtvdeep::TrackInfoBuilder::buildTrackInfo(), tthelpers::buildTT(), pat::LeptonVertexSignificance::calculate(), PrimaryVertexAssignment::chargedHadronVertex(), reco::JetSignalVertexCompatibilityAlgo::convert(), dqm::TrackAnalyzer::fillHistosForState(), NuclearVertexBuilder::FillVertexWithAdaptVtxFitter(), DisappearingMuonsSkimming::filter(), HIPTwoBodyDecayAnalyzer::fitDimuonVertex(), EGammaMvaEleEstimator::IDIsoCombinedMvaValue(), QualityCutsAnalyzer::LoopOverJetTracksAssociation(), EGammaMvaEleEstimatorCSA14::mvaValue(), EGammaMvaEleEstimator::mvaValue(), reco::tau::RecoTauImpactParameterSignificancePlugin::operator()(), CheckHitPattern::operator()(), PFConversionProducer::produce(), SoftPFMuonTagInfoProducer::produce(), PFTrackProducer::produce(), SoftPFElectronTagInfoProducer::produce(), Onia2MuMuPAT::produce(), TrackTimeValueMapProducer::produce(), PFTauPrimaryVertexProducerBase::produce(), PFTauTransverseImpactParameters::produce(), PFTauSecondaryVertexProducer::produce(), pat::PATElectronProducer::produce(), PixelJetPuId::produce(), BoostedDoubleSVProducer::produce(), DeepFlavourTagInfoProducer::produce(), pat::PATMuonProducer::produce(), PFTau3ProngReco::produce(), TemplatedSecondaryVertexProducer< IPTI, VTX >::produce(), IPProducer< Container, Base, Helper >::produce(), HPSPFRecoTauAlgorithm::refitThreeProng(), CSCOverlapsAlignmentAlgorithm::run(), ConvBremPFTrackFinder::runConvBremFinder(), PrimaryVertexResolution::sortTracksByPt(), ImpactParameterAlgorithm::tag(), SoftLepton::tag(), TrackEfficiencyMonitor::testSTATracks(), TrackEfficiencyMonitor::testTrackerTracks(), TransientTrackBuilder(), TrackExtenderWithMTDT< TrackCollection >::tryBTLLayers(), TrackExtenderWithMTDT< TrackCollection >::tryETLLayers(), and BPHDecayVertex::tTracks().

20  {
22 }
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
TransientTrack TransientTrackBuilder::build ( const reco::Track p) const

Definition at line 24 of file TransientTrackBuilder.cc.

24  {
26 }
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
TransientTrack TransientTrackBuilder::build ( const reco::GsfTrack p) const

Definition at line 28 of file TransientTrackBuilder.cc.

TransientTrack TransientTrackBuilder::build ( const reco::GsfTrack p) const

Definition at line 32 of file TransientTrackBuilder.cc.

TransientTrack TransientTrackBuilder::build ( const reco::TrackRef p) const

Definition at line 51 of file TransientTrackBuilder.cc.

51  {
53 }
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
TransientTrack TransientTrackBuilder::build ( const reco::TrackRef p) const

Definition at line 55 of file TransientTrackBuilder.cc.

55  {
57 }
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
TransientTrack TransientTrackBuilder::build ( const reco::GsfTrackRef p) const

Definition at line 60 of file TransientTrackBuilder.cc.

TransientTrack TransientTrackBuilder::build ( const reco::GsfTrackRef p) const

Definition at line 64 of file TransientTrackBuilder.cc.

TransientTrack TransientTrackBuilder::build ( const reco::CandidatePtr p) const

Definition at line 36 of file TransientTrackBuilder.cc.

References edm::Ptr< T >::get(), reco::PFCandidate::isTimeValid(), reco::PFCandidate::time(), pat::PackedCandidate::time(), reco::PFCandidate::timeError(), and pat::PackedCandidate::timeError().

36  {
37  reco::PFCandidatePtr tryPF(*t);
39  if( tryPF.get() != nullptr && tryPF->isTimeValid() ) {
40  return TransientTrack(*t, tryPF->time(), tryPF->timeError(), theField, theTrackingGeometry);
41  } else if ( tryPacked.get() != nullptr && tryPacked->timeError() > 0.f ) {
42  return TransientTrack(*t, (double)tryPacked->time(), (double)tryPacked->timeError(), theField, theTrackingGeometry);
43  }
45 }
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
TransientTrack TransientTrackBuilder::build ( const reco::CandidatePtr p) const

Definition at line 47 of file TransientTrackBuilder.cc.

47  {
48  return this->build(&t);
49 }
reco::TransientTrack build(const reco::Track *p) const
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< reco::TrackCollection > &  trkColl) const

Definition at line 69 of file TransientTrackBuilder.cc.

References mps_fire::i.

70 {
71  vector<TransientTrack> ttVect;
72  ttVect.reserve((*trkColl).size());
73  for (unsigned int i = 0; i < (*trkColl).size() ; i++) {
74  ttVect.push_back(TransientTrack(TrackRef(trkColl, i), theField, theTrackingGeometry));
75  }
76  return ttVect;
77 }
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:21
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< reco::GsfTrackCollection > &  trkColl) const

Definition at line 80 of file TransientTrackBuilder.cc.

References mps_fire::i.

81 {
82  vector<TransientTrack> ttVect;
83  ttVect.reserve((*trkColl).size());
84  for (unsigned int i = 0; i < (*trkColl).size() ; i++) {
85  ttVect.push_back( TransientTrack(
87  }
88  return ttVect;
89 }
edm::Ref< GsfTrackCollection > GsfTrackRef
persistent reference to a GsfTrack
Definition: GsfTrackFwd.h:13
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< edm::View< reco::Track > > &  trkColl) const

Definition at line 92 of file TransientTrackBuilder.cc.

References mps_fire::i.

93 {
94  vector<TransientTrack> ttVect;
95  ttVect.reserve((*trkColl).size());
96  for (unsigned int i = 0; i < (*trkColl).size() ; i++) {
97  const Track * trk = &(*trkColl)[i];
98  const GsfTrack * gsfTrack = dynamic_cast<const GsfTrack *>(trk);
99  if (gsfTrack) {
100  ttVect.push_back( TransientTrack(
101  new GsfTransientTrack(RefToBase<Track>(trkColl, i).castTo<GsfTrackRef>(), theField, theTrackingGeometry)) );
102  } else { // gsf
103  ttVect.push_back(TransientTrack(RefToBase<Track>(trkColl, i).castTo<TrackRef>(), theField, theTrackingGeometry));
104  }
105  }
106  return ttVect;
107 }
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< reco::TrackCollection > &  trkColl,
const edm::ValueMap< float > &  trackTimes,
const edm::ValueMap< float > &  trackTimeResos 
) const

Definition at line 110 of file TransientTrackBuilder.cc.

References MillePedeFileConverter_cfg::e, mps_fire::i, edm::isNotFinite(), and protons_cff::time.

113 {
114  vector<TransientTrack> ttVect;
115  ttVect.reserve((*trkColl).size());
116  for (unsigned int i = 0; i < (*trkColl).size() ; i++) {
117  TrackRef ref(trkColl, i);
118  double time = trackTimes[ref];
119  double timeReso = trackTimeResos[ref];
120  timeReso = ( timeReso > 1e-6 ? timeReso : defaultInvalidTrackReso ); // make the error much larger than the BS time width
121  if( edm::isNotFinite(time) ) {
122  time = 0.0;
123  timeReso = defaultInvalidTrackReso;
124  }
125  ttVect.push_back(TransientTrack(ref, time, timeReso, theField, theTrackingGeometry));
126  }
127  return ttVect;
128 }
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< reco::GsfTrackCollection > &  trkColl,
const edm::ValueMap< float > &  trackTimes,
const edm::ValueMap< float > &  trackTimeResos 
) const

Definition at line 131 of file TransientTrackBuilder.cc.

References MillePedeFileConverter_cfg::e, mps_fire::i, edm::isNotFinite(), and protons_cff::time.

134 {
135  vector<TransientTrack> ttVect;
136  ttVect.reserve((*trkColl).size());
137  for (unsigned int i = 0; i < (*trkColl).size() ; i++) {
138  GsfTrackRef ref(trkColl, i);
139  double time = trackTimes[ref];
140  double timeReso = trackTimeResos[ref];
141  timeReso = ( timeReso > 1e-6 ? timeReso : defaultInvalidTrackReso ); // make the error much larger than the BS time width
142  if( edm::isNotFinite(time) ) {
143  time = 0.0;
144  timeReso = defaultInvalidTrackReso;
145  }
146  ttVect.push_back( TransientTrack(
147  new GsfTransientTrack(ref, time, timeReso, theField, theTrackingGeometry)) );
148  }
149  return ttVect;
150 }
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< edm::View< reco::Track > > &  trkColl,
const edm::ValueMap< float > &  trackTimes,
const edm::ValueMap< float > &  trackTimeResos 
) const

Definition at line 153 of file TransientTrackBuilder.cc.

References MillePedeFileConverter_cfg::e, mps_fire::i, edm::isNotFinite(), and protons_cff::time.

156 {
157  vector<TransientTrack> ttVect;
158  ttVect.reserve((*trkColl).size());
159  for (unsigned int i = 0; i < (*trkColl).size() ; i++) {
160  const Track * trk = &(*trkColl)[i];
161  const GsfTrack * gsfTrack = dynamic_cast<const GsfTrack *>(trk);
162  if (gsfTrack) {
163  GsfTrackRef ref = RefToBase<Track>(trkColl, i).castTo<GsfTrackRef>();
164  double time = trackTimes[ref];
165  double timeReso = trackTimeResos[ref];
166  timeReso = ( timeReso > 1e-6 ? timeReso : defaultInvalidTrackReso ); // make the error much larger than the BS time width
167  if( edm::isNotFinite(time) ) {
168  time = 0.0;
169  timeReso = defaultInvalidTrackReso;
170  }
171  ttVect.push_back( TransientTrack(
172  new GsfTransientTrack(RefToBase<Track>(trkColl, i).castTo<GsfTrackRef>(), time, timeReso, theField, theTrackingGeometry)) );
173  } else { // gsf
174  TrackRef ref = RefToBase<Track>(trkColl, i).castTo<TrackRef>();
175  double time = trackTimes[ref];
176  double timeReso = trackTimeResos[ref];
177  timeReso = ( timeReso > 1e-6 ? timeReso : defaultInvalidTrackReso ); // make the error much larger than the BS time width
178  if( edm::isNotFinite(time) ) {
179  time = 0.0;
180  timeReso = defaultInvalidTrackReso;
181  }
182  ttVect.push_back(TransientTrack(RefToBase<Track>(trkColl, i).castTo<TrackRef>(), time, timeReso, theField, theTrackingGeometry));
183  }
184  }
185  return ttVect;
186 }
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< reco::TrackCollection > &  trkColl,
const reco::BeamSpot beamSpot 
) const

Definition at line 189 of file TransientTrackBuilder.cc.

References mps_fire::i.

191 {
192  vector<TransientTrack> ttVect = build(trkColl);
193  for (unsigned int i = 0; i < ttVect.size() ; i++) {
194  ttVect[i].setBeamSpot(beamSpot);
195  }
196  return ttVect;
197 }
reco::TransientTrack build(const reco::Track *p) const
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< reco::GsfTrackCollection > &  trkColl,
const reco::BeamSpot beamSpot 
) const

Definition at line 200 of file TransientTrackBuilder.cc.

References mps_fire::i.

202 {
203  vector<TransientTrack> ttVect = build(trkColl);
204  for (unsigned int i = 0; i < ttVect.size() ; i++) {
205  ttVect[i].setBeamSpot(beamSpot);
206  }
207  return ttVect;
208 }
reco::TransientTrack build(const reco::Track *p) const
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< edm::View< reco::Track > > &  trkColl,
const reco::BeamSpot beamSpot 
) const

Definition at line 211 of file TransientTrackBuilder.cc.

References mps_fire::i.

213 {
214  vector<TransientTrack> ttVect = build(trkColl);
215  for (unsigned int i = 0; i < ttVect.size() ; i++) {
216  ttVect[i].setBeamSpot(beamSpot);
217  }
218  return ttVect;
219 }
reco::TransientTrack build(const reco::Track *p) const
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< reco::TrackCollection > &  trkColl,
const reco::BeamSpot beamSpot,
const edm::ValueMap< float > &  trackTimes,
const edm::ValueMap< float > &  trackTimeResos 
) const

Definition at line 222 of file TransientTrackBuilder.cc.

References mps_fire::i.

226 {
227  vector<TransientTrack> ttVect = build(trkColl, trackTimes, trackTimeResos );
228  for (unsigned int i = 0; i < ttVect.size() ; i++) {
229  ttVect[i].setBeamSpot(beamSpot);
230  }
231  return ttVect;
232 }
reco::TransientTrack build(const reco::Track *p) const
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< reco::GsfTrackCollection > &  trkColl,
const reco::BeamSpot beamSpot,
const edm::ValueMap< float > &  trackTimes,
const edm::ValueMap< float > &  trackTimeResos 
) const

Definition at line 235 of file TransientTrackBuilder.cc.

References mps_fire::i.

239 {
240  vector<TransientTrack> ttVect = build(trkColl, trackTimes, trackTimeResos);
241  for (unsigned int i = 0; i < ttVect.size() ; i++) {
242  ttVect[i].setBeamSpot(beamSpot);
243  }
244  return ttVect;
245 }
reco::TransientTrack build(const reco::Track *p) const
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< edm::View< reco::Track > > &  trkColl,
const reco::BeamSpot beamSpot,
const edm::ValueMap< float > &  trackTimes,
const edm::ValueMap< float > &  trackTimeResos 
) const

Definition at line 248 of file TransientTrackBuilder.cc.

References mps_fire::i.

252 {
253  vector<TransientTrack> ttVect = build(trkColl, trackTimes, trackTimeResos);
254  for (unsigned int i = 0; i < ttVect.size() ; i++) {
255  ttVect[i].setBeamSpot(beamSpot);
256  }
257  return ttVect;
258 }
reco::TransientTrack build(const reco::Track *p) const
TransientTrack TransientTrackBuilder::build ( const FreeTrajectoryState fts) const
const MagneticField* TransientTrackBuilder::field ( ) const
inline

Definition at line 71 of file TransientTrackBuilder.h.

References theField.

Referenced by PFTau3ProngReco::produce().

71 {return theField;}
const MagneticField * theField
const edm::ESHandle<GlobalTrackingGeometry> TransientTrackBuilder::trackingGeometry ( ) const
inline

Definition at line 72 of file TransientTrackBuilder.h.

References theTrackingGeometry.

72 {return theTrackingGeometry;}
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry

Member Data Documentation

const MagneticField* TransientTrackBuilder::theField
private

Definition at line 75 of file TransientTrackBuilder.h.

Referenced by field().

edm::ESHandle<GlobalTrackingGeometry> TransientTrackBuilder::theTrackingGeometry
private

Definition at line 76 of file TransientTrackBuilder.h.

Referenced by trackingGeometry().