82 : _tracks(iConfig.getParameter<edm::InputTag>(
"tracks")),
83 _selectedMuons(iConfig.getParameter<edm::InputTag>(
"selectedMuons")),
84 _useCombinedCandidate(iConfig.getUntrackedParameter<bool>(
"useCombinedCandidate",
false))
89 produces<reco::TrackCollection>(
"tracks");
90 produces< std::vector< reco::PFCandidate > >(
"pfCands");
112 std::vector< reco::Particle::LorentzVector > toBeAdded;
118 for (
size_t idx = 0; idx < combCandidatesHandle->at(0).numberOfDaughters(); ++idx)
119 toBeAdded.push_back(combCandidatesHandle->at(0).daughter(idx)->p4());
125 for (
size_t idx = 0; idx < selectedZMuonsHandle->size(); ++idx)
126 toBeAdded.push_back(selectedZMuonsHandle->at(idx).p4());
129 if (toBeAdded.size() == 0)
147 std::auto_ptr<std::vector< reco::PFCandidate > > newCol(
new std::vector< reco::PFCandidate > );
154 for (;it!=itE;++it) {
161 std::vector< reco::Particle::LorentzVector >::const_iterator itSelectedMu = toBeAdded->begin();
162 std::vector< reco::Particle::LorentzVector >::const_iterator itSelectedMuE = toBeAdded->end();
163 for (; itSelectedMu != itSelectedMuE; ++itSelectedMu ){
165 if (dr < minDR) minDR = dr;
169 if ( pdg == 13 && (minDR < 0.001 ) ) {
173 newCol->push_back(*it);
177 iEvent.
put(newCol,
"pfCands");
189 unsigned int nMatched = 0;
191 for ( reco::TrackCollection::const_iterator it = tks->begin() ; it != tks->end(); ++it)
194 for ( std::vector< reco::Particle::LorentzVector >::const_iterator itTBA = toBeAdded->begin();
195 itTBA != toBeAdded->end();
205 if (ok) newCol->push_back(*it);
207 if (nMatched!=toBeAdded->size() )
std::cout <<
"TTT ARGGGHGH " << nMatched << std::endl;
209 iEvent.
put(newCol,
"tracks");
void produceTrackColl(edm::Event &, const std::vector< reco::Particle::LorentzVector > *toBeAdded)
#define DEFINE_FWK_MODULE(type)
std::vector< Track > TrackCollection
collection of Tracks
PFCandidateCollection::const_iterator PFCandidateConstIterator
iterator
double deltaR(double eta1, double phi1, double eta2, double phi2)
bool _useCombinedCandidate
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ZmumuPFEmbedder(const edm::ParameterSet &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void producePFCandColl(edm::Event &, const std::vector< reco::Particle::LorentzVector > *toBeAdded)
virtual void produce(edm::Event &, const edm::EventSetup &)
edm::InputTag _selectedMuons