171 std::vector<EcalRecHit> seeds;
173 double clusterSeedThreshold ;
182 double energy = itt->energy();
184 if (energy > clusterSeedThreshold ) seeds.push_back(*itt);
211 std::vector<reco::BasicCluster> clusters;
212 std::vector<DetId> usedXtals;
219 for (std::vector<EcalRecHit>::iterator itseed=seeds.begin(); itseed!=seeds.end(); itseed++) {
220 DetId seed_id = itseed->id();
221 std::vector<DetId>::const_iterator usedIds;
223 std::vector<DetId>::iterator itdet =
find(usedXtals.begin(),usedXtals.end(),seed_id);
224 if(itdet != usedXtals.end())
continue;
227 std::vector<std::pair<DetId, float> > clus_used;
229 float clus_energy = 0;
231 for (std::vector<DetId>::iterator det=clus_v.begin(); det!=clus_v.end(); det++) {
235 std::vector<DetId>::iterator itdet =
find(usedXtals.begin(),usedXtals.end(),
detid);
236 if(itdet != usedXtals.end())
continue;
239 if( hit == hits->
end())
continue;
243 usedXtals.push_back(detid);
244 clus_used.push_back(std::pair<DetId, float>(detid, 1.) );
245 clus_energy += hit->energy();
249 if( clus_energy <= 0 )
continue;
253 if (
debug_>=2 )
LogDebug(
"")<<
"nxn_cluster in run "<< evt.
id().
run()<<
" event "<<evt.
id().
event()<<
" energy: "<<clus_energy <<
" eta: "<< clus_pos.Eta()<<
" phi: "<< clus_pos.Phi()<<
" nRecHits: "<< clus_used.size() <<std::endl;
266 clusters_p->assign(clusters.begin(), clusters.end());
268 if(
debug_>=1)
LogDebug(
"")<<
"nxnclusterProducer: "<<clusters_p->size() <<
" made in barrel"<<std::endl;
272 if(
debug_>=1)
LogDebug(
"")<<
"nxnclusterProducer: "<<clusters_p->size() <<
" made in endcap"<<std::endl;
EventNumber_t event() const
std::vector< T >::const_iterator const_iterator
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::string endcapClusterCollection_
PositionCalc posCalculator_
const_iterator end() const
double clusSeedThrEndCap_
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
math::XYZPoint Calculate_Location(const std::vector< std::pair< DetId, float > > &iDetIds, const EcalRecHitCollection *iRecHits, const CaloSubdetectorGeometry *iSubGeom, const CaloSubdetectorGeometry *iESGeom=0)
iterator find(key_type k)
bool checkStatusOfEcalRecHit(const EcalChannelStatus &channelStatus, const EcalRecHit &rh)
const_iterator begin() const
std::string barrelClusterCollection_