192 auto caloClustersEB = std::make_unique<reco::CaloClusterCollection>();
193 auto caloClustersEE = std::make_unique<reco::CaloClusterCollection>();
194 auto caloClustersES = std::make_unique<reco::CaloClusterCollection>();
196 std::map<reco::CaloClusterPtr, unsigned int> pfClusterMapEB;
197 std::map<reco::CaloClusterPtr, unsigned int> pfClusterMapEE;
198 std::map<reco::CaloClusterPtr, unsigned int> pfClusterMapES;
203 if (!pfClusterMapEB.count(*pfclus)) {
205 caloClustersEB->push_back(caloclus);
206 pfClusterMapEB[*pfclus] = caloClustersEB->size() - 1;
210 <<
"Found an EB pfcluster matched to more than one EB supercluster!" 217 if (!pfClusterMapEE.count(*pfclus)) {
219 caloClustersEE->push_back(caloclus);
220 pfClusterMapEE[*pfclus] = caloClustersEE->size() - 1;
224 <<
"Found an EE pfcluster matched to more than one EE supercluster!" 229 if (!pfClusterMapES.count(*pfclus)) {
231 caloClustersES->push_back(caloclus);
232 pfClusterMapES[*pfclus] = caloClustersES->size() - 1;
236 <<
"Found an ES pfcluster matched to more than one EE supercluster!" 243 auto pfClusterAssociationEBEE = std::make_unique<edm::ValueMap<reco::CaloClusterPtr>>();
244 auto pfClusterAssociationES = std::make_unique<edm::ValueMap<reco::CaloClusterPtr>>();
247 std::vector<reco::CaloClusterPtr> clusptrsEB(caloClustersEB->size());
248 std::vector<reco::CaloClusterPtr> clusptrsEE(caloClustersEE->size());
249 std::vector<reco::CaloClusterPtr> clusptrsES(caloClustersES->size());
259 ebsc.setSeed(seedptr);
263 int caloclusidx = pfClusterMapEB[*pfclus];
266 clusptrsEB[caloclusidx] = *pfclus;
268 ebsc.setClusters(clusters);
272 eesc.setSeed(seedptr);
276 int caloclusidx = pfClusterMapEE[*pfclus];
279 clusptrsEE[caloclusidx] = *pfclus;
281 eesc.setClusters(clusters);
285 int caloclusidx = pfClusterMapES[*pfclus];
288 clusptrsES[caloclusidx] = *pfclus;
290 eesc.setPreshowerClusters(psclusters);
295 fillerEBEE.insert(caloClusHandleEB, clusptrsEB.begin(), clusptrsEB.end());
296 fillerEBEE.insert(caloClusHandleEE, clusptrsEE.begin(), clusptrsEE.end());
300 fillerES.insert(caloClusHandleES, clusptrsES.begin(), clusptrsES.end());
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
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_
std::string PFClusterAssociationES_
std::string PFSuperClusterCollectionEndcapWithPreshower_
std::string PFBasicClusterCollectionBarrel_