5 #include "TLorentzVector.h" 11 bool only6Jets =
true,
12 ROOT::Math::Boost
boost = ROOT::Math::Boost(0., 0., 0.)) {
13 std::vector<math::XYZVector>
p;
14 bool doBoost = (
boost == ROOT::Math::Boost(0., 0., 0.)) ?
false :
true;
15 for (std::vector<pat::Jet>::const_iterator
jet =
jets.begin();
jet !=
jets.end(); ++
jet) {
18 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > Ljet(
jet->px(),
jet->py(),
jet->pz(),
jet->energy());
23 if (only6Jets &&
jet -
jets.begin() == 5)
90 pts_ = std::vector<double>(0);
92 thetas_ = std::vector<double>(0);
123 dR_ = std::vector<double>(0);
124 dRMass_ = std::vector<double>(0);
132 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > totalSystem(0., 0., 0., 0.);
134 std::vector<std::pair<double, std::vector<unsigned short> > > dRs(0);
135 std::vector<std::pair<double, std::vector<unsigned short> > > dRs3Jets(0);
137 std::vector<std::pair<double, std::vector<unsigned short> > > M3s(0);
139 std::vector<ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > > fourVectors(0);
141 unsigned short nonBJets = 0;
142 for (std::vector<pat::Jet>::const_iterator
jet =
jets.begin();
jet !=
jets.end(); ++
jet) {
171 fourVectors.push_back(
jet->p4());
173 if (
jet->bDiscriminator(
"trackCountingHighEffBJetTags") > 3.3)
175 if (
jet->bDiscriminator(
"trackCountingHighPurBJetTags") > 3.41)
177 if (
jet->bDiscriminator(
"simpleSecondaryVertexHighEffBJetTags") > 1.74)
179 if (
jet->bDiscriminator(
"simpleSecondaryVertexHighPurBJetTags") > 2.0)
181 if (
jet->bDiscriminator(
"combinedSecondaryVertexBJetTags") > 0.75)
183 if (
jet->bDiscriminator(
"combinedSecondaryVertexMVABJetTags") > 0.75)
185 if (
jet->bDiscriminator(
"softMuonBJetTags") > 0.3)
188 if (
jet->nConstituents() > 0) {
206 if (
jet->bDiscriminator(
"trackCountingHighEffBJetTags") < 3.3 &&
207 jet->bDiscriminator(
"trackCountingHighPurBJetTags") < 1.93 &&
208 jet->bDiscriminator(
"simpleSecondaryVertexHighEffBJetTags") < 1.74 &&
209 jet->bDiscriminator(
"simpleSecondaryVertexHighPurBJetTags") < 2.0) {
223 for (std::vector<pat::Jet>::const_iterator jet2 =
jet + 1; jet2 !=
jets.end(); ++jet2) {
224 unsigned short comb2A[2] = {(
unsigned short)(
jet -
jets.begin()), (
unsigned short)(jet2 -
jets.begin())};
225 std::vector<unsigned short> comb2(comb2A, comb2A +
sizeof(comb2A) /
sizeof(
unsigned short));
226 dRs.push_back(std::make_pair(
deltaR(
jet->phi(),
jet->eta(), jet2->phi(), jet2->eta()), comb2));
228 for (std::vector<pat::Jet>::const_iterator jet3 = jet2 + 1; jet3 !=
jets.end(); ++jet3) {
229 unsigned short comb3A[3] = {(
unsigned short)(
jet -
jets.begin()),
230 (
unsigned short)(jet2 -
jets.begin()),
231 (
unsigned short)(jet3 -
jets.begin())};
232 std::vector<unsigned short> comb3(comb3A, comb3A +
sizeof(comb3A) /
sizeof(
unsigned short));
233 double dR1 =
deltaR(
jet->eta(),
jet->phi(), jet2->eta(), jet2->phi());
235 double dR3 =
deltaR(jet2->eta(), jet2->phi(), jet3->eta(), jet3->phi());
236 dRs3Jets.push_back(std::make_pair(dR1 +
dR2 + dR3, comb3));
237 M3s.push_back(std::make_pair((
jet->p4() + jet2->p4() + jet3->p4()).
pt(), comb3));
241 totalSystem +=
jet->p4();
244 ROOT::Math::Boost CoMBoostTotal(totalSystem.BoostToCM());
245 std::vector<reco::LeafCandidate> boostedJets;
247 for (std::vector<pat::Jet>::const_iterator
jet =
jets.begin();
jet !=
jets.end(); ++
jet) {
248 boostedJets.push_back(
281 std::sort(dRs3Jets.begin(), dRs3Jets.end());
283 for (
std::vector<std::pair<
double, std::vector<unsigned short> > >::const_iterator
dR = dRs.begin();
dR != dRs.end();
285 dR_.push_back(
dR->first);
288 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > wHypo =
289 jets.at(
dR->second.at(0)).p4() +
jets.at(
dR->second.at(1)).p4();
290 TLorentzVector wHypoHelper(wHypo.Px(), wHypo.Py(), wHypo.Pz(), wHypo.E());
291 wHypoHelper.SetVectM(TVector3(wHypo.Px(), wHypo.Py(), wHypo.Pz()), 80.4);
292 wHypo.SetPxPyPzE(wHypoHelper.Px(), wHypoHelper.Py(), wHypoHelper.Pz(), wHypoHelper.E());
293 ROOT::Math::Boost CoMBoostWHypo(wHypo.BoostToCM());
294 dRAngle_.push_back(ROOT::Math::VectorUtil::Angle(CoMBoostWHypo(
jets.at(
dR->second.at(0)).p4()),
295 CoMBoostWHypo(
jets.at(
dR->second.at(1)).p4())));
298 for (
std::vector<std::pair<
double, std::vector<unsigned short> > >::const_iterator
dR = dRs3Jets.begin();
299 dR != dRs3Jets.end();
303 (
jets.at(
dR->second.at(0)).p4() +
jets.at(
dR->second.at(1)).p4() +
jets.at(
dR->second.at(2)).p4()).
mass());
306 std::vector<std::pair<double, unsigned short> > massDiff2W;
312 std::sort(massDiff2W.begin(), massDiff2W.end());
316 for (
std::vector<std::pair<double, unsigned short> >::const_iterator
i = massDiff2W.begin();
i != massDiff2W.end();
318 unsigned int mass1 =
i->second;
319 for (
std::vector<std::pair<double, unsigned short> >::const_iterator
j =
i + 1;
j != massDiff2W.end(); ++
j) {
320 unsigned int mass2 =
j->second;
321 if (dRs.at(mass1).second.at(0) != dRs.at(mass2).second.at(0) &&
322 dRs.at(mass1).second.at(0) != dRs.at(mass2).second.at(1) &&
323 dRs.at(mass1).second.at(1) != dRs.at(mass2).second.at(0) &&
324 dRs.at(mass1).second.at(1) != dRs.at(mass2).second.at(1)) {
374 M3_ = (
jets.at((M3s.back().second.at(0))).p4() +
jets.at((M3s.back().second.at(1))).p4() +
375 jets.at((M3s.back().second.at(2))).p4())
382 jet != fourVectors.end();
384 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > boostedJet = CoMBoostTotal(*
jet);
385 if (
jet - fourVectors.begin() > 1) {
390 thetaStars_.push_back((boostedJet.Theta() >
M_PI / 2.) ? (
M_PI - boostedJet.Theta()) : boostedJet.Theta());
394 theta3jet_ /= (double)fourVectors.size() - 2.;
414 CAll_ = eventshapeAll.
C();
415 DAll_ = eventshapeAll.
D();
429 Thrust thrustAlgoCMS(boostedJets.begin(), boostedJets.end());
std::vector< double > etaetaMoments_
std::vector< double > TCHP_BJet_Discs_
std::vector< double > dR_
std::vector< double > massDiffMWCands_
double jets_phiphiMomentNoB_
std::vector< double > etaphiMoments_
std::vector< double > phiphiMomentsMoment_
std::vector< double > phiphiMomentsLogEt_
Class for the calculation of several event shape variables.
std::vector< double > etaphiMomentsLogEt_
std::vector< double > TCHE_BJet_Discs_
std::vector< double > phiphiMomentsNoB_
std::vector< double > dR3JetsMass_
Sin< T >::type sin(const T &t)
std::vector< double > EtStars_
std::vector< double > etaetaMomentsMomentLogEt_
double pt(unsigned short i) const
double jets_etaphiMoment_
std::vector< double > dR3Jets_
std::vector< double > etaphiMomentsMomentLogEt_
std::vector< double > etaetaMomentsLogEt_
double jets_phiphiMomentLogEt_
std::vector< math::XYZVector > makeVecForEventShape(std::vector< pat::Jet > jets, bool only6Jets=true, ROOT::Math::Boost boost=ROOT::Math::Boost(0., 0., 0.))
ALPAKA_FN_ACC static ALPAKA_FN_INLINE float dR2(Position4 pos1, Position4 pos2)
double jets_phiphiMoment_
std::vector< double > SM_BJet_Discs_
Abs< T >::type abs(const T &t)
double jets_etaetaMoment_
std::vector< double > EtSin2Thetas_
std::vector< double > etaetaMomentsNoB_
std::vector< double > thetas_
std::vector< double > pts_
std::vector< double > dRAngle_
std::vector< double > thetaStars_
XYZVectorD XYZVector
spatial vector with cartesian internal representation
double jets_etaetaMomentNoB_
double isotropy(const unsigned int &numberOfSteps=1000) const
std::vector< double > SSVHP_BJet_Discs_
std::vector< double > CSV_BJet_Discs_
double circularity(const unsigned int &numberOfSteps=1000) const
std::vector< double > SSVHE_BJet_Discs_
double jets_etaetaMomentLogEt_
std::vector< double > CSVMVA_BJet_Discs_
std::vector< double > etaphiMomentsNoB_
double jets_etaphiMomentNoB_
std::vector< double > etaphiMomentsMoment_
std::vector< double > etaetaMomentsMoment_
std::vector< double > phiphiMoments_
std::vector< double > phiphiMomentsMomentLogEt_
Power< A, B >::type pow(const A &a, const B &b)
double circularityAllCMS_
math::PtEtaPhiELorentzVectorF LorentzVector
std::vector< double > dRMass_
double jets_etaphiMomentLogEt_