123 : pfJetsMissing_(
false),
124 pfJetCorrMissing_(
false),
125 caloJetCorrMissing_(
false),
126 caloJetsMissing_(
false),
127 caloJetIDMissing_(
false),
128 pfMetMissing_(
false),
129 caloMetMissing_(
false),
130 caloMetBEMissing_(
false),
131 muonsMissing_(
false) {
141 "caloJECToken",
edm::InputTag(
"ak4CaloL1FastL2L3ResidualCorrector")));
162 tree_ = fs_->
make<TTree>(
"JetRecoTree",
"JetRecoTree");
163 tree_->Branch(
"Jet",
"L1Analysis::L1AnalysisRecoJetDataFormat", &
jet_data, 32000, 3);
164 tree_->Branch(
"Sums",
"L1Analysis::L1AnalysisRecoMetDataFormat", &
met_data, 32000, 3);
220 edm::LogWarning(
"MissingProduct") <<
"PFJets not found. Branch will not be filled" << std::endl;
230 edm::LogWarning(
"MissingProduct") <<
"PF Jet Corrector not found. Branch will not be filled" << std::endl;
242 edm::LogWarning(
"MissingProduct") <<
"Calo Jets not found. Branch will not be filled" << std::endl;
252 edm::LogWarning(
"MissingProduct") <<
"Calo Jet Corrector not found. Branch will not be filled" << std::endl;
259 edm::LogWarning(
"MissingProduct") <<
"Calo Jet ID not found. Branch will not be filled" << std::endl;
264 if (
pfMet.isValid()) {
267 if (
muons.isValid()) {
272 edm::LogWarning(
"MissingProduct") <<
"Muons not found. PFMetNoMu branch will not be filled" << std::endl;
278 edm::LogWarning(
"MissingProduct") <<
"PFMet not found. Branch will not be filled" << std::endl;
288 edm::LogWarning(
"MissingProduct") <<
"CaloMet not found. Branch will not be filled" << std::endl;
298 edm::LogWarning(
"MissingProduct") <<
"CaloMetBE not found. Branch will not be filled" << std::endl;
344 jet_data->
chef.push_back(it->chargedHadronEnergyFraction());
345 jet_data->
nhef.push_back(it->neutralHadronEnergyFraction());
346 jet_data->
pef.push_back(it->photonEnergyFraction());
347 jet_data->
eef.push_back(it->electronEnergyFraction());
360 jet_data->
cmef.push_back(it->chargedMuEnergyFraction());
371 float corrFactor = 1.;
372 unsigned int nJets = 0;
393 mHx += -1. * it->px() * corrFactor;
394 mHy += -1. * it->py() * corrFactor;
399 TVector2 tv2 = TVector2(mHx, mHy);
406 float caloCorrFactor = 1.;
407 unsigned int nCaloJets = 0;
446 double pfMetNoMuPx = theMet.
px();
447 double pfMetNoMuPy = theMet.
py();
449 double muPx(0.), muPy(0.);
451 for (
auto it =
muons->begin(); it !=
muons->end(); ++it) {
452 if (it->isPFMuon()) {
463 thePFMetNoMu.
setP4(pfMetNoMuP4);
492 tmp &=
jet.neutralHadronEnergyFraction() < 0.9;
493 tmp &=
jet.neutralEmEnergyFraction() < 0.9;
494 tmp &= (
jet.chargedMultiplicity() +
jet.neutralMultiplicity()) > 1;
495 tmp &=
jet.muonEnergyFraction() < 0.8;
496 tmp &=
jet.chargedHadronEnergyFraction() > 0.0;
497 tmp &=
jet.chargedMultiplicity() > 0;
498 tmp &=
jet.chargedEmEnergyFraction() < 0.9;
501 tmp &=
jet.neutralEmEnergyFraction() > 0.01;
502 tmp &=
jet.neutralHadronEnergyFraction() < 0.98;
503 tmp &=
jet.neutralMultiplicity() > 2;
506 tmp &=
jet.neutralEmEnergyFraction() < 0.9;
507 tmp &=
jet.neutralMultiplicity() > 10;
static const std::string kSharedResource
void doPFMet(edm::Handle< reco::PFMETCollection > pfMet)
T getParameter(std::string const &) const
bool pfJetID(const reco::PFJet &jet)
Jets made from CaloTowers.
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
#define DEFINE_FWK_MODULE(type)
T const * product() const
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.
T getUntrackedParameter(std::string const &, T const &) const
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_
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< reco::PFMETCollection > pfMetToken_
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
L1JetRecoTreeProducer(const edm::ParameterSet &)
void doCaloJets(edm::Handle< reco::CaloJetCollection > caloJets)
bool caloJetID(const reco::CaloJet &jet)
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_