164 auto clusters_p1 = std::make_unique<reco::PreshowerClusterCollection>();
165 auto clusters_p2 = std::make_unique<reco::PreshowerClusterCollection>();
167 auto superclusters_p = std::make_unique<reco::SuperClusterCollection>();
169 std::unique_ptr<CaloSubdetectorTopology> topology_p;
171 topology_p = std::make_unique<EcalPreshowerTopology>();
182 LogTrace(
"EcalClusters") <<
"PreshowerClusterProducerInfo: ### Total # of preshower RecHits: " << rechits->
size();
185 std::map<DetId, EcalRecHit> rechits_map;
187 for (it = rechits->
begin(); it != rechits->
end(); it++) {
189 if (it->recoFlag() == 1 || it->recoFlag() == 14 || (it->recoFlag() <= 10 && it->recoFlag() >= 5))
192 rechits_map.insert(std::make_pair(it->id(), *it));
195 std::set<DetId> used_strips;
197 LogTrace(
"EcalClusters") <<
"PreshowerClusterProducerInfo: ### rechits_map of size " << rechits_map.size()
204 reco::SuperClusterCollection::const_iterator it_super;
206 for (it_super = SClusts->begin(); it_super != SClusts->end(); ++it_super) {
213 LogTrace(
"EcalClusters") <<
" superE = " << it_super->energy() <<
" superETA = " << it_super->eta()
214 <<
" superPHI = " << it_super->phi();
220 for (; bc_iter != it_super->clustersEnd(); ++bc_iter) {
223 double X = (*bc_iter)->x();
224 double Y = (*bc_iter)->y();
225 double Z = (*bc_iter)->z();
237 if (status_p1->getStatusCode() == 1)
239 if (status_p2->getStatusCode() == 1)
241 }
else if (strip1 ==
ESDetId(0))
253 clusters1.push_back(cl1);
261 clusters2.push_back(cl2);
271 LogTrace(
"EcalClusters") <<
" For SC #" << isc - 1 <<
", containing " << it_super->clustersSize()
272 <<
" basic clusters, PreshowerClusterAlgo made " << clusters1.size() <<
" in X plane and "
273 << clusters2.size() <<
" in Y plane "
274 <<
" preshower clusters ";
277 if (e1 + e2 > 1.0
e-10) {
281 if (condP1 == 1 && condP2 == 1) {
283 }
else if (condP1 == 1 && condP2 == 0) {
285 }
else if (condP1 == 0 && condP2 == 1) {
287 }
else if (condP1 == 0 && condP2 == 0) {
293 float E = it_super->energy() + deltaE;
295 LogTrace(
"EcalClusters") <<
" Creating corrected SC ";
298 if (condP1 == 1 && condP2 == 1)
300 else if (condP1 == 1 && condP2 == 0)
301 sc.setPreshowerPlanesStatus(1);
302 else if (condP1 == 0 && condP2 == 1)
303 sc.setPreshowerPlanesStatus(2);
304 else if (condP1 == 0 && condP2 == 0)
305 sc.setPreshowerPlanesStatus(3);
307 if (sc.energy() *
sin(sc.position().theta()) >
etThresh_)
308 new_SC.push_back(sc);
309 LogTrace(
"EcalClusters") <<
" SuperClusters energies: new E = " << sc.energy()
310 <<
" vs. old E =" << it_super->energy();
315 clusters_p1->assign(clusters1.begin(), clusters1.end());
316 clusters_p2->assign(clusters2.begin(), clusters2.end());
320 LogTrace(
"EcalClusters") <<
"Preshower clusters added to the event";
323 superclusters_p->assign(new_SC.begin(), new_SC.end());
325 LogTrace(
"EcalClusters") <<
"Corrected SClusters added to the event";
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void push_back(Ptr< T > const &iPtr)
const self & getMap() const
std::string preshClusterCollectionY_
Sin< T >::type sin(const T &t)
std::vector< EcalRecHit >::const_iterator const_iterator
PreshowerClusterAlgo * presh_algo
reco::PreshowerCluster makeOneCluster(ESDetId strip, HitsID *used_strips, RecHitsMap *rechits_map, const CaloSubdetectorGeometry *geometry_p, const CaloSubdetectorTopology *topology_p)
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
edm::ESHandle< ESChannelStatus > esChannelStatus_
void setBCRef(const CaloClusterPtr &r)
DetIds of component RecHits – now inherited from CaloCluster.
const_iterator find(uint32_t rawId) const
std::vector< PreshowerCluster > PreshowerClusterCollection
collection of PreshowerCluster objects
double energy() const
cluster energy
const_iterator end() const
std::string preshClusterCollectionX_
void setPreshowerPlanesStatus(const uint32_t &status)
edm::EDGetTokenT< EcalRecHitCollection > preshHitsToken_
T const * product() const
void set(const edm::EventSetup &es)
std::vector< Item >::const_iterator const_iterator
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
std::string assocSClusterCollection_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
edm::EDGetTokenT< reco::SuperClusterCollection > endcapSClusterToken_
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
const_iterator begin() const