136 : pfJetsMissing_(
false),
137 puppiJetsMissing_(
false),
138 corrPuppiJetsMissing_(
false),
139 pfJetCorrMissing_(
false),
140 caloJetCorrMissing_(
false),
141 caloJetsMissing_(
false),
142 caloJetIDMissing_(
false),
143 pfMetMissing_(
false),
144 puppiMetMissing_(
false),
145 caloMetMissing_(
false),
146 caloMetBEMissing_(
false),
147 muonsMissing_(
false) {
160 "caloJECToken",
edm::InputTag(
"ak4CaloL1FastL2L3ResidualCorrector")));
183 tree_ = fs_->
make<TTree>(
"JetRecoTree",
"JetRecoTree");
184 tree_->Branch(
"Jet",
"L1Analysis::L1AnalysisRecoJetDataFormat", &
jet_data, 32000, 3);
185 tree_->Branch(
"Sums",
"L1Analysis::L1AnalysisRecoMetDataFormat", &
met_data, 32000, 3);
253 edm::LogWarning(
"MissingProduct") <<
"PFJets not found. Branch will not be filled" << std::endl;
263 edm::LogWarning(
"MissingProduct") <<
"PF Jet Corrector not found. Branch will not be filled" << std::endl;
275 edm::LogWarning(
"MissingProduct") <<
"PUPPIJets not found. Branch will not be filled" << std::endl;
287 edm::LogWarning(
"MissingProduct") <<
"Corrected PUPPIJets not found. Branch will not be filled" << std::endl;
299 edm::LogWarning(
"MissingProduct") <<
"Calo Jets not found. Branch will not be filled" << std::endl;
309 edm::LogWarning(
"MissingProduct") <<
"Calo Jet Corrector not found. Branch will not be filled" << std::endl;
316 edm::LogWarning(
"MissingProduct") <<
"Calo Jet ID not found. Branch will not be filled" << std::endl;
321 if (
pfMet.isValid()) {
324 if (
muons.isValid()) {
329 edm::LogWarning(
"MissingProduct") <<
"Muons not found. PFMetNoMu branch will not be filled" << std::endl;
335 edm::LogWarning(
"MissingProduct") <<
"PFMet not found. Branch will not be filled" << std::endl;
341 if (
muons.isValid()) {
346 edm::LogWarning(
"MissingProduct") <<
"Muons not found. PUPPIMetNoMu branch will not be filled" << std::endl;
352 edm::LogWarning(
"MissingProduct") <<
"PUPPIMet not found. Branch will not be filled" << std::endl;
362 edm::LogWarning(
"MissingProduct") <<
"CaloMet not found. Branch will not be filled" << std::endl;
372 edm::LogWarning(
"MissingProduct") <<
"CaloMetBE not found. Branch will not be filled" << std::endl;
377 if (
muons.isValid()) {
383 edm::LogWarning(
"MissingProduct") <<
"PUPPIJets not found. Branch will not be filled" << std::endl;
389 edm::LogWarning(
"MissingProduct") <<
"Muons not found. ZPt branch will not be filled" << std::endl;
435 jet_data->
chef.push_back(it->chargedHadronEnergyFraction());
436 jet_data->
nhef.push_back(it->neutralHadronEnergyFraction());
437 jet_data->
pef.push_back(it->photonEnergyFraction());
438 jet_data->
eef.push_back(it->electronEnergyFraction());
451 jet_data->
cmef.push_back(it->chargedMuEnergyFraction());
462 float corrFactor = 1.;
463 unsigned int nJets = 0;
484 mHx += -1. * it->px() * corrFactor;
485 mHy += -1. * it->py() * corrFactor;
490 TVector2 tv2 = TVector2(mHx, mHy);
545 mHx += -1. * it->px();
546 mHy += -1. * it->py();
551 TVector2 tv2 = TVector2(mHx, mHy);
558 float caloCorrFactor = 1.;
559 unsigned int nCaloJets = 0;
598 double pfMetNoMuPx = theMet.
px();
599 double pfMetNoMuPy = theMet.
py();
601 double muPx(0.), muPy(0.);
603 for (
auto it =
muons->begin(); it !=
muons->end(); ++it) {
604 if (it->isPFMuon()) {
615 thePFMetNoMu.
setP4(pfMetNoMuP4);
629 double puppiMetNoMuPx = theMet.
px();
630 double puppiMetNoMuPy = theMet.
py();
632 double muPx(0.), muPy(0.);
634 for (
auto it =
muons->begin(); it !=
muons->end(); ++it) {
635 if (it->isPFMuon()) {
641 puppiMetNoMuPx += muPx;
642 puppiMetNoMuPy += muPy;
646 thePUPPIMetNoMu.
setP4(puppiMetNoMuP4);
673 edm::Handle<std::vector<pat::Jet> > corrPuppiJets) {
674 bool passPuppiJetPtCut =
false;
676 for (
auto it = corrPuppiJets->begin(); it != corrPuppiJets->end(); ++it) {
679 if (it->muonEnergyFraction() > 0.5 || it->chargedEmEnergyFraction() > 0.5)
682 passPuppiJetPtCut =
true;
685 if (!passPuppiJetPtCut ||
muons->size() < 2) {
695 float closestDiff = 999.;
696 bool found2PFMuons =
false;
698 for (
auto it1 =
muons->begin(); it1 !=
muons->end(); ++it1) {
699 if (!it1->isPFMuon())
702 if (!it2->isPFMuon())
704 if (it1->charge() != (-1 * it2->charge()))
707 found2PFMuons =
true;
708 diMuMass = (it1->p4() + it2->p4()).M();
710 if (
diff < closestDiff) {
718 diMuMass = (muon1.
p4() + muon2.
p4()).M();
719 if (
abs(diMuMass -
zMass) > 30 || !found2PFMuons) {
724 float zPt = (muon1.
p4() + muon2.
p4()).
pt();
731 tmp &=
jet.neutralHadronEnergyFraction() < 0.9;
732 tmp &=
jet.neutralEmEnergyFraction() < 0.9;
733 tmp &= (
jet.chargedMultiplicity() +
jet.neutralMultiplicity()) > 1;
734 tmp &=
jet.muonEnergyFraction() < 0.8;
735 tmp &=
jet.chargedHadronEnergyFraction() > 0.01;
736 tmp &=
jet.chargedMultiplicity() > 0;
737 tmp &=
jet.chargedEmEnergyFraction() < 0.8;
740 tmp &=
jet.neutralHadronEnergyFraction() < 0.9;
741 tmp &=
jet.neutralEmEnergyFraction() < 0.99;
742 tmp &=
jet.muonEnergyFraction() < 0.8;
743 tmp &=
jet.chargedMultiplicity() > 0;
744 tmp &=
jet.chargedEmEnergyFraction() < 0.8;
747 tmp &=
jet.neutralEmEnergyFraction() < 0.99;
748 tmp &=
jet.neutralMultiplicity() > 1;
751 tmp &=
jet.neutralHadronEnergyFraction() > 0.2;
752 tmp &=
jet.neutralEmEnergyFraction() < 0.9;
753 tmp &=
jet.neutralMultiplicity() > 10;
767 tmp &=
jet.neutralHadronEnergyFraction() < 0.9;
768 tmp &=
jet.neutralEmEnergyFraction() < 0.9;
769 tmp &= (
jet.chargedMultiplicity() +
jet.neutralMultiplicity()) > 1;
770 tmp &=
jet.muonEnergyFraction() < 0.8;
771 tmp &=
jet.chargedHadronEnergyFraction() > 0.01;
772 tmp &=
jet.chargedMultiplicity() > 0;
773 tmp &=
jet.chargedEmEnergyFraction() < 0.8;
776 tmp &=
jet.neutralHadronEnergyFraction() < 0.9;
777 tmp &=
jet.neutralEmEnergyFraction() < 0.99;
778 tmp &=
jet.muonEnergyFraction() < 0.8;
779 tmp &=
jet.chargedEmEnergyFraction() < 0.8;
782 tmp &=
jet.neutralHadronEnergyFraction() < 0.9999;
785 tmp &=
jet.neutralEmEnergyFraction() < 0.9;
786 tmp &=
jet.neutralMultiplicity() > 2;
static const std::string kSharedResource
void doZPt(edm::Handle< reco::MuonCollection > muons, edm::Handle< std::vector< pat::Jet > > corrPuppiJets)
void doPFMet(edm::Handle< reco::PFMETCollection > pfMet)
T getParameter(std::string const &) const
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
bool pfJetID(const reco::PFJet &jet)
edm::EDGetTokenT< reco::PFMETCollection > puppiMetToken_
Jets made from CaloTowers.
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
T const * product() const
bool puppiJetID(const pat::Jet &jet)
void doPFJetCorr(edm::Handle< reco::PFJetCollection > pfJets, edm::Handle< reco::JetCorrector > pfJetCorr)
edm::EDGetTokenT< reco::CaloMETCollection > caloMetToken_
void analyze(const edm::Event &, const edm::EventSetup &) override
void doPFJets(edm::Handle< reco::PFJetCollection > pfJets)
caloMetBE
____________________________________________________________________________||
edm::EDGetTokenT< reco::JetCorrector > pfJECToken_
double correction(const LorentzVector &fJet) const
get correction using Jet information only
void doCaloMetBE(edm::Handle< reco::CaloMETCollection > caloMetBE)
Jets made from PFObjects.
edm::EDGetTokenT< reco::PFJetCollection > puppiJetToken_
const LorentzVector & p4() const final
four-momentum Lorentz vector
T getUntrackedParameter(std::string const &, T const &) const
bool corrPuppiJetsMissing_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
~L1JetRecoTreeProducer() override
L1Analysis::L1AnalysisRecoJetDataFormat * jet_data
double px() const final
x coordinate of momentum vector
void beginJob(void) override
Abs< T >::type abs(const T &t)
edm::EDGetTokenT< edm::ValueMap< reco::JetID > > caloJetIDToken_
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< reco::PFJetCollection > pfJetToken_
void doCaloJetCorr(edm::Handle< reco::CaloJetCollection > caloJets, edm::Handle< reco::JetCorrector > caloJetCorr)
double py() const final
y coordinate of momentum vector
void doPFMetNoMu(edm::Handle< reco::PFMETCollection > pfMet, edm::Handle< reco::MuonCollection >)
void doCaloMet(edm::Handle< reco::CaloMETCollection > caloMet)
edm::EDGetTokenT< std::vector< pat::Jet > > corrPuppiJetToken_
edm::EDGetTokenT< reco::PFMETCollection > pfMetToken_
void doPUPPIMetNoMu(edm::Handle< reco::PFMETCollection > puppiMet, edm::Handle< reco::MuonCollection >)
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
L1JetRecoTreeProducer(const edm::ParameterSet &)
Analysis-level calorimeter jet class.
void doCaloJets(edm::Handle< reco::CaloJetCollection > caloJets)
bool caloJetID(const reco::CaloJet &jet)
void doPUPPIJets(edm::Handle< reco::PFJetCollection > puppiJets)
edm::EDGetTokenT< reco::MuonCollection > muonToken_
edm::EDGetTokenT< reco::JetCorrector > caloJECToken_
double et() const final
transverse energy
std::vector< reco::PFMET > PFMETCollection
collection of PFMET objects
edm::EDGetTokenT< reco::CaloJetCollection > caloJetToken_
T * make(const Args &...args) const
make new ROOT object
Log< level::Warning, false > LogWarning
double phi() const final
momentum azimuthal angle
void setP4(const LorentzVector &p4) final
set 4-momentum
edm::EDGetTokenT< reco::CaloMETCollection > caloMetBEToken_
void doCorrPUPPIJets(edm::Handle< std::vector< pat::Jet > > corrPuppiJets)