247 <<
" in run "<<iEvent.
id().
run()<<std::endl;
258 pfeg_->setEEtoPSAssociation(eetops);
265 std::ostringstream err;
266 err<<
"Cannot find vertices for this event.Continuing Without them ";
277 LOGDRESSED(
"PFEGammaProducer")<<
"getting blocks"<<std::endl;
282 std::ostringstream err;
283 err<<
"cannot find blocks: (tag index)"
291 <<
"EGPFlow is starting..."<<std::endl;
294 assert( blocks.isValid() &&
"edm::Handle to blocks was null!");
295 std::ostringstream str;
298 LOGDRESSED(
"PFEGammaProducer") <<str.str()<<std::endl;
302 std::list< reco::PFBlockRef > hcalBlockRefs;
303 std::list< reco::PFBlockRef > ecalBlockRefs;
304 std::list< reco::PFBlockRef > hoBlockRefs;
305 std::list< reco::PFBlockRef > otherBlockRefs;
307 for(
unsigned i=0;
i<blocks->size(); ++
i ) {
316 <<
"Found " << elements.
size()
317 <<
" PFBlockElements in block: " <<
i << std::endl;
319 bool singleEcalOrHcal =
false;
320 if( elements.
size() == 1 ){
321 switch( elements[0].
type() ) {
324 <<
"PFBLOCKALGO BUG!!!! Found a SuperCluster in a block by itself!";
328 ecalBlockRefs.push_back( blockref );
329 singleEcalOrHcal =
true;
334 hcalBlockRefs.push_back( blockref );
335 singleEcalOrHcal =
true;
339 hoBlockRefs.push_back( blockref );
340 singleEcalOrHcal =
true;
347 if(!singleEcalOrHcal) {
348 otherBlockRefs.push_back( blockref );
359 for(
const auto& blockref : otherBlockRefs ) {
361 const auto& elements = blockref->elements();
366 std::vector<bool> active( elements.
size(),
true );
368 pfeg_->RunPFEG(blockref,active);
371 <<
"Block with " << elements.
size()
372 <<
" elements produced "
373 <<
pfeg_->getCandidates().size()
374 <<
" e-g candidates!" << std::endl;
378 reco::PFCandidateCollection::iterator eginsertfrom =
380 std::move(
pfeg_->getCandidates().begin(),
381 pfeg_->getCandidates().end(),
384 const size_t egxsize =
egExtra_->size();
386 reco::PFCandidateEGammaExtraCollection::iterator egxinsertfrom =
388 std::move(
pfeg_->getEGExtra().begin(),
389 pfeg_->getEGExtra().end(),
394 reco::SuperClusterCollection::iterator rscinsertfrom =
396 std::move(
pfeg_->getRefinedSCs().begin(),
397 pfeg_->getRefinedSCs().end(),
402 <<
"Running PFEGammaAlgo on all blocks produced = "
412 size_t non_zero_sc_idx = 0;
423 if( rsc.
energy() != 0.0 ) {
437 std::map<edm::Ptr<reco::CaloCluster>,
unsigned int> pfClusterMapEBEE;
438 std::map<edm::Ptr<reco::CaloCluster>,
unsigned int> pfClusterMapES;
442 if (!pfClusterMapEBEE.count(*pfclus)) {
444 caloClustersEBEE->push_back(caloclus);
445 pfClusterMapEBEE[*pfclus] = caloClustersEBEE->size() - 1;
449 <<
"Found an EB/EE pfcluster matched to more than one supercluster!"
450 << std::dec << std::endl;
454 if (!pfClusterMapES.count(*pfclus)) {
456 caloClustersES->push_back(caloclus);
457 pfClusterMapES[*pfclus] = caloClustersES->size() - 1;
461 <<
"Found an ES pfcluster matched to more than one supercluster!"
462 << std::dec << std::endl;
472 for(
auto& sc : *sClusters_ ) {
481 sc.setClusters(clusters);
488 sc.setPreshowerClusters(psclusters);
492 iEvent.
put(sClusters_);
EventNumber_t event() const
void setSuperClusterRef(reco::SuperClusterRef sc)
set reference to the corresponding supercluster
edm::EDGetTokenT< reco::VertexCollection > vertices_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void push_back(Ptr< T > const &iPtr)
bool useVerticesForNeutral_
unsigned int index() const
edm::Ref< SuperClusterCollection > SuperClusterRef
reference to an object in a collection of SuperCluster objects
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void setPFVertexParameters(bool useVertex, const reco::VertexCollection *primaryVertices)
std::vector< reco::PFCandidateEGammaExtra > PFCandidateEGammaExtraCollection
collection of PFCandidateEGammaExtras
std::auto_ptr< reco::PFCandidateEGammaExtraCollection > egExtra_
std::vector< CaloCluster > CaloClusterCollection
collection of CaloCluster objects
double energy() const
cluster energy
std::string ebeeClustersCollection_
std::string esClustersCollection_
std::auto_ptr< reco::PFCandidateCollection > egCandidates_
edm::EDGetTokenT< reco::PFCluster::EEtoPSAssociation > eetopsSrc_
RefProd< PROD > getRefBeforePut()
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
std::unique_ptr< PFEGammaAlgo > pfeg_
the unfiltered electron collection
T const * product() const
edm::EDGetTokenT< reco::PFBlockCollection > inputTagBlocks_
Particle reconstructed by the particle flow algorithm.
void setPFEGammaExtraRef(const reco::PFCandidateEGammaExtraRef &ref)
set the PF EGamma Extra Ref
void setSuperClusterRef(const reco::SuperClusterRef &scRef)
std::auto_ptr< reco::SuperClusterCollection > sClusters_