CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
TrackCountingComputer Class Reference

#include <TrackCountingComputer.h>

Inheritance diagram for TrackCountingComputer:
JetTagComputer NegativeTrackCountingComputer

Public Member Functions

float discriminator (const TagInfoHelper &ti) const
 
 TrackCountingComputer (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 reco::TrackIPTagInfo &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
 
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(), edm::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.

17  {
18  m_nthTrack = parameters.getParameter<int>("nthTrack");
19  m_ipType = parameters.getParameter<int>("impactParameterType");
20  m_deltaR = parameters.getParameter<double>("deltaR");
21  m_cutMaxDecayLen = parameters.getParameter<double>("maximumDecayLength"); //used
22  m_cutMaxDistToAxis = parameters.getParameter<double>("maximumDistanceToJetAxis"); //used
23  //
24  // access track quality class; "any" takes everything
25  //
26  std::string trackQualityType = parameters.getParameter<std::string>("trackQualityClass"); //used
28  m_useAllQualities = false;
29  if (trackQualityType == "any" ||
30  trackQualityType == "Any" ||
31  trackQualityType == "ANY" ) m_useAllQualities = true;
32 
33  uses("ipTagInfos");
34 
35  useVariableJTA_ = parameters.existsAs<bool>("useVariableJTA") ? parameters.getParameter<bool>("useVariableJTA") : false ;
36  if (useVariableJTA_){
37  varJTApars = {
38  parameters.getParameter<double>("a_dR"),
39  parameters.getParameter<double>("b_dR"),
40  parameters.getParameter<double>("a_pT"),
41  parameters.getParameter<double>("b_pT"),
42  parameters.getParameter<double>("min_pT"),
43  parameters.getParameter<double>("max_pT"),
44  parameters.getParameter<double>("min_pT_dRcut"),
45  parameters.getParameter<double>("max_pT_dRcut"),
46  parameters.getParameter<double>("max_pT_trackPTcut") };
47  }
48  }
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:184
reco::TrackIPTagInfo::variableJTAParameters varJTApars
void uses(unsigned int id, const std::string &label)
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:46
volatile std::atomic< bool > shutdown_flag false
reco::TrackBase::TrackQuality m_trackQuality

Member Function Documentation

float TrackCountingComputer::discriminator ( const TagInfoHelper ti) const
inlinevirtual

Reimplemented from JetTagComputer.

Definition at line 51 of file TrackCountingComputer.h.

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

52  {
53  const reco::TrackIPTagInfo & tkip = ti.get<reco::TrackIPTagInfo>();
54  std::multiset<float> significances = orderedSignificances(tkip);
55  std::multiset<float>::reverse_iterator nth=significances.rbegin();
56  for(int i=0;i<m_nthTrack-1 && nth!=significances.rend();i++) nth++;
57  if(nth!=significances.rend()) return *nth; else return -100.;
58  }
int i
Definition: DBlmapReader.cc:9
std::multiset< float > orderedSignificances(const reco::TrackIPTagInfo &tkip) const
std::multiset<float> TrackCountingComputer::orderedSignificances ( const reco::TrackIPTagInfo tkip) const
inlineprotected

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

62  {
63 
64  const std::vector<reco::TrackIPTagInfo::TrackIPData> & impactParameters((tkip.impactParameterData()));
66  std::multiset<float> significances;
67  int i=0;
68  if(tkip.primaryVertex().isNull()) { return std::multiset<float>();}
69 
70  GlobalPoint pv(tkip.primaryVertex()->position().x(),tkip.primaryVertex()->position().y(),tkip.primaryVertex()->position().z());
71 
72  for(std::vector<reco::TrackIPTagInfo::TrackIPData>::const_iterator it = impactParameters.begin(); it!=impactParameters.end(); ++it, i++) {
73  if( fabs(impactParameters[i].distanceToJetAxis.value()) < m_cutMaxDistToAxis && // distance to JetAxis
74  (impactParameters[i].closestToJetAxis - pv).mag() < m_cutMaxDecayLen && // max decay len
75  (m_useAllQualities == true || (*tracks[i]).quality(m_trackQuality)) // use selected track qualities
76  ) {
77  if (useVariableJTA_) {
78  if (tkip.variableJTA( varJTApars )[i]) significances.insert( ((m_ipType==0)?it->ip3d:it->ip2d).significance() );
79  }
80  else // no using variable JTA, use the default method
81  if(m_deltaR <=0 || ROOT::Math::VectorUtil::DeltaR((*tkip.jet()).p4().Vect(), (*tracks[i]).momentum()) < m_deltaR)
82  significances.insert( ((m_ipType==0)?it->ip3d:it->ip2d).significance() );
83  }
84  }
85 
86  return significances;
87  }
int i
Definition: DBlmapReader.cc:9
const edm::Ref< VertexCollection > & primaryVertex() const
bool isNull() const
Checks for null.
Definition: Ref.h:247
double p4[4]
Definition: TauolaWrapper.h:92
reco::TrackIPTagInfo::variableJTAParameters varJTApars
std::vector< bool > variableJTA(const variableJTAParameters &params) const
virtual edm::RefToBase< Jet > jet(void) const
returns a polymorphic reference to the tagged jet
Definition: JTATagInfo.h:20
tuple tracks
Definition: testEve_cfg.py:39
const std::vector< TrackIPData > & impactParameterData() const
reco::TrackBase::TrackQuality m_trackQuality
const edm::RefVector< TrackCollection > & selectedTracks() const

Member Data Documentation

double TrackCountingComputer::m_cutMaxDecayLen
protected

Definition at line 96 of file TrackCountingComputer.h.

Referenced by TrackCountingComputer().

double TrackCountingComputer::m_cutMaxDistToAxis
protected

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

int TrackCountingComputer::m_ipType
protected

Definition at line 94 of file TrackCountingComputer.h.

Referenced by TrackCountingComputer().

int TrackCountingComputer::m_nthTrack
protected
reco::TrackBase::TrackQuality TrackCountingComputer::m_trackQuality
protected

Definition at line 98 of file TrackCountingComputer.h.

Referenced by TrackCountingComputer().

bool TrackCountingComputer::m_useAllQualities
protected

Definition at line 99 of file TrackCountingComputer.h.

Referenced by orderedSignificances(), and TrackCountingComputer().

bool TrackCountingComputer::useVariableJTA_
protected

Definition at line 90 of file TrackCountingComputer.h.

Referenced by orderedSignificances(), and TrackCountingComputer().

reco::TrackIPTagInfo::variableJTAParameters TrackCountingComputer::varJTApars
protected

Definition at line 91 of file TrackCountingComputer.h.

Referenced by orderedSignificances(), and TrackCountingComputer().