55 endcapSClusterToken_ =
67 produces< reco::PreshowerClusterCollection >(preshClusterCollectionX_);
68 produces< reco::PreshowerClusterCollection >(preshClusterCollectionY_);
69 produces< reco::SuperClusterCollection >(assocSClusterCollection_);
71 float preshStripECut = ps.
getParameter<
double>(
"preshStripEnergyCut");
72 int preshSeededNst = ps.
getParameter<
int>(
"preshSeededNstrip");
73 preshClustECut = ps.
getParameter<
double>(
"preshClusterEnergyCut");
101 auto clusters_p1 = std::make_unique<reco::PreshowerClusterCollection>();
102 auto clusters_p2 = std::make_unique<reco::PreshowerClusterCollection>();
104 auto superclusters_p = std::make_unique<reco::SuperClusterCollection>();
111 evt.
getByToken(endcapSClusterToken_, pSuperClusters);
119 LogTrace(
"EcalClusters") <<
"PreshowerClusterProducerInfo: ### Total # of preshower RecHits: "<< rechits->
size();
122 std::map<DetId, EcalRecHit> rechits_map;
124 for (it = rechits->
begin(); it != rechits->
end(); it++) {
126 if (it->recoFlag()==1 || it->recoFlag()==14 || (it->recoFlag()<=10 && it->recoFlag()>=5))
continue;
128 rechits_map.insert(std::make_pair(it->id(), *it));
131 std::set<DetId> used_strips;
133 LogTrace(
"EcalClusters") <<
"PreshowerClusterProducerInfo: ### rechits_map of size " << rechits_map.size() <<
" was created!";
140 reco::SuperClusterCollection::const_iterator it_super;
142 for (it_super=SClusts->begin(); it_super!=SClusts->end(); ++it_super) {
150 LogTrace(
"EcalClusters")<<
" superE = " << it_super->energy() <<
" superETA = " << it_super->eta() <<
" superPHI = " << it_super->phi() ;
156 for ( ; bc_iter !=it_super->clustersEnd(); ++bc_iter ) {
160 double X = (*bc_iter)->x();
161 double Y = (*bc_iter)->y();
162 double Z = (*bc_iter)->z();
174 if (status_p1->getStatusCode() == 1) condP1 = 0;
175 if (status_p2->getStatusCode() == 1) condP2 = 0;
176 }
else if (strip1 ==
ESDetId(0))
183 for (
int i=0;
i<preshNclust_;
i++) {
184 reco::PreshowerCluster cl1 = presh_algo->makeOneCluster(strip1,&used_strips,&rechits_map,geometry_p,topology_p);
186 if (cl1.
energy() > preshClustECut) {
187 clusters1.push_back(cl1);
193 if ( cl2.
energy() > preshClustECut) {
194 clusters2.push_back(cl2);
204 LogTrace(
"EcalClusters") <<
" For SC #" << isc-1 <<
", containing " 205 << it_super->clustersSize()
206 <<
" basic clusters, PreshowerClusterAlgo made " 207 << clusters1.size() <<
" in X plane and " 209 <<
" in Y plane " <<
" preshower clusters " ;
212 if(e1+e2 > 1.0
e-10) {
217 if (condP1 == 1 && condP2 == 1) {
218 deltaE = gamma0_*(e1 + alpha0_*e2);
219 }
else if (condP1 == 1 && condP2 == 0) {
220 deltaE = gamma1_*(e1 + alpha1_*e2);
221 }
else if (condP1 == 0 && condP2 == 1) {
222 deltaE = gamma2_*(e1 + alpha2_*e2);
223 }
else if (condP1 == 0 && condP2 == 0) {
224 deltaE = gamma3_*(e1 + alpha3_*e2);
229 float E = it_super->energy() + deltaE;
231 LogTrace(
"EcalClusters") <<
" Creating corrected SC ";
234 if (condP1 == 1 && condP2 == 1)
sc.setPreshowerPlanesStatus(0);
235 else if (condP1 == 1 && condP2 == 0)
sc.setPreshowerPlanesStatus(1);
236 else if (condP1 == 0 && condP2 == 1)
sc.setPreshowerPlanesStatus(2);
237 else if (condP1 == 0 && condP2 == 0)
sc.setPreshowerPlanesStatus(3);
240 new_SC.push_back(
sc);
241 LogTrace(
"EcalClusters") <<
" SuperClusters energies: new E = " <<
sc.
energy() <<
" vs. old E =" << it_super->energy();
246 clusters_p1->assign(clusters1.begin(), clusters1.end());
247 clusters_p2->assign(clusters2.begin(), clusters2.end());
249 evt.
put(
std::move(clusters_p1), preshClusterCollectionX_);
250 evt.
put(
std::move(clusters_p2), preshClusterCollectionY_);
251 LogTrace(
"EcalClusters") <<
"Preshower clusters added to the event" ;
254 superclusters_p->assign(new_SC.begin(), new_SC.end());
255 evt.
put(
std::move(superclusters_p), assocSClusterCollection_);
256 LogTrace(
"EcalClusters") <<
"Corrected SClusters added to the event" ;
283 gamma0_ = (ESGain == 1) ? 0.02 : esEEInterCalib->
getGammaHigh0();
295 gamma3_ = (ESGain == 1) ? 0.02 : esEEInterCalib->
getGammaHigh3();
~PreshowerClusterProducer() override
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
float getConstAEta1() const
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
float getESValueLow() const
Sin< T >::type sin(const T &t)
float getConstAEta2() const
std::vector< EcalRecHit >::const_iterator const_iterator
float getGammaLow2() const
float getAlphaHigh3() const
float getGammaHigh2() const
float getConstAEta0() const
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.
float getConstBEta0() const
std::vector< PreshowerCluster > PreshowerClusterCollection
collection of PreshowerCluster objects
double energy() const
cluster energy
float getConstBEta2() const
float getConstAEta3() const
float getGammaHigh3() const
float theta() const
Momentum polar angle. Note this is taken from the first SimTrack only.
float getConstBEta1() const
float getGammaHigh1() const
const_iterator end() const
T const * product() const
float getAlphaHigh0() const
float getAlphaLow3() const
float getAlphaHigh2() const
PreshowerClusterProducer(const edm::ParameterSet &ps)
void set(const edm::EventSetup &es)
float getAlphaLow2() const
std::vector< Item >::const_iterator const_iterator
float getGammaLow1() const
float getAlphaHigh1() const
float getConstBEta3() const
void produce(edm::Event &evt, const edm::EventSetup &es) override
float getGammaHigh0() const
float getAlphaLow1() const
float getESValueHigh() const
*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
float getAlphaLow0() const
const_iterator begin() const