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
JetBProbabilityComputer(const edm::ParameterSet ¶meters)
const T & get(unsigned int index=0) const
const edm::Ref< VertexCollection > & primaryVertex() const
TrackQuality
track quality
double jetProbability(const std::vector< float > &v) const
reco::TrackBase::TrackQuality m_trackQuality
bool isNull() const
Checks for null.
float discriminator(const TagInfoHelper &ti) const
std::vector< bool > variableJTA(const variableJTAParameters ¶ms) const
void uses(unsigned int id, const std::string &label)
const std::vector< float > & probabilities(int ip) const
virtual edm::RefToBase< Jet > jet(void) const
returns a polymorphic reference to the tagged jet
reco::TrackIPTagInfo::variableJTAParameters varJTApars
static TrackQuality qualityByName(const std::string &name)
const std::vector< TrackIPData > & impactParameterData() const
const edm::RefVector< TrackCollection > & selectedTracks() const