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" || trackQualityType ==
"Any" || trackQualityType ==
"ANY")
46 parameters.getParameter<
double>(
"min_pT_dRcut"),
47 parameters.getParameter<
double>(
"max_pT_dRcut"),
48 parameters.getParameter<
double>(
"max_pT_trackPTcut")};
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++) {
80 probabilities.push_back(
p);
82 probabilitiesB.push_back(*
it);
85 probabilitiesB.push_back(-*
it);
92 probabilities.push_back(
p);
95 probabilitiesB.push_back(*
it);
98 probabilitiesB.push_back(-*
it);
105 std::sort(probabilitiesB.begin(), probabilitiesB.end());
114 int ngoodtracks =
v.size();
117 for (std::vector<float>::const_iterator
q =
v.begin();
q !=
v.end();
q++) {
122 double Loginvlog = 0;
125 if (ngoodtracks >= 2) {
126 Loginvlog =
log(-SumJet);
130 for (
int l = 1;
l != ngoodtracks;
l++) {
132 Prob +=
exp(
l * Loginvlog -
log(1. * lfact));
134 double LogProb =
log(Prob);
140 std::cout <<
"ProbJet too high: " << ProbJet << std::endl;
161 #endif // ImpactParameter_TemplatedJetBProbabilityComputer_h bool quality(const TrackQuality) const
Track quality.
reco::IPTagInfo< Container, Base > TagInfo
TrackQuality
track quality
TemplatedJetBProbabilityComputer(const edm::ParameterSet ¶meters)
const T & get(unsigned int index=0) const
const Container & selectedTracks() const
const reco::Track * toTrack(const reco::TrackBaseRef &t)
TEMPL(T2) struct Divides void
float discriminator(const TagInfoHelper &ti) const override
reco::btag::variableJTAParameters varJTApars
double m_cutMaxDistToAxis
void uses(unsigned int id, const std::string &label)
const std::vector< btag::TrackIPData > & impactParameterData() const
bool isNull() const
Checks for null.
double jetProbability(const std::vector< float > &v) const
static TrackQuality qualityByName(const std::string &name)
std::vector< bool > variableJTA(const btag::variableJTAParameters ¶ms) const
const edm::Ref< VertexCollection > & primaryVertex() const
edm::AssociationVector< reco::JetRefBaseProd, Values > Container
reco::TrackBase::TrackQuality m_trackQuality
const std::vector< float > & probabilities(int ip) const