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" ||
57 const TagInfo & tkip = ti.
get<TagInfo>();
60 const std::vector<reco::btag::TrackIPData> & impactParameters((tkip.
impactParameterData()));
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 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);}
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());
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
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
edm::AssociationVector< reco::JetRefBaseProd, Values > Container
reco::TrackBase::TrackQuality m_trackQuality