63 std::set<int> bHadronIdxs;
64 for (
size_t i = 0,
n = genParticleHandle->size();
i <
n; ++
i) {
72 bHadronIdxs.insert(-
i - 1);
77 std::vector<size_t> leptonIdxs;
78 for (
size_t i = 0, n = finalStateHandle->size();
i <
n; ++
i) {
95 leptonIdxs.push_back(
i);
110 std::vector<fastjet::PseudoJet> fjLepInputs;
111 fjLepInputs.reserve(leptonIdxs.size());
112 for (
auto index : leptonIdxs) {
117 fjLepInputs.push_back(fastjet::PseudoJet(p.
px(), p.
py(), p.
pz(), p.
energy()));
118 fjLepInputs.back().set_user_index(
index);
122 fastjet::ClusterSequence fjLepClusterSeq(fjLepInputs, *
fjLepDef_);
123 std::vector<fastjet::PseudoJet> fjLepJets = fastjet::sorted_by_pt(fjLepClusterSeq.inclusive_jets(
minLeptonPt_));
126 leptons->reserve(fjLepJets.size());
127 std::set<size_t> lepDauIdxs;
128 for (
auto& fjJet : fjLepJets) {
133 const std::vector<fastjet::PseudoJet> fjConstituents = fastjet::sorted_by_pt(fjJet.constituents());
135 std::vector<reco::CandidatePtr> constituents;
137 for (
auto& fjConstituent : fjConstituents) {
138 const size_t index = fjConstituent.user_index();
140 const int absPdgId =
abs(cand->pdgId());
141 if (absPdgId == 11
or absPdgId == 13) {
142 if (lepCand.
isNonnull() and lepCand->pt() > cand->pt())
146 constituents.push_back(cand);
151 const LorentzVector jetP4(fjJet.px(), fjJet.py(), fjJet.pz(), fjJet.E());
155 lepJet.setPdgId(lepCand->pdgId());
156 lepJet.setCharge(lepCand->charge());
158 const double jetArea = fjJet.has_area() ? fjJet.area() : 0;
159 lepJet.setJetArea(jetArea);
164 for (
auto& fjConstituent : fjConstituents) {
165 lepDauIdxs.insert(fjConstituent.user_index());
172 std::vector<fastjet::PseudoJet> fjJetInputs;
173 fjJetInputs.reserve(nStables);
174 for (
size_t i = 0, n = finalStateHandle->size();
i <
n; ++
i) {
182 if (absId == 12
or absId == 14
or absId == 16)
184 if (lepDauIdxs.find(
i) != lepDauIdxs.end())
187 fjJetInputs.push_back(fastjet::PseudoJet(p.
px(), p.
py(), p.
pz(), p.
energy()));
188 fjJetInputs.back().set_user_index(
i);
191 for (
auto index : bHadronIdxs) {
196 const double scale = 1
e-20 / p.
p();
198 fjJetInputs.back().set_user_index(index);
202 fastjet::ClusterSequence fjJetClusterSeq(fjJetInputs, *
fjJetDef_);
203 std::vector<fastjet::PseudoJet> fjJets = fastjet::sorted_by_pt(fjJetClusterSeq.inclusive_jets(
minJetPt_));
206 jets->reserve(fjJets.size());
207 std::vector<size_t> bjetIdxs, ljetIdxs;
208 for (
auto& fjJet : fjJets) {
213 const std::vector<fastjet::PseudoJet> fjConstituents = fastjet::sorted_by_pt(fjJet.constituents());
215 std::vector<reco::CandidatePtr> constituents;
216 bool hasBHadron =
false;
217 for (
size_t j = 0,
m = fjConstituents.size();
j <
m; ++
j) {
218 const int index = fjConstituents[
j].user_index();
219 if (bHadronIdxs.find(index) != bHadronIdxs.end()) {
224 constituents.push_back(cand);
227 const LorentzVector jetP4(fjJet.px(), fjJet.py(), fjJet.pz(), fjJet.E());
231 const double jetArea = fjJet.has_area() ? fjJet.area() : 0;
232 genJet.setJetArea(jetArea);
235 bjetIdxs.push_back(
jets->size());
237 ljetIdxs.push_back(
jets->size());
240 jets->push_back(genJet);
246 if (bjetIdxs.size() < 2)
250 if (
leptons->size() == 2 and neutrinos->size() >= 2) {
252 const int q1 =
leptons->at(0).charge();
253 const int q2 =
leptons->at(1).charge();
268 int selNu1 = -1, selNu2 = -1;
269 for (
int i = 0;
i < 2; ++
i) {
271 for (
int j = 0;
j < 2; ++
j) {
275 const double newDm = dm1 + dm2;
287 const auto& nu1 = neutrinos->at(selNu1);
288 const auto& nu2 = neutrinos->at(selNu2);
289 const auto w1LVec = lepton1.p4() + nu1.p4();
290 const auto w2LVec = lepton2.p4() + nu2.p4();
294 int selB1 = -1, selB2 = -1;
295 for (
auto i : bjetIdxs) {
297 for (
auto j : bjetIdxs) {
301 const double newDm = dm1 + dm2;
315 const auto t1LVec = w1LVec +
bJet1.p4();
316 const auto t2LVec = w2LVec +
bJet2.p4();
319 const int lepQ1 = lepton1.charge();
320 const int lepQ2 = lepton2.charge();
347 }
else if (!
leptons->empty() and !neutrinos->empty() and ljetIdxs.size() >= 2) {
349 const auto& lepton =
leptons->at(0);
354 bool hasVetoLepton =
false;
355 for (
auto vetoLeptonItr =
next(
leptons->begin()); vetoLeptonItr !=
leptons->end(); ++vetoLeptonItr) {
358 hasVetoLepton =
true;
365 double metX = 0, metY = 0;
366 for (
const auto& neutrino : *neutrinos) {
367 metX += neutrino.px();
368 metY += neutrino.py();
370 const double metPt = std::hypot(metX, metY);
374 const double mtW =
std::sqrt(2 * lepton.pt() * metPt *
cos(lepton.phi() - atan2(metX, metY)));
384 const double lpz = lepton.pz(), le = lepton.energy(), lpt = lepton.pt();
385 const double cf = (
wMass_ *
wMass_) / 2 + lepton.px() * metX + lepton.py() * metY;
386 const double det = cf * cf * lpz * lpz - lpt * lpt * (le * le * metPt * metPt - cf * cf);
387 const double pz = (cf * lpz + (cf < 0 ? -
sqrt(det) : sqrt(det))) / lpt / lpt;
389 const auto w1LVec = lepton.p4() + nu1P4;
394 for (
auto b1Itr = bjetIdxs.begin(); b1Itr != bjetIdxs.end(); ++b1Itr) {
395 const double dR =
deltaR(
jets->at(*b1Itr).p4(), w1LVec);
404 const auto t1LVec = w1LVec +
bJet1.p4();
407 const auto& wJet1 =
jets->at(ljetIdxs[0]);
408 const auto& wJet2 =
jets->at(ljetIdxs[1]);
409 const auto w2LVec = wJet1.p4() + wJet2.p4();
414 for (
auto i : bjetIdxs) {
427 const auto t2LVec = w2LVec +
bJet2.p4();
429 const int q = lepton.charge();
485 event.put(
std::move(neutrinos),
"neutrinos");
const edm::EDGetTokenT< edm::View< reco::Candidate > > genParticleToken_
bool isBHadron(const reco::Candidate *p) const
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
reco::Particle::Point genVertex_
virtual double energy() const =0
energy
const double maxLeptonEtaSemilepton_
common ppss p3p6s2 common epss epspn46 common const1 w2
tuple bJet1
do the razor with one or two b jets (medium CSV)
const double maxLeptonEta_
const double minVetoLeptonPtSemilepton_
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
const double maxLeptonEtaDilepton_
virtual double pt() const =0
transverse momentum
std::shared_ptr< JetDef > fjJetDef_
virtual int status() const =0
status word
std::vector< GenJet > GenJetCollection
collection of GenJet objects
virtual double pz() const =0
z coordinate of momentum vector
virtual size_type numberOfMothers() const =0
number of mothers (zero or one in most of but not all the cases)
bool isFromHadron(const reco::Candidate *p) const
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_
virtual double p() const =0
magnitude of momentum vector
Cos< T >::type cos(const T &t)
bool isNull() const
Checks for null.
Abs< T >::type abs(const T &t)
Jets made from MC generator particles.
math::XYZTLorentzVector LorentzVector
virtual const Point & vertex() const =0
vertex position
virtual int charge() const =0
electric charge
virtual double py() const =0
y coordinate of momentum vector
bool isNonnull() const
Checks for non-null.
virtual double px() const =0
x coordinate of momentum vector
virtual int pdgId() const =0
PDG identifier.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
const double maxVetoLeptonEtaSemilepton_
const double minLeptonPt_
const double minDileptonMassDilepton_
static constexpr float b2
const edm::EDGetTokenT< edm::View< reco::Candidate > > finalStateToken_
const double minLeptonPtDilepton_
static constexpr float b1
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector