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 
19 
22 
26 
27 namespace reco { namespace tau {
28 
30  public:
34  void operator()(PFTau& tau) const override;
35  void beginEvent() override;
36  private:
39 };
40 
43  :RecoTauModifierPlugin(pset,std::move(iC)),
44  vertexAssociator_(pset.getParameter<edm::ParameterSet>("qualityCuts"),std::move(iC)){}
45 
48  // Get tranisent track builder.
49  edm::ESHandle<TransientTrackBuilder> myTransientTrackBuilder;
50  evtSetup()->get<TransientTrackRecord>().get("TransientTrackBuilder",
51  myTransientTrackBuilder);
52  builder_= myTransientTrackBuilder.product();
53 }
54 
56  // Get the transient lead track
57  if (tau.leadPFChargedHadrCand().isNonnull()) {
58  TrackRef leadTrack = tau.leadPFChargedHadrCand()->trackRef();
59  if (leadTrack.isNonnull()) {
60  const TransientTrack track = builder_->build(leadTrack);
61  GlobalVector direction(tau.jetRef()->px(), tau.jetRef()->py(),
62  tau.jetRef()->pz());
64  // Compute the significance
65  std::pair<bool,Measurement1D> ipsig =
66  IPTools::signedImpactParameter3D(track, direction, *pv);
67  if (ipsig.first)
68  tau.setleadPFChargedHadrCandsignedSipt(ipsig.second.significance());
69  }
70  }
71 }
72 
73 }} // end namespace reco::tau
77  "RecoTauImpactParameterSignificancePlugin");
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:253
const PFJetRef & jetRef() const
Definition: PFTau.cc:58
const PFCandidatePtr & leadPFChargedHadrCand() const
Definition: PFTau.cc:67
reco::VertexRef associatedVertex(const PFJet &jet) const
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
void setEvent(const edm::Event &evt)
Load the vertices from the event.
def pv(vc)
Definition: MetAnalyzer.py:6
void setleadPFChargedHadrCandsignedSipt(const float &)
Definition: PFTau.cc:76
const edm::EventSetup * evtSetup() const
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:168
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalVector
vector in glovbal coordinate system
Definition: Vector3D.h:27
RecoTauImpactParameterSignificancePlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
const T & get() const
Definition: EventSetup.h:59
fixed size matrix
HLT enums.
#define DEFINE_EDM_PLUGIN(factory, type, name)
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:510