Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 45 of file PFCandidateMixer.cc.
Implements edm::EDProducer.
Definition at line 98 of file PFCandidateMixer.cc.
References _col1, _col2, _trackCol, gather_cfg::cout, reco::deltaR(), newFWLiteAna::found, edm::Event::getByLabel(), edm::Event::getProvenance(), i, edm::Provenance::moduleLabel(), edm::Provenance::processName(), edm::Provenance::productInstanceName(), edm::Event::put(), dt_dqm_sourceclient_common_cff::reco, reco::PFCandidate::setTrackRef(), and GlobalPosition_Frontier_DevDB_cff::tag.
101 using namespace reco;
107 std::vector< Handle<PFCandidateCollection> > colVec;
113 colVec.push_back(pfIn1);
114 colVec.push_back(pfIn2);
116 std::auto_ptr<std::vector< reco::PFCandidate > > pOut(
new std::vector< reco::PFCandidate > );
118 std::vector< Handle<PFCandidateCollection> >::iterator itCol= colVec.begin();
119 std::vector< Handle<PFCandidateCollection> >::iterator itColE= colVec.end();
122 for (;itCol!=itColE; ++itCol){
123 if (!itCol->isValid()) {
128 for (;it!=itE;++it) {
132 double minDR = 9999.;
134 if (it->trackRef().isNonnull()) {
135 for ( i = 0 ; i < trackCol->size(); ++
i){
136 if (
reco::deltaR( *(it->trackRef()), trackCol->at(i) )<0.001 ) {
140 double dr =
reco::deltaR( *(it->trackRef()), trackCol->at(i) );
149 cand.setTrackRef(trref);
153 if (it->trackRef().isNonnull()) {
154 std::cout <<
" XXXXXXXXXXX track not found "
156 <<
" ch " << it->charge()
157 <<
" id " << it->pdgId()
158 <<
" pt " << it->pt()
159 <<
" track: eta " << it->trackRef()->eta()
160 <<
" pt: " << it->trackRef()->pt()
161 <<
" charge: " << it->trackRef()->charge()
163 std::cout <<
" minDR=" << minDR << std::endl;
166 <<
" closest track pt=" << trackCol->at(iMinDr).pt()
167 <<
" ch=" << trackCol->at(iMinDr).charge()
172 std::cout <<
" trackref in PFCand came from: " <<
tag.encode() << std::endl;
177 pOut->push_back(cand);
PFCandidateCollection::const_iterator PFCandidateConstIterator
iterator
std::string const & processName() const
double deltaR(double eta1, double phi1, double eta2, double phi2)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::string const & moduleLabel() const
Particle reconstructed by the particle flow algorithm.
std::string const & productInstanceName() const
Provenance getProvenance(BranchID const &theID) const