|
|
Go to the documentation of this file.
13 : isolator_(iConfig.exists(
"userIsolation") ? iConfig.getParameter<
edm::
ParameterSet>(
"userIsolation")
17 userDataHelper_(iConfig.getParameter<
edm::
ParameterSet>(
"userData"), consumesCollector()) {
39 iConfig.
getParameter<std::vector<edm::InputTag> >(
"genParticleMatch"),
40 [
this](
edm::InputTag const&
tag) { return consumes<edm::Association<reco::GenParticleCollection> >(tag); });
49 produces<std::vector<GenericParticle> >();
51 if (iConfig.
exists(
"isoDeposits")) {
53 if (depconf.
exists(
"tracker"))
55 if (depconf.
exists(
"ecal"))
57 if (depconf.
exists(
"hcal"))
59 if (depconf.
exists(
"user")) {
60 std::vector<edm::InputTag> userdeps = depconf.
getParameter<std::vector<edm::InputTag> >(
"user");
61 std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
63 for (; it != ed; ++it, ++
key) {
70 return consumes<edm::ValueMap<IsoDeposit> >(
label.second);
86 if (iConfig.
exists(
"vertexing")) {
93 if (iConfig.
exists(
"userData")) {
118 for (
size_t j = 0, nd =
deposits.size();
j < nd; ++
j) {
123 std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > > genMatches(
genMatchTokens_.size());
136 std::vector<GenericParticle>* PATGenericParticles =
new std::vector<GenericParticle>();
138 itGenericParticle++) {
140 unsigned int idx = itGenericParticle -
cands->begin();
176 for (
size_t j = 0, nd =
deposits.size();
j < nd; ++
j) {
182 for (
size_t i = 0,
n = genMatches.size();
i <
n; ++
i) {
191 aGenericParticle.
setQuality((*qualities)[candRef]);
216 std::sort(PATGenericParticles->begin(), PATGenericParticles->end(),
eTComparator_);
219 std::unique_ptr<std::vector<GenericParticle> > myGenericParticles(PATGenericParticles);
edm::EDGetTokenT< edm::View< reco::Candidate > > srcToken_
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
pat::PATUserDataHelper< pat::GenericParticle > userDataHelper_
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const
pat::helper::EfficiencyLoader efficiencyLoader_
void embedSuperCluster()
embeds the supercluster instead of keeping a reference to it
bool enabled() const
'true' if this there is at least one efficiency configured
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
void addGenParticleRef(const reco::GenParticleRef &ref)
pat::helper::MultiIsolator isolator_
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
void embedGsfTrack()
embeds the gsf track instead of keeping a reference to it
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
bool enabled() const
'true' if this there is at least one efficiency configured
bool enabled() const
True if it has a non null configuration.
GreaterByEt< GenericParticle > eTComparator_
void setIsolation(IsolationKeys key, float value)
#define DEFINE_FWK_MODULE(type)
void add(ObjectType &patObject, edm::Event const &iEvent, edm::EventSetup const &iSetup)
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
PATGenericParticleProducer(const edm::ParameterSet &iConfig)
void setQuality(float quality)
sets a user defined quality value
void embedStandalone()
embeds the stand-alone track instead of keeping a reference to it
Produces and/or checks pat::VertexAssociation's.
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 embedCaloTower()
embeds the calotower instead of keeping a reference to it
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< std::pair< pat::IsolationKeys, edm::InputTag > > isoDepositLabels_
void newEvent(const edm::Event &event)
To be called for each new event, reads in the vertex collection.
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed)
Produces the pat::GenericParticle.
pat::helper::KinResolutionsLoader resolutionLoader_
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
void setVertexAssociation(const pat::VertexAssociation &assoc)
Set a single vertex association.
void newEvent(const edm::Event &event, const edm::EventSetup &setup)
To be called for each new event, reads in the EventSetup object.
T getParameter(std::string const &) const
bool enabled() const
returns true if this was given a non dummy configuration
~PATGenericParticleProducer() override
void embedCombined()
embeds the combined track instead of keeping a reference to it
IsolationKeys
Enum defining isolation keys.
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
edm::EDGetTokenT< edm::ValueMap< float > > qualitySrcToken_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
void embedTracks()
embeds the other tracks instead of keeping references
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.
pat::helper::VertexingHelper vertexingHelper_
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
void embedTrack()
embeds the master track instead of keeping a reference to it