1 #ifndef ImpactParameter_JetBProbabilityComputer_h
2 #define ImpactParameter_JetBProbabilityComputer_h
8 #include "Math/GenVector/VectorUtil.h"
32 if (trackQualityType ==
"any" ||
33 trackQualityType ==
"Any" ||
63 std::vector<float> probabilities;
64 std::vector<float> probabilitiesB;
66 for(std::vector<float>::const_iterator it = allProbabilities.begin(); it!=allProbabilities.end(); ++it, i++)
68 if (fabs(impactParameters[i].distanceToJetAxis.value()) < m_cutMaxDistToAxis &&
69 (impactParameters[i].closestToJetAxis - pv).mag() < m_cutMaxDecayLen &&
77 if(m_trackSign>0 || *it <0 ) probabilities.push_back(p);
78 if(m_trackSign>0 && *it >=0){probabilitiesB.push_back(*it);}
79 if(m_trackSign<0 && *it <=0){probabilitiesB.push_back(- *it);}
83 if( m_deltaR < 0 || ROOT::Math::VectorUtil::DeltaR((*tkip.jet()).
p4().Vect(), (*
tracks[
i]).momentum()) < m_deltaR)
86 if(m_trackSign>0 || *it <0 ) probabilities.push_back(p);
88 if(m_trackSign>0 && *it >=0){probabilitiesB.push_back(*it);}
89 if(m_trackSign<0 && *it <=0){probabilitiesB.push_back(- *it);}
95 std::sort(probabilitiesB.begin(), probabilitiesB.end());
96 if(probabilitiesB.size() >
m_nbTracks ) probabilitiesB.resize(m_nbTracks);
99 return -
log(b)/4-
log(all)/4;
104 int ngoodtracks=v.size();
107 for(std::vector<float>::const_iterator
q = v.begin();
q != v.end();
q++){
116 Loginvlog=
log(-SumJet);
120 for(
int l=1;
l!=ngoodtracks;
l++){
122 Prob+=
exp(
l*Loginvlog-
log(1.*lfact));
124 double LogProb=
log(Prob);
131 std::cout <<
"ProbJet too high: " << ProbJet << std::endl;
152 #endif // ImpactParameter_JetBProbabilityComputer_h
double m_cutMaxDistToAxis
T getParameter(std::string const &) const
const std::vector< float > & probabilities(int ip) const
JetBProbabilityComputer(const edm::ParameterSet ¶meters)
const T & get(unsigned int index=0) const
std::vector< bool > variableJTA(const btag::variableJTAParameters ¶ms) const
TrackQuality
track quality
const Container & selectedTracks() const
double jetProbability(const std::vector< float > &v) const
reco::TrackBase::TrackQuality m_trackQuality
const edm::Ref< VertexCollection > & primaryVertex() const
float discriminator(const TagInfoHelper &ti) const
const T & max(const T &a, const T &b)
void uses(unsigned int id, const std::string &label)
bool isNull() const
Checks for null.
const std::vector< btag::TrackIPData > & impactParameterData() const
static TrackQuality qualityByName(const std::string &name)
reco::btag::variableJTAParameters varJTApars