12 std::vector<edm::InputTag>
tags = iConfig.
getParameter<std::vector<edm::InputTag> >(
"PFCandidate");
13 for (
unsigned int i=0;
i<tags.size();++
i)
47 edm::LogError(
"PFLinker") <<
" cannot read several collections of PFCandidates and produce a new collection at the same time. " << std::endl;
50 if(producePFCandidates_) {
56 if(fillMuonRefs_) produces<edm::ValueMap<reco::PFCandidatePtr> > (
muonTag_.
label());
64 std::auto_ptr<reco::PFCandidateCollection>
70 std::map<reco::GsfElectronRef,reco::PFCandidatePtr> electronCandidateMap;
75 std::map<reco::PhotonRef,reco::PFCandidatePtr> photonCandidateMap;
81 std::map<reco::MuonRef,reco::PFCandidatePtr> muonCandidateMap;
86 for(
unsigned icol=0;icol<nColPF;++icol) {
88 unsigned ncand=pfCandidates->size();
90 for(
unsigned i=0;
i<ncand; ++
i) {
100 if ( !(isphoton || iselectron || hasNonNullMuonRef)){pfCandidates_p->push_back(cand);
continue;}
103 if (hasNonNullMuonRef) {
106 muonCandidateMap[muRef] = candPtr;
114 std::vector<reco::GsfElectron>::const_iterator itcheck=find_if(gsfElectrons->begin(),gsfElectrons->end(),myEqual);
115 if(itcheck==gsfElectrons->end()) {
116 std::ostringstream err;
117 err <<
" Problem in PFLinker: no GsfElectron " << std::endl;
124 electronCandidateMap[electronRef] = candPtr;
131 std::vector<reco::Photon>::const_iterator itcheck=find_if(photons->begin(),photons->end(),myEqual);
132 if(itcheck==photons->end()) {
133 std::ostringstream err;
134 err <<
" Problem in PFLinker: no Photon " << std::endl;
141 photonCandidateMap[photonRef] = candPtr;
144 pfCandidates_p->push_back(cand);
157 electronCandidateMap,
173 pfMapMuons = fillValueMap<reco::MuonCollection>(
iEvent,
180 std::auto_ptr<edm::ValueMap<reco::PFCandidatePtr> >
184 *pfMapMerged += pfMapGsfElectrons;
185 *pfMapMerged += pfMapPhotons;
193 template<
typename TYPE>
205 unsigned nObj=inputObjCollection->size();
206 std::vector<reco::PFCandidatePtr>
values(nObj);
208 for(
unsigned iobj=0; iobj < nObj; ++iobj) {
211 MapTYPE_it itcheck = mapToTheCandidate.find(objRef);
215 if(itcheck != mapToTheCandidate.end())
218 values[iobj] = candPtr;
221 filler.
insert(inputObjCollection,values.begin(),values.end());
224 event.put(pfMap_p,label);
T getParameter(std::string const &) const
edm::InputTag muonTag_
Input Muons.
void setGsfElectronRef(const reco::GsfElectronRef &ref)
set GsfElectronRef
edm::EDGetTokenT< reco::MuonCollection > inputTagMuons_
float mva_nothing_gamma() const
mva for gamma detection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void insert(const H &h, I begin, I end)
virtual void produce(edm::Event &, const edm::EventSetup &) override
bool producePFCandidates_
Flags - if true: References will be towards new collection ; if false to the original one...
edm::EDGetTokenT< reco::PhotonCollection > inputTagPhotons_
Input Photons.
PFLinker(const edm::ParameterSet &)
edm::ValueMap< reco::PFCandidatePtr > fillValueMap(edm::Event &event, std::string label, edm::Handle< TYPE > &inputObjCollection, const std::map< edm::Ref< TYPE >, reco::PFCandidatePtr > &mapToTheCandidate, const edm::OrphanHandle< reco::PFCandidateCollection > &newPFCandColl) const
edm::EDGetTokenT< reco::MuonToMuonMap > inputTagMuonMap_
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
bool isNonnull() const
Checks for non-null.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::string nameOutputElectronsPF_
name of output ValueMap electrons
std::string nameOutputPhotonsPF_
name of output ValueMap photons
std::string nameOutputPF_
name of output collection of PFCandidate
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
reco::MuonRef muonRef() const
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
bool fillMuonRefs_
Set muon refs and produce the value map?
void setPhotonRef(const reco::PhotonRef &phRef)
set ref to the corresponding reco::Photon if any
Particle reconstructed by the particle flow algorithm.
void setMuonRef(const reco::MuonRef &ref)
set muon reference
reco::GsfTrackRef gsfTrackRef() const
void setSuperClusterRef(const reco::SuperClusterRef &scRef)
virtual ParticleType particleId() const
edm::EDGetTokenT< reco::GsfElectronCollection > inputTagGsfElectrons_
Input GsfElectrons.
std::vector< edm::EDGetTokenT< reco::PFCandidateCollection > > inputTagPFCandidates_
Input PFCandidates.
std::string nameOutputMergedPF_
name of output merged ValueMap
reco::SuperClusterRef superClusterRef() const
return a reference to the corresponding SuperCluster if any