1 #ifndef ImpactParameter_TemplatedJetBProbabilityComputer_h
2 #define ImpactParameter_TemplatedJetBProbabilityComputer_h
8 #include "Math/GenVector/VectorUtil.h"
13 template <
class Container,
class Base>
35 if (trackQualityType ==
"any" ||
36 trackQualityType ==
"Any" ||
66 std::vector<float> probabilities;
67 std::vector<float> probabilitiesB;
69 for(std::vector<float>::const_iterator it = allProbabilities.begin(); it!=allProbabilities.end(); ++it, i++)
71 if (fabs(impactParameters[i].distanceToJetAxis.value()) < m_cutMaxDistToAxis &&
72 (impactParameters[i].closestToJetAxis -
pv).mag() < m_cutMaxDecayLen &&
80 if(m_trackSign>0 || *it <0 ) probabilities.push_back(p);
81 if(m_trackSign>0 && *it >=0){probabilitiesB.push_back(*it);}
82 if(m_trackSign<0 && *it <=0){probabilitiesB.push_back(- *it);}
86 if( m_deltaR < 0 || ROOT::Math::VectorUtil::DeltaR((*tkip.jet()).
p4().Vect(), (*
tracks[
i]).momentum()) < m_deltaR)
89 if(m_trackSign>0 || *it <0 ) probabilities.push_back(p);
91 if(m_trackSign>0 && *it >=0){probabilitiesB.push_back(*it);}
92 if(m_trackSign<0 && *it <=0){probabilitiesB.push_back(- *it);}
98 std::sort(probabilitiesB.begin(), probabilitiesB.end());
99 if(probabilitiesB.size() >
m_nbTracks ) probabilitiesB.resize(m_nbTracks);
102 return -
log(b)/4-
log(all)/4;
107 int ngoodtracks=v.size();
110 for(std::vector<float>::const_iterator
q = v.begin();
q != v.end();
q++){
119 Loginvlog=
log(-SumJet);
123 for(
int l=1;
l!=ngoodtracks;
l++){
125 Prob+=
exp(
l*Loginvlog-
log(1.*lfact));
127 double LogProb=
log(Prob);
134 std::cout <<
"ProbJet too high: " << ProbJet << std::endl;
155 #endif // ImpactParameter_TemplatedJetBProbabilityComputer_h
T getParameter(std::string const &) const
const std::vector< float > & probabilities(int ip) const
double jetProbability(const std::vector< float > &v) const
const T & get(unsigned int index=0) const
std::vector< bool > variableJTA(const btag::variableJTAParameters ¶ms) const
EcalChannelStatus Container
TrackQuality
track quality
TemplatedJetBProbabilityComputer(const edm::ParameterSet ¶meters)
const Container & selectedTracks() const
const reco::Track * toTrack(const reco::TrackBaseRef &t)
const edm::Ref< VertexCollection > & primaryVertex() const
reco::btag::variableJTAParameters varJTApars
double m_cutMaxDistToAxis
void uses(unsigned int id, const std::string &label)
float discriminator(const TagInfoHelper &ti) const
bool isNull() const
Checks for null.
const std::vector< btag::TrackIPData > & impactParameterData() const
static TrackQuality qualityByName(const std::string &name)
bool quality(const TrackQuality) const
Track quality.
reco::IPTagInfo< Container, Base > TagInfo
reco::TrackBase::TrackQuality m_trackQuality