CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
reco::tau::RecoTauImpactParameterSignificancePlugin Class Reference
Inheritance diagram for reco::tau::RecoTauImpactParameterSignificancePlugin:
reco::tau::RecoTauModifierPlugin reco::tau::RecoTauEventHolderPlugin reco::tau::RecoTauNamedPlugin

Public Member Functions

void beginEvent () override
 
void operator() (PFTau &tau) const override
 
 RecoTauImpactParameterSignificancePlugin (const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
 
 ~RecoTauImpactParameterSignificancePlugin () override
 
- Public Member Functions inherited from reco::tau::RecoTauModifierPlugin
virtual void endEvent ()
 
 RecoTauModifierPlugin (const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
 
 ~RecoTauModifierPlugin () override
 
- Public Member Functions inherited from reco::tau::RecoTauEventHolderPlugin
const edm::Eventevt () const
 
edm::Eventevt ()
 
const edm::EventSetupevtSetup () const
 
 RecoTauEventHolderPlugin (const edm::ParameterSet &pset)
 
void setup (edm::Event &, const edm::EventSetup &)
 
 ~RecoTauEventHolderPlugin () override
 
- Public Member Functions inherited from reco::tau::RecoTauNamedPlugin
const std::string & name () const
 
 RecoTauNamedPlugin (const edm::ParameterSet &pset)
 
virtual ~RecoTauNamedPlugin ()
 

Private Attributes

const TransientTrackBuilderbuilder_
 
RecoTauVertexAssociator vertexAssociator_
 

Detailed Description

Definition at line 30 of file RecoTauImpactParameterSignificancePlugin.cc.

Constructor & Destructor Documentation

reco::tau::RecoTauImpactParameterSignificancePlugin::RecoTauImpactParameterSignificancePlugin ( const edm::ParameterSet pset,
edm::ConsumesCollector &&  iC 
)
explicit

Definition at line 43 of file RecoTauImpactParameterSignificancePlugin.cc.

45  vertexAssociator_(pset.getParameter<edm::ParameterSet>("qualityCuts"),std::move(iC)){}
T getParameter(std::string const &) const
RecoTauModifierPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
def move(src, dest)
Definition: eostools.py:511
reco::tau::RecoTauImpactParameterSignificancePlugin::~RecoTauImpactParameterSignificancePlugin ( )
inlineoverride

Definition at line 34 of file RecoTauImpactParameterSignificancePlugin.cc.

References beginEvent(), operator()(), and metsig::tau.

34 {}

Member Function Documentation

void reco::tau::RecoTauImpactParameterSignificancePlugin::beginEvent ( )
overridevirtual

Reimplemented from reco::tau::RecoTauModifierPlugin.

Definition at line 47 of file RecoTauImpactParameterSignificancePlugin.cc.

References builder_, reco::tau::RecoTauEventHolderPlugin::evt(), reco::tau::RecoTauEventHolderPlugin::evtSetup(), edm::EventSetup::get(), edm::Ref< C, T, F >::get(), getTrack(), pat::PackedCandidate::hasTrackDetails(), edm::Ref< C, T, F >::isNonnull(), edm::ESHandle< T >::product(), pat::PackedCandidate::pseudoTrack(), reco::tau::RecoTauVertexAssociator::setEvent(), reco::PFCandidate::trackRef(), and vertexAssociator_.

Referenced by ~RecoTauImpactParameterSignificancePlugin().

47  {
49  // Get tranisent track builder.
50  edm::ESHandle<TransientTrackBuilder> myTransientTrackBuilder;
51  evtSetup()->get<TransientTrackRecord>().get("TransientTrackBuilder",
52  myTransientTrackBuilder);
53  builder_= myTransientTrackBuilder.product();
54 }
void setEvent(const edm::Event &evt)
Load the vertices from the event.
const edm::EventSetup * evtSetup() const
T get() const
Definition: EventSetup.h:71
T const * product() const
Definition: ESHandle.h:86
void reco::tau::RecoTauImpactParameterSignificancePlugin::operator() ( PFTau tau) const
overridevirtual

Implements reco::tau::RecoTauModifierPlugin.

Definition at line 76 of file RecoTauImpactParameterSignificancePlugin.cc.

References reco::tau::RecoTauVertexAssociator::associatedVertex(), TransientTrackBuilder::build(), builder_, DEFINE_EDM_PLUGIN, getTrack(), edm::Ptr< T >::isNonnull(), reco::PFTau::jetRef(), reco::PFTau::leadChargedHadrCand(), TauDiscriminatorTools::leadTrack, MetAnalyzer::pv(), reco::PFTau::setleadPFChargedHadrCandsignedSipt(), IPTools::signedImpactParameter3D(), HiIsolationCommonParameters_cff::track, and vertexAssociator_.

Referenced by ~RecoTauImpactParameterSignificancePlugin().

76  {
77  // Get the transient lead track
78  if (tau.leadChargedHadrCand().isNonnull()) {
79  const reco::Track* leadTrack = getTrack(*tau.leadChargedHadrCand());
80  if (leadTrack != nullptr) {
81  const TransientTrack track = builder_->build(leadTrack);
82  GlobalVector direction(tau.jetRef()->px(), tau.jetRef()->py(),
83  tau.jetRef()->pz());
85  // Compute the significance
86  std::pair<bool,Measurement1D> ipsig =
87  IPTools::signedImpactParameter3D(track, direction, *pv);
88  if (ipsig.first)
89  tau.setleadPFChargedHadrCandsignedSipt(ipsig.second.significance());
90  }
91  }
92 }
reco::TransientTrack build(const reco::Track *p) const
std::pair< bool, Measurement1D > signedImpactParameter3D(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:71
def pv(vc)
Definition: MetAnalyzer.py:7
edm::Ref< VertexCollection > VertexRef
persistent reference to a Vertex
Definition: VertexFwd.h:13
static const TrackGhostTrackState * getTrack(const BasicGhostTrackState *basic)
reco::VertexRef associatedVertex(const Jet &jet) const

Member Data Documentation

const TransientTrackBuilder* reco::tau::RecoTauImpactParameterSignificancePlugin::builder_
private

Definition at line 39 of file RecoTauImpactParameterSignificancePlugin.cc.

Referenced by beginEvent(), and operator()().

RecoTauVertexAssociator reco::tau::RecoTauImpactParameterSignificancePlugin::vertexAssociator_
private

Definition at line 38 of file RecoTauImpactParameterSignificancePlugin.cc.

Referenced by beginEvent(), and operator()().