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 16 of file TransientTrackBuilder.cc.

Referenced by MuonEnergyDepositAnalyzer::analyze(), dqm::TrackAnalyzer::analyze(), CheckHitPattern::analyze(), SiPixelTrackResidualSource::analyze(), BDHadronTrackMonitoringAnalyzer::analyze(), GetTrackTrajInfo::analyze(), PrimaryVertexValidation::analyze(), HIPTwoBodyDecayAnalyzer::analyzeTrackCollection(), pat::helper::VertexingHelper::associate(), CaloRecoTauAlgorithm::buildCaloTau(), ConversionProducer::buildCollection(), PFRecoTauAlgorithm::buildPFTau(), HPSPFRecoTauAlgorithm::buildPFTau(), tthelpers::buildTT(), pat::LeptonVertexSignificance::calculate(), PrimaryVertexAssignment::chargedHadronVertex(), reco::JetSignalVertexCompatibilityAlgo::convert(), PFRecoTauDiscriminationByFlight::discriminate(), dqm::TrackAnalyzer::fillHistosForState(), NuclearVertexBuilder::FillVertexWithAdaptVtxFitter(), HIPTwoBodyDecayAnalyzer::fitDimuonVertex(), EGammaMvaEleEstimator::IDIsoCombinedMvaValue(), QualityCutsAnalyzer::LoopOverJetTracksAssociation(), EGammaMvaEleEstimatorCSA14::mvaValue(), EGammaMvaEleEstimator::mvaValue(), reco::tau::RecoTauImpactParameterSignificancePlugin::operator()(), PFConversionProducer::produce(), SoftPFMuonTagInfoProducer::produce(), PFTrackProducer::produce(), SoftPFElectronTagInfoProducer::produce(), Onia2MuMuPAT::produce(), pat::PATMuonProducer::produce(), TrackTimeValueMapProducer::produce(), PFTauSecondaryVertexProducer::produce(), pat::PATElectronProducer::produce(), PFTauTransverseImpactParameters::produce(), PixelJetPuId::produce(), BoostedDoubleSVProducer::produce(), PFTauPrimaryVertexProducer::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(), and BPHDecayVertex::tTracks().

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

Definition at line 20 of file TransientTrackBuilder.cc.

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

Definition at line 24 of file TransientTrackBuilder.cc.

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

Definition at line 28 of file TransientTrackBuilder.cc.

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

Definition at line 40 of file TransientTrackBuilder.cc.

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

Definition at line 44 of file TransientTrackBuilder.cc.

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

Definition at line 49 of file TransientTrackBuilder.cc.

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

Definition at line 53 of file TransientTrackBuilder.cc.

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

Definition at line 32 of file TransientTrackBuilder.cc.

32  {
34 }
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
TransientTrack TransientTrackBuilder::build ( const reco::CandidatePtr p) const

Definition at line 36 of file TransientTrackBuilder.cc.

36  {
38 }
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< reco::TrackCollection > &  trkColl) const

Definition at line 58 of file TransientTrackBuilder.cc.

References mps_fire::i.

59 {
60  vector<TransientTrack> ttVect;
61  ttVect.reserve((*trkColl).size());
62  for (unsigned int i = 0; i < (*trkColl).size() ; i++) {
63  ttVect.push_back(TransientTrack(TrackRef(trkColl, i), theField, theTrackingGeometry));
64  }
65  return ttVect;
66 }
const MagneticField * theField
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< reco::GsfTrackCollection > &  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(
76  }
77  return ttVect;
78 }
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 81 of file TransientTrackBuilder.cc.

References mps_fire::i.

82 {
83  vector<TransientTrack> ttVect;
84  ttVect.reserve((*trkColl).size());
85  for (unsigned int i = 0; i < (*trkColl).size() ; i++) {
86  const Track * trk = &(*trkColl)[i];
87  const GsfTrack * gsfTrack = dynamic_cast<const GsfTrack *>(trk);
88  if (gsfTrack) {
89  ttVect.push_back( TransientTrack(
90  new GsfTransientTrack(RefToBase<Track>(trkColl, i).castTo<GsfTrackRef>(), theField, theTrackingGeometry)) );
91  } else { // gsf
92  ttVect.push_back(TransientTrack(RefToBase<Track>(trkColl, i).castTo<TrackRef>(), theField, theTrackingGeometry));
93  }
94  }
95  return ttVect;
96 }
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 99 of file TransientTrackBuilder.cc.

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

102 {
103  vector<TransientTrack> ttVect;
104  ttVect.reserve((*trkColl).size());
105  for (unsigned int i = 0; i < (*trkColl).size() ; i++) {
106  TrackRef ref(trkColl, i);
107  double time = trackTimes[ref];
108  double timeReso = trackTimeResos[ref];
109  timeReso = ( timeReso > 1e-6 ? timeReso : defaultInvalidTrackReso ); // make the error much larger than the BS time width
110  if( edm::isNotFinite(time) ) {
111  time = 0.0;
112  timeReso = defaultInvalidTrackReso;
113  }
114  ttVect.push_back(TransientTrack(ref, time, timeReso, theField, theTrackingGeometry));
115  }
116  return ttVect;
117 }
const MagneticField * theField
bool isNotFinite(T x)
Definition: isFinite.h:10
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 120 of file TransientTrackBuilder.cc.

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

123 {
124  vector<TransientTrack> ttVect;
125  ttVect.reserve((*trkColl).size());
126  for (unsigned int i = 0; i < (*trkColl).size() ; i++) {
127  GsfTrackRef ref(trkColl, i);
128  double time = trackTimes[ref];
129  double timeReso = trackTimeResos[ref];
130  timeReso = ( timeReso > 1e-6 ? timeReso : defaultInvalidTrackReso ); // make the error much larger than the BS time width
131  if( edm::isNotFinite(time) ) {
132  time = 0.0;
133  timeReso = defaultInvalidTrackReso;
134  }
135  ttVect.push_back( TransientTrack(
136  new GsfTransientTrack(ref, time, timeReso, theField, theTrackingGeometry)) );
137  }
138  return ttVect;
139 }
const MagneticField * theField
bool isNotFinite(T x)
Definition: isFinite.h:10
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 142 of file TransientTrackBuilder.cc.

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

145 {
146  vector<TransientTrack> ttVect;
147  ttVect.reserve((*trkColl).size());
148  for (unsigned int i = 0; i < (*trkColl).size() ; i++) {
149  const Track * trk = &(*trkColl)[i];
150  const GsfTrack * gsfTrack = dynamic_cast<const GsfTrack *>(trk);
151  if (gsfTrack) {
152  GsfTrackRef ref = RefToBase<Track>(trkColl, i).castTo<GsfTrackRef>();
153  double time = trackTimes[ref];
154  double timeReso = trackTimeResos[ref];
155  timeReso = ( timeReso > 1e-6 ? timeReso : defaultInvalidTrackReso ); // make the error much larger than the BS time width
156  if( edm::isNotFinite(time) ) {
157  time = 0.0;
158  timeReso = defaultInvalidTrackReso;
159  }
160  ttVect.push_back( TransientTrack(
161  new GsfTransientTrack(RefToBase<Track>(trkColl, i).castTo<GsfTrackRef>(), time, timeReso, theField, theTrackingGeometry)) );
162  } else { // gsf
163  TrackRef ref = RefToBase<Track>(trkColl, i).castTo<TrackRef>();
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(RefToBase<Track>(trkColl, i).castTo<TrackRef>(), time, timeReso, theField, theTrackingGeometry));
172  }
173  }
174  return ttVect;
175 }
const MagneticField * theField
bool isNotFinite(T x)
Definition: isFinite.h:10
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
vector< TransientTrack > TransientTrackBuilder::build ( const edm::Handle< reco::TrackCollection > &  trkColl,
const reco::BeamSpot beamSpot 
) const

Definition at line 178 of file TransientTrackBuilder.cc.

References mps_fire::i.

180 {
181  vector<TransientTrack> ttVect = build(trkColl);
182  for (unsigned int i = 0; i < ttVect.size() ; i++) {
183  ttVect[i].setBeamSpot(beamSpot);
184  }
185  return ttVect;
186 }
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 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< edm::View< reco::Track > > &  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< reco::TrackCollection > &  trkColl,
const reco::BeamSpot beamSpot,
const edm::ValueMap< float > &  trackTimes,
const edm::ValueMap< float > &  trackTimeResos 
) const

Definition at line 211 of file TransientTrackBuilder.cc.

References mps_fire::i.

215 {
216  vector<TransientTrack> ttVect = build(trkColl, trackTimes, trackTimeResos );
217  for (unsigned int i = 0; i < ttVect.size() ; i++) {
218  ttVect[i].setBeamSpot(beamSpot);
219  }
220  return ttVect;
221 }
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 224 of file TransientTrackBuilder.cc.

References mps_fire::i.

228 {
229  vector<TransientTrack> ttVect = build(trkColl, trackTimes, trackTimeResos);
230  for (unsigned int i = 0; i < ttVect.size() ; i++) {
231  ttVect[i].setBeamSpot(beamSpot);
232  }
233  return ttVect;
234 }
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 237 of file TransientTrackBuilder.cc.

References mps_fire::i.

241 {
242  vector<TransientTrack> ttVect = build(trkColl, trackTimes, trackTimeResos);
243  for (unsigned int i = 0; i < ttVect.size() ; i++) {
244  ttVect[i].setBeamSpot(beamSpot);
245  }
246  return ttVect;
247 }
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().