CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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:
32  const edm::ParameterSet& pset,edm::ConsumesCollector &&iC);
34  void operator()(PFTau& tau) const override;
35  virtual 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:250
const PFJetRef & jetRef() const
Definition: PFTau.cc:54
const PFCandidatePtr & leadPFChargedHadrCand() const
Definition: PFTau.cc:63
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 move
Definition: eostools.py:508
void setleadPFChargedHadrCandsignedSipt(const float &)
Definition: PFTau.cc:72
const edm::EventSetup * evtSetup() const
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:152
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:55
T const * product() const
Definition: ESHandle.h:86
#define DEFINE_EDM_PLUGIN(factory, type, name)