43 bcCollection_(ps.getParameter<
std::
string>(
"bcCollection")),
44 scCollection_(ps.getParameter<
std::
string>(
"scCollection"))
73 int uncleanSize = pUncleanSC->size();
74 int cleanSize = pCleanSC->size();
76 LogTrace(
"EcalCleaning") <<
"Size of Clean Collection: " << cleanSize
77 <<
", uncleanSize: " << uncleanSize;
91 std::vector< std::pair<int, int> > basicClusterOwner;
93 std::vector<DetId> scUncleanSeedDetId;
94 for (
int isc =0; isc< uncleanSize; ++isc) {
96 scUncleanSeedDetId.push_back(unsc.
seed()->seed());
100 basicClusters.push_back(**bciter);
102 basicClusterOwner.push_back( std::make_pair(isc,0) );
108 std::vector<DetId> scCleanSeedDetId;
109 std::vector<int> isToBeKept;
110 for (
int isc =0; isc< cleanSize; ++isc) {
112 scCleanSeedDetId.push_back(cscRef->seed()->seed());
115 basicClusters.push_back(**bciter);
117 basicClusterOwner.push_back( std::make_pair(isc,1) );
119 if (cscRef->isInUnclean()) isToBeKept.push_back(1);
120 else isToBeKept.push_back(0);
124 auto basicClusters_p = std::make_unique<reco::BasicClusterCollection>();
125 basicClusters_p->assign(basicClusters.begin(), basicClusters.end());
130 edm::LogWarning(
"MissingInput") <<
"could not handle the new BasicClusters!";
135 LogTrace(
"EcalCleaning") <<
"Got the BasicClusters from the event again";
136 int bcSize = bccHandle->size();
141 for (
int isc=0; isc< uncleanSize; ++isc) {
145 for (
int jbc=0; jbc< bcSize; ++jbc) {
146 std::pair<int,int> theBcOwner = basicClusterOwner[jbc];
147 if (theBcOwner.first == isc && theBcOwner.second == 0) {
150 if (scUncleanSeedDetId[isc] == currentClu->seed()) {
158 superClusters.push_back(newSC);
162 for (
int isc=0; isc< cleanSize; ++isc) {
164 if (not cscRef->isInUnclean())
continue;
168 for (
int jbc=0; jbc< bcSize; ++jbc) {
169 std::pair<int,int> theBcOwner = basicClusterOwner[jbc];
170 if (theBcOwner.first == isc && theBcOwner.second == 1) {
173 if (scCleanSeedDetId[isc] == currentClu->seed()) {
179 seed, clusterPtrVector );
181 superClusters.push_back(newSC);
184 auto superClusters_p = std::make_unique<reco::SuperClusterCollection>();
185 superClusters_p->assign(superClusters.begin(), superClusters.end());
189 LogTrace(
"EcalCleaning")<<
"Clusters (Basic/Super) added to the Event! :-)";
194 LogTrace(
"EcalCleaning") <<
"Clean Collection SC ";
195 for (
int i=0;
i < cleanSize; ++
i) {
197 LogTrace(
"EcalCleaning") <<
" >>> clean #" <<
i <<
"; Energy: " << csc.
energy()
198 <<
" eta: " << csc.
eta()
199 <<
" sc seed detid: " << csc.
seed()->seed().rawId();
202 LogTrace(
"EcalCleaning") <<
"Unclean Collection SC ";
203 for (
int i=0;
i < uncleanSize; ++
i) {
205 LogTrace(
"EcalCleaning") <<
" >>> unclean #" <<
i <<
"; Energy: " << usc.
energy()
206 <<
" eta: " << usc.
eta()
207 <<
" sc seed detid: " << usc.
seed()->seed().rawId();
210 LogTrace(
"EcalCleaning")<<
"The new SC clean collection with size "<< superClusters.size();
211 for (
unsigned int i=0;
i < superClusters.size(); ++
i) {
213 LogTrace(
"EcalCleaning")<<
" >>> newSC #" <<
i <<
"; Energy: " << nsc.
energy()
214 <<
" eta: " << nsc.
eta() <<
" isClean=" 216 <<
" sc seed detid: " << nsc.
seed()->seed().rawId();
UncleanSCRecoveryProducer(const edm::ParameterSet &ps)
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
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents