95 auto clusters_p1 = std::make_unique<reco::PreshowerClusterCollection>();
96 auto clusters_p2 = std::make_unique<reco::PreshowerClusterCollection>();
98 auto superclusters_p = std::make_unique<reco::SuperClusterCollection>();
100 std::unique_ptr<CaloSubdetectorTopology> topology_p;
102 topology_p = std::make_unique<EcalPreshowerTopology>();
113 LogTrace(
"EcalClusters") <<
"PreshowerClusterProducerInfo: ### Total # of preshower RecHits: " << rechits->
size();
116 std::map<DetId, EcalRecHit> rechits_map;
118 for (it = rechits->
begin(); it != rechits->
end(); it++) {
120 if (it->recoFlag() == 1 || it->recoFlag() == 14 || (it->recoFlag() <= 10 && it->recoFlag() >= 5))
123 rechits_map.insert(std::make_pair(it->id(), *it));
126 std::set<DetId> used_strips;
128 LogTrace(
"EcalClusters") <<
"PreshowerClusterProducerInfo: ### rechits_map of size " << rechits_map.size()
135 reco::SuperClusterCollection::const_iterator it_super;
137 for (it_super = SClusts->begin(); it_super != SClusts->end(); ++it_super) {
144 LogTrace(
"EcalClusters") <<
" superE = " << it_super->energy() <<
" superETA = " << it_super->eta()
145 <<
" superPHI = " << it_super->phi();
151 for (; bc_iter != it_super->clustersEnd(); ++bc_iter) {
154 double X = (*bc_iter)->x();
155 double Y = (*bc_iter)->y();
156 double Z = (*bc_iter)->z();
168 if (status_p1->getStatusCode() == 1)
170 if (status_p2->getStatusCode() == 1)
172 }
else if (strip1 ==
ESDetId(0))
184 clusters1.push_back(cl1);
192 clusters2.push_back(cl2);
202 LogTrace(
"EcalClusters") <<
" For SC #" << isc - 1 <<
", containing " << it_super->clustersSize()
203 <<
" basic clusters, PreshowerClusterAlgo made " << clusters1.size() <<
" in X plane and " 204 << clusters2.size() <<
" in Y plane " 205 <<
" preshower clusters ";
208 if (e1 + e2 > 1.0
e-10) {
212 if (condP1 == 1 && condP2 == 1) {
214 }
else if (condP1 == 1 && condP2 == 0) {
216 }
else if (condP1 == 0 && condP2 == 1) {
218 }
else if (condP1 == 0 && condP2 == 0) {
224 float E = it_super->energy() +
deltaE;
226 LogTrace(
"EcalClusters") <<
" Creating corrected SC ";
229 if (condP1 == 1 && condP2 == 1)
230 sc.setPreshowerPlanesStatus(0);
231 else if (condP1 == 1 && condP2 == 0)
232 sc.setPreshowerPlanesStatus(1);
233 else if (condP1 == 0 && condP2 == 1)
234 sc.setPreshowerPlanesStatus(2);
235 else if (condP1 == 0 && condP2 == 0)
236 sc.setPreshowerPlanesStatus(3);
239 new_SC.push_back(
sc);
240 LogTrace(
"EcalClusters") <<
" SuperClusters energies: new E = " <<
sc.
energy()
241 <<
" vs. old E =" << it_super->energy();
246 clusters_p1->assign(clusters1.begin(), clusters1.end());
247 clusters_p2->assign(clusters2.begin(), clusters2.end());
251 LogTrace(
"EcalClusters") <<
"Preshower clusters added to the event";
254 superclusters_p->assign(new_SC.begin(), new_SC.end());
256 LogTrace(
"EcalClusters") <<
"Corrected SClusters added to the event";
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
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
float energy() const
Energy. Note this is taken from the first SimTrack only.
std::vector< PreshowerCluster > PreshowerClusterCollection
collection of PreshowerCluster objects
double energy() const
cluster energy
float theta() const
Momentum polar angle. Note this is taken from the first SimTrack only.
const_iterator end() const
std::string preshClusterCollectionX_
edm::EDGetTokenT< EcalRecHitCollection > preshHitsToken_
T const * product() const
std::vector< Item >::const_iterator const_iterator
std::string assocSClusterCollection_
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