93 auto clusters_p1 = std::make_unique<reco::PreshowerClusterCollection>();
94 auto clusters_p2 = std::make_unique<reco::PreshowerClusterCollection>();
96 auto superclusters_p = std::make_unique<reco::SuperClusterCollection>();
107 LogTrace(
"EcalClusters") <<
"PreshowerPhiClusterProducerInfo: ### Total # of preshower RecHits: "<< rechits->
size();
110 std::map<DetId, EcalRecHit> rechits_map;
112 for (it = rechits->
begin(); it != rechits->
end(); it++) {
114 if (it->recoFlag()==1 || it->recoFlag()==14 || (it->recoFlag()<=10 && it->recoFlag()>=5))
continue;
116 rechits_map.insert(std::make_pair(it->id(), *it));
119 std::set<DetId> used_strips;
121 LogTrace(
"EcalClusters") <<
"PreshowerPhiClusterProducerInfo: ### rechits_map of size " << rechits_map.size() <<
" was created!";
127 reco::SuperClusterCollection::const_iterator it_super;
129 for (it_super=SClusts->begin(); it_super!=SClusts->end(); ++it_super) {
137 LogTrace(
"EcalClusters")<<
" superE = " << it_super->energy() <<
" superETA = " << it_super->eta() <<
" superPHI = " << it_super->phi() ;
150 for ( ; bc_iter !=it_super->clustersEnd(); ++bc_iter) {
152 refPhi = (*bc_iter)->phi();
167 for (bc_iter = it_super->clustersBegin() ; bc_iter !=it_super->clustersEnd(); ++bc_iter) {
171 double X = (*bc_iter)->x();
172 double Y = (*bc_iter)->y();
173 double Z = (*bc_iter)->z();
185 if (status_p1->getStatusCode() == 1) condP1 = 0;
186 if (status_p2->getStatusCode() == 1) condP2 = 0;
187 }
else if (strip1 ==
ESDetId(0)) {
189 }
else if (strip2 ==
ESDetId(0)) {
198 clusters1.push_back(cl1);
204 clusters2.push_back(cl2);
213 LogTrace(
"EcalClusters") <<
" For SC #" << isc-1 <<
", containing " 214 << it_super->clustersSize()
215 <<
" basic clusters, PreshowerPhiClusterAlgo made " 216 << clusters1.size() <<
" in X plane and " 218 <<
" in Y plane " <<
" preshower clusters " ;
221 if(e1+e2 > 1.0
e-10) {
226 if (condP1 == 1 && condP2 == 1) {
228 }
else if (condP1 == 1 && condP2 == 0) {
230 }
else if (condP1 == 0 && condP2 == 1) {
232 }
else if (condP1 == 0 && condP2 == 0) {
238 float E = it_super->energy() + deltaE;
240 LogTrace(
"EcalClusters") <<
" Creating corrected SC ";
243 sc.setPreshowerEnergyPlane1(e1*
mip_);
244 sc.setPreshowerEnergyPlane2(e2*mip_);
245 if (condP1 == 1 && condP2 == 1)
sc.setPreshowerPlanesStatus(0);
246 else if (condP1 == 1 && condP2 == 0)
sc.setPreshowerPlanesStatus(1);
247 else if (condP1 == 0 && condP2 == 1)
sc.setPreshowerPlanesStatus(2);
248 else if (condP1 == 0 && condP2 == 0)
sc.setPreshowerPlanesStatus(3);
252 new_SC.push_back(
sc);
254 new_SC.push_back(
sc);
260 clusters_p1->assign(clusters1.begin(), clusters1.end());
261 clusters_p2->assign(clusters2.begin(), clusters2.end());
265 LogTrace(
"EcalClusters") <<
"Preshower clusters added to the event" ;
268 superclusters_p->assign(new_SC.begin(), new_SC.end());
270 LogTrace(
"EcalClusters") <<
"Corrected SClusters added to the event" ;
constexpr double deltaPhi(double phi1, double phi2)
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.
PreshowerPhiClusterAlgo * presh_algo
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void push_back(Ptr< T > const &iPtr)
const self & getMap() const
reco::PreshowerCluster makeOneCluster(ESDetId strip, HitsID *used_strips, RecHitsMap *rechits_map, const CaloSubdetectorGeometry *geometry_p, double deltaEta, double minDeltaPhi, double maxDeltaPhi)
Sin< T >::type sin(const T &t)
std::vector< EcalRecHit >::const_iterator const_iterator
std::string preshClusterCollectionX_
std::string assocSClusterCollection_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
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
edm::ESHandle< ESChannelStatus > esChannelStatus_
float esPhiClusterDeltaEta_
std::string preshClusterCollectionY_
float theta() const
Momentum polar angle. Note this is taken from the first SimTrack only.
const_iterator end() const
T const * product() const
std::vector< Item >::const_iterator const_iterator
edm::EDGetTokenT< reco::SuperClusterCollection > endcapSClusterToken_
edm::EDGetTokenT< EcalRecHitCollection > preshHitToken_
*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
float esPhiClusterDeltaPhi_