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
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 ()
 

Private Attributes

double dZ_vertex
 
double isolation_cone
 
double m_cutMaxChiSquared
 
double m_cutMaxDecayLen
 
double m_cutMaxTIP
 
double m_cutMinPt
 
int m_cutPixelHits
 
int m_cutTotalHits
 
int m_nthTrack
 
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 15 of file ConeIsolationAlgorithm.h.

Constructor & Destructor Documentation

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

Definition at line 9 of file ConeIsolationAlgorithm.cc.

References edm::ParameterSet::getParameter().

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

Definition at line 6 of file ConeIsolationAlgorithm.cc.

7 { }
ConeIsolationAlgorithm::~ConeIsolationAlgorithm ( )
inline

Definition at line 25 of file ConeIsolationAlgorithm.h.

25 {}

Member Function Documentation

pair< float, IsolatedTauTagInfo > ConeIsolationAlgorithm::tag ( const reco::JetTracksAssociationRef jetTracks,
const reco::Vertex pv 
)

Definition at line 33 of file ConeIsolationAlgorithm.cc.

References edm::RefVector< C, T, F >::begin(), reco::IsolatedTauTagInfo::discriminator(), edm::RefVector< C, T, F >::end(), reco::IsolatedTauTagInfo::leadingSignalTrack(), max(), min, reco::Vertex::position(), edm::RefVector< C, T, F >::push_back(), reco::IsolatedTauTagInfo::setDiscriminator(), reco::IsolatedTauTagInfo::setLeadingTrack(), testEve_cfg::tracks, and reco::Vertex::z().

Referenced by Inspector.Inspector::SetTag().

34 {
35  const edm::RefVector<reco::TrackCollection> & tracks = jetTracks->second;
37 
38  // Selection of the Tracks
39  float z_pv = pv.z();
40  for(edm::RefVector<reco::TrackCollection>::const_iterator it = tracks.begin(); it!= tracks.end(); ++it)
41  {
42  if ( (*it)->pt() > m_cutMinPt &&
43  (*it)->normalizedChi2() < m_cutMaxChiSquared &&
44  fabs((*it)->dxy(pv.position())) < m_cutMaxTIP &&
45  (*it)->recHitsSize() >= (unsigned int) m_cutTotalHits &&
46  (*it)->hitPattern().numberOfValidPixelHits() >= m_cutPixelHits )
47  {
48  if (useVertexConstrain_ && z_pv > -500.) {
49  if (fabs((*it)->dz(pv.position())) < dZ_vertex)
50  myTracks.push_back(*it);
51  } else
52  myTracks.push_back(*it);
53  }
54  }
55  IsolatedTauTagInfo resultExtended(myTracks,jetTracks);
56 
57  double r_sigCone = signal_cone;
58  double energyJet = jetTracks->first->energy();
59  if (not useFixedSizeCone) {
60  r_sigCone = std::min(variableMaxCone, variableConeParameter / energyJet);
61  r_sigCone = std::max((double)r_sigCone, variableMinCone);
62  }
63 
64  // now I can use it for the discriminator;
65  math::XYZVector jetDir(jetTracks->first->px(), jetTracks->first->py(), jetTracks->first->pz());
66  float discriminator = 0.;
67  if (useVertexConstrain_) {
68  // In this case all the selected tracks comes from the same vertex, so no need to pass the dZ_vertex requirement to the discriminator
69  const TrackRef myLeadTk = resultExtended.leadingSignalTrack( matching_cone, pt_min_leadTrack);
70  resultExtended.setLeadingTrack(myLeadTk);
71  discriminator = resultExtended.discriminator(jetDir, matching_cone, r_sigCone, isolation_cone, pt_min_leadTrack, pt_min_isolation, n_tracks_isolation_ring);
72  resultExtended.setDiscriminator(discriminator);
73  } else {
74  // In this case the dZ_vertex is used to associate the tracks to the Z_imp parameter of the Leading Track
75  const TrackRef myLeadTk = resultExtended.leadingSignalTrack( matching_cone, pt_min_leadTrack);
76  resultExtended.setLeadingTrack(myLeadTk);
77  discriminator = resultExtended.discriminator(jetDir, matching_cone, r_sigCone, isolation_cone, pt_min_leadTrack, pt_min_isolation, n_tracks_isolation_ring, dZ_vertex);
78  resultExtended.setDiscriminator(discriminator);
79  }
80 
81  return std::make_pair(discriminator, resultExtended);
82 }
#define min(a, b)
Definition: mlp_lapack.h:161
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:249
const Point & position() const
position
Definition: Vertex.h:93
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:244
const T & max(const T &a, const T &b)
double z() const
y coordinate
Definition: Vertex.h:99
tuple tracks
Definition: testEve_cfg.py:39
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:64

Member Data Documentation

double ConeIsolationAlgorithm::dZ_vertex
private

Definition at line 44 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::isolation_cone
private

Definition at line 41 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::m_cutMaxChiSquared
private

Definition at line 38 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::m_cutMaxDecayLen
private

Definition at line 37 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::m_cutMaxTIP
private

Definition at line 35 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::m_cutMinPt
private

Definition at line 36 of file ConeIsolationAlgorithm.h.

int ConeIsolationAlgorithm::m_cutPixelHits
private

Definition at line 33 of file ConeIsolationAlgorithm.h.

int ConeIsolationAlgorithm::m_cutTotalHits
private

Definition at line 34 of file ConeIsolationAlgorithm.h.

int ConeIsolationAlgorithm::m_nthTrack
private

Definition at line 32 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::matching_cone
private

Definition at line 39 of file ConeIsolationAlgorithm.h.

int ConeIsolationAlgorithm::n_tracks_isolation_ring
private

Definition at line 45 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::pt_min_isolation
private

Definition at line 42 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::pt_min_leadTrack
private

Definition at line 43 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::signal_cone
private

Definition at line 40 of file ConeIsolationAlgorithm.h.

bool ConeIsolationAlgorithm::useFixedSizeCone
private

Definition at line 47 of file ConeIsolationAlgorithm.h.

bool ConeIsolationAlgorithm::useVertexConstrain_
private

Definition at line 46 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::variableConeParameter
private

Definition at line 48 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::variableMaxCone
private

Definition at line 49 of file ConeIsolationAlgorithm.h.

double ConeIsolationAlgorithm::variableMinCone
private

Definition at line 50 of file ConeIsolationAlgorithm.h.