26 userDataHelper_ ( iConfig.getParameter<edm::
ParameterSet>(
"userData"), consumesCollector() )
44 addEfficiencies_ = iConfig.getParameter<
bool>(
"addEfficiencies");
45 if (addEfficiencies_) {
50 addResolutions_ = iConfig.getParameter<
bool>(
"addResolutions");
51 if (addResolutions_) {
57 if ( iConfig.exists(
"userData") ) {
62 produces<std::vector<PFParticle> >();
67 PATPFParticleProducer::~PATPFParticleProducer() {
79 std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > > genMatches(
genMatchTokens_.size());
90 std::vector<PFParticle> *
patPFParticles =
new std::vector<PFParticle>();
92 itPFParticle = pfCandidates->begin();
93 itPFParticle != pfCandidates->end();
97 unsigned int idx = itPFParticle - pfCandidates->begin();
103 for(
size_t i = 0,
n = genMatches.size();
i <
n; ++
i) {
124 patPFParticles->push_back(aPFParticle);
131 std::auto_ptr<std::vector<PFParticle> > ptr(patPFParticles);
bool enabled() const
'true' if this there is at least one efficiency configured
T getParameter(std::string const &) const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
pat::helper::KinResolutionsLoader resolutionLoader_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
PATPFParticleProducer(const edm::ParameterSet &iConfig)
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
bool enabled() const
'true' if this there is at least one efficiency configured
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
pat::helper::EfficiencyLoader efficiencyLoader_
edm::EDGetTokenT< edm::View< reco::PFCandidate > > pfCandidateToken_
Produces pat::PFParticle's.
void addGenParticleRef(const reco::GenParticleRef &ref)
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
Analysis-level class for reconstructed particles.
pat::PATUserDataHelper< pat::PFParticle > userDataHelper_
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
void newEvent(const edm::Event &event, const edm::EventSetup &setup) const
To be called for each new event, reads in the EventSetup object.
void newEvent(const edm::Event &event) const
To be called for each new event, reads in the ValueMaps for efficiencies.
GreaterByPt< PFParticle > pTComparator_