CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
TemplatedTrackCountingComputer< Container, Base > Class Template Reference

#include <TemplatedTrackCountingComputer.h>

Inheritance diagram for TemplatedTrackCountingComputer< Container, Base >:
JetTagComputer TemplatedNegativeTrackCountingComputer< Container, Base >

Public Types

typedef reco::IPTagInfo< Container, Base > TagInfo
 
using Tokens = void
 

Public Member Functions

float discriminator (const TagInfoHelper &ti) const override
 
 TemplatedTrackCountingComputer (const edm::ParameterSet &parameters)
 
- Public Member Functions inherited from JetTagComputer
const std::vector< std::string > & getInputLabels () const
 
virtual void initialize (const JetTagComputerRecord &)
 
 JetTagComputer ()
 
 JetTagComputer (const edm::ParameterSet &configuration)
 
float operator() (const reco::BaseTagInfo &info) const
 
float operator() (const TagInfoHelper &helper) const
 
void setupDone ()
 
virtual ~JetTagComputer ()
 

Protected Member Functions

std::multiset< float > orderedSignificances (const TagInfo &tkip) const
 
- Protected Member Functions inherited from JetTagComputer
virtual float discriminator (const reco::BaseTagInfo &) const
 
void uses (unsigned int id, const std::string &label)
 
void uses (const std::string &label)
 

Protected Attributes

double m_cutMaxDecayLen
 
double m_cutMaxDistToAxis
 
double m_deltaR
 
int m_ipType
 
double m_minIP
 
int m_nthTrack
 
reco::TrackBase::TrackQuality m_trackQuality
 
bool m_useAllQualities
 
bool m_useSignedIPSig
 
bool useVariableJTA_
 
reco::btag::variableJTAParameters varJTApars
 

Detailed Description

template<class Container, class Base>
class TemplatedTrackCountingComputer< Container, Base >

Definition at line 12 of file TemplatedTrackCountingComputer.h.

Member Typedef Documentation

◆ TagInfo

template<class Container, class Base>
typedef reco::IPTagInfo<Container, Base> TemplatedTrackCountingComputer< Container, Base >::TagInfo

Definition at line 16 of file TemplatedTrackCountingComputer.h.

◆ Tokens

template<class Container, class Base>
using TemplatedTrackCountingComputer< Container, Base >::Tokens = void

Definition at line 14 of file TemplatedTrackCountingComputer.h.

Constructor & Destructor Documentation

◆ TemplatedTrackCountingComputer()

template<class Container, class Base>
TemplatedTrackCountingComputer< Container, Base >::TemplatedTrackCountingComputer ( const edm::ParameterSet parameters)
inline

Definition at line 18 of file TemplatedTrackCountingComputer.h.

References TemplatedTrackCountingComputer< Container, Base >::m_cutMaxDecayLen, TemplatedTrackCountingComputer< Container, Base >::m_cutMaxDistToAxis, TemplatedTrackCountingComputer< Container, Base >::m_deltaR, TemplatedTrackCountingComputer< Container, Base >::m_ipType, TemplatedTrackCountingComputer< Container, Base >::m_minIP, TemplatedTrackCountingComputer< Container, Base >::m_nthTrack, TemplatedTrackCountingComputer< Container, Base >::m_trackQuality, TemplatedTrackCountingComputer< Container, Base >::m_useAllQualities, TemplatedTrackCountingComputer< Container, Base >::m_useSignedIPSig, reco::TrackBase::qualityByName(), AlCaHLTBitMon_QueryRunRegistry::string, JetTagComputer::uses(), TemplatedTrackCountingComputer< Container, Base >::useVariableJTA_, and TemplatedTrackCountingComputer< Container, Base >::varJTApars.

18  {
19  m_minIP = parameters.existsAs<double>("minimumImpactParameter")
20  ? parameters.getParameter<double>("minimumImpactParameter")
21  : -1;
22  m_useSignedIPSig = parameters.existsAs<bool>("useSignedImpactParameterSig")
23  ? parameters.getParameter<bool>("useSignedImpactParameterSig")
24  : true;
25  m_nthTrack = parameters.getParameter<int>("nthTrack");
26  m_ipType = parameters.getParameter<int>("impactParameterType");
27  m_deltaR = parameters.getParameter<double>("deltaR");
28  m_cutMaxDecayLen = parameters.getParameter<double>("maximumDecayLength"); //used
29  m_cutMaxDistToAxis = parameters.getParameter<double>("maximumDistanceToJetAxis"); //used
30  //
31  // access track quality class; "any" takes everything
32  //
33  std::string trackQualityType = parameters.getParameter<std::string>("trackQualityClass"); //used
35  m_useAllQualities = false;
36  if (trackQualityType == "any" || trackQualityType == "Any" || trackQualityType == "ANY")
37  m_useAllQualities = true;
38 
39  uses("ipTagInfos");
40 
42  parameters.existsAs<bool>("useVariableJTA") ? parameters.getParameter<bool>("useVariableJTA") : false;
43  if (useVariableJTA_) {
44  varJTApars = {parameters.getParameter<double>("a_dR"),
45  parameters.getParameter<double>("b_dR"),
46  parameters.getParameter<double>("a_pT"),
47  parameters.getParameter<double>("b_pT"),
48  parameters.getParameter<double>("min_pT"),
49  parameters.getParameter<double>("max_pT"),
50  parameters.getParameter<double>("min_pT_dRcut"),
51  parameters.getParameter<double>("max_pT_dRcut"),
52  parameters.getParameter<double>("max_pT_trackPTcut")};
53  }
54  }
reco::TrackBase::TrackQuality m_trackQuality
void uses(unsigned int id, const std::string &label)
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
reco::btag::variableJTAParameters varJTApars

Member Function Documentation

◆ discriminator()

template<class Container, class Base>
float TemplatedTrackCountingComputer< Container, Base >::discriminator ( const TagInfoHelper ti) const
inlineoverridevirtual

Reimplemented from JetTagComputer.

Definition at line 56 of file TemplatedTrackCountingComputer.h.

References JetTagComputer::TagInfoHelper::get(), mps_fire::i, TemplatedTrackCountingComputer< Container, Base >::m_nthTrack, and TemplatedTrackCountingComputer< Container, Base >::orderedSignificances().

56  {
57  const TagInfo& tkip = ti.get<TagInfo>();
58  std::multiset<float> significances = orderedSignificances(tkip);
59  std::multiset<float>::reverse_iterator nth = significances.rbegin();
60  for (int i = 0; i < m_nthTrack - 1 && nth != significances.rend(); i++)
61  nth++;
62  if (nth != significances.rend())
63  return *nth;
64  else
65  return -100.;
66  }
reco::IPTagInfo< Container, Base > TagInfo
std::multiset< float > orderedSignificances(const TagInfo &tkip) const

◆ orderedSignificances()

template<class Container, class Base>
std::multiset<float> TemplatedTrackCountingComputer< Container, Base >::orderedSignificances ( const TagInfo tkip) const
inlineprotected

Definition at line 69 of file TemplatedTrackCountingComputer.h.

References electronAnalyzer_cfi::DeltaR, mps_fire::i, reco::IPTagInfo< Container, Base >::impactParameterData(), edm::Ref< C, T, F >::isNull(), TemplatedTrackCountingComputer< Container, Base >::m_cutMaxDecayLen, TemplatedTrackCountingComputer< Container, Base >::m_cutMaxDistToAxis, TemplatedTrackCountingComputer< Container, Base >::m_deltaR, TemplatedTrackCountingComputer< Container, Base >::m_ipType, TemplatedTrackCountingComputer< Container, Base >::m_minIP, TemplatedTrackCountingComputer< Container, Base >::m_trackQuality, TemplatedTrackCountingComputer< Container, Base >::m_useAllQualities, TemplatedTrackCountingComputer< Container, Base >::m_useSignedIPSig, reco::IPTagInfo< Container, Base >::primaryVertex(), MetAnalyzer::pv(), reco::TrackBase::quality(), reco::IPTagInfo< Container, Base >::selectedTracks(), met_cff::significance, reco::btag::toTrack(), pwdgSkimBPark_cfi::tracks, TemplatedTrackCountingComputer< Container, Base >::useVariableJTA_, reco::IPTagInfo< Container, Base >::variableJTA(), and TemplatedTrackCountingComputer< Container, Base >::varJTApars.

Referenced by TemplatedNegativeTrackCountingComputer< Container, Base >::discriminator(), and TemplatedTrackCountingComputer< Container, Base >::discriminator().

69  {
70  const std::vector<reco::btag::TrackIPData>& impactParameters((tkip.impactParameterData()));
71  const Container& tracks(tkip.selectedTracks());
72  std::multiset<float> significances;
73  int i = 0;
74  if (tkip.primaryVertex().isNull()) {
75  return std::multiset<float>();
76  }
77 
78  GlobalPoint pv(tkip.primaryVertex()->position().x(),
79  tkip.primaryVertex()->position().y(),
80  tkip.primaryVertex()->position().z());
81 
82  for (std::vector<reco::btag::TrackIPData>::const_iterator it = impactParameters.begin();
83  it != impactParameters.end();
84  ++it, i++) {
85  if (fabs(impactParameters[i].distanceToJetAxis.value()) < m_cutMaxDistToAxis && // distance to JetAxis
86  (impactParameters[i].closestToJetAxis - pv).mag() < m_cutMaxDecayLen && // max decay len
87  (m_useAllQualities == true ||
88  reco::btag::toTrack(tracks[i])->quality(m_trackQuality)) && // use selected track qualities
89  (fabs(((m_ipType == 0) ? it->ip3d : it->ip2d).value()) > m_minIP) // minimum impact parameter
90  ) {
91  //calculate the signed or un-signed significance
92  float signed_sig = ((m_ipType == 0) ? it->ip3d : it->ip2d).significance();
93  float unsigned_sig = fabs(signed_sig);
94  float significance = (m_useSignedIPSig) ? signed_sig : unsigned_sig;
95 
96  if (useVariableJTA_) {
97  if (tkip.variableJTA(varJTApars)[i])
98  significances.insert(significance);
99  } else // no using variable JTA, use the default method
100  if (m_deltaR <= 0 ||
101  ROOT::Math::VectorUtil::DeltaR((*tkip.jet()).p4().Vect(), (*tracks[i]).momentum()) < m_deltaR)
102  significances.insert(significance);
103  }
104  }
105 
106  return significances;
107  }
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:552
reco::TrackBase::TrackQuality m_trackQuality
const reco::Track * toTrack(const reco::TrackBaseRef &t)
Definition: IPTagInfo.h:24
def pv(vc)
Definition: MetAnalyzer.py:7
reco::btag::variableJTAParameters varJTApars
significance
Definition: met_cff.py:15
edm::AssociationVector< reco::JetRefBaseProd, Values > Container

Member Data Documentation

◆ m_cutMaxDecayLen

template<class Container, class Base>
double TemplatedTrackCountingComputer< Container, Base >::m_cutMaxDecayLen
protected

◆ m_cutMaxDistToAxis

template<class Container, class Base>
double TemplatedTrackCountingComputer< Container, Base >::m_cutMaxDistToAxis
protected

◆ m_deltaR

template<class Container, class Base>
double TemplatedTrackCountingComputer< Container, Base >::m_deltaR
protected

◆ m_ipType

template<class Container, class Base>
int TemplatedTrackCountingComputer< Container, Base >::m_ipType
protected

◆ m_minIP

template<class Container, class Base>
double TemplatedTrackCountingComputer< Container, Base >::m_minIP
protected

◆ m_nthTrack

template<class Container, class Base>
int TemplatedTrackCountingComputer< Container, Base >::m_nthTrack
protected

◆ m_trackQuality

template<class Container, class Base>
reco::TrackBase::TrackQuality TemplatedTrackCountingComputer< Container, Base >::m_trackQuality
protected

◆ m_useAllQualities

template<class Container, class Base>
bool TemplatedTrackCountingComputer< Container, Base >::m_useAllQualities
protected

◆ m_useSignedIPSig

template<class Container, class Base>
bool TemplatedTrackCountingComputer< Container, Base >::m_useSignedIPSig
protected

◆ useVariableJTA_

template<class Container, class Base>
bool TemplatedTrackCountingComputer< Container, Base >::useVariableJTA_
protected

◆ varJTApars

template<class Container, class Base>
reco::btag::variableJTAParameters TemplatedTrackCountingComputer< Container, Base >::varJTApars
protected