CMS 3D CMS Logo

Public Member Functions | Private Attributes

ConeIsolationAlgorithm Class Reference

#include <ConeIsolationAlgorithm.h>

List of all members.

Public Member Functions

 ConeIsolationAlgorithm (const edm::ParameterSet &parameters)
 ConeIsolationAlgorithm ()
void setPrimaryVertex (reco::Vertex *pv)
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
reco::Vertexm_primaryVertex
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().

{
  //FIXME: use unsigned int where needed
  m_cutPixelHits     = parameters.getParameter<int>("MinimumNumberOfPixelHits");    // not used
  m_cutTotalHits     = parameters.getParameter<int>("MinimumNumberOfHits");
  m_cutMaxTIP        = parameters.getParameter<double>("MaximumTransverseImpactParameter");
  m_cutMinPt         = parameters.getParameter<double>("MinimumTransverseMomentum");
  m_cutMaxChiSquared = parameters.getParameter<double>("MaximumChiSquared");
  dZ_vertex          = parameters.getParameter<double>("DeltaZetTrackVertex");      //  to be modified
  useVertexConstrain_ = parameters.getParameter<bool>("useVertex");

  matching_cone      = parameters.getParameter<double>("MatchingCone");
  signal_cone        = parameters.getParameter<double>("SignalCone");
  isolation_cone     = parameters.getParameter<double>("IsolationCone"); 
  pt_min_isolation   = parameters.getParameter<double>("MinimumTransverseMomentumInIsolationRing"); 
  pt_min_leadTrack   = parameters.getParameter<double>("MinimumTransverseMomentumLeadingTrack"); 
  n_tracks_isolation_ring = parameters.getParameter<int>("MaximumNumberOfTracksIsolationRing"); 
  
  useFixedSizeCone = parameters.getParameter<bool>("UseFixedSizeCone"); 
  variableConeParameter = parameters.getParameter<double>("VariableConeParameter");
  variableMaxCone = parameters.getParameter<double>("VariableMaxCone");
  variableMinCone = parameters.getParameter<double>("VariableMinCone");
}
ConeIsolationAlgorithm::ConeIsolationAlgorithm ( void  )

Definition at line 6 of file ConeIsolationAlgorithm.cc.

{ }
ConeIsolationAlgorithm::~ConeIsolationAlgorithm ( ) [inline]

Definition at line 25 of file ConeIsolationAlgorithm.h.

{}

Member Function Documentation

void ConeIsolationAlgorithm::setPrimaryVertex ( reco::Vertex pv) [inline]

Definition at line 28 of file ConeIsolationAlgorithm.h.

References m_primaryVertex.

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

{
  const edm::RefVector<reco::TrackCollection> & tracks = jetTracks->second;
  edm::RefVector<reco::TrackCollection> myTracks;

  // Selection of the Tracks
  float z_pv = pv.z();
  for(edm::RefVector<reco::TrackCollection>::const_iterator it = tracks.begin(); it!= tracks.end(); ++it)
  {
    if ( (*it)->pt()                                  >  m_cutMinPt                     &&
         (*it)->normalizedChi2()                      <  m_cutMaxChiSquared             &&
         fabs((*it)->dxy(pv.position()))                            <  m_cutMaxTIP                    &&
         (*it)->recHitsSize()                         >= (unsigned int) m_cutTotalHits  &&
         (*it)->hitPattern().numberOfValidPixelHits() >= m_cutPixelHits ) 
    {
      if (useVertexConstrain_ && z_pv > -500.) {
        if (fabs((*it)->dz(pv.position())) < dZ_vertex)
          myTracks.push_back(*it);
      } else
        myTracks.push_back(*it);
    }
  }
  IsolatedTauTagInfo resultExtended(myTracks,jetTracks);

  double r_sigCone = signal_cone;
  double energyJet = jetTracks->first->energy();
  if (not useFixedSizeCone) {
    r_sigCone = std::min(variableMaxCone, variableConeParameter / energyJet);
    r_sigCone = std::max((double)r_sigCone, variableMinCone);
  }

  // now I can use it for the discriminator;
  math::XYZVector jetDir(jetTracks->first->px(), jetTracks->first->py(), jetTracks->first->pz());   
  float discriminator = 0.;
  if (useVertexConstrain_) {
    // In this case all the selected tracks comes from the same vertex, so no need to pass the dZ_vertex requirement to the discriminator 
   const TrackRef myLeadTk = resultExtended.leadingSignalTrack( matching_cone, pt_min_leadTrack);
      resultExtended.setLeadingTrack(myLeadTk);
    discriminator = resultExtended.discriminator(jetDir, matching_cone, r_sigCone, isolation_cone, pt_min_leadTrack, pt_min_isolation,  n_tracks_isolation_ring); 
    resultExtended.setDiscriminator(discriminator);
  } else {
    // In this case the dZ_vertex is used to associate the tracks to the Z_imp parameter of the Leading Track
 const TrackRef myLeadTk = resultExtended.leadingSignalTrack( matching_cone, pt_min_leadTrack);
   resultExtended.setLeadingTrack(myLeadTk);    
    discriminator = resultExtended.discriminator(jetDir, matching_cone, r_sigCone, isolation_cone, pt_min_leadTrack, pt_min_isolation,  n_tracks_isolation_ring, dZ_vertex); 
    resultExtended.setDiscriminator(discriminator);
  }

  return std::make_pair(discriminator, resultExtended); 
}

Member Data Documentation

Definition at line 49 of file ConeIsolationAlgorithm.h.

Definition at line 46 of file ConeIsolationAlgorithm.h.

Definition at line 43 of file ConeIsolationAlgorithm.h.

Definition at line 42 of file ConeIsolationAlgorithm.h.

Definition at line 40 of file ConeIsolationAlgorithm.h.

Definition at line 41 of file ConeIsolationAlgorithm.h.

Definition at line 38 of file ConeIsolationAlgorithm.h.

Definition at line 39 of file ConeIsolationAlgorithm.h.

Definition at line 37 of file ConeIsolationAlgorithm.h.

Definition at line 34 of file ConeIsolationAlgorithm.h.

Referenced by setPrimaryVertex().

Definition at line 44 of file ConeIsolationAlgorithm.h.

Definition at line 50 of file ConeIsolationAlgorithm.h.

Definition at line 47 of file ConeIsolationAlgorithm.h.

Definition at line 48 of file ConeIsolationAlgorithm.h.

Definition at line 45 of file ConeIsolationAlgorithm.h.

Definition at line 52 of file ConeIsolationAlgorithm.h.

Definition at line 51 of file ConeIsolationAlgorithm.h.

Definition at line 53 of file ConeIsolationAlgorithm.h.

Definition at line 54 of file ConeIsolationAlgorithm.h.

Definition at line 55 of file ConeIsolationAlgorithm.h.