137 : pfJetsMissing_(
false),
138 puppiJetsMissing_(
false),
139 corrPuppiJetsMissing_(
false),
140 pfJetCorrMissing_(
false),
141 caloJetCorrMissing_(
false),
142 caloJetsMissing_(
false),
143 caloJetIDMissing_(
false),
144 pfMetMissing_(
false),
145 puppiMetMissing_(
false),
146 caloMetMissing_(
false),
147 caloMetBEMissing_(
false),
148 muonsMissing_(
false) {
161 "caloJECToken",
edm::InputTag(
"ak4CaloL1FastL2L3ResidualCorrector")));
184 tree_ = fs_->
make<TTree>(
"JetRecoTree",
"JetRecoTree");
185 tree_->Branch(
"Jet",
"L1Analysis::L1AnalysisRecoJetDataFormat", &
jet_data, 32000, 3);
186 tree_->Branch(
"Sums",
"L1Analysis::L1AnalysisRecoMetDataFormat", &
met_data, 32000, 3);
254 edm::LogWarning(
"MissingProduct") <<
"PFJets not found. Branch will not be filled" << std::endl;
264 edm::LogWarning(
"MissingProduct") <<
"PF Jet Corrector not found. Branch will not be filled" << std::endl;
276 edm::LogWarning(
"MissingProduct") <<
"PUPPIJets not found. Branch will not be filled" << std::endl;
288 edm::LogWarning(
"MissingProduct") <<
"Corrected PUPPIJets not found. Branch will not be filled" << std::endl;
300 edm::LogWarning(
"MissingProduct") <<
"Calo Jets not found. Branch will not be filled" << std::endl;
310 edm::LogWarning(
"MissingProduct") <<
"Calo Jet Corrector not found. Branch will not be filled" << std::endl;
317 edm::LogWarning(
"MissingProduct") <<
"Calo Jet ID not found. Branch will not be filled" << std::endl;
322 if (
pfMet.isValid()) {
325 if (
muons.isValid()) {
330 edm::LogWarning(
"MissingProduct") <<
"Muons not found. PFMetNoMu branch will not be filled" << std::endl;
336 edm::LogWarning(
"MissingProduct") <<
"PFMet not found. Branch will not be filled" << std::endl;
342 if (
muons.isValid()) {
347 edm::LogWarning(
"MissingProduct") <<
"Muons not found. PUPPIMetNoMu branch will not be filled" << std::endl;
353 edm::LogWarning(
"MissingProduct") <<
"PUPPIMet not found. Branch will not be filled" << std::endl;
363 edm::LogWarning(
"MissingProduct") <<
"CaloMet not found. Branch will not be filled" << std::endl;
373 edm::LogWarning(
"MissingProduct") <<
"CaloMetBE not found. Branch will not be filled" << std::endl;
378 if (
muons.isValid()) {
383 edm::LogWarning(
"MissingProduct") <<
"Muons not found. ZPt branch will not be filled" << std::endl;
429 jet_data->
chef.push_back(it->chargedHadronEnergyFraction());
430 jet_data->
nhef.push_back(it->neutralHadronEnergyFraction());
431 jet_data->
pef.push_back(it->photonEnergyFraction());
432 jet_data->
eef.push_back(it->electronEnergyFraction());
445 jet_data->
cmef.push_back(it->chargedMuEnergyFraction());
456 float corrFactor = 1.;
457 unsigned int nJets = 0;
478 mHx += -1. * it->px() * corrFactor;
479 mHy += -1. * it->py() * corrFactor;
484 TVector2 tv2 = TVector2(mHx, mHy);
539 mHx += -1. * it->px();
540 mHy += -1. * it->py();
545 TVector2 tv2 = TVector2(mHx, mHy);
552 float caloCorrFactor = 1.;
553 unsigned int nCaloJets = 0;
592 double pfMetNoMuPx = theMet.
px();
593 double pfMetNoMuPy = theMet.
py();
595 double muPx(0.), muPy(0.);
597 for (
auto it =
muons->begin(); it !=
muons->end(); ++it) {
598 if (it->isPFMuon()) {
609 thePFMetNoMu.
setP4(pfMetNoMuP4);
623 double puppiMetNoMuPx = theMet.
px();
624 double puppiMetNoMuPy = theMet.
py();
626 double muPx(0.), muPy(0.);
628 for (
auto it =
muons->begin(); it !=
muons->end(); ++it) {
629 if (it->isPFMuon()) {
635 puppiMetNoMuPx += muPx;
636 puppiMetNoMuPy += muPy;
638 math::XYZTLorentzVector puppiMetNoMuP4(puppiMetNoMuPx, puppiMetNoMuPy, 0, hypot(puppiMetNoMuPx, puppiMetNoMuPy));
640 thePUPPIMetNoMu.
setP4(puppiMetNoMuP4);
667 if (
muons->size() < 2) {
677 float closestDiff = 999.;
678 bool found2PFMuons =
false;
680 for (
auto it1 =
muons->begin(); it1 !=
muons->end(); ++it1) {
681 if (!it1->isPFMuon())
684 if (!it2->isPFMuon())
686 if (it1->charge() != (-1 * it2->charge()))
689 found2PFMuons =
true;
690 diMuMass = (it1->p4() + it2->p4()).M();
692 if (
diff < closestDiff) {
700 diMuMass = (muon1.
p4() + muon2.
p4()).M();
701 if (
abs(diMuMass -
zMass) > 30 || !found2PFMuons) {
706 float zPt = (muon1.
p4() + muon2.
p4()).
pt();
713 tmp &=
jet.neutralHadronEnergyFraction() < 0.9;
714 tmp &=
jet.neutralEmEnergyFraction() < 0.9;
715 tmp &= (
jet.chargedMultiplicity() +
jet.neutralMultiplicity()) > 1;
716 tmp &=
jet.muonEnergyFraction() < 0.8;
717 tmp &=
jet.chargedHadronEnergyFraction() > 0.01;
718 tmp &=
jet.chargedMultiplicity() > 0;
719 tmp &=
jet.chargedEmEnergyFraction() < 0.8;
722 tmp &=
jet.neutralHadronEnergyFraction() < 0.9;
723 tmp &=
jet.neutralEmEnergyFraction() < 0.99;
724 tmp &=
jet.muonEnergyFraction() < 0.8;
725 tmp &=
jet.chargedMultiplicity() > 0;
726 tmp &=
jet.chargedEmEnergyFraction() < 0.8;
729 tmp &=
jet.neutralEmEnergyFraction() < 0.99;
730 tmp &=
jet.neutralMultiplicity() > 1;
733 tmp &=
jet.neutralHadronEnergyFraction() > 0.2;
734 tmp &=
jet.neutralEmEnergyFraction() < 0.9;
735 tmp &=
jet.neutralMultiplicity() > 10;
749 tmp &=
jet.neutralHadronEnergyFraction() < 0.9;
750 tmp &=
jet.neutralEmEnergyFraction() < 0.9;
751 tmp &= (
jet.chargedMultiplicity() +
jet.neutralMultiplicity()) > 1;
752 tmp &=
jet.muonEnergyFraction() < 0.8;
753 tmp &=
jet.chargedHadronEnergyFraction() > 0.01;
754 tmp &=
jet.chargedMultiplicity() > 0;
755 tmp &=
jet.chargedEmEnergyFraction() < 0.8;
758 tmp &=
jet.neutralHadronEnergyFraction() < 0.9;
759 tmp &=
jet.neutralEmEnergyFraction() < 0.99;
760 tmp &=
jet.muonEnergyFraction() < 0.8;
761 tmp &=
jet.chargedEmEnergyFraction() < 0.8;
764 tmp &=
jet.neutralHadronEnergyFraction() < 0.9999;
767 tmp &=
jet.neutralEmEnergyFraction() < 0.9;
768 tmp &=
jet.neutralMultiplicity() > 2;
static const std::string kSharedResource
void doPFMet(edm::Handle< reco::PFMETCollection > pfMet)
T getParameter(std::string const &) const
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 doZPt(edm::Handle< reco::MuonCollection >)
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)