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);
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 std::auto_ptr< reco::SuperClusterCollection>
186 superClusters_p->assign(superClusters.begin(), superClusters.end());
190 LogTrace(
"EcalCleaning")<<
"Clusters (Basic/Super) added to the Event! :-)";
195 LogTrace(
"EcalCleaning") <<
"Clean Collection SC ";
196 for (
int i=0;
i < cleanSize; ++
i) {
198 LogTrace(
"EcalCleaning") <<
" >>> clean #" <<
i <<
"; Energy: " << csc.
energy()
199 <<
" eta: " << csc.
eta()
200 <<
" sc seed detid: " << csc.
seed()->seed().rawId();
203 LogTrace(
"EcalCleaning") <<
"Unclean Collection SC ";
204 for (
int i=0;
i < uncleanSize; ++
i) {
206 LogTrace(
"EcalCleaning") <<
" >>> unclean #" <<
i <<
"; Energy: " << usc.
energy()
207 <<
" eta: " << usc.
eta()
208 <<
" sc seed detid: " << usc.
seed()->seed().rawId();
211 LogTrace(
"EcalCleaning")<<
"The new SC clean collection with size "<< superClusters.size();
212 for (
unsigned int i=0;
i < superClusters.size(); ++
i) {
214 LogTrace(
"EcalCleaning")<<
" >>> newSC #" <<
i <<
"; Energy: " << nsc.
energy()
215 <<
" eta: " << nsc.
eta() <<
" isClean="
217 <<
" sc seed detid: " << nsc.
seed()->seed().rawId();
UncleanSCRecoveryProducer(const edm::ParameterSet &ps)
virtual void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
const math::XYZPoint & position() const
cluster centroid position
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
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
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