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);
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);
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();
176 tmassTopQuark_(-1) {}
189 std::vector<double> VbtagWP,
double btagWP_) {
229 sqrt(
pow(metT + lepT, 2) - (WT.px() * WT.px()) - (WT.py() * WT.py()));
232 (topT.py() * topT.py()));
243 sqrt(
pow(metT + lepT, 2) - (WT.px() * WT.px()) - (WT.py() * WT.py()));
246 (topT.py() * topT.py()));
260 std::vector<int> maxPtIndices;
261 maxPtIndices.push_back(-1);
262 maxPtIndices.push_back(-1);
263 maxPtIndices.push_back(-1);
268 for (
int kdx = 0; kdx <
maxNJets_; ++kdx) {
269 if (kdx ==
idx || kdx == jdx)
continue;
271 jets[
idx].p4() + jets[jdx].p4() + jets[kdx].p4();
272 if (maxPt < 0. || maxPt < sum.pt()) {
274 maxPtIndices.clear();
275 maxPtIndices.push_back(
idx);
276 maxPtIndices.push_back(jdx);
277 maxPtIndices.push_back(kdx);
282 massTopQuark_ = (jets[maxPtIndices[0]].p4() + jets[maxPtIndices[1]].p4() +
283 jets[maxPtIndices[2]].p4()).
mass();
288 std::vector<int> wMassIndices;
289 wMassIndices.push_back(-1);
290 wMassIndices.push_back(-1);
291 for (
unsigned idx = 0;
idx < maxPtIndices.size(); ++
idx) {
292 for (
unsigned jdx = 0; jdx < maxPtIndices.size(); ++jdx) {
293 if (jdx ==
idx || maxPtIndices[
idx] > maxPtIndices[jdx])
continue;
295 jets[maxPtIndices[
idx]].p4() + jets[maxPtIndices[jdx]].p4();
296 if (wDist < 0. || wDist > fabs(sum.mass() -
wMass_)) {
297 wDist = fabs(sum.mass() -
wMass_);
298 wMassIndices.clear();
299 wMassIndices.push_back(maxPtIndices[
idx]);
300 wMassIndices.push_back(maxPtIndices[jdx]);
305 (jets[wMassIndices[0]].p4() + jets[wMassIndices[1]].p4()).
mass();
309 std::vector<double> bjet,
double btagWP) {
317 if (jets.size() != bjet.size()) {
324 std::vector<int> maxBPtIndices;
325 maxBPtIndices.push_back(-1);
326 maxBPtIndices.push_back(-1);
327 maxBPtIndices.push_back(-1);
331 for (
int kdx = 0; kdx <
maxNJets_; ++kdx) {
332 if (kdx ==
idx || kdx == jdx)
continue;
334 if ((bjet[
idx] > btagWP && bjet[jdx] <= btagWP &&
335 bjet[kdx] <= btagWP) ||
336 (bjet[
idx] <= btagWP && bjet[jdx] > btagWP &&
337 bjet[kdx] <= btagWP) ||
338 (bjet[
idx] <= btagWP && bjet[jdx] <= btagWP &&
339 bjet[kdx] > btagWP)) {
341 jets[
idx].p4() + jets[jdx].p4() + jets[kdx].p4();
342 if (maxBPt < 0. || maxBPt < sum.pt()) {
344 maxBPtIndices.clear();
345 maxBPtIndices.push_back(
idx);
346 maxBPtIndices.push_back(jdx);
347 maxBPtIndices.push_back(kdx);
353 if (maxBPtIndices[0] < 0 || maxBPtIndices[1] < 0 || maxBPtIndices[2] < 0)
355 massBTopQuark_ = (jets[maxBPtIndices[0]].p4() + jets[maxBPtIndices[1]].p4() +
356 jets[maxBPtIndices[2]].p4()).
mass();
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
const LorentzVector & p4(P4Kind kind) const
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
void operator2(const std::vector< reco::Jet > &, std::vector< double >, double)
do the calculation of the t-quark mass with one b-jet
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
virtual double py() const final
y coordinate of momentum vector
double wMass_
paramater of the w boson mass
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 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
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
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
virtual double px() const final
x coordinate of momentum vector
volatile std::atomic< bool > shutdown_flag false
Calculate(int maxNJets, double wMass)
default constructor
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Analysis-level muon class.
virtual const LorentzVector & p4() const final
four-momentum Lorentz 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