187 auto caloClustersEB = std::make_unique<reco::CaloClusterCollection>();
188 auto caloClustersEE = std::make_unique<reco::CaloClusterCollection>();
189 auto caloClustersES = std::make_unique<reco::CaloClusterCollection>();
191 std::map<reco::CaloClusterPtr, unsigned int> pfClusterMapEB;
192 std::map<reco::CaloClusterPtr, unsigned int> pfClusterMapEE;
193 std::map<reco::CaloClusterPtr, unsigned int> pfClusterMapES;
198 if (!pfClusterMapEB.count(*pfclus)) {
200 caloClustersEB->push_back(caloclus);
201 pfClusterMapEB[*pfclus] = caloClustersEB->size() - 1;
205 <<
"Found an EB pfcluster matched to more than one EB supercluster!" 212 if (!pfClusterMapEE.count(*pfclus)) {
214 caloClustersEE->push_back(caloclus);
215 pfClusterMapEE[*pfclus] = caloClustersEE->size() - 1;
219 <<
"Found an EE pfcluster matched to more than one EE supercluster!" 224 if (!pfClusterMapES.count(*pfclus)) {
226 caloClustersES->push_back(caloclus);
227 pfClusterMapES[*pfclus] = caloClustersES->size() - 1;
231 <<
"Found an ES pfcluster matched to more than one EE supercluster!" 238 auto pfClusterAssociationEBEE = std::make_unique<edm::ValueMap<reco::CaloClusterPtr>>();
239 auto pfClusterAssociationES = std::make_unique<edm::ValueMap<reco::CaloClusterPtr>>();
242 std::vector<reco::CaloClusterPtr> clusptrsEB(caloClustersEB->size());
243 std::vector<reco::CaloClusterPtr> clusptrsEE(caloClustersEE->size());
244 std::vector<reco::CaloClusterPtr> clusptrsES(caloClustersES->size());
254 ebsc.setSeed(seedptr);
258 int caloclusidx = pfClusterMapEB[*pfclus];
261 clusptrsEB[caloclusidx] = *pfclus;
263 ebsc.setClusters(clusters);
267 eesc.setSeed(seedptr);
271 int caloclusidx = pfClusterMapEE[*pfclus];
274 clusptrsEE[caloclusidx] = *pfclus;
276 eesc.setClusters(clusters);
280 int caloclusidx = pfClusterMapES[*pfclus];
283 clusptrsES[caloclusidx] = *pfclus;
285 eesc.setPreshowerClusters(psclusters);
290 fillerEBEE.insert(caloClusHandleEB, clusptrsEB.begin(), clusptrsEB.end());
291 fillerEBEE.insert(caloClusHandleEE, clusptrsEE.begin(), clusptrsEE.end());
295 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_