43 inputPFlowLabel_tok_ = consumes<reco::PFCandidateCollection> (iConfig.
getParameter<
std::string>(
"InputPFlowLabel") );
46 if (outputFile_.size() > 0)
47 edm::LogInfo(
"OutputInfo") <<
" ParticleFLow Task histograms will be saved to '" << outputFile_.c_str() <<
"'";
48 else edm::LogInfo(
"OutputInfo") <<
" ParticleFlow Task histograms will NOT be saved";
63 dbe_->setCurrentFolder(
"PFTask/PFCandidates");
65 me[
"CandidateEt"] =
dbe_->book1D(
"CandidateEt",
"CandidateEt",1000,0,1000);
66 me[
"CandidateEta"] =
dbe_->book1D(
"CandidateEta",
"CandidateEta",200,-5,5);
67 me[
"CandidatePhi"] =
dbe_->book1D(
"CandidatePhi",
"CandidatePhi",200,-
M_PI,
M_PI);
68 me[
"CandidateCharge"] =
dbe_->book1D(
"CandidateCharge",
"CandidateCharge",5,-2,2);
69 me[
"PFCandidateType"] =
dbe_->book1D(
"PFCandidateType",
"PFCandidateType",10,0,10);
71 dbe_->setCurrentFolder(
"PFTask/PFBlocks");
73 me[
"NumElements"] =
dbe_->book1D(
"NumElements",
"NumElements",25,0,25);
74 me[
"NumTrackElements"] =
dbe_->book1D(
"NumTrackElements",
"NumTrackElements",5,0,5);
75 me[
"NumPS1Elements"] =
dbe_->book1D(
"NumPS1Elements",
"NumPS1Elements",5,0,5);
76 me[
"NumPS2Elements"] =
dbe_->book1D(
"NumPS2Elements",
"NumPS2Elements",5,0,5);
77 me[
"NumECALElements"] =
dbe_->book1D(
"NumECALElements",
"NumECALElements",5,0,5);
78 me[
"NumHCALElements"] =
dbe_->book1D(
"NumHCALElements",
"NumHCALElements",5,0,5);
79 me[
"NumMuonElements"] =
dbe_->book1D(
"NumMuonElements",
"NumMuonElements",5,0,5);
81 dbe_->setCurrentFolder(
"PFTask/PFTracks");
83 me[
"TrackCharge"] =
dbe_->book1D(
"TrackCharge",
"TrackCharge",5,-2,2);
84 me[
"TrackNumPoints"] =
dbe_->book1D(
"TrackNumPoints",
"TrackNumPoints",100,0,100);
85 me[
"TrackNumMeasurements"] =
dbe_->book1D(
"TrackNumMeasurements",
"TrackNumMeasurements",100,0,100);
86 me[
"TrackImpactParameter"] =
dbe_->book1D(
"TrackImpactParameter",
"TrackImpactParameter",1000,0,1);
88 dbe_->setCurrentFolder(
"PFTask/PFClusters");
110 iEvent.
getByToken(inputPFlowLabel_tok_, pflow_hnd);
111 pflow_candidates = pflow_hnd.
product();
115 if (!pflow_candidates) {
117 edm::LogInfo(
"OutputInfo") <<
" failed to retrieve data required by ParticleFlow Task";
118 edm::LogInfo(
"OutputInfo") <<
" ParticleFlow Task cannot continue...!";
128 PFCandidateCollection::const_iterator pf;
129 for (pf = pflow_candidates->begin(); pf != pflow_candidates->end(); pf++) {
134 me[
"CandidateEt"]->Fill(particle->
et());
135 me[
"CandidateEta"]->Fill(particle->
eta());
136 me[
"CandidatePhi"]->Fill(particle->
phi());
137 me[
"CandidateCharge"]->Fill(particle->
charge());
138 me[
"CandidatePdgId"]->Fill(particle->
pdgId());
141 me[
"PFCandidateType"]->Fill(particle->
particleId());
218 if (outputFile_.size() > 0 &&
dbe_)
219 dbe_->save(outputFile_);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual int pdgId() const
PDG identifier.
virtual double et() const
transverse energy
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual double eta() const
momentum pseudorapidity
virtual void analyze(const edm::Event &, const edm::EventSetup &)
virtual int charge() const
electric charge
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 &)
virtual double phi() const
momentum azimuthal angle