172 auto caloClustersEB = std::make_unique<reco::CaloClusterCollection>();
173 auto caloClustersEE = std::make_unique<reco::CaloClusterCollection>();
174 auto caloClustersES = std::make_unique<reco::CaloClusterCollection>();
176 std::map<reco::CaloClusterPtr, unsigned int> pfClusterMapEB;
177 std::map<reco::CaloClusterPtr, unsigned int> pfClusterMapEE;
178 std::map<reco::CaloClusterPtr, unsigned int> pfClusterMapES;
183 if (!pfClusterMapEB.count(*pfclus)) {
185 caloClustersEB->push_back(caloclus);
186 pfClusterMapEB[*pfclus] = caloClustersEB->size() - 1;
189 <<
"Found an EB pfcluster matched to more than one EB supercluster!" <<
std::dec << std::endl;
195 if (!pfClusterMapEE.count(*pfclus)) {
197 caloClustersEE->push_back(caloclus);
198 pfClusterMapEE[*pfclus] = caloClustersEE->size() - 1;
201 <<
"Found an EE pfcluster matched to more than one EE supercluster!" <<
std::dec << std::endl;
206 if (!pfClusterMapES.count(*pfclus)) {
208 caloClustersES->push_back(caloclus);
209 pfClusterMapES[*pfclus] = caloClustersES->size() - 1;
212 <<
"Found an ES pfcluster matched to more than one EE supercluster!" <<
std::dec << std::endl;
218 auto pfClusterAssociationEBEE = std::make_unique<edm::ValueMap<reco::CaloClusterPtr>>();
219 auto pfClusterAssociationES = std::make_unique<edm::ValueMap<reco::CaloClusterPtr>>();
222 std::vector<reco::CaloClusterPtr> clusptrsEB(caloClustersEB->size());
223 std::vector<reco::CaloClusterPtr> clusptrsEE(caloClustersEE->size());
224 std::vector<reco::CaloClusterPtr> clusptrsES(caloClustersES->size());
237 ebsc.setSeed(seedptr);
241 int caloclusidx = pfClusterMapEB[*pfclus];
244 clusptrsEB[caloclusidx] = *pfclus;
246 ebsc.setClusters(clusters);
250 eesc.setSeed(seedptr);
254 int caloclusidx = pfClusterMapEE[*pfclus];
257 clusptrsEE[caloclusidx] = *pfclus;
259 eesc.setClusters(clusters);
264 int caloclusidx = pfClusterMapES[*pfclus];
267 clusptrsES[caloclusidx] = *pfclus;
269 eesc.setPreshowerClusters(psclusters);
274 fillerEBEE.insert(caloClusHandleEB, clusptrsEB.begin(), clusptrsEB.end());
275 fillerEBEE.insert(caloClusHandleEE, clusptrsEE.begin(), clusptrsEE.end());
279 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_