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()) {
153 superClusters.push_back(newSC);
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()) {
176 superClusters.push_back(newSC);
179 auto superClusters_p = std::make_unique<reco::SuperClusterCollection>();
180 superClusters_p->assign(superClusters.begin(), superClusters.end());
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();
203 LogTrace(
"EcalCleaning") <<
"The new SC clean collection with size " << superClusters.size();
204 for (
unsigned int i = 0;
i < superClusters.size(); ++
i) {
206 LogTrace(
"EcalCleaning") <<
" >>> newSC #" <<
i <<
"; Energy: " << nsc.
energy() <<
" eta: " << nsc.
eta()
208 <<
" sc seed detid: " << nsc.
seed()->seed().rawId();
const math::XYZPoint & position() const
cluster centroid position
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::string bcCollection_
void push_back(Ptr< T > const &iPtr)
edm::Ptr< CaloCluster > CaloClusterPtr
const edm::EDGetTokenT< reco::SuperClusterCollection > uncleanScCollection_
double eta() const
pseudorapidity of cluster centroid
const edm::EDGetTokenT< reco::SuperClusterCollection > cleanScCollection_
void setFlags(uint32_t flags)
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
double energy() const
cluster energy
const std::string scCollection_
const edm::EDGetTokenT< reco::BasicClusterCollection > uncleanBcCollection_
T const * product() const
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
const CaloClusterPtr & seed() const
seed BasicCluster
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents