diff --git a/RecoParticleFlow/PFProducer/src/MLPFModel.cc b/RecoParticleFlow/PFProducer/src/MLPFModel.cc index 0372283195f4b..6582cdf940302 100644 --- a/RecoParticleFlow/PFProducer/src/MLPFModel.cc +++ b/RecoParticleFlow/PFProducer/src/MLPFModel.cc @@ -267,6 +267,7 @@ namespace reco::mlpf { posEta[ihit] = RefPFRecHit->position().eta(); posPhi[ihit] = deltaPhi(RefPFRecHit->position().phi(), ref->phi()); depths[ihit] = RefPFRecHit->depth(); + // std::cout << "CLH " << type << " d=" << RefPFRecHit->depth() << " l=" << RefPFRecHit->layer() << " e=" << energyHit << " px=" << RefPFRecHit->position().x() << " py=" << RefPFRecHit->position().y() << " pz=" << RefPFRecHit->position().z() << std::endl; if (depths[ihit] == 1) { depth1_hitE.push_back(hitE[ihit]); diff --git a/Validation/RecoParticleFlow/plugins/PFAnalysisNtuplizer.cc b/Validation/RecoParticleFlow/plugins/PFAnalysisNtuplizer.cc index b5d18ec83156a..e4861d48f47fa 100644 --- a/Validation/RecoParticleFlow/plugins/PFAnalysisNtuplizer.cc +++ b/Validation/RecoParticleFlow/plugins/PFAnalysisNtuplizer.cc @@ -17,6 +17,8 @@ #include "DataFormats/EgammaReco/interface/SuperCluster.h" #include "DataFormats/GsfTrackReco/interface/GsfTrack.h" #include "DataFormats/Math/interface/deltaPhi.h" +#include "DataFormats/JetReco/interface/GenJet.h" +#include "DataFormats/METReco/interface/GenMET.h" #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" #include "DataFormats/ParticleFlowReco/interface/PFBlock.h" #include "DataFormats/ParticleFlowReco/interface/PFBlockElementBrem.h" @@ -117,6 +119,8 @@ class PFAnalysis : public edm::one::EDAnalyzer tracks_recotosim_; edm::EDGetTokenT gsf_recotosim_; edm::EDGetTokenT> gsfElectrons_; + edm::EDGetTokenT> genJets_; + edm::EDGetTokenT> genMETs_; TTree* t_; @@ -210,6 +214,14 @@ class PFAnalysis : public edm::one::EDAnalyzer gen_status_; vector> gen_daughters_; + vector genjet_pt_; + vector genjet_eta_; + vector genjet_phi_; + vector genjet_mass_; + + vector genmet_pt_; + vector genmet_phi_; + vector element_pt_; vector element_pterror_; vector element_px_; @@ -301,6 +313,8 @@ PFAnalysis::PFAnalysis(const edm::ParameterSet& iConfig) { gsftracks_ = consumes>(edm::InputTag("electronGsfTracks")); saveHits = iConfig.getUntrackedParameter("saveHits", false); gsfElectrons_ = consumes>(edm::InputTag("gedGsfElectrons")); + genJets_ = consumes>(edm::InputTag("ak4GenJets")); + genMETs_ = consumes>(edm::InputTag("genMetTrue")); usesResource(TFileService::kSharedResource); edm::Service fs; @@ -393,6 +407,14 @@ PFAnalysis::PFAnalysis(const edm::ParameterSet& iConfig) { t_->Branch("gen_status", &gen_status_); t_->Branch("gen_daughters", &gen_daughters_); + t_->Branch("genjet_pt", &genjet_pt_); + t_->Branch("genjet_eta", &genjet_eta_); + t_->Branch("genjet_phi", &genjet_phi_); + t_->Branch("genjet_mass", &genjet_mass_); + + t_->Branch("genmet_pt", &genmet_pt_); + t_->Branch("genmet_phi", &genmet_phi_); + //PF Elements t_->Branch("element_pt", &element_pt_); t_->Branch("element_pterror", &element_pterror_); @@ -572,6 +594,14 @@ void PFAnalysis::clearVariables() { gen_status_.clear(); gen_daughters_.clear(); + genjet_pt_.clear(); + genjet_eta_.clear(); + genjet_phi_.clear(); + genjet_mass_.clear(); + + genmet_pt_.clear(); + genmet_phi_.clear(); + element_pt_.clear(); element_pterror_.clear(); element_px_.clear(); @@ -697,6 +727,24 @@ void PFAnalysis::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup gen_daughters_.push_back(daughters); } + edm::Handle> genJetsHandle; + iEvent.getByToken(genJets_, genJetsHandle); + const edm::View& genJets = *genJetsHandle; + for (const auto& genjet : genJets) { + genjet_pt_.push_back(genjet.pt()); + genjet_eta_.push_back(genjet.eta()); + genjet_phi_.push_back(genjet.phi()); + genjet_mass_.push_back(genjet.mass()); + } + + edm::Handle> genMETsHandle; + iEvent.getByToken(genMETs_, genMETsHandle); + const edm::View& genMETs = *genMETsHandle; + for (const auto& genmet : genMETs) { + genmet_pt_.push_back(genmet.pt()); + genmet_phi_.push_back(genmet.phi()); + } + edm::Handle> pfCandidatesHandle; iEvent.getByToken(pfCandidates_, pfCandidatesHandle); std::vector pfCandidates = *pfCandidatesHandle;