74 _col1(iConfig.getUntrackedParameter<edm::InputTag>(
"col1") ),
75 _col2(iConfig.getUntrackedParameter<edm::InputTag>(
"col2") ),
76 _trackCol(iConfig.getUntrackedParameter<edm::InputTag>(
"trackCol") )
79 produces< std::vector< reco::PFCandidate > >();
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) );
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);
#define DEFINE_FWK_MODULE(type)
virtual void produce(edm::Event &, const edm::EventSetup &)
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.
PFCandidateMixer(const edm::ParameterSet &)
std::string const & productInstanceName() const
void setTrackRef(const reco::TrackRef &ref)
set track reference
Provenance getProvenance(BranchID const &theID) const