40 inputPFlowLabel_tok_ = consumes<reco::PFCandidateCollection>(iConfig.
getParameter<
std::string>(
"InputPFlowLabel"));
43 if (!outputFile_.empty())
44 edm::LogInfo(
"OutputInfo") <<
" ParticleFLow Task histograms will be saved to '" << outputFile_.c_str() <<
"'";
46 edm::LogInfo(
"OutputInfo") <<
" ParticleFlow Task histograms will NOT be saved";
56 dbe_->setCurrentFolder(
"PFTask/PFCandidates");
58 me[
"CandidateEt"] =
dbe_->book1D(
"CandidateEt",
"CandidateEt", 1000, 0, 1000);
59 me[
"CandidateEta"] =
dbe_->book1D(
"CandidateEta",
"CandidateEta", 200, -5, 5);
60 me[
"CandidatePhi"] =
dbe_->book1D(
"CandidatePhi",
"CandidatePhi", 200, -
M_PI,
M_PI);
61 me[
"CandidateCharge"] =
dbe_->book1D(
"CandidateCharge",
"CandidateCharge", 5, -2, 2);
62 me[
"PFCandidateType"] =
dbe_->book1D(
"PFCandidateType",
"PFCandidateType", 10, 0, 10);
64 dbe_->setCurrentFolder(
"PFTask/PFBlocks");
66 me[
"NumElements"] =
dbe_->book1D(
"NumElements",
"NumElements", 25, 0, 25);
67 me[
"NumTrackElements"] =
dbe_->book1D(
"NumTrackElements",
"NumTrackElements", 5, 0, 5);
68 me[
"NumPS1Elements"] =
dbe_->book1D(
"NumPS1Elements",
"NumPS1Elements", 5, 0, 5);
69 me[
"NumPS2Elements"] =
dbe_->book1D(
"NumPS2Elements",
"NumPS2Elements", 5, 0, 5);
70 me[
"NumECALElements"] =
dbe_->book1D(
"NumECALElements",
"NumECALElements", 5, 0, 5);
71 me[
"NumHCALElements"] =
dbe_->book1D(
"NumHCALElements",
"NumHCALElements", 5, 0, 5);
72 me[
"NumMuonElements"] =
dbe_->book1D(
"NumMuonElements",
"NumMuonElements", 5, 0, 5);
74 dbe_->setCurrentFolder(
"PFTask/PFTracks");
76 me[
"TrackCharge"] =
dbe_->book1D(
"TrackCharge",
"TrackCharge", 5, -2, 2);
77 me[
"TrackNumPoints"] =
dbe_->book1D(
"TrackNumPoints",
"TrackNumPoints", 100, 0, 100);
78 me[
"TrackNumMeasurements"] =
dbe_->book1D(
"TrackNumMeasurements",
"TrackNumMeasurements", 100, 0, 100);
79 me[
"TrackImpactParameter"] =
dbe_->book1D(
"TrackImpactParameter",
"TrackImpactParameter", 1000, 0, 1);
81 dbe_->setCurrentFolder(
"PFTask/PFClusters");
96 iEvent.
getByToken(inputPFlowLabel_tok_, pflow_hnd);
97 pflow_candidates = pflow_hnd.
product();
100 if (!pflow_candidates) {
101 edm::LogInfo(
"OutputInfo") <<
" failed to retrieve data required by ParticleFlow Task";
102 edm::LogInfo(
"OutputInfo") <<
" ParticleFlow Task cannot continue...!";
111 PFCandidateCollection::const_iterator
pf;
112 for (pf = pflow_candidates->begin(); pf != pflow_candidates->end(); pf++) {
116 me[
"CandidateEt"]->Fill(particle->
et());
117 me[
"CandidateEta"]->Fill(particle->
eta());
118 me[
"CandidatePhi"]->Fill(particle->
phi());
119 me[
"CandidateCharge"]->Fill(particle->
charge());
120 me[
"CandidatePdgId"]->Fill(particle->
pdgId());
123 me[
"PFCandidateType"]->Fill(particle->
particleId());
196 if (!outputFile_.empty() &&
dbe_)
197 dbe_->save(outputFile_);
T getParameter(std::string const &) const
int pdgId() const final
PDG identifier.
T getUntrackedParameter(std::string const &, T const &) const
double eta() const final
momentum pseudorapidity
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void analyze(const edm::Event &, const edm::EventSetup &) override
int charge() const final
electric charge
double et() const final
transverse energy
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
T const * product() const
Particle reconstructed by the particle flow algorithm.
virtual ParticleType particleId() const
PFTester(const edm::ParameterSet &)
double phi() const final
momentum azimuthal angle