CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
IPProducer< Container, Base, Helper > Class Template Reference

#include <IPProducer.h>

Inheritance diagram for IPProducer< Container, Base, Helper >:
edm::stream::EDProducer<>

Public Types

typedef std::vector
< reco::IPTagInfo< Container,
Base > > 
Product
 
- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Public Member Functions

template<>
void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
template<>
void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
 IPProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~IPProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void checkEventSetup (const edm::EventSetup &iSetup)
 

Private Attributes

unsigned long long m_calibrationCacheId2D
 
unsigned long long m_calibrationCacheId3D
 
bool m_computeGhostTrack
 
bool m_computeProbabilities
 
const edm::ParameterSetm_config
 
double m_cutMaxChiSquared
 
double m_cutMaxLIP
 
double m_cutMaxTIP
 
double m_cutMinPt
 
int m_cutPixelHits
 
int m_cutTotalHits
 
bool m_directionWithGhostTrack
 
bool m_directionWithTracks
 
double m_ghostTrackPriorDeltaR
 
Helper m_helper
 
std::unique_ptr
< HistogramProbabilityEstimator
m_probabilityEstimator
 
bool m_useDB
 
bool m_useTrackQuality
 
edm::ESGetToken
< TrackProbabilityCalibration,
BTagTrackProbability2DRcd
token_calib2D
 
edm::ESGetToken
< TrackProbabilityCalibration,
BTagTrackProbability3DRcd
token_calib3D
 
edm::EDGetTokenT
< reco::VertexCollection
token_primaryVertex
 
edm::ESGetToken
< TransientTrackBuilder,
TransientTrackRecord
token_trackBuilder
 

Detailed Description

template<class Container, class Base, class Helper>
class IPProducer< Container, Base, Helper >

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 130 of file IPProducer.h.

Member Typedef Documentation

template<class Container, class Base, class Helper>
typedef std::vector<reco::IPTagInfo<Container, Base> > IPProducer< Container, Base, Helper >::Product

Definition at line 132 of file IPProducer.h.

Constructor & Destructor Documentation

template<class Container , class Base , class Helper >
IPProducer< Container, Base, Helper >::IPProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 191 of file IPProducer.h.

References edm::ParameterSet::getParameter(), IPProducer< Container, Base, Helper >::m_calibrationCacheId2D, IPProducer< Container, Base, Helper >::m_calibrationCacheId3D, IPProducer< Container, Base, Helper >::m_computeGhostTrack, IPProducer< Container, Base, Helper >::m_computeProbabilities, IPProducer< Container, Base, Helper >::m_config, IPProducer< Container, Base, Helper >::m_cutMaxChiSquared, IPProducer< Container, Base, Helper >::m_cutMaxLIP, IPProducer< Container, Base, Helper >::m_cutMaxTIP, IPProducer< Container, Base, Helper >::m_cutMinPt, IPProducer< Container, Base, Helper >::m_cutPixelHits, IPProducer< Container, Base, Helper >::m_cutTotalHits, IPProducer< Container, Base, Helper >::m_directionWithGhostTrack, IPProducer< Container, Base, Helper >::m_directionWithTracks, IPProducer< Container, Base, Helper >::m_ghostTrackPriorDeltaR, IPProducer< Container, Base, Helper >::m_useTrackQuality, IPProducer< Container, Base, Helper >::token_calib2D, IPProducer< Container, Base, Helper >::token_calib3D, IPProducer< Container, Base, Helper >::token_primaryVertex, and IPProducer< Container, Base, Helper >::token_trackBuilder.

192  : m_config(iConfig), m_helper(iConfig, consumesCollector()) {
195 
196  token_primaryVertex = consumes<reco::VertexCollection>(m_config.getParameter<edm::InputTag>("primaryVertex"));
198  esConsumes<TransientTrackBuilder, TransientTrackRecord>(edm::ESInputTag("", "TransientTrackBuilder"));
199  token_calib2D = esConsumes<TrackProbabilityCalibration, BTagTrackProbability2DRcd>();
200  token_calib3D = esConsumes<TrackProbabilityCalibration, BTagTrackProbability3DRcd>();
201 
202  m_computeProbabilities = m_config.getParameter<bool>("computeProbabilities");
203  m_computeGhostTrack = m_config.getParameter<bool>("computeGhostTrack");
204  m_ghostTrackPriorDeltaR = m_config.getParameter<double>("ghostTrackPriorDeltaR");
205  m_cutPixelHits = m_config.getParameter<int>("minimumNumberOfPixelHits");
206  m_cutTotalHits = m_config.getParameter<int>("minimumNumberOfHits");
207  m_cutMaxTIP = m_config.getParameter<double>("maximumTransverseImpactParameter");
208  m_cutMinPt = m_config.getParameter<double>("minimumTransverseMomentum");
209  m_cutMaxChiSquared = m_config.getParameter<double>("maximumChiSquared");
210  m_cutMaxLIP = m_config.getParameter<double>("maximumLongitudinalImpactParameter");
211  m_directionWithTracks = m_config.getParameter<bool>("jetDirectionUsingTracks");
212  m_directionWithGhostTrack = m_config.getParameter<bool>("jetDirectionUsingGhostTrack");
213  m_useTrackQuality = m_config.getParameter<bool>("useTrackQuality");
214 
215  if (m_computeGhostTrack)
216  produces<reco::TrackCollection>("ghostTracks");
217  produces<Product>();
218 }
double m_cutMaxChiSquared
Definition: IPProducer.h:161
bool m_directionWithGhostTrack
Definition: IPProducer.h:164
unsigned long long m_calibrationCacheId3D
Definition: IPProducer.h:154
edm::ESGetToken< TrackProbabilityCalibration, BTagTrackProbability2DRcd > token_calib2D
Definition: IPProducer.h:146
double m_cutMaxTIP
Definition: IPProducer.h:159
unsigned long long m_calibrationCacheId2D
Definition: IPProducer.h:153
double m_cutMinPt
Definition: IPProducer.h:160
bool m_useTrackQuality
Definition: IPProducer.h:165
edm::ESGetToken< TrackProbabilityCalibration, BTagTrackProbability3DRcd > token_calib3D
Definition: IPProducer.h:147
int m_cutTotalHits
Definition: IPProducer.h:158
double m_ghostTrackPriorDeltaR
Definition: IPProducer.h:151
int m_cutPixelHits
Definition: IPProducer.h:157
Helper m_helper
Definition: IPProducer.h:166
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex
Definition: IPProducer.h:144
bool m_directionWithTracks
Definition: IPProducer.h:163
const edm::ParameterSet & m_config
Definition: IPProducer.h:143
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > token_trackBuilder
Definition: IPProducer.h:145
bool m_computeProbabilities
Definition: IPProducer.h:149
bool m_computeGhostTrack
Definition: IPProducer.h:150
double m_cutMaxLIP
Definition: IPProducer.h:162
template<class Container , class Base , class Helper >
IPProducer< Container, Base, Helper >::~IPProducer ( )
override

Definition at line 221 of file IPProducer.h.

221 {}

Member Function Documentation

template<class Container , class Base , class Helper >
void IPProducer< Container, Base, Helper >::checkEventSetup ( const edm::EventSetup iSetup)
private

Definition at line 420 of file IPProducer.h.

References edm::eventsetup::EventSetupRecord::cacheIdentifier(), edm::EventSetup::get(), edm::EventSetup::getHandle(), and edm::ESHandle< class >::product().

420  {
423  unsigned long long cacheId2D = re2D.cacheIdentifier();
424  unsigned long long cacheId3D = re3D.cacheIdentifier();
425 
426  if (cacheId2D != m_calibrationCacheId2D || cacheId3D != m_calibrationCacheId3D) //Calibration changed
427  {
428  //iSetup.get<BTagTrackProbabilityRcd>().get(calib);
431 
432  const TrackProbabilityCalibration* ca2D = calib2DHandle.product();
433  const TrackProbabilityCalibration* ca3D = calib3DHandle.product();
434 
435  m_probabilityEstimator = std::make_unique<HistogramProbabilityEstimator>(ca3D, ca2D);
436  }
437  m_calibrationCacheId3D = cacheId3D;
438  m_calibrationCacheId2D = cacheId2D;
439 }
unsigned long long cacheIdentifier() const
unsigned long long m_calibrationCacheId3D
Definition: IPProducer.h:154
edm::ESGetToken< TrackProbabilityCalibration, BTagTrackProbability2DRcd > token_calib2D
Definition: IPProducer.h:146
unsigned long long m_calibrationCacheId2D
Definition: IPProducer.h:153
edm::ESGetToken< TrackProbabilityCalibration, BTagTrackProbability3DRcd > token_calib3D
Definition: IPProducer.h:147
std::unique_ptr< HistogramProbabilityEstimator > m_probabilityEstimator
Definition: IPProducer.h:152
T const * product() const
Definition: ESHandle.h:86
T get() const
Definition: EventSetup.h:88
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:157
template<class Container, class Base, class Helper>
static void IPProducer< Container, Base, Helper >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static
template<>
void IPProducer< reco::TrackRefVector, reco::JTATagInfo, IPProducerHelpers::FromJTA >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inline

Definition at line 444 of file IPProducer.h.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), submitPVResolutionJobs::desc, and HLT_FULL_cff::InputTag.

445  {
447  desc.add<double>("maximumTransverseImpactParameter", 0.2);
448  desc.add<int>("minimumNumberOfHits", 8);
449  desc.add<double>("minimumTransverseMomentum", 1.0);
450  desc.add<edm::InputTag>("primaryVertex", edm::InputTag("offlinePrimaryVertices"));
451  desc.add<double>("maximumLongitudinalImpactParameter", 17.0);
452  desc.add<bool>("computeGhostTrack", true);
453  desc.add<double>("ghostTrackPriorDeltaR", 0.03);
454  desc.add<edm::InputTag>("jetTracks", edm::InputTag("ak4JetTracksAssociatorAtVertexPF"));
455  desc.add<bool>("jetDirectionUsingGhostTrack", false);
456  desc.add<int>("minimumNumberOfPixelHits", 2);
457  desc.add<bool>("jetDirectionUsingTracks", false);
458  desc.add<bool>("computeProbabilities", true);
459  desc.add<bool>("useTrackQuality", false);
460  desc.add<double>("maximumChiSquared", 5.0);
461  descriptions.addDefault(desc);
462 }
void addDefault(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
template<>
void IPProducer< std::vector< reco::CandidatePtr >, reco::JetTagInfo, IPProducerHelpers::FromJetAndCands >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inline

Definition at line 466 of file IPProducer.h.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), edm::ParameterSetDescription::addOptional(), submitPVResolutionJobs::desc, and HLT_FULL_cff::InputTag.

467  {
469  desc.add<double>("maximumTransverseImpactParameter", 0.2);
470  desc.add<int>("minimumNumberOfHits", 8);
471  desc.add<double>("minimumTransverseMomentum", 1.0);
472  desc.add<edm::InputTag>("primaryVertex", edm::InputTag("offlinePrimaryVertices"));
473  desc.add<double>("maximumLongitudinalImpactParameter", 17.0);
474  desc.add<bool>("computeGhostTrack", true);
475  desc.add<double>("maxDeltaR", 0.4);
476  desc.add<edm::InputTag>("candidates", edm::InputTag("particleFlow"));
477  desc.add<bool>("jetDirectionUsingGhostTrack", false);
478  desc.add<int>("minimumNumberOfPixelHits", 2);
479  desc.add<bool>("jetDirectionUsingTracks", false);
480  desc.add<bool>("computeProbabilities", true);
481  desc.add<bool>("useTrackQuality", false);
482  desc.add<edm::InputTag>("jets", edm::InputTag("ak4PFJetsCHS"));
483  desc.add<double>("ghostTrackPriorDeltaR", 0.03);
484  desc.add<double>("maximumChiSquared", 5.0);
485  desc.addOptional<bool>("explicitJTA", false);
486  descriptions.addDefault(desc);
487 }
void addDefault(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
template<class Container , class Base , class Helper >
void IPProducer< Container, Base, Helper >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 228 of file IPProducer.h.

References funct::abs(), IPTools::closestApproachToJet(), reco::btag::TrackIPData::closestToGhostTrack, reco::btag::TrackIPData::closestToJetAxis, RecoVertex::convertError(), RecoVertex::convertPos(), reco::GhostTrackPrediction::direction(), VertexDistance3D::distance(), reco::btag::TrackIPData::distanceToGhostTrack, reco::btag::TrackIPData::distanceToJetAxis, reco::TrackBase::dxy(), reco::TrackBase::dz(), alignCSCRings::e, relativeConstraints::error, reco::Vertex::error(), reco::TransientTrack::field(), reco::GhostTrackFitter::fit(), edm::Event::getByToken(), edm::EventSetup::getHandle(), edm::Event::getRefBeforePut(), reco::btag::TrackIPData::ghostTrackWeight, TrajectoryStateOnSurface::globalPosition(), reco::TrackBase::hitPattern(), reco::TransientTrack::impactPointState(), reco::btag::TrackIPData::ip2d, reco::btag::TrackIPData::ip3d, TrajectoryStateOnSurface::isValid(), IPTools::jetTrackDistance(), reco::GhostTrackPrediction::lambda(), eostools::move(), reco::TrackBase::normalizedChi2(), reco::HitPattern::numberOfValidHits(), reco::TrackBase::numberOfValidHits(), reco::HitPattern::numberOfValidPixelHits(), AlCaHLTBitMon_ParallelJobs::p, fireworks::p1, fireworks::p2, reco::GhostTrackPrediction::position(), reco::Vertex::position(), reco::GhostTrackPrediction::positionError(), reco::GhostTrackPrediction::prediction(), beam_dqm_sourceclient-live_cfg::primaryVertex, reco::TrackBase::pt(), edm::Event::put(), MetAnalyzer::pv(), mps_fire::result, TrackCollections2monitor_cff::selectedTracks, IPTools::signedImpactParameter3D(), IPTools::signedTransverseImpactParameter(), reco::btag::toTrack(), reco::TransientTrack::track(), HLT_FULL_cff::track, and tracks.

228  {
229  // Update probability estimator if event setup is changed
231  checkEventSetup(iSetup);
232 
234  iEvent.getByToken(token_primaryVertex, primaryVertex);
235 
237  // m_algo.setTransientTrackBuilder(builder.product());
238 
239  // output collections
240  auto result = std::make_unique<Product>();
241 
242  std::unique_ptr<reco::TrackCollection> ghostTracks;
243  reco::TrackRefProd ghostTrackRefProd;
244  if (m_computeGhostTrack) {
245  ghostTracks = std::make_unique<reco::TrackCollection>();
246  ghostTrackRefProd = iEvent.getRefBeforePut<reco::TrackCollection>("ghostTracks");
247  }
248 
249  // use first pv of the collection
250  reco::Vertex dummy;
251  const reco::Vertex* pv = &dummy;
253  if (!primaryVertex->empty()) {
254  pv = &*primaryVertex->begin();
255  // we always use the first vertex (at the moment)
257  } else { // create a dummy PV
259  e(0, 0) = 0.0015 * 0.0015;
260  e(1, 1) = 0.0015 * 0.0015;
261  e(2, 2) = 15. * 15.;
262  reco::Vertex::Point p(0, 0, 0);
263  dummy = reco::Vertex(p, e, 0, 0, 0);
264  }
265 
266  std::vector<Base> baseTagInfos = m_helper.makeBaseVector(iEvent);
267  for (typename std::vector<Base>::const_iterator it = baseTagInfos.begin(); it != baseTagInfos.end(); it++) {
268  Container tracks = m_helper.tracks(*it);
269  math::XYZVector jetMomentum = it->jet()->momentum();
270 
271  if (m_directionWithTracks) {
272  jetMomentum *= 0.5;
273  for (typename Container::const_iterator itTrack = tracks.begin(); itTrack != tracks.end(); ++itTrack)
274  if (reco::btag::toTrack(*itTrack)->numberOfValidHits() >= m_cutTotalHits) //minimal quality cuts
275  jetMomentum += (*itTrack)->momentum();
276  }
277 
279  std::vector<reco::TransientTrack> transientTracks;
280 
281  for (typename Container::const_iterator itTrack = tracks.begin(); itTrack != tracks.end(); ++itTrack) {
282  reco::TransientTrack transientTrack = builder->build(*itTrack);
283  const reco::Track& track = transientTrack.track(); //**itTrack;
284  /* cout << " pt " << track.pt() <<
285  " d0 " << fabs(track.d0()) <<
286  " #hit " << track.hitPattern().numberOfValidHits()<<
287  " ipZ " << fabs(track.dz()-pv->z())<<
288  " chi2 " << track.normalizedChi2()<<
289  " #pixel " << track.hitPattern().numberOfValidPixelHits()<< endl;
290 */
291  if (track.pt() > m_cutMinPt &&
292  track.hitPattern().numberOfValidHits() >= m_cutTotalHits && // min num tracker hits
294  track.normalizedChi2() < m_cutMaxChiSquared && std::abs(track.dxy(pv->position())) < m_cutMaxTIP &&
295  std::abs(track.dz(pv->position())) < m_cutMaxLIP) {
296  // std::cout << "selected" << std::endl;
297  selectedTracks.push_back(*itTrack);
298  transientTracks.push_back(transientTrack);
299  }
300  }
301  // std::cout <<"SIZE: " << transientTracks.size() << std::endl;
302  GlobalVector direction(jetMomentum.x(), jetMomentum.y(), jetMomentum.z());
303 
304  std::unique_ptr<reco::GhostTrack> ghostTrack;
305  reco::TrackRef ghostTrackRef;
306  if (m_computeGhostTrack) {
307  reco::GhostTrackFitter fitter;
310  ghostTrack = std::make_unique<reco::GhostTrack>(
311  fitter.fit(origin, error, direction, m_ghostTrackPriorDeltaR, transientTracks));
312 
313  /*
314  if (std::sqrt(jetMomentum.Perp2()) > 30) {
315  double offset = ghostTrack->prediction().lambda(origin);
316  std::cout << "------------------ jet pt " << std::sqrt(jetMomentum.Perp2()) << std::endl;
317  const std::vector<GhostTrackState> *states = &ghostTrack->states();
318  for(std::vector<GhostTrackState>::const_iterator state = states->begin();
319  state != states->end(); ++state) {
320  double dist = state->lambda() - offset;
321  double err = state->lambdaError(ghostTrack->prediction(), error);
322  double ipSig = IPTools::signedImpactParameter3D(state->track(), direction, *pv).second.significance();
323  double axisDist = state->axisDistance(ghostTrack->prediction());
324  std::cout << state->track().impactPointState().freeState()->momentum().perp()
325  << ": " << dist << "/" << err << " [" << (dist / err) << "], ipsig = " << ipSig << ", dist = " << axisDist << ", w = " << state->weight() << std::endl;
326  }
327  }
328 */
329  ghostTrackRef = reco::TrackRef(ghostTrackRefProd, ghostTracks->size());
330  ghostTracks->push_back(*ghostTrack);
331 
333  const reco::GhostTrackPrediction& pred = ghostTrack->prediction();
334  double lambda = pred.lambda(origin);
335  dummy = reco::Vertex(RecoVertex::convertPos(pred.position(lambda)),
337  0,
338  0,
339  0);
340  pv = &dummy;
341  direction = pred.direction();
342  }
343  }
344 
345  std::vector<float> prob2D, prob3D;
346  std::vector<reco::btag::TrackIPData> ipData;
347 
348  for (unsigned int ind = 0; ind < transientTracks.size(); ind++) {
349  const reco::TransientTrack& transientTrack = transientTracks[ind];
350  const reco::Track& track = transientTrack.track();
351 
352  reco::btag::TrackIPData trackIP;
353  trackIP.ip3d = IPTools::signedImpactParameter3D(transientTrack, direction, *pv).second;
354  trackIP.ip2d = IPTools::signedTransverseImpactParameter(transientTrack, direction, *pv).second;
355 
356  TrajectoryStateOnSurface closest =
357  IPTools::closestApproachToJet(transientTrack.impactPointState(), *pv, direction, transientTrack.field());
358  if (closest.isValid())
359  trackIP.closestToJetAxis = closest.globalPosition();
360 
361  // TODO: cross check if it is the same using other methods
362  trackIP.distanceToJetAxis = IPTools::jetTrackDistance(transientTrack, direction, *pv).second;
363 
364  if (ghostTrack.get()) {
365  const std::vector<reco::GhostTrackState>& states = ghostTrack->states();
366  std::vector<reco::GhostTrackState>::const_iterator pos =
367  std::find_if(states.begin(), states.end(), [&](auto& arg) { return arg.track() == transientTrack; });
368 
369  if (pos != states.end() && pos->isValid()) {
370  VertexDistance3D dist;
371  const reco::GhostTrackPrediction& pred = ghostTrack->prediction();
372  GlobalPoint p1 = pos->tsos().globalPosition();
373  GlobalError e1 = pos->tsos().cartesianError().position();
374  GlobalPoint p2 = pred.position(pos->lambda());
375  GlobalError e2 = pred.positionError(pos->lambda());
376  trackIP.closestToGhostTrack = p1;
377  trackIP.distanceToGhostTrack = dist.distance(VertexState(p1, e1), VertexState(p2, e2));
378  trackIP.ghostTrackWeight = pos->weight();
379  } else {
380  trackIP.distanceToGhostTrack = Measurement1D(0., -1.);
381  trackIP.ghostTrackWeight = 0.;
382  }
383  } else {
384  trackIP.distanceToGhostTrack = Measurement1D(0., -1.);
385  trackIP.ghostTrackWeight = 1.;
386  }
387 
388  ipData.push_back(trackIP);
389 
391  //probability with 3D ip
392  std::pair<bool, double> probability = m_probabilityEstimator->probability(
393  m_useTrackQuality, 0, ipData.back().ip3d.significance(), track, *(it->jet()), *pv);
394  prob3D.push_back(probability.first ? probability.second : -1.);
395 
396  //probability with 2D ip
397  probability = m_probabilityEstimator->probability(
398  m_useTrackQuality, 1, ipData.back().ip2d.significance(), track, *(it->jet()), *pv);
399  prob2D.push_back(probability.first ? probability.second : -1.);
400  }
401  }
402 
403  result->push_back(
404  typename Product::value_type(ipData, prob2D, prob3D, selectedTracks, *it, pvRef, direction, ghostTrackRef));
405  }
406 
408  iEvent.put(std::move(ghostTracks), "ghostTracks");
409  iEvent.put(std::move(result));
410 }
reco::Vertex::Point convertPos(const GlobalPoint &p)
double m_cutMaxChiSquared
Definition: IPProducer.h:161
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool m_directionWithGhostTrack
Definition: IPProducer.h:164
double lambda(const GlobalPoint &point) const
const TString p2
Definition: fwPaths.cc:13
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:593
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
int numberOfValidHits() const
Definition: HitPattern.h:811
Measurement1D ip2d
Definition: IPTagInfo.h:31
double m_cutMaxTIP
Definition: IPProducer.h:159
std::pair< bool, Measurement1D > signedTransverseImpactParameter(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:57
reco::Vertex::Error convertError(const GlobalError &ge)
Definition: ConvertError.h:8
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
double m_cutMinPt
Definition: IPProducer.h:160
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:44
std::pair< bool, Measurement1D > signedImpactParameter3D(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:81
GlobalPoint globalPosition() const
bool m_useTrackQuality
Definition: IPProducer.h:165
TrajectoryStateOnSurface closestApproachToJet(const TrajectoryStateOnSurface &state, const reco::Vertex &vertex, const GlobalVector &aJetDirection, const MagneticField *field)
Definition: IPTools.cc:182
const MagneticField * field() const
auto const & tracks
cannot be loose
const reco::Track * toTrack(const reco::TrackBaseRef &t)
Definition: IPTagInfo.h:24
const Point & position() const
position
Definition: Vertex.h:127
A arg
Definition: Factorize.h:31
int m_cutTotalHits
Definition: IPProducer.h:158
std::pair< double, Measurement1D > jetTrackDistance(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:206
double m_ghostTrackPriorDeltaR
Definition: IPProducer.h:151
GhostTrack fit(const GlobalPoint &priorPosition, const GlobalError &priorError, const GlobalVector &direction, double coneRadius, const std::vector< TransientTrack > &tracks) const
tuple result
Definition: mps_fire.py:311
void checkEventSetup(const edm::EventSetup &iSetup)
Definition: IPProducer.h:420
std::unique_ptr< HistogramProbabilityEstimator > m_probabilityEstimator
Definition: IPProducer.h:152
Measurement1D distanceToGhostTrack
Definition: IPTagInfo.h:34
int m_cutPixelHits
Definition: IPProducer.h:157
Helper m_helper
Definition: IPProducer.h:166
double pt() const
track transverse momentum
Definition: TrackBase.h:637
def move
Definition: eostools.py:511
const TString p1
Definition: fwPaths.cc:12
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex
Definition: IPProducer.h:144
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:798
Measurement1D ip3d
Definition: IPTagInfo.h:32
bool m_directionWithTracks
Definition: IPProducer.h:163
RefProd< PROD > getRefBeforePut()
Definition: Event.h:158
Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const override
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:622
GlobalPoint closestToJetAxis
Definition: IPTagInfo.h:29
const Track & track() const
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:504
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > token_trackBuilder
Definition: IPProducer.h:145
Error error() const
return SMatrix
Definition: Vertex.h:163
Measurement1D distanceToJetAxis
Definition: IPTagInfo.h:33
const Vector & prediction() const
GlobalPoint position(double lambda=0.) const
GlobalPoint closestToGhostTrack
Definition: IPTagInfo.h:30
int numberOfValidPixelHits() const
Definition: HitPattern.h:825
TrajectoryStateOnSurface impactPointState() const
bool m_computeProbabilities
Definition: IPProducer.h:149
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:157
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:608
bool m_computeGhostTrack
Definition: IPProducer.h:150
edm::AssociationVector< reco::JetRefBaseProd, Values > Container
double m_cutMaxLIP
Definition: IPProducer.h:162
GlobalError positionError(double lambda=0.) const
const GlobalVector direction() const

Member Data Documentation

template<class Container, class Base, class Helper>
unsigned long long IPProducer< Container, Base, Helper >::m_calibrationCacheId2D
private

Definition at line 153 of file IPProducer.h.

Referenced by IPProducer< Container, Base, Helper >::IPProducer().

template<class Container, class Base, class Helper>
unsigned long long IPProducer< Container, Base, Helper >::m_calibrationCacheId3D
private

Definition at line 154 of file IPProducer.h.

Referenced by IPProducer< Container, Base, Helper >::IPProducer().

template<class Container, class Base, class Helper>
bool IPProducer< Container, Base, Helper >::m_computeGhostTrack
private

Definition at line 150 of file IPProducer.h.

Referenced by IPProducer< Container, Base, Helper >::IPProducer().

template<class Container, class Base, class Helper>
bool IPProducer< Container, Base, Helper >::m_computeProbabilities
private

Definition at line 149 of file IPProducer.h.

Referenced by IPProducer< Container, Base, Helper >::IPProducer().

template<class Container, class Base, class Helper>
const edm::ParameterSet& IPProducer< Container, Base, Helper >::m_config
private

Definition at line 143 of file IPProducer.h.

Referenced by IPProducer< Container, Base, Helper >::IPProducer().

template<class Container, class Base, class Helper>
double IPProducer< Container, Base, Helper >::m_cutMaxChiSquared
private

Definition at line 161 of file IPProducer.h.

Referenced by IPProducer< Container, Base, Helper >::IPProducer().

template<class Container, class Base, class Helper>
double IPProducer< Container, Base, Helper >::m_cutMaxLIP
private

Definition at line 162 of file IPProducer.h.

Referenced by IPProducer< Container, Base, Helper >::IPProducer().

template<class Container, class Base, class Helper>
double IPProducer< Container, Base, Helper >::m_cutMaxTIP
private

Definition at line 159 of file IPProducer.h.

Referenced by IPProducer< Container, Base, Helper >::IPProducer().

template<class Container, class Base, class Helper>
double IPProducer< Container, Base, Helper >::m_cutMinPt
private

Definition at line 160 of file IPProducer.h.

Referenced by IPProducer< Container, Base, Helper >::IPProducer().

template<class Container, class Base, class Helper>
int IPProducer< Container, Base, Helper >::m_cutPixelHits
private

Definition at line 157 of file IPProducer.h.

Referenced by IPProducer< Container, Base, Helper >::IPProducer().

template<class Container, class Base, class Helper>
int IPProducer< Container, Base, Helper >::m_cutTotalHits
private

Definition at line 158 of file IPProducer.h.

Referenced by IPProducer< Container, Base, Helper >::IPProducer().

template<class Container, class Base, class Helper>
bool IPProducer< Container, Base, Helper >::m_directionWithGhostTrack
private

Definition at line 164 of file IPProducer.h.

Referenced by IPProducer< Container, Base, Helper >::IPProducer().

template<class Container, class Base, class Helper>
bool IPProducer< Container, Base, Helper >::m_directionWithTracks
private

Definition at line 163 of file IPProducer.h.

Referenced by IPProducer< Container, Base, Helper >::IPProducer().

template<class Container, class Base, class Helper>
double IPProducer< Container, Base, Helper >::m_ghostTrackPriorDeltaR
private

Definition at line 151 of file IPProducer.h.

Referenced by IPProducer< Container, Base, Helper >::IPProducer().

template<class Container, class Base, class Helper>
Helper IPProducer< Container, Base, Helper >::m_helper
private

Definition at line 166 of file IPProducer.h.

template<class Container, class Base, class Helper>
std::unique_ptr<HistogramProbabilityEstimator> IPProducer< Container, Base, Helper >::m_probabilityEstimator
private

Definition at line 152 of file IPProducer.h.

template<class Container, class Base, class Helper>
bool IPProducer< Container, Base, Helper >::m_useDB
private

Definition at line 155 of file IPProducer.h.

template<class Container, class Base, class Helper>
bool IPProducer< Container, Base, Helper >::m_useTrackQuality
private

Definition at line 165 of file IPProducer.h.

Referenced by IPProducer< Container, Base, Helper >::IPProducer().

template<class Container, class Base, class Helper>
edm::ESGetToken<TrackProbabilityCalibration, BTagTrackProbability2DRcd> IPProducer< Container, Base, Helper >::token_calib2D
private

Definition at line 146 of file IPProducer.h.

Referenced by IPProducer< Container, Base, Helper >::IPProducer().

template<class Container, class Base, class Helper>
edm::ESGetToken<TrackProbabilityCalibration, BTagTrackProbability3DRcd> IPProducer< Container, Base, Helper >::token_calib3D
private

Definition at line 147 of file IPProducer.h.

Referenced by IPProducer< Container, Base, Helper >::IPProducer().

template<class Container, class Base, class Helper>
edm::EDGetTokenT<reco::VertexCollection> IPProducer< Container, Base, Helper >::token_primaryVertex
private

Definition at line 144 of file IPProducer.h.

Referenced by IPProducer< Container, Base, Helper >::IPProducer().

template<class Container, class Base, class Helper>
edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> IPProducer< Container, Base, Helper >::token_trackBuilder
private

Definition at line 145 of file IPProducer.h.

Referenced by IPProducer< Container, Base, Helper >::IPProducer().