126 : pfJetsMissing_(
false),
127 pfJetCorrMissing_(
false),
128 caloJetCorrMissing_(
false),
129 caloJetsMissing_(
false),
130 caloJetIDMissing_(
false),
131 pfMetMissing_(
false),
132 caloMetMissing_(
false),
133 caloMetBEMissing_(
false),
134 muonsMissing_(
false) {
144 "caloJECToken",
edm::InputTag(
"ak4CaloL1FastL2L3ResidualCorrector")));
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;
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;
381 for (
auto it = pfJets->begin(); it != pfJets->end() && nJets <
maxJet_; ++it) {
385 corrFactor = pfJetCorr.
product()->correction(*it);
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;
411 for (
auto it = caloJets->begin(); it != caloJets->end() && nCaloJets <
maxJet_; ++it) {
416 caloCorrFactor = caloJetCorr.
product()->correction(*it);
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);
491 if (fabs(jet.
eta()) < 2.7) {
500 if (fabs(jet.
eta()) > 2.7 && fabs(jet.
eta()) < 3.0) {
505 if (fabs(jet.
eta()) > 3.0) {
T getUntrackedParameter(std::string const &, T const &) const
void doPFMet(edm::Handle< reco::PFMETCollection > pfMet)
bool pfJetID(const reco::PFJet &jet)
Jets made from CaloTowers.
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
tuple caloMet
____________________________________________________________________________||
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::Service< TFileService > fs_
#define DEFINE_FWK_MODULE(type)
float chargedHadronEnergyFraction() const
chargedHadronEnergyFraction
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)
T * make(const Args &...args) const
make new ROOT object
edm::EDGetTokenT< reco::JetCorrector > pfJECToken_
void doCaloMetBE(edm::Handle< reco::CaloMETCollection > caloMetBE)
int chargedMultiplicity() const
chargedMultiplicity
Jets made from PFObjects.
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
~L1JetRecoTreeProducer() override
L1Analysis::L1AnalysisRecoJetDataFormat * jet_data
float neutralEmEnergyFraction() const
neutralEmEnergyFraction
double px() const final
x coordinate of momentum vector
void beginJob(void) override
float neutralHadronEnergyFraction() const
neutralHadronEnergyFraction
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)
int neutralMultiplicity() const
neutralMultiplicity
edm::EDGetTokenT< reco::PFMETCollection > pfMetToken_
float chargedEmEnergyFraction() const
chargedEmEnergyFraction
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
T const * product() const
T getParameter(std::string const &) const
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_
Log< level::Warning, false > LogWarning
float muonEnergyFraction() const
muonEnergyFraction
double phi() const final
momentum azimuthal angle
void setP4(const LorentzVector &p4) final
set 4-momentum
edm::EDGetTokenT< reco::CaloMETCollection > caloMetBEToken_
tuple caloMetBE
____________________________________________________________________________||
double eta() const final
momentum pseudorapidity