21 inputTagPFCandidatesReco_
24 inputTagPFCandidatesReReco_
55 <<
" input collections : "<<inputTagPFCandidatesReco_<<
" "<<inputTagPFCandidatesReReco_;
75 <<
" in run "<<iEvent.
id().
run()<<endl;
82 iEvent.
getByLabel(inputTagPFCandidatesReco_, pfCandidatesReco);
85 iEvent.
getByLabel(inputTagPFCandidatesReReco_, pfCandidatesReReco);
88 iEvent.
getByLabel(inputTagPFJetsReco_, pfJetsReco);
91 iEvent.
getByLabel(inputTagPFJetsReReco_, pfJetsReReco);
98 pfReco=*pfCandidatesReco;
99 pfReReco=*pfCandidatesReReco;
100 sort(pfReco.begin(),pfReco.end(),greaterPt);
101 sort(pfReReco.begin(),pfReReco.end(),greaterPt);
104 unsigned minSize = pfReco.size() < pfReReco.size() ? pfReco.size() : pfReReco.size();
105 bool differentCand =
false;
106 bool differentSize = pfReco.size() != pfReReco.size();
108 std::cout <<
"+++WARNING+++ PFCandidate size changed for entry "
109 << entry_ <<
" !" << endl
110 <<
" - RECO size : " << pfReco.size() << endl
111 <<
" - Re-RECO size : " << pfReReco.size() << endl;
114 for(
unsigned i=0;
i<minSize;
i++ ) {
117 const reco::PFCandidate & candReReco = (rankByPt_) ? pfReReco[
i] : (*pfCandidatesReReco)[
i];
122 if ( fabs(deltaE) > deltaEMax_ ||
123 fabs(deltaEta) > deltaEtaMax_ ||
124 fabs(deltaPhi) > deltaPhiMax_ ) {
125 differentCand =
true;
126 std::cout <<
"+++WARNING+++ PFCandidate " <<
i
127 <<
" changed for entry " << entry_ <<
" ! " << std::endl
128 <<
" - RECO : " << candReco << std::endl
129 <<
" - Re-RECO : " << candReReco << std::endl
130 <<
" DeltaE = : " << deltaE << std::endl
131 <<
" DeltaEta = : " << deltaEta << std::endl
132 <<
" DeltaPhi = : " << deltaPhi << std::endl << std::endl;
134 std::cout <<
"Elements in Block for RECO: " <<std::endl;
135 printElementsInBlocks(candReco);
136 std::cout <<
"Elements in Block for Re-RECO: " <<std::endl;
137 printElementsInBlocks(candReReco);
139 if ( ++npr == 5 )
break;
143 if ( differentSize || differentCand ) {
144 printJets(*pfJetsReco, *pfJetsReReco);
145 printMet(pfReco, pfReReco);
150 <<
" in run "<<iEvent.
id().
run()<<std::endl;
159 for(
unsigned i=0;
i<pfReco.size();
i++ ) {
160 metX += pfReco[
i].px();
161 metY += pfReco[
i].py();
164 std::cout <<
"MET RECO = " << metX <<
" " << metY <<
" " << met << std::endl;
168 for(
unsigned i=0;
i<pfReReco.size();
i++ ) {
169 metX += pfReReco[
i].px();
170 metY += pfReReco[
i].py();
173 std::cout <<
"MET Re-RECO = " << metX <<
" " << metY <<
" " << met << std::endl;
180 bool differentSize = pfJetsReco.size() != pfJetsReReco.size();
182 std::cout <<
"+++WARNING+++ PFJet size changed for entry "
183 << entry_ <<
" !" << endl
184 <<
" - RECO size : " << pfJetsReco.size() << endl
185 <<
" - Re-RECO size : " << pfJetsReReco.size() << endl;
186 unsigned minSize = pfJetsReco.size() < pfJetsReReco.size() ? pfJetsReco.size() : pfJetsReReco.size();
188 for (
unsigned i = 0;
i < minSize; ++
i) {
191 if ( candReco.
et() < 20. && candReReco.
et() < 20. )
break;
192 double deltaE = (candReReco.
et()-candReco.
et())/(candReReco.
et()+candReco.
et());
195 if ( fabs(deltaE) > deltaEMax_ ||
196 fabs(deltaEta) > deltaEtaMax_ ||
197 fabs(deltaPhi) > deltaPhiMax_ ) {
199 <<
" changed for entry " << entry_ <<
" ! " << std::endl
200 <<
" - RECO : " << candReco.
et() <<
" " << candReco.
eta() <<
" " << candReco.
phi() << std::endl
201 <<
" - Re-RECO : " << candReReco.
et() <<
" " << candReReco.
eta() <<
" " << candReReco.
phi() << std::endl
202 <<
" DeltaE = : " << deltaE << std::endl
203 <<
" DeltaEta = : " << deltaEta << std::endl
204 <<
" DeltaPhi = : " << deltaPhi << std::endl << std::endl;
205 if ( ++npr == 5 )
break;
207 std::cout <<
"Jet " <<
i <<
" " << candReco.
et() << std::endl;
215 ostream&
out)
const {
225 cerr<<
"ERROR! no block ref!";
233 else if( blockRef!=firstRef) {
234 cerr<<
"WARNING! This PFCandidate is not made from a single block"<<endl;
T getParameter(std::string const &) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
virtual double et() const
transverse energy
virtual float phi() const
momentum azimuthal angle
Jets made from PFObjects.
virtual double energy() const
energy
virtual float eta() const
momentum pseudorapidity
virtual void beginRun(const edm::Run &r, const edm::EventSetup &c)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool isNull() const
Checks for null.
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
void printElementsInBlocks(const reco::PFCandidate &cand, std::ostream &out=std::cout) const
std::vector< PFJet > PFJetCollection
collection of PFJet objects
Particle reconstructed by the particle flow algorithm.
PFCandidateChecker(const edm::ParameterSet &)
const ElementsInBlocks & elementsInBlocks() const
void printMet(const reco::PFCandidateCollection &pfReco, const reco::PFCandidateCollection &pfReReco) const
void printJets(const reco::PFJetCollection &pfJetsReco, const reco::PFJetCollection &pfJetsReReco) const