CMS 3D CMS Logo

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

#include <ConeIsolationAlgorithm.h>

Public Member Functions

 ConeIsolationAlgorithm (const edm::ParameterSet &parameters)
 
 ConeIsolationAlgorithm ()
 
std::pair< float,reco::IsolatedTauTagInfotag (const reco::JetTracksAssociationRef &jetTracks, const reco::Vertex &pv)
 
 ~ConeIsolationAlgorithm ()
 

Static Public Member Functions

static void fillDescription (edm::ParameterSetDescription &desc)
 

Private Attributes

double dZ_vertex
 
double isolation_cone
 
double m_cutMaxChiSquared
 
double m_cutMaxTIP
 
double m_cutMinPt
 
int m_cutPixelHits
 
int m_cutTotalHits
 
double matching_cone
 
int n_tracks_isolation_ring
 
double pt_min_isolation
 
double pt_min_leadTrack
 
double signal_cone
 
bool useFixedSizeCone
 
bool useVertexConstrain_
 
double variableConeParameter
 
double variableMaxCone
 
double variableMinCone
 

Detailed Description

Definition at line 17 of file ConeIsolationAlgorithm.h.

Constructor & Destructor Documentation

ConeIsolationAlgorithm::ConeIsolationAlgorithm ( const edm::ParameterSet parameters)

Definition at line 8 of file ConeIsolationAlgorithm.cc.

References edm::ParameterSet::getParameter().

9 {
10  //FIXME: use unsigned int where needed
11  m_cutPixelHits = parameters.getParameter<int>("MinimumNumberOfPixelHits"); // not used
12  m_cutTotalHits = parameters.getParameter<int>("MinimumNumberOfHits");
13  m_cutMaxTIP = parameters.getParameter<double>("MaximumTransverseImpactParameter");
14  m_cutMinPt = parameters.getParameter<double>("MinimumTransverseMomentum");
15  m_cutMaxChiSquared = parameters.getParameter<double>("MaximumChiSquared");
16  dZ_vertex = parameters.getParameter<double>("DeltaZetTrackVertex"); // to be modified
17  useVertexConstrain_ = parameters.getParameter<bool>("useVertex");
18 
19  matching_cone = parameters.getParameter<double>("MatchingCone");
20  signal_cone = parameters.getParameter<double>("SignalCone");
21  isolation_cone = parameters.getParameter<double>("IsolationCone");
22  pt_min_isolation = parameters.getParameter<double>("MinimumTransverseMomentumInIsolationRing");
23  pt_min_leadTrack = parameters.getParameter<double>("MinimumTransverseMomentumLeadingTrack");
24  n_tracks_isolation_ring = parameters.getParameter<int>("MaximumNumberOfTracksIsolationRing");
25 
26  useFixedSizeCone = parameters.getParameter<bool>("UseFixedSizeCone");
27  variableConeParameter = parameters.getParameter<double>("VariableConeParameter");
28  variableMaxCone = parameters.getParameter<double>("VariableMaxCone");
29  variableMinCone = parameters.getParameter<double>("VariableMinCone");
30 }
T getParameter(std::string const &) const
ConeIsolationAlgorithm::ConeIsolationAlgorithm ( )
default
ConeIsolationAlgorithm::~ConeIsolationAlgorithm ( )
inline

Member Function Documentation

void ConeIsolationAlgorithm::fillDescription ( edm::ParameterSetDescription desc)
static

Definition at line 32 of file ConeIsolationAlgorithm.cc.

References edm::ParameterSetDescription::add().

Referenced by ConeIsolation::fillDescriptions(), and ~ConeIsolationAlgorithm().

32  {
33  desc.add<int>("MinimumNumberOfPixelHits",2);
34  desc.add<int>("MinimumNumberOfHits",8);
35  desc.add<double>("MaximumTransverseImpactParameter",0.03);
36  desc.add<double>("MinimumTransverseMomentum",1.0);
37  desc.add<double>("MaximumChiSquared",100.0);
38  desc.add<double>("DeltaZetTrackVertex",0.2);
39  desc.add<bool>("useVertex",true);
40  desc.add<double>("MatchingCone",0.1);
41  desc.add<double>("SignalCone",0.07);
42  desc.add<double>("IsolationCone",0.45);
43  desc.add<double>("MinimumTransverseMomentumInIsolationRing",0.0);
44  desc.add<double>("MinimumTransverseMomentumLeadingTrack",6.0);
45  desc.add<int>("MaximumNumberOfTracksIsolationRing",0);
46  desc.add<bool>("UseFixedSizeCone",true);
47  desc.add<double>("VariableConeParameter",3.5);
48  desc.add<double>("VariableMaxCone",0.17);
49  desc.add<double>("VariableMinCone",0.05);
50 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
pair< float, IsolatedTauTagInfo > ConeIsolationAlgorithm::tag ( const reco::JetTracksAssociationRef jetTracks,
const reco::Vertex pv 
)

Definition at line 52 of file ConeIsolationAlgorithm.cc.

References reco::IsolatedTauTagInfo::discriminator(), mvaPFMET_leptons_cfi::discriminator, PVValHelper::dxy, PVValHelper::dz, createfilelist::int, reco::IsolatedTauTagInfo::leadingSignalTrack(), hpstanc_transforms::max, min(), reco::Vertex::position(), EnergyCorrector::pt, edm::RefVector< C, T, F >::push_back(), reco::IsolatedTauTagInfo::setDiscriminator(), reco::IsolatedTauTagInfo::setLeadingTrack(), HiIsolationCommonParameters_cff::track, l1t::tracks, and reco::Vertex::z().

Referenced by ~ConeIsolationAlgorithm().

53 {
54  const edm::RefVector<reco::TrackCollection> & tracks = jetTracks->second;
56 
57  // Selection of the Tracks
58  float z_pv = pv.z();
59  for(auto && track : tracks)
60  {
61  if ( (track)->pt() > m_cutMinPt &&
62  (track)->normalizedChi2() < m_cutMaxChiSquared &&
63  fabs((track)->dxy(pv.position())) < m_cutMaxTIP &&
64  (track)->recHitsSize() >= (unsigned int) m_cutTotalHits &&
65  (track)->hitPattern().numberOfValidPixelHits() >= m_cutPixelHits )
66  {
67  if (useVertexConstrain_ && z_pv > -500.) {
68  if (fabs((track)->dz(pv.position())) < dZ_vertex)
69  myTracks.push_back(track);
70  } else
71  myTracks.push_back(track);
72  }
73  }
74  IsolatedTauTagInfo resultExtended(myTracks,jetTracks);
75 
76  double r_sigCone = signal_cone;
77  double energyJet = jetTracks->first->energy();
78  if (not useFixedSizeCone) {
79  r_sigCone = std::min(variableMaxCone, variableConeParameter / energyJet);
80  r_sigCone = std::max((double)r_sigCone, variableMinCone);
81  }
82 
83  // now I can use it for the discriminator;
84  math::XYZVector jetDir(jetTracks->first->px(), jetTracks->first->py(), jetTracks->first->pz());
85  float discriminator = 0.;
86  if (useVertexConstrain_) {
87  // In this case all the selected tracks comes from the same vertex, so no need to pass the dZ_vertex requirement to the discriminator
88  const TrackRef myLeadTk = resultExtended.leadingSignalTrack( matching_cone, pt_min_leadTrack);
89  resultExtended.setLeadingTrack(myLeadTk);
90  discriminator = resultExtended.discriminator(jetDir, matching_cone, r_sigCone, isolation_cone, pt_min_leadTrack, pt_min_isolation, n_tracks_isolation_ring);
91  resultExtended.setDiscriminator(discriminator);
92  } else {
93  // In this case the dZ_vertex is used to associate the tracks to the Z_imp parameter of the Leading Track
94  const TrackRef myLeadTk = resultExtended.leadingSignalTrack( matching_cone, pt_min_leadTrack);
95  resultExtended.setLeadingTrack(myLeadTk);
96  discriminator = resultExtended.discriminator(jetDir, matching_cone, r_sigCone, isolation_cone, pt_min_leadTrack, pt_min_isolation, n_tracks_isolation_ring, dZ_vertex);
97  resultExtended.setDiscriminator(discriminator);
98  }
99 
100  return std::make_pair(discriminator, resultExtended);
101 }
const Point & position() const
position
Definition: Vertex.h:109
double z() const
z coordinate
Definition: Vertex.h:115
T min(T a, T b)
Definition: MathUtil.h:58
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:69

Member Data Documentation

double ConeIsolationAlgorithm::dZ_vertex
private

Definition at line 46 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::isolation_cone
private

Definition at line 43 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::m_cutMaxChiSquared
private

Definition at line 40 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::m_cutMaxTIP
private

Definition at line 38 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::m_cutMinPt
private

Definition at line 39 of file ConeIsolationAlgorithm.h.

int ConeIsolationAlgorithm::m_cutPixelHits
private

Definition at line 36 of file ConeIsolationAlgorithm.h.

int ConeIsolationAlgorithm::m_cutTotalHits
private

Definition at line 37 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::matching_cone
private

Definition at line 41 of file ConeIsolationAlgorithm.h.

int ConeIsolationAlgorithm::n_tracks_isolation_ring
private

Definition at line 47 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::pt_min_isolation
private

Definition at line 44 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::pt_min_leadTrack
private

Definition at line 45 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::signal_cone
private

Definition at line 42 of file ConeIsolationAlgorithm.h.

bool ConeIsolationAlgorithm::useFixedSizeCone
private

Definition at line 49 of file ConeIsolationAlgorithm.h.

bool ConeIsolationAlgorithm::useVertexConstrain_
private

Definition at line 48 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::variableConeParameter
private

Definition at line 50 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::variableMaxCone
private

Definition at line 51 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::variableMinCone
private

Definition at line 52 of file ConeIsolationAlgorithm.h.