79 deltaEtaMax_ = iConfig.
getParameter<
double>(
"deltaEtaMax");
81 deltaPhiMax_ = iConfig.
getParameter<
double>(
"deltaPhiMax");
91 LogDebug(
"PFCandidateChecker") <<
" input collections : " << inputTagPFCandidatesReco_ <<
" " 92 << inputTagPFCandidatesReReco_;
96 LogDebug(
"PFCandidateChecker") <<
"START event: " <<
iEvent.id().event() <<
" in run " <<
iEvent.id().run() << endl;
101 iEvent.getByLabel(inputTagPFCandidatesReco_, pfCandidatesReco);
104 iEvent.getByLabel(inputTagPFCandidatesReReco_, pfCandidatesReReco);
107 iEvent.getByLabel(inputTagPFJetsReco_, pfJetsReco);
110 iEvent.getByLabel(inputTagPFJetsReReco_, pfJetsReReco);
116 pfReco = *pfCandidatesReco;
117 pfReReco = *pfCandidatesReReco;
118 sort(pfReco.begin(), pfReco.end(), greaterPt);
119 sort(pfReReco.begin(), pfReReco.end(), greaterPt);
122 unsigned minSize = pfReco.size() < pfReReco.size() ? pfReco.size() : pfReReco.size();
123 bool differentCand =
false;
124 bool differentSize = pfReco.size() != pfReReco.size();
126 std::cout <<
"+++WARNING+++ PFCandidate size changed for entry " << entry_ <<
" !" << endl
127 <<
" - RECO size : " << pfReco.size() << endl
128 <<
" - Re-RECO size : " << pfReReco.size() << endl;
131 for (
unsigned i = 0;
i < minSize;
i++) {
133 const reco::PFCandidate& candReReco = (rankByPt_) ? pfReReco[
i] : (*pfCandidatesReReco)[
i];
139 differentCand =
true;
140 std::cout <<
"+++WARNING+++ PFCandidate " <<
i <<
" changed for entry " << entry_ <<
" ! " << std::endl
141 <<
" - RECO : " << candReco << std::endl
142 <<
" - Re-RECO : " << candReReco << std::endl
143 <<
" DeltaE = : " <<
deltaE << std::endl
144 <<
" DeltaEta = : " <<
deltaEta << std::endl
145 <<
" DeltaPhi = : " <<
deltaPhi << std::endl
148 std::cout <<
"Elements in Block for RECO: " << std::endl;
149 printElementsInBlocks(candReco);
150 std::cout <<
"Elements in Block for Re-RECO: " << std::endl;
151 printElementsInBlocks(candReReco);
158 if (differentSize || differentCand) {
159 printJets(*pfJetsReco, *pfJetsReReco);
160 printMet(pfReco, pfReReco);
164 LogDebug(
"PFCandidateChecker") <<
"STOP event: " <<
iEvent.id().event() <<
" in run " <<
iEvent.id().run()
171 for (
unsigned i = 0;
i < pfReco.size();
i++) {
172 metX += pfReco[
i].px();
173 metY += pfReco[
i].py();
176 std::cout <<
"MET RECO = " << metX <<
" " << metY <<
" " <<
met << std::endl;
180 for (
unsigned i = 0;
i < pfReReco.size();
i++) {
181 metX += pfReReco[
i].px();
182 metY += pfReReco[
i].py();
185 std::cout <<
"MET Re-RECO = " << metX <<
" " << metY <<
" " <<
met << std::endl;
189 bool differentSize = pfJetsReco.size() != pfJetsReReco.size();
191 std::cout <<
"+++WARNING+++ PFJet size changed for entry " << entry_ <<
" !" << endl
192 <<
" - RECO size : " << pfJetsReco.size() << endl
193 <<
" - Re-RECO size : " << pfJetsReReco.size() << endl;
194 unsigned minSize = pfJetsReco.size() < pfJetsReReco.size() ? pfJetsReco.size() : pfJetsReReco.size();
196 for (
unsigned i = 0;
i < minSize; ++
i) {
199 if (candReco.
et() < 20. && candReReco.
et() < 20.)
201 double deltaE = (candReReco.
et() - candReco.
et()) / (candReReco.
et() + candReco.
et());
205 std::cout <<
"+++WARNING+++ PFJet " <<
i <<
" changed for entry " << entry_ <<
" ! " << std::endl
206 <<
" - RECO : " << candReco.
et() <<
" " << candReco.
eta() <<
" " << candReco.
phi() << std::endl
207 <<
" - Re-RECO : " << candReReco.
et() <<
" " << candReReco.
eta() <<
" " << candReReco.
phi()
209 <<
" DeltaE = : " <<
deltaE << std::endl
210 <<
" DeltaEta = : " <<
deltaEta << std::endl
211 <<
" DeltaPhi = : " <<
deltaPhi << std::endl
216 std::cout <<
"Jet " <<
i <<
" " << candReco.
et() << std::endl;
228 for (
unsigned i = 0;
i <
cand.elementsInBlocks().size();
i++) {
232 cerr <<
"ERROR! no block ref!";
239 }
else if (blockRef != firstRef) {
240 cerr <<
"WARNING! This PFCandidate is not made from a single block" << endl;
243 out <<
"\t" <<
cand.elementsInBlocks()[
i].second << endl;
void analyze(const edm::Event &, const edm::EventSetup &) override
static bool greaterPt(const reco::PFCandidate &a, const reco::PFCandidate &b)
T getParameter(std::string const &) const
void printMet(const reco::PFCandidateCollection &pfReco, const reco::PFCandidateCollection &pfReReco) const
void printJets(const reco::PFJetCollection &pfJetsReco, const reco::PFJetCollection &pfJetsReReco) const
void printElementsInBlocks(const reco::PFCandidate &cand, std::ostream &out=std::cout) const
double deltaEMax_
Cuts for comparison.
Jets made from PFObjects.
static const double deltaEta
T getUntrackedParameter(std::string const &, T const &) const
Checks what a re-reco changes in PFCandidates.
#define DEFINE_FWK_MODULE(type)
bool isNull() const
Checks for null.
edm::InputTag inputTagPFJetsReReco_
bool rankByPt_
rank the candidates by Pt
edm::InputTag inputTagPFJetsReco_
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
std::vector< PFJet > PFJetCollection
collection of PFJet objects
Particle reconstructed by the particle flow algorithm.
double et() const final
transverse energy
edm::InputTag inputTagPFCandidatesReco_
PFCandidates in which we'll look for pile up particles.
bool printBlocks_
print the blocks associated to a given candidate ?
PFCandidateChecker(const edm::ParameterSet &)
double phi() const final
momentum azimuthal angle
edm::InputTag inputTagPFCandidatesReReco_
double energy() const final
energy
double eta() const final
momentum pseudorapidity