43 bcCollection_(ps.getParameter<
std::
string>(
"bcCollection")),
44 scCollection_(ps.getParameter<
std::
string>(
"scCollection")) {
69 int uncleanSize = pUncleanSC->size();
70 int cleanSize = pCleanSC->size();
72 LogTrace(
"EcalCleaning") <<
"Size of Clean Collection: " << cleanSize <<
", uncleanSize: " << uncleanSize;
86 std::vector<std::pair<int, int> > basicClusterOwner;
88 std::vector<DetId> scUncleanSeedDetId;
89 for (
int isc = 0; isc < uncleanSize; ++isc) {
91 scUncleanSeedDetId.push_back(unsc.
seed()->seed());
95 basicClusters.push_back(**bciter);
97 basicClusterOwner.push_back(std::make_pair(isc, 0));
103 std::vector<DetId> scCleanSeedDetId;
104 std::vector<int> isToBeKept;
105 for (
int isc = 0; isc < cleanSize; ++isc) {
107 scCleanSeedDetId.push_back(cscRef->seed()->seed());
110 basicClusters.push_back(**bciter);
112 basicClusterOwner.push_back(std::make_pair(isc, 1));
114 if (cscRef->isInUnclean())
115 isToBeKept.push_back(1);
117 isToBeKept.push_back(0);
121 auto basicClusters_p = std::make_unique<reco::BasicClusterCollection>();
122 basicClusters_p->assign(basicClusters.begin(), basicClusters.end());
125 edm::LogWarning(
"MissingInput") <<
"could not handle the new BasicClusters!";
130 LogTrace(
"EcalCleaning") <<
"Got the BasicClusters from the event again";
131 int bcSize = bccHandle->size();
136 for (
int isc = 0; isc < uncleanSize; ++isc) {
140 for (
int jbc = 0; jbc < bcSize; ++jbc) {
141 std::pair<int, int> theBcOwner = basicClusterOwner[jbc];
142 if (theBcOwner.first == isc && theBcOwner.second == 0) {
145 if (scUncleanSeedDetId[isc] == currentClu->seed()) {
157 for (
int isc = 0; isc < cleanSize; ++isc) {
159 if (not cscRef->isInUnclean())
164 for (
int jbc = 0; jbc < bcSize; ++jbc) {
165 std::pair<int, int> theBcOwner = basicClusterOwner[jbc];
166 if (theBcOwner.first == isc && theBcOwner.second == 1) {
169 if (scCleanSeedDetId[isc] == currentClu->seed()) {
179 auto superClusters_p = std::make_unique<reco::SuperClusterCollection>();
184 LogTrace(
"EcalCleaning") <<
"Clusters (Basic/Super) added to the Event! :-)";
189 LogTrace(
"EcalCleaning") <<
"Clean Collection SC ";
190 for (
int i = 0;
i < cleanSize; ++
i) {
192 LogTrace(
"EcalCleaning") <<
" >>> clean #" <<
i <<
"; Energy: " <<
csc.energy() <<
" eta: " <<
csc.eta()
193 <<
" sc seed detid: " <<
csc.seed()->seed().rawId();
196 LogTrace(
"EcalCleaning") <<
"Unclean Collection SC ";
197 for (
int i = 0;
i < uncleanSize; ++
i) {
199 LogTrace(
"EcalCleaning") <<
" >>> unclean #" <<
i <<
"; Energy: " << usc.
energy() <<
" eta: " << usc.
eta()
200 <<
" sc seed detid: " << usc.
seed()->seed().rawId();
206 LogTrace(
"EcalCleaning") <<
" >>> newSC #" <<
i <<
"; Energy: " << nsc.
energy() <<
" eta: " << nsc.
eta()
208 <<
" sc seed detid: " << nsc.
seed()->seed().rawId();