CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::TauImpactParameterInfo
tag (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 23 of file ImpactParameterAlgorithm.h.

Constructor & Destructor Documentation

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

Definition at line 17 of file ImpactParameterAlgorithm.cc.

References edm::ParameterSet::getParameter(), 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 
24 }
T getParameter(std::string const &) const
ImpactParameterAlgorithm::ImpactParameterAlgorithm ( )

Definition at line 9 of file ImpactParameterAlgorithm.cc.

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

ImpactParameterAlgorithm::~ImpactParameterAlgorithm ( )
inline

Definition at line 34 of file ImpactParameterAlgorithm.h.

34 {}

Member Function Documentation

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

Definition at line 36 of file ImpactParameterAlgorithm.h.

References primaryVertex, and MetAnalyzer::pv().

void ImpactParameterAlgorithm::setTransientTrackBuilder ( const TransientTrackBuilder builder)

Definition at line 26 of file ImpactParameterAlgorithm.cc.

References transientTrackBuilder.

Referenced by ImpactParameter::produce().

26  {
27  transientTrackBuilder = builder;
28 }
const TransientTrackBuilder * transientTrackBuilder
std::pair< float, reco::TauImpactParameterInfo > ImpactParameterAlgorithm::tag ( const reco::IsolatedTauTagInfoRef tauRef,
const reco::Vertex pv 
)

Definition at line 31 of file ImpactParameterAlgorithm.cc.

References SignedImpactParameter3D::apply(), SignedTransverseImpactParameter::apply(), TransientTrackBuilder::build(), reco::TauImpactParameterInfo::discriminator(), Measurement1D::error(), edm::hlt::Exception, edm::Ref< C, T, F >::get(), reco::TauImpactParameterTrackData::ip3D, ip_max, ip_min, metsig::jet, LogDebug, reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::LeafCandidate::pz(), reco::TauImpactParameterInfo::setIsolatedTauTag(), sip_min, reco::TauImpactParameterInfo::storeTrackData(), testEve_cfg::tracks, transientTrackBuilder, reco::TauImpactParameterTrackData::transverseIp, use3D, use_sign, Measurement1D::value(), and reco::Vertex::z().

Referenced by ImpactParameter::produce(), and Inspector.Inspector::SetTag().

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

Member Data Documentation

double ImpactParameterAlgorithm::ip_max
private

Definition at line 47 of file ImpactParameterAlgorithm.h.

Referenced by ImpactParameterAlgorithm(), and tag().

double ImpactParameterAlgorithm::ip_min
private

Definition at line 47 of file ImpactParameterAlgorithm.h.

Referenced by ImpactParameterAlgorithm(), and tag().

reco::Vertex* ImpactParameterAlgorithm::primaryVertex
private

Definition at line 44 of file ImpactParameterAlgorithm.h.

Referenced by setPrimaryVertex().

double ImpactParameterAlgorithm::sip_min
private

Definition at line 47 of file ImpactParameterAlgorithm.h.

Referenced by ImpactParameterAlgorithm(), and tag().

const TransientTrackBuilder* ImpactParameterAlgorithm::transientTrackBuilder
private

Definition at line 53 of file ImpactParameterAlgorithm.h.

Referenced by setTransientTrackBuilder(), and tag().

bool ImpactParameterAlgorithm::use3D
private

Definition at line 50 of file ImpactParameterAlgorithm.h.

Referenced by ImpactParameterAlgorithm(), and tag().

bool ImpactParameterAlgorithm::use_sign
private

Definition at line 50 of file ImpactParameterAlgorithm.h.

Referenced by ImpactParameterAlgorithm(), and tag().