50 tmassTopQuark_ =
sqrt(
pow((metT + lepT + bT), 2) - (topT.px() * topT.px()) - (topT.py() * topT.py()));
64 std::vector<int> maxPtIndices;
65 maxPtIndices.push_back(-1);
66 maxPtIndices.push_back(-1);
67 maxPtIndices.push_back(-1);
72 for (
int kdx = 0; kdx <
maxNJets_; ++kdx) {
73 if (kdx ==
idx || kdx == jdx)
79 maxPtIndices.push_back(
idx);
80 maxPtIndices.push_back(jdx);
81 maxPtIndices.push_back(kdx);
91 std::vector<int> wMassIndices;
92 wMassIndices.push_back(-1);
93 wMassIndices.push_back(-1);
94 for (
unsigned idx = 0;
idx < maxPtIndices.size(); ++
idx) {
95 for (
unsigned jdx = 0; jdx < maxPtIndices.size(); ++jdx) {
96 if (jdx ==
idx || maxPtIndices[
idx] > maxPtIndices[jdx])
99 if (wDist < 0. || wDist > fabs(sum.mass() -
wMass_)) {
100 wDist = fabs(sum.mass() -
wMass_);
101 wMassIndices.clear();
102 wMassIndices.push_back(maxPtIndices[
idx]);
103 wMassIndices.push_back(maxPtIndices[jdx]);
117 if (
jets.size() != bjet.size()) {
124 std::vector<int> maxBPtIndices;
125 maxBPtIndices.push_back(-1);
126 maxBPtIndices.push_back(-1);
127 maxBPtIndices.push_back(-1);
131 for (
int kdx = 0; kdx <
maxNJets_; ++kdx) {
132 if (kdx ==
idx || kdx == jdx)
135 if ((bjet[
idx] > btagWP && bjet[jdx] <= btagWP && bjet[kdx] <= btagWP) ||
136 (bjet[
idx] <= btagWP && bjet[jdx] > btagWP && bjet[kdx] <= btagWP) ||
137 (bjet[
idx] <= btagWP && bjet[jdx] <= btagWP && bjet[kdx] > btagWP)) {
139 if (maxBPt < 0. || maxBPt < sum.pt()) {
141 maxBPtIndices.clear();
142 maxBPtIndices.push_back(
idx);
143 maxBPtIndices.push_back(jdx);
144 maxBPtIndices.push_back(kdx);
150 if (maxBPtIndices[0] < 0 || maxBPtIndices[1] < 0 || maxBPtIndices[2] < 0)
163 tmassTopQuark_(-1) {}
178 std::vector<double> VbtagWP,
216 tmassTopQuark_ =
sqrt(
pow((metT + lepT + bT), 2) - (topT.px() * topT.px()) - (topT.py() * topT.py()));
226 tmassTopQuark_ =
sqrt(
pow((metT + lepT + bT), 2) - (topT.px() * topT.px()) - (topT.py() * topT.py()));
240 std::vector<int> maxPtIndices;
241 maxPtIndices.push_back(-1);
242 maxPtIndices.push_back(-1);
243 maxPtIndices.push_back(-1);
248 for (
int kdx = 0; kdx <
maxNJets_; ++kdx) {
249 if (kdx ==
idx || kdx == jdx)
254 maxPtIndices.clear();
255 maxPtIndices.push_back(
idx);
256 maxPtIndices.push_back(jdx);
257 maxPtIndices.push_back(kdx);
267 std::vector<int> wMassIndices;
268 wMassIndices.push_back(-1);
269 wMassIndices.push_back(-1);
270 for (
unsigned idx = 0;
idx < maxPtIndices.size(); ++
idx) {
271 for (
unsigned jdx = 0; jdx < maxPtIndices.size(); ++jdx) {
272 if (jdx ==
idx || maxPtIndices[
idx] > maxPtIndices[jdx])
275 if (wDist < 0. || wDist > fabs(sum.mass() -
wMass_)) {
276 wDist = fabs(sum.mass() -
wMass_);
277 wMassIndices.clear();
278 wMassIndices.push_back(maxPtIndices[
idx]);
279 wMassIndices.push_back(maxPtIndices[jdx]);
295 if (
jets.size() != bjet.size()) {
302 std::vector<int> maxBPtIndices;
303 maxBPtIndices.push_back(-1);
304 maxBPtIndices.push_back(-1);
305 maxBPtIndices.push_back(-1);
309 for (
int kdx = 0; kdx <
maxNJets_; ++kdx) {
310 if (kdx ==
idx || kdx == jdx)
313 if ((bjet[
idx] > btagWP && bjet[jdx] <= btagWP && bjet[kdx] <= btagWP) ||
314 (bjet[
idx] <= btagWP && bjet[jdx] > btagWP && bjet[kdx] <= btagWP) ||
315 (bjet[
idx] <= btagWP && bjet[jdx] <= btagWP && bjet[kdx] > btagWP)) {
317 if (maxBPt < 0. || maxBPt < sum.pt()) {
319 maxBPtIndices.clear();
320 maxBPtIndices.push_back(
idx);
321 maxBPtIndices.push_back(jdx);
322 maxBPtIndices.push_back(kdx);
328 if (maxBPtIndices[0] < 0 || maxBPtIndices[1] < 0 || maxBPtIndices[2] < 0)
double massWBoson_
cache of w boson mass estimate
Analysis-level MET class.
double massBTopQuark_
cache of b-tagged top quark mass estimate
double massBTopQuark(const std::vector< reco::Jet > &jets, std::vector< double > VbtagWP, double btagWP_)
calculate b-tagged t-quark mass estimate
double tmassWBoson(pat::Muon *lep, const pat::MET &met, const pat::Jet &b)
calculate W boson transverse mass estimate
double massTopQuark_
cache of top quark mass estimate
double massTopQuark_
cache of top quark mass estimate
double tmassTopQuark_
cache of top quark transverse mass estimate
Base class for all types of Jets.
double massTopQuark(const std::vector< reco::Jet > &jets)
calculate t-quark mass estimate
bool failed_
indicate failed associations
double massWBoson(const std::vector< pat::Jet > &jets)
calculate W boson mass estimate
double massWBoson_
cache of w boson mass estimate
double massWBoson(const std::vector< reco::Jet > &jets)
calculate W boson mass estimate
const LorentzVector & p4() const final
four-momentum Lorentz vector
void operator2(const std::vector< reco::Jet > &, std::vector< double >, double)
do the calculation of the t-quark mass with one b-jet
double px() const final
x coordinate of momentum vector
double tmassWBoson_
cache of W boson transverse mass estimate
int maxNJets_
max. number of jets to be considered
void operator()(const std::vector< pat::Jet > &jets)
int maxNJets_
max. number of jets to be considered
double wMass_
paramater of the w boson mass
double wMass_
paramater of the w boson mass
const LorentzVector & p4(P4Kind kind) const
double tmassTopQuark(reco::RecoCandidate *lep, const reco::MET &met, const reco::Jet &b)
calculate top quark transverse mass estimate
double py() const final
y coordinate of momentum vector
double massTopQuark(const std::vector< pat::Jet > &jets)
calculate t-quark mass estimate
double tmassTopQuark(pat::Muon *lep, const pat::MET &met, const pat::Jet &b)
calculate top quark transverse mass estimate
void operator2(const std::vector< pat::Jet > &, std::vector< double >, double)
do the calculation of the t-quark mass with one b-jet
double tmassWBoson(reco::RecoCandidate *lep, const reco::MET &met, const reco::Jet &b)
calculate W boson transverse mass estimate
double massBTopQuark(const std::vector< pat::Jet > &jets, std::vector< double > VbtagWP, double btagWP_)
calculate b-tagged t-quark mass estimate
Analysis-level electron class.
Analysis-level calorimeter jet class.
void operator()(const std::vector< reco::Jet > &jets)
bool failed_
indicate failed associations
Calculate_miniAOD(int maxNJets, double wMass)
default constructor
double tmassTopQuark_
cache of top quark transverse mass estimate
Calculate(int maxNJets, double wMass)
default constructor
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Analysis-level muon class.
Power< A, B >::type pow(const A &a, const B &b)
double tmassWBoson_
cache of W boson transverse mass estimate
double massBTopQuark_
cache of b-tagged top quark mass estimate