24 std::vector<double> VbtagWP,
double btagWP_) {
48 sqrt(
pow(metT + lepT, 2) - (WT.px() * WT.px()) - (WT.py() * WT.py()));
51 (topT.py() * topT.py()));
64 std::vector<int> maxPtIndices;
65 maxPtIndices.push_back(-1);
66 maxPtIndices.push_back(-1);
67 maxPtIndices.push_back(-1);
70 for (
int jdx = 0; jdx <
maxNJets_; ++jdx) {
71 if (jdx <=
idx)
continue;
72 for (
int kdx = 0; kdx <
maxNJets_; ++kdx) {
73 if (kdx ==
idx || kdx == jdx)
continue;
75 jets[
idx].p4() + jets[jdx].p4() + jets[kdx].p4();
76 if (maxPt < 0. || maxPt < sum.pt()) {
79 maxPtIndices.push_back(
idx);
80 maxPtIndices.push_back(jdx);
81 maxPtIndices.push_back(kdx);
86 massTopQuark_ = (jets[maxPtIndices[0]].p4() + jets[maxPtIndices[1]].p4() +
87 jets[maxPtIndices[2]].p4()).mass();
92 std::vector<int> wMassIndices;
93 wMassIndices.push_back(-1);
94 wMassIndices.push_back(-1);
95 for (
unsigned idx = 0;
idx < maxPtIndices.size(); ++
idx) {
96 for (
unsigned jdx = 0; jdx < maxPtIndices.size(); ++jdx) {
97 if (jdx ==
idx || maxPtIndices[
idx] > maxPtIndices[jdx])
continue;
99 jets[maxPtIndices[
idx]].p4() + jets[maxPtIndices[jdx]].p4();
100 if (wDist < 0. || wDist > fabs(sum.mass() -
wMass_)) {
101 wDist = fabs(sum.mass() -
wMass_);
102 wMassIndices.clear();
103 wMassIndices.push_back(maxPtIndices[
idx]);
104 wMassIndices.push_back(maxPtIndices[jdx]);
109 (jets[wMassIndices[0]].p4() + jets[wMassIndices[1]].p4()).mass();
113 std::vector<double> bjet,
double btagWP) {
119 if (jets.size() != bjet.size()) {
126 std::vector<int> maxBPtIndices;
127 maxBPtIndices.push_back(-1);
128 maxBPtIndices.push_back(-1);
129 maxBPtIndices.push_back(-1);
131 for (
int jdx = 0; jdx <
maxNJets_; ++jdx) {
132 if (jdx <=
idx)
continue;
133 for (
int kdx = 0; kdx <
maxNJets_; ++kdx) {
134 if (kdx ==
idx || kdx == jdx)
continue;
136 if ((bjet[
idx] > btagWP && bjet[jdx] <= btagWP &&
137 bjet[kdx] <= btagWP) ||
138 (bjet[
idx] <= btagWP && bjet[jdx] > btagWP &&
139 bjet[kdx] <= btagWP) ||
140 (bjet[
idx] <= btagWP && bjet[jdx] <= btagWP &&
141 bjet[kdx] > btagWP)) {
143 jets[
idx].p4() + jets[jdx].p4() + jets[kdx].p4();
144 if (maxBPt < 0. || maxBPt < sum.pt()) {
146 maxBPtIndices.clear();
147 maxBPtIndices.push_back(
idx);
148 maxBPtIndices.push_back(jdx);
149 maxBPtIndices.push_back(kdx);
155 if (maxBPtIndices[0] < 0 || maxBPtIndices[1] < 0 || maxBPtIndices[2] < 0)
157 massBTopQuark_ = (jets[maxBPtIndices[0]].p4() + jets[maxBPtIndices[1]].p4() +
158 jets[maxBPtIndices[2]].p4()).mass();
double massWBoson_
cache of w boson mass estimate
double massBTopQuark(const std::vector< reco::Jet > &jets, std::vector< double > VbtagWP, double btagWP_)
calculate b-tagged t-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
double massWBoson(const std::vector< reco::Jet > &jets)
calculate W boson mass estimate
void operator2(const std::vector< reco::Jet > &, std::vector< double >, double)
do the calculation of the t-quark mass with one b-jet
int maxNJets_
max. number of jets to be considered
double wMass_
paramater of the w boson mass
double tmassTopQuark(reco::RecoCandidate *lep, const reco::MET &met, const reco::Jet &b)
calculate top quark transverse mass estimate
double tmassWBoson(reco::RecoCandidate *lep, const reco::MET &met, const reco::Jet &b)
calculate W boson transverse mass estimate
virtual double px() const
x coordinate of momentum vector
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
void operator()(const std::vector< reco::Jet > &jets)
bool failed_
indicate failed associations
volatile std::atomic< bool > shutdown_flag false
Calculate(int maxNJets, double wMass)
default constructor
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
virtual double py() const
y coordinate of momentum vector
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