216 auto caloClustersEB = std::make_unique<reco::CaloClusterCollection>();
217 auto caloClustersEE = std::make_unique<reco::CaloClusterCollection>();
218 auto caloClustersES = std::make_unique<reco::CaloClusterCollection>();
220 std::map<reco::CaloClusterPtr, unsigned int> pfClusterMapEB;
221 std::map<reco::CaloClusterPtr, unsigned int> pfClusterMapEE;
222 std::map<reco::CaloClusterPtr, unsigned int> pfClusterMapES;
227 if (!pfClusterMapEB.count(*pfclus)) {
229 caloClustersEB->push_back(caloclus);
230 pfClusterMapEB[*pfclus] = caloClustersEB->size() - 1;
233 <<
"Found an EB pfcluster matched to more than one EB supercluster!" <<
std::dec << std::endl;
239 if (!pfClusterMapEE.count(*pfclus)) {
241 caloClustersEE->push_back(caloclus);
242 pfClusterMapEE[*pfclus] = caloClustersEE->size() - 1;
245 <<
"Found an EE pfcluster matched to more than one EE supercluster!" <<
std::dec << std::endl;
250 if (!pfClusterMapES.count(*pfclus)) {
252 caloClustersES->push_back(caloclus);
253 pfClusterMapES[*pfclus] = caloClustersES->size() - 1;
256 <<
"Found an ES pfcluster matched to more than one EE supercluster!" <<
std::dec << std::endl;
262 auto pfClusterAssociationEBEE = std::make_unique<edm::ValueMap<reco::CaloClusterPtr>>();
263 auto pfClusterAssociationES = std::make_unique<edm::ValueMap<reco::CaloClusterPtr>>();
266 std::vector<reco::CaloClusterPtr> clusptrsEB(caloClustersEB->size());
267 std::vector<reco::CaloClusterPtr> clusptrsEE(caloClustersEE->size());
268 std::vector<reco::CaloClusterPtr> clusptrsES(caloClustersES->size());
281 ebsc.setSeed(seedptr);
285 int caloclusidx = pfClusterMapEB[*pfclus];
288 clusptrsEB[caloclusidx] = *pfclus;
294 eesc.setSeed(seedptr);
298 int caloclusidx = pfClusterMapEE[*pfclus];
301 clusptrsEE[caloclusidx] = *pfclus;
308 int caloclusidx = pfClusterMapES[*pfclus];
311 clusptrsES[caloclusidx] = *pfclus;
313 eesc.setPreshowerClusters(psclusters);
318 fillerEBEE.insert(caloClusHandleEB, clusptrsEB.begin(), clusptrsEB.end());
319 fillerEBEE.insert(caloClusHandleEE, clusptrsEE.begin(), clusptrsEE.end());
323 fillerES.insert(caloClusHandleES, clusptrsES.begin(), clusptrsES.end());
std::unique_ptr< reco::SuperClusterCollection > & getEEOutputSCCollection()
void push_back(Ptr< T > const &iPtr)
std::string PFBasicClusterCollectionEndcap_
std::string PFClusterAssociationEBEE_
void loadAndSortPFClusters(const edm::Event &evt)
PFECALSuperClusterAlgo superClusterAlgo_
clustering algorithm
std::unique_ptr< reco::SuperClusterCollection > & getEBOutputSCCollection()
std::string PFSuperClusterCollectionBarrel_
std::string PFBasicClusterCollectionPreshower_
void updateSCParams(const edm::EventSetup &)
std::string PFClusterAssociationES_
std::string PFSuperClusterCollectionEndcapWithPreshower_
std::string PFBasicClusterCollectionBarrel_