105 std::set<int> bHadronIdxs;
106 for (
size_t i = 0,
n = genParticleHandle->size();
i <
n; ++
i) {
114 bHadronIdxs.insert(-
i - 1);
119 std::vector<size_t> leptonIdxs;
120 for (
size_t i = 0,
n = finalStateHandle->size();
i <
n; ++
i) {
122 const int absPdgId =
abs(
p.pdgId());
127 if (
p.numberOfMothers() == 0)
129 if (
p.mother()->status() == 4)
137 leptonIdxs.push_back(
i);
152 std::vector<fastjet::PseudoJet> fjLepInputs;
153 fjLepInputs.reserve(leptonIdxs.size());
154 for (
auto index : leptonIdxs) {
159 fjLepInputs.push_back(fastjet::PseudoJet(
p.px(),
p.py(),
p.pz(),
p.energy()));
160 fjLepInputs.back().set_user_index(
index);
164 fastjet::ClusterSequence fjLepClusterSeq(fjLepInputs, *
fjLepDef_);
165 std::vector<fastjet::PseudoJet> fjLepJets = fastjet::sorted_by_pt(fjLepClusterSeq.inclusive_jets(
minLeptonPt_));
168 leptons->reserve(fjLepJets.size());
169 std::set<size_t> lepDauIdxs;
170 for (
auto& fjJet : fjLepJets) {
175 const std::vector<fastjet::PseudoJet> fjConstituents = fastjet::sorted_by_pt(fjJet.constituents());
177 std::vector<reco::CandidatePtr> constituents;
179 for (
auto& fjConstituent : fjConstituents) {
180 const size_t index = fjConstituent.user_index();
182 const int absPdgId =
abs(
cand->pdgId());
183 if (absPdgId == 11
or absPdgId == 13) {
188 constituents.push_back(
cand);
193 const LorentzVector jetP4(fjJet.px(), fjJet.py(), fjJet.pz(), fjJet.E());
197 lepJet.setPdgId(lepCand->
pdgId());
198 lepJet.setCharge(lepCand->
charge());
200 const double jetArea = fjJet.has_area() ? fjJet.area() : 0;
201 lepJet.setJetArea(jetArea);
206 for (
auto& fjConstituent : fjConstituents) {
207 lepDauIdxs.insert(fjConstituent.user_index());
214 std::vector<fastjet::PseudoJet> fjJetInputs;
215 fjJetInputs.reserve(nStables);
216 for (
size_t i = 0,
n = finalStateHandle->size();
i <
n; ++
i) {
224 if (absId == 12
or absId == 14
or absId == 16)
226 if (lepDauIdxs.find(
i) != lepDauIdxs.end())
229 fjJetInputs.push_back(fastjet::PseudoJet(
p.px(),
p.py(),
p.pz(),
p.energy()));
230 fjJetInputs.back().set_user_index(
i);
233 for (
auto index : bHadronIdxs) {
238 const double scale = 1
e-20 /
p.p();
240 fjJetInputs.back().set_user_index(
index);
244 fastjet::ClusterSequence fjJetClusterSeq(fjJetInputs, *
fjJetDef_);
245 std::vector<fastjet::PseudoJet> fjJets = fastjet::sorted_by_pt(fjJetClusterSeq.inclusive_jets(
minJetPt_));
248 jets->reserve(fjJets.size());
249 std::vector<size_t> bjetIdxs, ljetIdxs;
250 for (
auto& fjJet : fjJets) {
255 const std::vector<fastjet::PseudoJet> fjConstituents = fastjet::sorted_by_pt(fjJet.constituents());
257 std::vector<reco::CandidatePtr> constituents;
258 bool hasBHadron =
false;
259 for (
size_t j = 0,
m = fjConstituents.size();
j <
m; ++
j) {
260 const int index = fjConstituents[
j].user_index();
261 if (bHadronIdxs.find(
index) != bHadronIdxs.end()) {
266 constituents.push_back(
cand);
269 const LorentzVector jetP4(fjJet.px(), fjJet.py(), fjJet.pz(), fjJet.E());
273 const double jetArea = fjJet.has_area() ? fjJet.area() : 0;
274 genJet.setJetArea(jetArea);
277 bjetIdxs.push_back(
jets->size());
279 ljetIdxs.push_back(
jets->size());
282 jets->push_back(genJet);
288 if (bjetIdxs.size() < 2)
294 const int q1 =
leptons->at(0).charge();
295 const int q2 =
leptons->at(1).charge();
310 int selNu1 = -1, selNu2 = -1;
311 for (
int i = 0;
i < 2; ++
i) {
313 for (
int j = 0;
j < 2; ++
j) {
317 const double newDm = dm1 + dm2;
331 const auto w1LVec = lepton1.p4() + nu1.p4();
332 const auto w2LVec = lepton2.p4() + nu2.p4();
336 int selB1 = -1, selB2 = -1;
337 for (
auto i : bjetIdxs) {
339 for (
auto j : bjetIdxs) {
343 const double newDm = dm1 + dm2;
357 const auto t1LVec = w1LVec +
bJet1.p4();
358 const auto t2LVec = w2LVec +
bJet2.p4();
361 const int lepQ1 = lepton1.charge();
362 const int lepQ2 = lepton2.charge();
389 }
else if (!
leptons->empty() and !
neutrinos->empty() and ljetIdxs.size() >= 2) {
391 const auto& lepton =
leptons->at(0);
396 bool hasVetoLepton =
false;
397 for (
auto vetoLeptonItr =
next(
leptons->begin()); vetoLeptonItr !=
leptons->end(); ++vetoLeptonItr) {
400 hasVetoLepton =
true;
407 double metX = 0, metY = 0;
408 for (
const auto& neutrino : *
neutrinos) {
409 metX += neutrino.px();
410 metY += neutrino.py();
412 const double metPt = std::hypot(metX, metY);
416 const double mtW =
std::sqrt(2 * lepton.pt() * metPt *
cos(lepton.phi() - atan2(metX, metY)));
426 const double lpz = lepton.pz(), le = lepton.energy(), lpt = lepton.pt();
427 const double cf = (
wMass_ *
wMass_) / 2 + lepton.px() * metX + lepton.py() * metY;
428 const double det = cf * cf * lpz * lpz - lpt * lpt * (le * le * metPt * metPt - cf * cf);
429 const double pz = (cf * lpz + (cf < 0 ? -
sqrt(det) :
sqrt(det))) / lpt / lpt;
431 const auto w1LVec = lepton.p4() + nu1P4;
436 for (
auto b1Itr = bjetIdxs.begin(); b1Itr != bjetIdxs.end(); ++b1Itr) {
437 const double dR =
deltaR(
jets->at(*b1Itr).p4(), w1LVec);
446 const auto t1LVec = w1LVec +
bJet1.p4();
449 const auto& wJet1 =
jets->at(ljetIdxs[0]);
450 const auto& wJet2 =
jets->at(ljetIdxs[1]);
451 const auto w2LVec = wJet1.p4() + wJet2.p4();
456 for (
auto i : bjetIdxs) {
469 const auto t2LVec = w2LVec +
bJet2.p4();
471 const int q = lepton.charge();
const edm::EDGetTokenT< edm::View< reco::Candidate > > genParticleToken_
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
reco::Particle::Point genVertex_
const double maxLeptonEtaSemilepton_
common ppss p3p6s2 common epss epspn46 common const1 w2
const double maxLeptonEta_
const double minVetoLeptonPtSemilepton_
const double maxLeptonEtaDilepton_
virtual double pt() const =0
transverse momentum
std::shared_ptr< JetDef > fjJetDef_
std::vector< GenJet > GenJetCollection
collection of GenJet objects
void writeSpecific(reco::CaloJet &jet, reco::Particle::LorentzVector const &p4, reco::Particle::Point const &point, std::vector< reco::CandidatePtr > const &constituents, CaloGeometry const &geometry, HcalTopology const &topology)
std::shared_ptr< JetDef > fjLepDef_
const double minMtWSemiLepton_
const double minMETSemiLepton_
const double minLeptonPtSemilepton_
bool isNull() const
Checks for null.
bJet1
do the razor with one or two b jets (medium CSV)
bool isNonnull() const
Checks for non-null.
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
Jets made from MC generator particles.
math::XYZTLorentzVector LorentzVector
virtual int charge() const =0
electric charge
virtual int pdgId() const =0
PDG identifier.
weight_default_t w1[2000]
math::XYZTLorentzVector LorentzVector
Lorentz vector.
bool isFromHadron(const reco::Candidate *p) const
const double maxVetoLeptonEtaSemilepton_
const double minLeptonPt_
const double minDileptonMassDilepton_
const edm::EDGetTokenT< edm::View< reco::Candidate > > finalStateToken_
const double minLeptonPtDilepton_
bool isBHadron(const reco::Candidate *p) const