CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ImpactParameterAlgorithm Class Reference

#include <ImpactParameterAlgorithm.h>

Public Member Functions

 ImpactParameterAlgorithm (const edm::ParameterSet &parameters)
 
 ImpactParameterAlgorithm ()
 
void setPrimaryVertex (reco::Vertex *pv)
 
void setTransientTrackBuilder (const TransientTrackBuilder *)
 
std::pair< float, reco::TauImpactParameterInfotag (const reco::IsolatedTauTagInfoRef &, const reco::Vertex &)
 
 ~ImpactParameterAlgorithm ()
 

Private Attributes

double ip_max
 
double ip_min
 
reco::VertexprimaryVertex
 
double sip_min
 
const TransientTrackBuildertransientTrackBuilder
 
bool use3D
 
bool use_sign
 

Detailed Description

Definition at line 19 of file ImpactParameterAlgorithm.h.

Constructor & Destructor Documentation

◆ ImpactParameterAlgorithm() [1/2]

ImpactParameterAlgorithm::ImpactParameterAlgorithm ( const edm::ParameterSet parameters)

Definition at line 17 of file ImpactParameterAlgorithm.cc.

References ip_max, ip_min, sip_min, use3D, and use_sign.

17  {
18  ip_min = parameters.getParameter<double>("TauImpactParameterMin");
19  ip_max = parameters.getParameter<double>("TauImpactParameterMax");
20  sip_min = parameters.getParameter<double>("TauImpactParameterSignificanceMin");
21  use_sign = parameters.getParameter<bool>("UseTauImpactParameterSign");
22  use3D = parameters.getParameter<bool>("UseTau3DImpactParameter");
23 }

◆ ImpactParameterAlgorithm() [2/2]

ImpactParameterAlgorithm::ImpactParameterAlgorithm ( )

◆ ~ImpactParameterAlgorithm()

ImpactParameterAlgorithm::~ImpactParameterAlgorithm ( )
inline

Definition at line 28 of file ImpactParameterAlgorithm.h.

28 {}

Member Function Documentation

◆ setPrimaryVertex()

void ImpactParameterAlgorithm::setPrimaryVertex ( reco::Vertex pv)
inline

Definition at line 30 of file ImpactParameterAlgorithm.h.

References primaryVertex, and MetAnalyzer::pv().

30 { primaryVertex = pv; }
def pv(vc)
Definition: MetAnalyzer.py:7

◆ setTransientTrackBuilder()

void ImpactParameterAlgorithm::setTransientTrackBuilder ( const TransientTrackBuilder builder)

Definition at line 25 of file ImpactParameterAlgorithm.cc.

References transientTrackBuilder.

Referenced by ImpactParameter::produce().

25  {
26  transientTrackBuilder = builder;
27 }
const TransientTrackBuilder * transientTrackBuilder

◆ tag()

std::pair< float, reco::TauImpactParameterInfo > ImpactParameterAlgorithm::tag ( const reco::IsolatedTauTagInfoRef tauRef,
const reco::Vertex pv 
)

Definition at line 29 of file ImpactParameterAlgorithm.cc.

References SignedImpactParameter3D::apply(), SignedTransverseImpactParameter::apply(), TransientTrackBuilder::build(), PDWG_TauSkim_cff::discriminator, reco::TauImpactParameterInfo::discriminator(), Measurement1D::error(), Exception, edm::Ref< C, T, F >::get(), reco::TauImpactParameterTrackData::ip3D, ip_max, ip_min, metsig::jet, LogDebug, MetAnalyzer::pv(), reco::TauImpactParameterInfo::setIsolatedTauTag(), sip_min, reco::TauImpactParameterInfo::storeTrackData(), tracks, transientTrackBuilder, reco::TauImpactParameterTrackData::transverseIp, use3D, use_sign, and Measurement1D::value().

Referenced by ImpactParameter::produce().

30  {
31  if (transientTrackBuilder == nullptr) {
32  throw cms::Exception("NullTransientTrackBuilder") << "Transient track builder is 0. ";
33  }
34 
35  reco::TauImpactParameterInfo resultExtended;
36  resultExtended.setIsolatedTauTag(tauRef);
37 
38  const reco::Jet* jet = tauRef->jet().get();
39  GlobalVector direction(jet->px(), jet->py(), jet->pz());
40 
41  const reco::TrackRefVector& tracks = tauRef->selectedTracks();
42 
44  for (iTrack = tracks.begin(); iTrack != tracks.end(); iTrack++) {
45  const reco::TransientTrack transientTrack = (transientTrackBuilder->build(&(**iTrack)));
46 
48  Measurement1D ip = stip.apply(transientTrack, direction, pv).second;
49 
50  SignedImpactParameter3D signed_ip3D;
51  Measurement1D ip3D = signed_ip3D.apply(transientTrack, direction, pv).second;
52  LogDebug("ImpactParameterAlgorithm::tag") << "check pv,ip3d " << pv.z() << " " << ip3D.value();
53  if (!use_sign) {
54  Measurement1D tmp2D(fabs(ip.value()), ip.error());
55  ip = tmp2D;
56 
57  Measurement1D tmp3D(fabs(ip3D.value()), ip3D.error());
58  ip3D = tmp3D;
59  }
60 
62 
63  theData.transverseIp = ip;
64  theData.ip3D = ip3D;
65  resultExtended.storeTrackData(*iTrack, theData);
66  }
67 
68  float discriminator = resultExtended.discriminator(ip_min, ip_max, sip_min, use_sign, use3D);
69 
70  return std::make_pair(discriminator, resultExtended);
71 }
void setIsolatedTauTag(const IsolatedTauTagInfoRef &)
Base class for all types of Jets.
Definition: Jet.h:20
std::pair< bool, Measurement1D > apply(const reco::TransientTrack &, const GlobalVector &direction, const reco::Vertex &vertex) const
reco::TransientTrack build(const reco::Track *p) const
def pv(vc)
Definition: MetAnalyzer.py:7
const TransientTrackBuilder * transientTrackBuilder
auto const & tracks
cannot be loose
float discriminator(double, double, double, bool, bool) const
std::pair< bool, Measurement1D > apply(const reco::TransientTrack &, const GlobalVector &, const reco::Vertex &) const
double value() const
Definition: Measurement1D.h:25
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
double error() const
Definition: Measurement1D.h:27
void storeTrackData(const reco::TrackRef &, const TauImpactParameterTrackData &)
#define LogDebug(id)

Member Data Documentation

◆ ip_max

double ImpactParameterAlgorithm::ip_max
private

Definition at line 40 of file ImpactParameterAlgorithm.h.

Referenced by ImpactParameterAlgorithm(), and tag().

◆ ip_min

double ImpactParameterAlgorithm::ip_min
private

Definition at line 40 of file ImpactParameterAlgorithm.h.

Referenced by ImpactParameterAlgorithm(), and tag().

◆ primaryVertex

reco::Vertex* ImpactParameterAlgorithm::primaryVertex
private

Definition at line 37 of file ImpactParameterAlgorithm.h.

Referenced by setPrimaryVertex().

◆ sip_min

double ImpactParameterAlgorithm::sip_min
private

Definition at line 40 of file ImpactParameterAlgorithm.h.

Referenced by ImpactParameterAlgorithm(), and tag().

◆ transientTrackBuilder

const TransientTrackBuilder* ImpactParameterAlgorithm::transientTrackBuilder
private

Definition at line 43 of file ImpactParameterAlgorithm.h.

Referenced by setTransientTrackBuilder(), and tag().

◆ use3D

bool ImpactParameterAlgorithm::use3D
private

Definition at line 41 of file ImpactParameterAlgorithm.h.

Referenced by ImpactParameterAlgorithm(), and tag().

◆ use_sign

bool ImpactParameterAlgorithm::use_sign
private

Definition at line 41 of file ImpactParameterAlgorithm.h.

Referenced by ImpactParameterAlgorithm(), and tag().