CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef std::vector
< reco::IPTagInfo< Container,
Base > > 
Product
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

template<>
void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
template<>
void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
 IPProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~IPProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (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::auto_ptr
< HistogramProbabilityEstimator
m_probabilityEstimator
 
bool m_useDB
 
bool m_useTrackQuality
 
edm::EDGetTokenT
< reco::VertexCollection
token_primaryVertex
 

Additional Inherited Members

- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 135 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 137 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 196 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, and IPProducer< Container, Base, Helper >::token_primaryVertex.

196  :
197  m_config(iConfig),m_helper(iConfig,consumesCollector())
198 {
201 
202  token_primaryVertex = consumes<reco::VertexCollection>(m_config.getParameter<edm::InputTag>("primaryVertex"));
203 
204  m_computeProbabilities = m_config.getParameter<bool>("computeProbabilities");
205  m_computeGhostTrack = m_config.getParameter<bool>("computeGhostTrack");
206  m_ghostTrackPriorDeltaR = m_config.getParameter<double>("ghostTrackPriorDeltaR");
207  m_cutPixelHits = m_config.getParameter<int>("minimumNumberOfPixelHits");
208  m_cutTotalHits = m_config.getParameter<int>("minimumNumberOfHits");
209  m_cutMaxTIP = m_config.getParameter<double>("maximumTransverseImpactParameter");
210  m_cutMinPt = m_config.getParameter<double>("minimumTransverseMomentum");
211  m_cutMaxChiSquared = m_config.getParameter<double>("maximumChiSquared");
212  m_cutMaxLIP = m_config.getParameter<double>("maximumLongitudinalImpactParameter");
213  m_directionWithTracks = m_config.getParameter<bool>("jetDirectionUsingTracks");
214  m_directionWithGhostTrack = m_config.getParameter<bool>("jetDirectionUsingGhostTrack");
215  m_useTrackQuality = m_config.getParameter<bool>("useTrackQuality");
216 
217  if (m_computeGhostTrack)
218  produces<reco::TrackCollection>("ghostTracks");
219  produces<Product>();
220 }
T getParameter(std::string const &) const
double m_cutMaxChiSquared
Definition: IPProducer.h:163
bool m_directionWithGhostTrack
Definition: IPProducer.h:166
unsigned long long m_calibrationCacheId3D
Definition: IPProducer.h:156
double m_cutMaxTIP
Definition: IPProducer.h:161
unsigned long long m_calibrationCacheId2D
Definition: IPProducer.h:155
double m_cutMinPt
Definition: IPProducer.h:162
bool m_useTrackQuality
Definition: IPProducer.h:167
int m_cutTotalHits
Definition: IPProducer.h:160
double m_ghostTrackPriorDeltaR
Definition: IPProducer.h:153
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
int m_cutPixelHits
Definition: IPProducer.h:159
Helper m_helper
Definition: IPProducer.h:168
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex
Definition: IPProducer.h:149
bool m_directionWithTracks
Definition: IPProducer.h:165
const edm::ParameterSet & m_config
Definition: IPProducer.h:148
bool m_computeProbabilities
Definition: IPProducer.h:151
bool m_computeGhostTrack
Definition: IPProducer.h:152
double m_cutMaxLIP
Definition: IPProducer.h:164
template<class Container , class Base , class Helper >
IPProducer< Container, Base, Helper >::~IPProducer ( )

Definition at line 222 of file IPProducer.h.

223 {
224 }

Member Function Documentation

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

Definition at line 432 of file IPProducer.h.

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

433  {
434  using namespace edm;
435  using namespace edm::eventsetup;
436 
437  const EventSetupRecord & re2D= iSetup.get<BTagTrackProbability2DRcd>();
438  const EventSetupRecord & re3D= iSetup.get<BTagTrackProbability3DRcd>();
439  unsigned long long cacheId2D= re2D.cacheIdentifier();
440  unsigned long long cacheId3D= re3D.cacheIdentifier();
441 
442  if(cacheId2D!=m_calibrationCacheId2D || cacheId3D!=m_calibrationCacheId3D ) //Calibration changed
443  {
444  //iSetup.get<BTagTrackProbabilityRcd>().get(calib);
446  iSetup.get<BTagTrackProbability2DRcd>().get(calib2DHandle);
448  iSetup.get<BTagTrackProbability3DRcd>().get(calib3DHandle);
449 
450  const TrackProbabilityCalibration * ca2D= calib2DHandle.product();
451  const TrackProbabilityCalibration * ca3D= calib3DHandle.product();
452 
454 
455  }
456  m_calibrationCacheId3D=cacheId3D;
457  m_calibrationCacheId2D=cacheId2D;
458 }
unsigned long long cacheIdentifier() const
unsigned long long m_calibrationCacheId3D
Definition: IPProducer.h:156
unsigned long long m_calibrationCacheId2D
Definition: IPProducer.h:155
std::auto_ptr< HistogramProbabilityEstimator > m_probabilityEstimator
Definition: IPProducer.h:154
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
template<class Container , class Base , class Helper >
static void IPProducer< Container, Base, Helper >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 463 of file IPProducer.h.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), and HLT_25ns14e33_v1_cff::InputTag.

463  {
464 
466  desc.add<double>("maximumTransverseImpactParameter",0.2);
467  desc.add<int>("minimumNumberOfHits",8);
468  desc.add<double>("minimumTransverseMomentum",1.0);
469  desc.add<edm::InputTag>("primaryVertex",edm::InputTag("offlinePrimaryVertices"));
470  desc.add<double>("maximumLongitudinalImpactParameter",17.0);
471  desc.add<bool>("computeGhostTrack",true);
472  desc.add<double>("ghostTrackPriorDeltaR",0.03);
473  desc.add<edm::InputTag>("jetTracks",edm::InputTag("ak4JetTracksAssociatorAtVertexPF"));
474  desc.add<bool>("jetDirectionUsingGhostTrack",false);
475  desc.add<int>("minimumNumberOfPixelHits",2);
476  desc.add<bool>("jetDirectionUsingTracks",false);
477  desc.add<bool>("computeProbabilities",true);
478  desc.add<bool>("useTrackQuality",false);
479  desc.add<double>("maximumChiSquared",5.0);
480  descriptions.addDefault(desc);
481 }
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)

Definition at line 484 of file IPProducer.h.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), edm::ParameterSetDescription::addOptional(), and HLT_25ns14e33_v1_cff::InputTag.

484  {
485 
487  desc.add<double>("maximumTransverseImpactParameter",0.2);
488  desc.add<int>("minimumNumberOfHits",8);
489  desc.add<double>("minimumTransverseMomentum",1.0);
490  desc.add<edm::InputTag>("primaryVertex",edm::InputTag("offlinePrimaryVertices"));
491  desc.add<double>("maximumLongitudinalImpactParameter",17.0);
492  desc.add<bool>("computeGhostTrack",true);
493  desc.add<double>("maxDeltaR",0.4);
494  desc.add<edm::InputTag>("candidates",edm::InputTag("particleFlow"));
495  desc.add<bool>("jetDirectionUsingGhostTrack",false);
496  desc.add<int>("minimumNumberOfPixelHits",2);
497  desc.add<bool>("jetDirectionUsingTracks",false);
498  desc.add<bool>("computeProbabilities",true);
499  desc.add<bool>("useTrackQuality",false);
500  desc.add<edm::InputTag>("jets",edm::InputTag("ak4PFJetsCHS"));
501  desc.add<double>("ghostTrackPriorDeltaR",0.03);
502  desc.add<double>("maximumChiSquared",5.0);
503  desc.addOptional<bool>("explicitJTA",false);
504  descriptions.addDefault(desc);
505 }
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 
)
virtual

Implements edm::stream::EDProducerBase.

Definition at line 231 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::EventSetup::get(), edm::Event::getByToken(), 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(), reco::TrackBase::normalizedChi2(), reco::HitPattern::numberOfValidHits(), reco::TrackBase::numberOfValidHits(), reco::HitPattern::numberOfValidPixelHits(), AlCaHLTBitMon_ParallelJobs::p, p1, p2, reco::GhostTrackPrediction::position(), reco::Vertex::position(), reco::GhostTrackPrediction::positionError(), reco::GhostTrackPrediction::prediction(), HLT_25ns14e33_v1_cff::primaryVertex, reco::TrackBase::pt(), edm::Event::put(), MetAnalyzer::pv(), query::result, TrackCollections2monitor_cff::selectedTracks, IPTools::signedImpactParameter3D(), IPTools::signedTransverseImpactParameter(), edmStreamStallGrapher::states, reco::btag::toTrack(), reco::GhostTrackState::track(), reco::TransientTrack::track(), testEve_cfg::tracks, and hltvertexperformanceanalyzer_cfi::Vertex.

232 {
233  // Update probability estimator if event setup is changed
235  checkEventSetup(iSetup);
236 
237 
239  iEvent.getByToken(token_primaryVertex, primaryVertex);
240 
242  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", builder);
243  // m_algo.setTransientTrackBuilder(builder.product());
244 
245  // output collections
246  std::auto_ptr<Product> result(new Product);
247 
248  std::auto_ptr<reco::TrackCollection> ghostTracks;
249  reco::TrackRefProd ghostTrackRefProd;
250  if (m_computeGhostTrack) {
251  ghostTracks.reset(new reco::TrackCollection);
252  ghostTrackRefProd = iEvent.getRefBeforePut<reco::TrackCollection>("ghostTracks");
253  }
254 
255  // use first pv of the collection
256  reco::Vertex dummy;
257  const reco::Vertex *pv = &dummy;
259  if (primaryVertex->size() != 0) {
260  pv = &*primaryVertex->begin();
261  // we always use the first vertex (at the moment)
263  } else { // create a dummy PV
265  e(0, 0) = 0.0015 * 0.0015;
266  e(1, 1) = 0.0015 * 0.0015;
267  e(2, 2) = 15. * 15.;
268  reco::Vertex::Point p(0, 0, 0);
269  dummy = reco::Vertex(p, e, 0, 0, 0);
270  }
271 
272  std::vector<Base> baseTagInfos = m_helper.makeBaseVector(iEvent);
273  for(typename std::vector<Base>::const_iterator it = baseTagInfos.begin(); it != baseTagInfos.end(); it++) {
274  Container tracks = m_helper.tracks(*it);
275  math::XYZVector jetMomentum = it->jet()->momentum();
276 
277  if (m_directionWithTracks) {
278  jetMomentum *= 0.5;
279  for(typename Container::const_iterator itTrack = tracks.begin();
280  itTrack != tracks.end(); ++itTrack)
281  if (reco::btag::toTrack(*itTrack)->numberOfValidHits() >= m_cutTotalHits) //minimal quality cuts
282  jetMomentum += (*itTrack)->momentum();
283  }
284 
286  std::vector<reco::TransientTrack> transientTracks;
287 
288  for(typename Container::const_iterator itTrack = tracks.begin();
289  itTrack != tracks.end(); ++itTrack) {
290  reco::TransientTrack transientTrack = builder->build(*itTrack);
291  const reco::Track & track = transientTrack.track(); //**itTrack;
292  /* cout << " pt " << track.pt() <<
293  " d0 " << fabs(track.d0()) <<
294  " #hit " << track.hitPattern().numberOfValidHits()<<
295  " ipZ " << fabs(track.dz()-pv->z())<<
296  " chi2 " << track.normalizedChi2()<<
297  " #pixel " << track.hitPattern().numberOfValidPixelHits()<< endl;
298 */
299  if (track.pt() > m_cutMinPt &&
300  track.hitPattern().numberOfValidHits() >= m_cutTotalHits && // min num tracker hits
303  std::abs(track.dxy(pv->position())) < m_cutMaxTIP &&
304  std::abs(track.dz(pv->position())) < m_cutMaxLIP) {
305 // std::cout << "selected" << std::endl;
306  selectedTracks.push_back(*itTrack);
307  transientTracks.push_back(transientTrack);
308  }
309  }
310 // std::cout <<"SIZE: " << transientTracks.size() << std::endl;
311  GlobalVector direction(jetMomentum.x(), jetMomentum.y(), jetMomentum.z());
312 
313  std::auto_ptr<reco::GhostTrack> ghostTrack;
314  reco::TrackRef ghostTrackRef;
315  if (m_computeGhostTrack) {
316  reco::GhostTrackFitter fitter;
319  ghostTrack.reset(new reco::GhostTrack(fitter.fit(origin, error, direction,
321  transientTracks)));
322 
323 /*
324  if (std::sqrt(jetMomentum.Perp2()) > 30) {
325  double offset = ghostTrack->prediction().lambda(origin);
326  std::cout << "------------------ jet pt " << std::sqrt(jetMomentum.Perp2()) << std::endl;
327  const std::vector<GhostTrackState> *states = &ghostTrack->states();
328  for(std::vector<GhostTrackState>::const_iterator state = states->begin();
329  state != states->end(); ++state) {
330  double dist = state->lambda() - offset;
331  double err = state->lambdaError(ghostTrack->prediction(), error);
332  double ipSig = IPTools::signedImpactParameter3D(state->track(), direction, *pv).second.significance();
333  double axisDist = state->axisDistance(ghostTrack->prediction());
334  std::cout << state->track().impactPointState().freeState()->momentum().perp()
335  << ": " << dist << "/" << err << " [" << (dist / err) << "], ipsig = " << ipSig << ", dist = " << axisDist << ", w = " << state->weight() << std::endl;
336  }
337  }
338 */
339  ghostTrackRef = reco::TrackRef(ghostTrackRefProd, ghostTracks->size());
340  ghostTracks->push_back(*ghostTrack);
341 
343  const reco::GhostTrackPrediction &pred = ghostTrack->prediction();
344  double lambda = pred.lambda(origin);
345  dummy = reco::Vertex(RecoVertex::convertPos(pred.position(lambda)),
347  0, 0, 0);
348  pv = &dummy;
349  direction = pred.direction();
350  }
351  }
352 
353  std::vector<float> prob2D, prob3D;
354  std::vector<reco::btag::TrackIPData> ipData;
355 
356  for(unsigned int ind = 0; ind < transientTracks.size(); ind++) {
357  const reco::TransientTrack &transientTrack = transientTracks[ind];
358  const reco::Track & track = transientTrack.track();
359 
360  reco::btag::TrackIPData trackIP;
361  trackIP.ip3d = IPTools::signedImpactParameter3D(transientTrack, direction, *pv).second;
362  trackIP.ip2d = IPTools::signedTransverseImpactParameter(transientTrack, direction, *pv).second;
363 
364  TrajectoryStateOnSurface closest =
366  *pv, direction,
367  transientTrack.field());
368  if (closest.isValid())
369  trackIP.closestToJetAxis = closest.globalPosition();
370 
371  // TODO: cross check if it is the same using other methods
372  trackIP.distanceToJetAxis = IPTools::jetTrackDistance(transientTrack, direction, *pv).second;
373 
374  if (ghostTrack.get()) {
375  const std::vector<reco::GhostTrackState> &states = ghostTrack->states();
376  std::vector<reco::GhostTrackState>::const_iterator pos =
377  std::find_if(states.begin(), states.end(),
378  bind(std::equal_to<reco::TransientTrack>(),
379  bind(&reco::GhostTrackState::track, _1),
380  transientTrack));
381 
382  if (pos != states.end() && pos->isValid()) {
383  VertexDistance3D dist;
384  const reco::GhostTrackPrediction &pred = ghostTrack->prediction();
385  GlobalPoint p1 = pos->tsos().globalPosition();
386  GlobalError e1 = pos->tsos().cartesianError().position();
387  GlobalPoint p2 = pred.position(pos->lambda());
388  GlobalError e2 = pred.positionError(pos->lambda());
389  trackIP.closestToGhostTrack = p1;
390  trackIP.distanceToGhostTrack = dist.distance(VertexState(p1, e1),
391  VertexState(p2, e2));
392  trackIP.ghostTrackWeight = pos->weight();
393  } else {
394  trackIP.distanceToGhostTrack = Measurement1D(-1. -1.);
395  trackIP.ghostTrackWeight = 0.;
396  }
397  } else {
398  trackIP.distanceToGhostTrack = Measurement1D(-1. -1.);
399  trackIP.ghostTrackWeight = 1.;
400  }
401 
402  ipData.push_back(trackIP);
403 
405  //probability with 3D ip
406  std::pair<bool,double> probability = m_probabilityEstimator->probability(m_useTrackQuality, 0,ipData.back().ip3d.significance(),track,*(it->jet()),*pv);
407  prob3D.push_back(probability.first ? probability.second : -1.);
408 
409  //probability with 2D ip
410  probability = m_probabilityEstimator->probability(m_useTrackQuality,1,ipData.back().ip2d.significance(),track,*(it->jet()),*pv);
411  prob2D.push_back(probability.first ? probability.second : -1.);
412  }
413  }
414 
415  result->push_back(typename Product::value_type(ipData, prob2D, prob3D, selectedTracks,
416  *it, pvRef, direction, ghostTrackRef));
417  }
418 
420  iEvent.put(ghostTracks, "ghostTracks");
421  iEvent.put(result);
422 }
virtual Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const
reco::Vertex::Point convertPos(const GlobalPoint &p)
double m_cutMaxChiSquared
Definition: IPProducer.h:163
bool m_directionWithGhostTrack
Definition: IPProducer.h:166
EcalChannelStatus Container
double lambda(const GlobalPoint &point) const
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:514
const TransientTrack & track() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
int numberOfValidHits() const
Definition: HitPattern.h:734
Measurement1D ip2d
Definition: IPTagInfo.h:31
double m_cutMaxTIP
Definition: IPProducer.h:161
std::pair< bool, Measurement1D > signedTransverseImpactParameter(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:50
reco::Vertex::Error convertError(const GlobalError &ge)
Definition: ConvertError.h:8
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:13
double m_cutMinPt
Definition: IPProducer.h:162
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:43
std::pair< bool, Measurement1D > signedImpactParameter3D(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:71
GlobalPoint globalPosition() const
bool m_useTrackQuality
Definition: IPProducer.h:167
TrajectoryStateOnSurface closestApproachToJet(const TrajectoryStateOnSurface &state, const reco::Vertex &vertex, const GlobalVector &aJetDirection, const MagneticField *field)
Definition: IPTools.cc:177
const MagneticField * field() const
std::auto_ptr< HistogramProbabilityEstimator > m_probabilityEstimator
Definition: IPProducer.h:154
const reco::Track * toTrack(const reco::TrackBaseRef &t)
Definition: IPTagInfo.h:24
const Point & position() const
position
Definition: Vertex.h:106
int m_cutTotalHits
Definition: IPProducer.h:160
std::vector< reco::IPTagInfo< Container, Base > > Product
Definition: IPProducer.h:137
std::pair< double, Measurement1D > jetTrackDistance(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:200
double m_ghostTrackPriorDeltaR
Definition: IPProducer.h:153
GhostTrack fit(const GlobalPoint &priorPosition, const GlobalError &priorError, const GlobalVector &direction, double coneRadius, const std::vector< TransientTrack > &tracks) const
void checkEventSetup(const edm::EventSetup &iSetup)
Definition: IPProducer.h:432
Measurement1D distanceToGhostTrack
Definition: IPTagInfo.h:34
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
int m_cutPixelHits
Definition: IPProducer.h:159
Helper m_helper
Definition: IPProducer.h:168
double pt() const
track transverse momentum
Definition: TrackBase.h:574
tuple result
Definition: query.py:137
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex
Definition: IPProducer.h:149
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:773
Measurement1D ip3d
Definition: IPTagInfo.h:32
Container::value_type value_type
double p2[4]
Definition: TauolaWrapper.h:90
bool m_directionWithTracks
Definition: IPProducer.h:165
RefProd< PROD > getRefBeforePut()
Definition: Event.h:133
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:562
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:411
tuple tracks
Definition: testEve_cfg.py:39
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
const T & get() const
Definition: EventSetup.h:55
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:19
Error error() const
return SMatrix
Definition: Vertex.h:129
Measurement1D distanceToJetAxis
Definition: IPTagInfo.h:33
const Vector & prediction() const
double p1[4]
Definition: TauolaWrapper.h:89
GlobalPoint position(double lambda=0.) const
GlobalPoint closestToGhostTrack
Definition: IPTagInfo.h:30
int numberOfValidPixelHits() const
Definition: HitPattern.h:749
TrajectoryStateOnSurface impactPointState() const
bool m_computeProbabilities
Definition: IPProducer.h:151
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:544
bool m_computeGhostTrack
Definition: IPProducer.h:152
double m_cutMaxLIP
Definition: IPProducer.h:164
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 155 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 156 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 152 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 151 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 148 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 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_cutMaxLIP
private

Definition at line 164 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 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_cutMinPt
private

Definition at line 162 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 159 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 160 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 166 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 165 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 153 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 168 of file IPProducer.h.

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

Definition at line 154 of file IPProducer.h.

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

Definition at line 157 of file IPProducer.h.

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

Definition at line 167 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 149 of file IPProducer.h.

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