CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes

TrackCountingComputer Class Reference

#include <TrackCountingComputer.h>

Inheritance diagram for TrackCountingComputer:
JetTagComputer NegativeTrackCountingComputer PromptTrackCountingComputer

List of all members.

Public Member Functions

float discriminator (const TagInfoHelper &ti) const
 TrackCountingComputer (const edm::ParameterSet &parameters)

Protected Member Functions

std::multiset< float > orderedSignificances (const reco::TrackIPTagInfo &tkip) const

Protected Attributes

double m_cutMaxDecayLen
double m_cutMaxDistToAxis
double m_deltaR
int m_ipType
int m_nthTrack
reco::TrackBase::TrackQuality m_trackQuality
bool m_useAllQualities

Detailed Description

Definition at line 11 of file TrackCountingComputer.h.


Constructor & Destructor Documentation

TrackCountingComputer::TrackCountingComputer ( const edm::ParameterSet parameters) [inline]

Definition at line 14 of file TrackCountingComputer.h.

References edm::ParameterSet::getParameter(), m_cutMaxDecayLen, m_cutMaxDistToAxis, m_deltaR, m_ipType, m_nthTrack, m_trackQuality, m_useAllQualities, reco::TrackBase::qualityByName(), and JetTagComputer::uses().

  {
     m_nthTrack         = parameters.getParameter<int>("nthTrack");
     m_ipType           = parameters.getParameter<int>("impactParameterType");
     m_deltaR           = parameters.getParameter<double>("deltaR");
     m_cutMaxDecayLen   = parameters.getParameter<double>("maximumDecayLength"); //used
     m_cutMaxDistToAxis = parameters.getParameter<double>("maximumDistanceToJetAxis"); //used
     //
     // access track quality class; "any" takes everything
     //
     std::string trackQualityType = parameters.getParameter<std::string>("trackQualityClass"); //used
     m_trackQuality =  reco::TrackBase::qualityByName(trackQualityType);
     m_useAllQualities = false;
     if (trackQualityType == "any" || 
         trackQualityType == "Any" || 
         trackQualityType == "ANY" ) m_useAllQualities = true;

     uses("ipTagInfos");
  }

Member Function Documentation

float TrackCountingComputer::discriminator ( const TagInfoHelper ti) const [inline, virtual]

Reimplemented from JetTagComputer.

Reimplemented in NegativeTrackCountingComputer, and PromptTrackCountingComputer.

Definition at line 35 of file TrackCountingComputer.h.

References JetTagComputer::TagInfoHelper::get(), i, m_nthTrack, and orderedSignificances().

   {
    const reco::TrackIPTagInfo & tkip = ti.get<reco::TrackIPTagInfo>();
    std::multiset<float> significances = orderedSignificances(tkip);
    std::multiset<float>::reverse_iterator nth=significances.rbegin();
    for(int i=0;i<m_nthTrack-1 && nth!=significances.rend();i++) nth++;  
     if(nth!=significances.rend()) return *nth; else return -100.;
   }
std::multiset<float> TrackCountingComputer::orderedSignificances ( const reco::TrackIPTagInfo tkip) const [inline, protected]

Definition at line 45 of file TrackCountingComputer.h.

References i, reco::TrackIPTagInfo::impactParameterData(), PyquenDefaultSettings_cff::impactParameters, edm::Ref< C, T, F >::isNull(), reco::JTATagInfo::jet(), m_cutMaxDecayLen, m_cutMaxDistToAxis, m_deltaR, m_ipType, m_trackQuality, m_useAllQualities, p4, reco::TrackIPTagInfo::primaryVertex(), reco::TrackIPTagInfo::selectedTracks(), and testEve_cfg::tracks.

Referenced by NegativeTrackCountingComputer::discriminator(), discriminator(), and PromptTrackCountingComputer::discriminator().

                                                                                       {

          const std::vector<reco::TrackIPTagInfo::TrackIPData> & impactParameters((tkip.impactParameterData()));
          const edm::RefVector<reco::TrackCollection> & tracks(tkip.selectedTracks());
          std::multiset<float> significances;
          int i=0;
          if(tkip.primaryVertex().isNull())  {  return std::multiset<float>();}

          GlobalPoint pv(tkip.primaryVertex()->position().x(),tkip.primaryVertex()->position().y(),tkip.primaryVertex()->position().z());

          for(std::vector<reco::TrackIPTagInfo::TrackIPData>::const_iterator it = impactParameters.begin(); it!=impactParameters.end(); ++it, i++)
           {
           if(   fabs(impactParameters[i].distanceToJetAxis.value()) < m_cutMaxDistToAxis  &&        // distance to JetAxis
                 (impactParameters[i].closestToJetAxis - pv).mag() < m_cutMaxDecayLen  &&      // max decay len
                 (m_useAllQualities  == true || (*tracks[i]).quality(m_trackQuality)) // use selected track qualities
             )
             {
                if(m_deltaR <=0  || ROOT::Math::VectorUtil::DeltaR((*tkip.jet()).p4().Vect(), (*tracks[i]).momentum()) < m_deltaR)
                 significances.insert( ((m_ipType==0)?it->ip3d:it->ip2d).significance() );
              }
          }
 
         return significances;    
   }

Member Data Documentation

Definition at line 75 of file TrackCountingComputer.h.

Referenced by orderedSignificances(), and TrackCountingComputer().

Definition at line 76 of file TrackCountingComputer.h.

Referenced by orderedSignificances(), and TrackCountingComputer().

double TrackCountingComputer::m_deltaR [protected]

Definition at line 74 of file TrackCountingComputer.h.

Referenced by orderedSignificances(), and TrackCountingComputer().

Definition at line 73 of file TrackCountingComputer.h.

Referenced by orderedSignificances(), and TrackCountingComputer().

Definition at line 77 of file TrackCountingComputer.h.

Referenced by orderedSignificances(), and TrackCountingComputer().

Definition at line 78 of file TrackCountingComputer.h.

Referenced by orderedSignificances(), and TrackCountingComputer().