CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes

TrackCountingComputer Class Reference

#include <TrackCountingComputer.h>

Inheritance diagram for TrackCountingComputer:
JetTagComputer NegativeTrackCountingComputer

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
bool useVariableJTA_
reco::TrackIPTagInfo::variableJTAParameters varJTApars

Detailed Description

Definition at line 12 of file TrackCountingComputer.h.


Constructor & Destructor Documentation

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

Definition at line 16 of file TrackCountingComputer.h.

References edm::ParameterSet::existsAs(), funct::false, edm::ParameterSet::getParameter(), m_cutMaxDecayLen, m_cutMaxDistToAxis, m_deltaR, m_ipType, m_nthTrack, m_trackQuality, m_useAllQualities, reco::TrackBase::qualityByName(), AlCaHLTBitMon_QueryRunRegistry::string, JetTagComputer::uses(), useVariableJTA_, and varJTApars.

  {
    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");
  
    useVariableJTA_    = parameters.existsAs<bool>("useVariableJTA") ?  parameters.getParameter<bool>("useVariableJTA") : false ;
    if (useVariableJTA_){ 
      varJTApars = {
        parameters.getParameter<double>("a_dR"),
        parameters.getParameter<double>("b_dR"),
        parameters.getParameter<double>("a_pT"),
        parameters.getParameter<double>("b_pT"),
        parameters.getParameter<double>("min_pT"),  
        parameters.getParameter<double>("max_pT"),
        parameters.getParameter<double>("min_pT_dRcut"),  
        parameters.getParameter<double>("max_pT_dRcut"),
        parameters.getParameter<double>("max_pT_trackPTcut") };
    }
  }

Member Function Documentation

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

Reimplemented from JetTagComputer.

Reimplemented in NegativeTrackCountingComputer.

Definition at line 51 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 62 of file TrackCountingComputer.h.

References i, reco::TrackIPTagInfo::impactParameterData(), PyquenDefaultSettings_cff::impactParameters, edm::Ref< C, T, F >::isNull(), reco::JTATagInfo::jet(), m_useAllQualities, p4, reco::TrackIPTagInfo::primaryVertex(), reco::TrackIPTagInfo::selectedTracks(), testEve_cfg::tracks, useVariableJTA_, reco::TrackIPTagInfo::variableJTA(), and varJTApars.

Referenced by NegativeTrackCountingComputer::discriminator(), and 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 (useVariableJTA_) {
          if (tkip.variableJTA( varJTApars )[i])  significances.insert( ((m_ipType==0)?it->ip3d:it->ip2d).significance() );
        }
        else // no using variable JTA, use the default method 
          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 96 of file TrackCountingComputer.h.

Referenced by TrackCountingComputer().

Definition at line 97 of file TrackCountingComputer.h.

Referenced by TrackCountingComputer().

double TrackCountingComputer::m_deltaR [protected]

Definition at line 95 of file TrackCountingComputer.h.

Referenced by TrackCountingComputer().

Definition at line 94 of file TrackCountingComputer.h.

Referenced by TrackCountingComputer().

Definition at line 98 of file TrackCountingComputer.h.

Referenced by TrackCountingComputer().

Definition at line 99 of file TrackCountingComputer.h.

Referenced by orderedSignificances(), and TrackCountingComputer().

Definition at line 90 of file TrackCountingComputer.h.

Referenced by orderedSignificances(), and TrackCountingComputer().

Definition at line 91 of file TrackCountingComputer.h.

Referenced by orderedSignificances(), and TrackCountingComputer().