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;
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);
491 if (fabs(
jet.eta()) < 2.7) {
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;
500 if (fabs(
jet.eta()) > 2.7 && fabs(
jet.eta()) < 3.0) {
501 tmp &=
jet.neutralEmEnergyFraction() > 0.01;
502 tmp &=
jet.neutralHadronEnergyFraction() < 0.98;
503 tmp &=
jet.neutralMultiplicity() > 2;
505 if (fabs(
jet.eta()) > 3.0) {
506 tmp &=
jet.neutralEmEnergyFraction() < 0.9;
507 tmp &=
jet.neutralMultiplicity() > 10;