CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 

Public Member Functions

float discriminator (const TagInfoHelper &ti) const
 
 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

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

Definition at line 16 of file TemplatedTrackCountingComputer.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file TemplatedTrackCountingComputer.h.

References edm::ParameterSet::existsAs(), edm::false, edm::ParameterSet::getParameter(), 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.

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

Member Function Documentation

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

Reimplemented from JetTagComputer.

Definition at line 55 of file TemplatedTrackCountingComputer.h.

References JetTagComputer::TagInfoHelper::get(), 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++) nth++;
61  if(nth!=significances.rend()) return *nth; else return -100.;
62  }
int i
Definition: DBlmapReader.cc:9
reco::IPTagInfo< Container, Base > TagInfo
std::multiset< float > orderedSignificances(const TagInfo &tkip) const
template<class Container, class Base>
std::multiset<float> TemplatedTrackCountingComputer< Container, Base >::orderedSignificances ( const TagInfo tkip) const
inlineprotected

Definition at line 66 of file TemplatedTrackCountingComputer.h.

References HLT_25ns10e33_v2_cff::DeltaR, i, reco::IPTagInfo< Container, Base >::impactParameterData(), PyquenDefaultSettings_cff::impactParameters, edm::Ref< C, T, F >::isNull(), TemplatedTrackCountingComputer< Container, Base >::m_minIP, TemplatedTrackCountingComputer< Container, Base >::m_useAllQualities, TemplatedTrackCountingComputer< Container, Base >::m_useSignedIPSig, p4, reco::IPTagInfo< Container, Base >::primaryVertex(), MetAnalyzer::pv(), reco::TrackBase::quality(), reco::IPTagInfo< Container, Base >::selectedTracks(), reco::btag::toTrack(), testEve_cfg::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().

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

Member Data Documentation

template<class Container, class Base>
double TemplatedTrackCountingComputer< Container, Base >::m_cutMaxDecayLen
protected
template<class Container, class Base>
double TemplatedTrackCountingComputer< Container, Base >::m_cutMaxDistToAxis
protected
template<class Container, class Base>
double TemplatedTrackCountingComputer< Container, Base >::m_deltaR
protected
template<class Container, class Base>
int TemplatedTrackCountingComputer< Container, Base >::m_ipType
protected
template<class Container, class Base>
double TemplatedTrackCountingComputer< Container, Base >::m_minIP
protected
template<class Container, class Base>
int TemplatedTrackCountingComputer< Container, Base >::m_nthTrack
protected
template<class Container, class Base>
reco::TrackBase::TrackQuality TemplatedTrackCountingComputer< Container, Base >::m_trackQuality
protected
template<class Container, class Base>
bool TemplatedTrackCountingComputer< Container, Base >::m_useAllQualities
protected
template<class Container, class Base>
bool TemplatedTrackCountingComputer< Container, Base >::m_useSignedIPSig
protected
template<class Container, class Base>
bool TemplatedTrackCountingComputer< Container, Base >::useVariableJTA_
protected
template<class Container, class Base>
reco::btag::variableJTAParameters TemplatedTrackCountingComputer< Container, Base >::varJTApars
protected