13 isolator_(iConfig.exists(
"userIsolation") ? iConfig.getParameter<edm::
ParameterSet>(
"userIsolation") : edm::
ParameterSet(), consumesCollector(),
false),
14 userDataHelper_ ( iConfig.getParameter<edm::
ParameterSet>(
"userData"), consumesCollector() )
40 addQuality_ = iConfig.getParameter<
bool>(
"addQuality");
41 qualitySrcToken_ = mayConsume<edm::ValueMap<float> >(iConfig.getParameter<
edm::InputTag>(
"qualitySource"));
44 produces<std::vector<GenericParticle> >();
46 if (iConfig.exists(
"isoDeposits")) {
51 if (depconf.
exists(
"user")) {
52 std::vector<edm::InputTag> userdeps = depconf.
getParameter<std::vector<edm::InputTag> >(
"user");
53 std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
55 for ( ; it != ed; ++it, ++
key) {
56 isoDepositLabels_.push_back(std::make_pair(
IsolationKeys(key), *it));
60 isoDepositTokens_ =
edm::vector_transform(isoDepositLabels_, [
this](std::pair<IsolationKeys,edm::InputTag>
const &
label){
return consumes<edm::ValueMap<IsoDeposit> >(label.second);});
63 addEfficiencies_ = iConfig.getParameter<
bool>(
"addEfficiencies");
64 if (addEfficiencies_) {
69 addResolutions_ = iConfig.getParameter<
bool>(
"addResolutions");
70 if (addResolutions_) {
74 if (iConfig.exists(
"vertexing")) {
80 if ( iConfig.exists(
"userData") ) {
85 PATGenericParticleProducer::~PATGenericParticleProducer() {
101 std::vector<edm::Handle<edm::ValueMap<IsoDeposit> > > deposits(
isoDepositTokens_.size());
102 for (
size_t j = 0, nd = deposits.size();
j < nd; ++
j) {
107 std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > > genMatches(
genMatchTokens_.size());
119 std::vector<GenericParticle> * PATGenericParticles =
new std::vector<GenericParticle>();
122 unsigned int idx = itGenericParticle - cands->begin();
148 for (
size_t j = 0, nd = deposits.size();
j < nd; ++
j) {
154 for(
size_t i = 0,
n = genMatches.size();
i <
n; ++
i) {
162 aGenericParticle.
setQuality( (*qualities)[candRef] );
190 std::auto_ptr<std::vector<GenericParticle> > myGenericParticles(PATGenericParticles);
191 iEvent.
put(myGenericParticles);
bool enabled() const
'true' if this there is at least one efficiency configured
T getParameter(std::string const &) const
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
void setIsolation(IsolationKeys key, float value)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void embedTrack()
embeds the master track instead of keeping a reference to it
IsolationKeys
Enum defining isolation keys.
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
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)
bool enabled() const
True if it has a non null configuration.
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed) ...
pat::PATUserDataHelper< pat::GenericParticle > userDataHelper_
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
void embedStandalone()
embeds the stand-alone track instead of keeping a reference to it
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
edm::EDGetTokenT< edm::View< reco::Candidate > > srcToken_
PATGenericParticleProducer(const edm::ParameterSet &iConfig)
GreaterByEt< GenericParticle > eTComparator_
Produces the pat::GenericParticle.
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
void embedGsfTrack()
embeds the gsf track instead of keeping a reference to it
void embedSuperCluster()
embeds the supercluster instead of keeping a reference to it
void addGenParticleRef(const reco::GenParticleRef &ref)
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
void embedTracks()
embeds the other tracks instead of keeping references
void newEvent(const edm::Event &event)
To be called for each new event, reads in the vertex collection.
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.
bool enabled() const
returns true if this was given a non dummy configuration
pat::helper::EfficiencyLoader efficiencyLoader_
pat::helper::VertexingHelper vertexingHelper_
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.
pat::helper::MultiIsolator isolator_
void embedCaloTower()
embeds the calotower instead of keeping a reference to it
std::vector< std::pair< pat::IsolationKeys, edm::InputTag > > isoDepositLabels_
volatile std::atomic< bool > shutdown_flag false
void setQuality(float quality)
sets a user defined quality value
void newEvent(const edm::Event &event, const edm::EventSetup &setup) const
To be called for each new event, reads in the EventSetup object.
void embedCombined()
embeds the combined track instead of keeping a reference to it
pat::helper::KinResolutionsLoader resolutionLoader_
edm::EDGetTokenT< edm::ValueMap< float > > qualitySrcToken_
Produces and/or checks pat::VertexAssociation's.
void newEvent(const edm::Event &event) const
To be called for each new event, reads in the ValueMaps for efficiencies.
void setVertexAssociation(const pat::VertexAssociation &assoc)
Set a single vertex association.
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const