76 edm::LogWarning(
"MissingInput") <<
"could not handle clean super clusters";
85 edm::LogWarning(
"MissingInput") <<
"could not handle unclean Basic Clusters!";
94 edm::LogWarning(
"MissingInput") <<
"could not handle unclean super clusters!";
98 int uncleanSize = pUncleanSC->size();
99 int cleanSize = pCleanSC->size();
101 LogTrace(
"EcalCleaning") <<
"Size of Clean Collection: " << cleanSize
102 <<
", uncleanSize: " << uncleanSize;
116 std::vector< std::pair<int, int> > basicClusterOwner;
118 std::vector<DetId> scUncleanSeedDetId;
119 for (
int isc =0; isc< uncleanSize; ++isc) {
121 scUncleanSeedDetId.push_back(unsc.
seed()->seed());
125 basicClusters.push_back(**bciter);
127 basicClusterOwner.push_back( std::make_pair(isc,0) );
133 std::vector<DetId> scCleanSeedDetId;
134 std::vector<int> isToBeKept;
135 for (
int isc =0; isc< cleanSize; ++isc) {
137 scCleanSeedDetId.push_back(cscRef->seed()->seed());
140 basicClusters.push_back(**bciter);
142 basicClusterOwner.push_back( std::make_pair(isc,1) );
144 if (cscRef->isInUnclean()) isToBeKept.push_back(1);
145 else isToBeKept.push_back(0);
150 basicClusters_p->assign(basicClusters.begin(), basicClusters.end());
155 edm::LogWarning(
"MissingInput") <<
"could not handle the new BasicClusters!";
160 LogTrace(
"EcalCleaning") <<
"Got the BasicClusters from the event again";
161 int bcSize = bccHandle->size();
166 for (
int isc=0; isc< uncleanSize; ++isc) {
170 for (
int jbc=0; jbc< bcSize; ++jbc) {
171 std::pair<int,int> theBcOwner = basicClusterOwner[jbc];
172 if (theBcOwner.first == isc && theBcOwner.second == 0) {
175 if (scUncleanSeedDetId[isc] == currentClu->seed()) {
183 superClusters.push_back(newSC);
187 for (
int isc=0; isc< cleanSize; ++isc) {
189 if (not cscRef->isInUnclean())
continue;
193 for (
int jbc=0; jbc< bcSize; ++jbc) {
194 std::pair<int,int> theBcOwner = basicClusterOwner[jbc];
195 if (theBcOwner.first == isc && theBcOwner.second == 1) {
198 if (scCleanSeedDetId[isc] == currentClu->seed()) {
204 seed, clusterPtrVector );
206 superClusters.push_back(newSC);
209 std::auto_ptr< reco::SuperClusterCollection>
211 superClusters_p->assign(superClusters.begin(), superClusters.end());
215 LogTrace(
"EcalCleaning")<<
"Clusters (Basic/Super) added to the Event! :-)";
220 LogTrace(
"EcalCleaning") <<
"Clean Collection SC ";
221 for (
int i=0;
i < cleanSize; ++
i) {
223 LogTrace(
"EcalCleaning") <<
" >>> clean #" <<
i <<
"; Energy: " << csc.
energy()
224 <<
" eta: " << csc.
eta()
225 <<
" sc seed detid: " << csc.
seed()->seed().rawId();
228 LogTrace(
"EcalCleaning") <<
"Unclean Collection SC ";
229 for (
int i=0;
i < uncleanSize; ++
i) {
231 LogTrace(
"EcalCleaning") <<
" >>> unclean #" <<
i <<
"; Energy: " << usc.
energy()
232 <<
" eta: " << usc.
eta()
233 <<
" sc seed detid: " << usc.
seed()->seed().rawId();
236 LogTrace(
"EcalCleaning")<<
"The new SC clean collection with size "<< superClusters.size();
237 for (
unsigned int i=0;
i < superClusters.size(); ++
i) {
239 LogTrace(
"EcalCleaning")<<
" >>> newSC #" <<
i <<
"; Energy: " << nsc.
energy()
240 <<
" eta: " << nsc.
eta() <<
" isClean="
242 <<
" 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
edm::InputTag cleanScCollection_
virtual void produce(edm::Event &, const edm::EventSetup &)
void push_back(Ptr< T > const &iPtr)
edm::Ptr< CaloCluster > CaloClusterPtr
double eta() const
pseudorapidity of cluster centroid
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.
~UncleanSCRecoveryProducer()
std::string bcCollection_
double energy() const
cluster energy
edm::InputTag cleanBcCollection_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::InputTag uncleanScCollection_
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
T const * product() const
std::string scCollection_
edm::InputTag uncleanBcCollection_
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
const CaloClusterPtr & seed() const
seed BasicCluster
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents