CMS 3D CMS Logo

RecoTauImpactParameterSignificancePlugin.cc
Go to the documentation of this file.
1 /*
2  * =============================================================================
3  * Filename: RecoTauImpactParameterSignificancePlugin.cc
4  *
5  * Description: Add the IP significance of the lead track w.r.t to the PV.
6  * to a PFTau.
7  * Created: 10/31/2010 13:32:14
8  *
9  * Authors: Evan K. Friis (UC Davis), evan.klose.friis@cern.ch,
10  * Simone Gennai, Ludovic Houchu
11  *
12  * =============================================================================
13  */
14 
20 
22 
26 
27 namespace reco {
28  namespace tau {
29 
31  public:
34  void operator()(PFTau& tau) const override;
35  void beginEvent() override;
36 
37  private:
41  };
42 
46  transTrackBuilderToken_(iC.esConsumes(edm::ESInputTag{"", "TransientTrackBuilder"})),
47  vertexAssociator_(pset.getParameter<edm::ParameterSet>("qualityCuts"), std::move(iC)) {}
48 
51  // Get tranisent track builder.
53  }
54 
55  namespace {
56  inline const reco::Track* getTrack(const Candidate& cand) {
57  const PFCandidate* pfCandPtr = dynamic_cast<const PFCandidate*>(&cand);
58  if (pfCandPtr) {
59  if (pfCandPtr->trackRef().isNonnull())
60  return pfCandPtr->trackRef().get();
61  else
62  return nullptr;
63  }
64 
65  const pat::PackedCandidate* packedCand = dynamic_cast<const pat::PackedCandidate*>(&cand);
66  if (packedCand && packedCand->hasTrackDetails())
67  return &packedCand->pseudoTrack();
68 
69  return nullptr;
70  }
71  } // namespace
72 
74  // Get the transient lead track
75  if (tau.leadChargedHadrCand().isNonnull()) {
76  const reco::Track* leadTrack = getTrack(*tau.leadChargedHadrCand());
77  if (leadTrack != nullptr) {
79  GlobalVector direction(tau.jetRef()->px(), tau.jetRef()->py(), tau.jetRef()->pz());
81  // Compute the significance
82  std::pair<bool, Measurement1D> ipsig = IPTools::signedImpactParameter3D(track, direction, *pv);
83  if (ipsig.first)
84  tau.setleadPFChargedHadrCandsignedSipt(ipsig.second.significance());
85  }
86  }
87  }
88 
89  } // namespace tau
90 } // namespace reco
94  "RecoTauImpactParameterSignificancePlugin");
reco::PFCandidate::trackRef
reco::TrackRef trackRef() const
Definition: PFCandidate.cc:408
pat::PackedCandidate::hasTrackDetails
bool hasTrackDetails() const
Return true if a bestTrack can be extracted from this Candidate.
Definition: PackedCandidate.h:788
reco::tau::RecoTauEventHolderPlugin::evt
const edm::Event * evt() const
Definition: RecoTauPluginsCommon.cc:16
reco::tau::RecoTauImpactParameterSignificancePlugin::~RecoTauImpactParameterSignificancePlugin
~RecoTauImpactParameterSignificancePlugin() override
Definition: RecoTauImpactParameterSignificancePlugin.cc:33
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11724
ESInputTag
metsig::tau
Definition: SignAlgoResolutions.h:49
PFCandidate.h
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::Ref::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
reco::PFTau
Definition: PFTau.h:36
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
TransientTrack.h
reco::tau::RecoTauImpactParameterSignificancePlugin::vertexAssociator_
RecoTauVertexAssociator vertexAssociator_
Definition: RecoTauImpactParameterSignificancePlugin.cc:39
edm::Ref< VertexCollection >
MakerMacros.h
singlePfTauSkim_cff.leadTrack
leadTrack
Definition: singlePfTauSkim_cff.py:22
reco::tau::RecoTauVertexAssociator
Definition: RecoTauVertexAssociator.h:50
IPTools::signedImpactParameter3D
std::pair< bool, Measurement1D > signedImpactParameter3D(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:81
reco::Track
Definition: Track.h:27
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
reco::tau::RecoTauImpactParameterSignificancePlugin::beginEvent
void beginEvent() override
Definition: RecoTauImpactParameterSignificancePlugin.cc:49
pat::PackedCandidate::pseudoTrack
virtual const reco::Track & pseudoTrack() const
Definition: PackedCandidate.h:773
TransientTrackBuilder.h
reco::tau::RecoTauVertexAssociator::associatedVertex
reco::VertexRef associatedVertex(const Jet &jet) const
Definition: RecoTauVertexAssociator.cc:378
edm::ParameterSet
Definition: ParameterSet.h:47
pat::PackedCandidate
Definition: PackedCandidate.h:22
edmplugin::PluginFactory
Definition: PluginFactory.h:34
PackedCandidate.h
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
math::GlobalVector
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalVector
vector in glovbal coordinate system
Definition: Vector3D.h:28
cand
Definition: decayParser.h:32
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
TransientTrackBuilder
Definition: TransientTrackBuilder.h:16
TransientTrackRecord.h
reco::tau::RecoTauVertexAssociator::setEvent
void setEvent(const edm::Event &evt)
Load the vertices from the event.
Definition: RecoTauVertexAssociator.cc:242
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord >
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
reco::Candidate
Definition: Candidate.h:27
RecoTauBuilderPlugins.h
VertexFwd.h
getTrack
static const TrackGhostTrackState * getTrack(const BasicGhostTrackState *basic)
Definition: GhostTrackState.cc:49
reco::tau::RecoTauImpactParameterSignificancePlugin::operator()
void operator()(PFTau &tau) const override
Definition: RecoTauImpactParameterSignificancePlugin.cc:73
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
IPTools.h
reco::tau::RecoTauImpactParameterSignificancePlugin::transTrackBuilderToken_
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > transTrackBuilderToken_
Definition: RecoTauImpactParameterSignificancePlugin.cc:38
reco::TransientTrack
Definition: TransientTrack.h:19
reco::tau::RecoTauImpactParameterSignificancePlugin::RecoTauImpactParameterSignificancePlugin
RecoTauImpactParameterSignificancePlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
Definition: RecoTauImpactParameterSignificancePlugin.cc:43
reco::tau::RecoTauModifierPlugin
Definition: RecoTauBuilderPlugins.h:104
Vertex.h
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
TransientTrackBuilder::build
reco::TransientTrack build(const reco::Track *p) const
Definition: TransientTrackBuilder.cc:20
reco::tau::RecoTauEventHolderPlugin::evtSetup
const edm::EventSetup * evtSetup() const
Definition: RecoTauPluginsCommon.cc:18
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
reco::tau::RecoTauImpactParameterSignificancePlugin
Definition: RecoTauImpactParameterSignificancePlugin.cc:30
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
reco::tau::RecoTauImpactParameterSignificancePlugin::builder_
const TransientTrackBuilder * builder_
Definition: RecoTauImpactParameterSignificancePlugin.cc:40
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27