88 int uncleanSize = pUncleanSC->size();
89 int cleanSize = pCleanSC->size();
91 LogTrace(
"EcalCleaning") <<
"Size of Clean Collection: " << cleanSize
92 <<
", uncleanSize: " << uncleanSize;
106 std::vector< std::pair<int, int> > basicClusterOwner;
108 std::vector<DetId> scUncleanSeedDetId;
109 for (
int isc =0; isc< uncleanSize; ++isc) {
111 scUncleanSeedDetId.push_back(unsc.
seed()->seed());
115 basicClusters.push_back(**bciter);
117 basicClusterOwner.push_back( std::make_pair(isc,0) );
123 std::vector<DetId> scCleanSeedDetId;
124 std::vector<int> isToBeKept;
125 for (
int isc =0; isc< cleanSize; ++isc) {
127 scCleanSeedDetId.push_back(cscRef->seed()->seed());
130 basicClusters.push_back(**bciter);
132 basicClusterOwner.push_back( std::make_pair(isc,1) );
134 if (cscRef->isInUnclean()) isToBeKept.push_back(1);
135 else isToBeKept.push_back(0);
140 basicClusters_p->assign(basicClusters.begin(), basicClusters.end());
145 edm::LogWarning(
"MissingInput") <<
"could not handle the new BasicClusters!";
150 LogTrace(
"EcalCleaning") <<
"Got the BasicClusters from the event again";
151 int bcSize = bccHandle->size();
156 for (
int isc=0; isc< uncleanSize; ++isc) {
160 for (
int jbc=0; jbc< bcSize; ++jbc) {
161 std::pair<int,int> theBcOwner = basicClusterOwner[jbc];
162 if (theBcOwner.first == isc && theBcOwner.second == 0) {
165 if (scUncleanSeedDetId[isc] == currentClu->seed()) {
173 superClusters.push_back(newSC);
177 for (
int isc=0; isc< cleanSize; ++isc) {
179 if (not cscRef->isInUnclean())
continue;
183 for (
int jbc=0; jbc< bcSize; ++jbc) {
184 std::pair<int,int> theBcOwner = basicClusterOwner[jbc];
185 if (theBcOwner.first == isc && theBcOwner.second == 1) {
188 if (scCleanSeedDetId[isc] == currentClu->seed()) {
194 seed, clusterPtrVector );
196 superClusters.push_back(newSC);
199 std::auto_ptr< reco::SuperClusterCollection>
201 superClusters_p->assign(superClusters.begin(), superClusters.end());
205 LogTrace(
"EcalCleaning")<<
"Clusters (Basic/Super) added to the Event! :-)";
210 LogTrace(
"EcalCleaning") <<
"Clean Collection SC ";
211 for (
int i=0;
i < cleanSize; ++
i) {
213 LogTrace(
"EcalCleaning") <<
" >>> clean #" <<
i <<
"; Energy: " << csc.
energy()
214 <<
" eta: " << csc.
eta()
215 <<
" sc seed detid: " << csc.
seed()->seed().rawId();
218 LogTrace(
"EcalCleaning") <<
"Unclean Collection SC ";
219 for (
int i=0;
i < uncleanSize; ++
i) {
221 LogTrace(
"EcalCleaning") <<
" >>> unclean #" <<
i <<
"; Energy: " << usc.
energy()
222 <<
" eta: " << usc.
eta()
223 <<
" sc seed detid: " << usc.
seed()->seed().rawId();
226 LogTrace(
"EcalCleaning")<<
"The new SC clean collection with size "<< superClusters.size();
227 for (
unsigned int i=0;
i < superClusters.size(); ++
i) {
229 LogTrace(
"EcalCleaning")<<
" >>> newSC #" <<
i <<
"; Energy: " << nsc.
energy()
230 <<
" eta: " << nsc.
eta() <<
" isClean="
232 <<
" sc seed detid: " << nsc.
seed()->seed().rawId();
UncleanSCRecoveryProducer(const edm::ParameterSet &ps)
T getParameter(std::string const &) const
const math::XYZPoint & position() const
cluster centroid position
virtual void produce(edm::Event &, const edm::EventSetup &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void push_back(Ptr< T > const &iPtr)
edm::Ptr< CaloCluster > CaloClusterPtr
edm::EDGetTokenT< reco::SuperClusterCollection > cleanScCollection_
double eta() const
pseudorapidity of cluster centroid
edm::EDGetTokenT< reco::BasicClusterCollection > cleanBcCollection_
void setFlags(uint32_t flags)
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< reco::SuperClusterCollection > uncleanScCollection_
std::string bcCollection_
double energy() const
cluster energy
T const * product() const
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
std::string scCollection_
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
const CaloClusterPtr & seed() const
seed BasicCluster
edm::EDGetTokenT< reco::BasicClusterCollection > uncleanBcCollection_
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents