115 endcapSClusterToken_ =
118 esGainToken_ = esConsumes<ESGain, ESGainRcd>();
119 esMIPToGeVToken_ = esConsumes<ESMIPToGeVConstant, ESMIPToGeVConstantRcd>();
120 esEEInterCalibToken_ = esConsumes<ESEEIntercalibConstants, ESEEIntercalibConstantsRcd>();
121 esMissingECalibToken_ = esConsumes<ESMissingEnergyCalibration, ESMissingEnergyCalibrationRcd>();
122 esChannelStatusToken_ = esConsumes<ESChannelStatus, ESChannelStatusRcd>();
123 caloGeometryToken_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
131 produces<reco::PreshowerClusterCollection>(preshClusterCollectionX_);
132 produces<reco::PreshowerClusterCollection>(preshClusterCollectionY_);
133 produces<reco::SuperClusterCollection>(assocSClusterCollection_);
135 float esStripECut = ps.
getParameter<
double>(
"esStripEnergyCut");
136 esPhiClusterDeltaEta_ = ps.
getParameter<
double>(
"esPhiClusterDeltaEta");
137 esPhiClusterDeltaPhi_ = ps.
getParameter<
double>(
"esPhiClusterDeltaPhi");
160 auto clusters_p1 = std::make_unique<reco::PreshowerClusterCollection>();
161 auto clusters_p2 = std::make_unique<reco::PreshowerClusterCollection>();
163 auto superclusters_p = std::make_unique<reco::SuperClusterCollection>();
166 evt.
getByToken(endcapSClusterToken_, pSuperClusters);
174 LogTrace(
"EcalClusters") <<
"PreshowerPhiClusterProducerInfo: ### Total # of preshower RecHits: " <<
rechits->size();
177 std::map<DetId, EcalRecHit> rechits_map;
181 if (
it->recoFlag() == 1 ||
it->recoFlag() == 14 || (
it->recoFlag() <= 10 &&
it->recoFlag() >= 5))
184 rechits_map.insert(std::make_pair(
it->id(), *
it));
187 std::set<DetId> used_strips;
189 LogTrace(
"EcalClusters") <<
"PreshowerPhiClusterProducerInfo: ### rechits_map of size " << rechits_map.size()
196 reco::SuperClusterCollection::const_iterator it_super;
198 for (it_super = SClusts->begin(); it_super != SClusts->end(); ++it_super) {
205 LogTrace(
"EcalClusters") <<
" superE = " << it_super->energy() <<
" superETA = " << it_super->eta()
206 <<
" superPHI = " << it_super->phi();
219 for (; bc_iter != it_super->clustersEnd(); ++bc_iter) {
221 refPhi = (*bc_iter)->phi();
236 for (bc_iter = it_super->clustersBegin(); bc_iter != it_super->clustersEnd(); ++bc_iter) {
239 double X = (*bc_iter)->x();
240 double Y = (*bc_iter)->y();
241 double Z = (*bc_iter)->z();
253 if (status_p1->getStatusCode() == 1)
255 if (status_p2->getStatusCode() == 1)
257 }
else if (strip1 ==
ESDetId(0)) {
259 }
else if (strip2 ==
ESDetId(0)) {
269 clusters1.push_back(cl1);
275 cl2.setBCRef(*bc_iter);
276 clusters2.push_back(
cl2);
285 LogTrace(
"EcalClusters") <<
" For SC #" << isc - 1 <<
", containing " << it_super->clustersSize()
286 <<
" basic clusters, PreshowerPhiClusterAlgo made " << clusters1.size()
287 <<
" in X plane and " << clusters2.size() <<
" in Y plane " 288 <<
" preshower clusters ";
291 if (
e1 + e2 > 1.0
e-10) {
295 if (condP1 == 1 && condP2 == 1) {
296 deltaE = gamma0_ * (
e1 + alpha0_ * e2);
297 }
else if (condP1 == 1 && condP2 == 0) {
298 deltaE = gamma1_ * (
e1 + alpha1_ * e2);
299 }
else if (condP1 == 0 && condP2 == 1) {
300 deltaE = gamma2_ * (
e1 + alpha2_ * e2);
301 }
else if (condP1 == 0 && condP2 == 0) {
302 deltaE = gamma3_ * (
e1 + alpha3_ * e2);
307 float E = it_super->energy() +
deltaE;
309 LogTrace(
"EcalClusters") <<
" Creating corrected SC ";
313 sc.setPreshowerEnergyPlane2(e2 * mip_);
314 if (condP1 == 1 && condP2 == 1)
315 sc.setPreshowerPlanesStatus(0);
316 else if (condP1 == 1 && condP2 == 0)
317 sc.setPreshowerPlanesStatus(1);
318 else if (condP1 == 0 && condP2 == 1)
319 sc.setPreshowerPlanesStatus(2);
320 else if (condP1 == 0 && condP2 == 0)
321 sc.setPreshowerPlanesStatus(3);
324 if (sc.energy() *
sin(sc.position().theta()) > etThresh_)
325 new_SC.push_back(sc);
327 new_SC.push_back(sc);
333 clusters_p1->assign(clusters1.begin(), clusters1.end());
334 clusters_p2->assign(clusters2.begin(), clusters2.end());
336 evt.
put(
std::move(clusters_p1), preshClusterCollectionX_);
337 evt.
put(
std::move(clusters_p2), preshClusterCollectionY_);
338 LogTrace(
"EcalClusters") <<
"Preshower clusters added to the event";
341 superclusters_p->assign(new_SC.begin(), new_SC.end());
342 evt.
put(
std::move(superclusters_p), assocSClusterCollection_);
343 LogTrace(
"EcalClusters") <<
"Corrected SClusters added to the event";
352 esMIPToGeV_ = es.
getHandle(esMIPToGeVToken_);
357 esChannelStatus_ = es.
getHandle(esChannelStatusToken_);
359 esEEInterCalib_ = es.
getHandle(esEEInterCalibToken_);
378 esMissingECalib_ = es.
getHandle(esMissingECalibToken_);
float getAlphaHigh1() const
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
constexpr double deltaPhi(double phi1, double phi2)
T getParameter(std::string const &) const
float getESValueHigh() const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::ESGetToken< ESChannelStatus, ESChannelStatusRcd > esChannelStatusToken_
float getConstAEta0() const
PreshowerPhiClusterAlgo * presh_algo
float getConstAEta1() const
float getConstAEta3() const
void push_back(Ptr< T > const &iPtr)
Sin< T >::type sin(const T &t)
float getGammaLow1() const
T const * product() const
edm::ESGetToken< ESGain, ESGainRcd > esGainToken_
std::vector< EcalRecHit >::const_iterator const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const_iterator find(uint32_t rawId) const
float getConstAEta2() const
void set(const edm::EventSetup &es)
edm::ESGetToken< ESMissingEnergyCalibration, ESMissingEnergyCalibrationRcd > esMissingECalibToken_
std::string preshClusterCollectionX_
std::string assocSClusterCollection_
float getGammaHigh1() const
float getAlphaHigh2() const
float getAlphaHigh3() const
edm::ESHandle< ESMIPToGeVConstant > esMIPToGeV_
float getAlphaHigh0() const
edm::ESHandle< ESMissingEnergyCalibration > esMissingECalib_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
edm::ESGetToken< ESEEIntercalibConstants, ESEEIntercalibConstantsRcd > esEEInterCalibToken_
void setBCRef(const CaloClusterPtr &r)
DetIds of component RecHits – now inherited from CaloCluster.
float getGammaHigh0() const
float getAlphaLow2() const
edm::ESHandle< ESEEIntercalibConstants > esEEInterCalib_
float getESValueLow() const
std::vector< PreshowerCluster > PreshowerClusterCollection
collection of PreshowerCluster objects
#define DEFINE_FWK_MODULE(type)
edm::ESHandle< ESChannelStatus > esChannelStatus_
float esPhiClusterDeltaEta_
float getConstBEta3() const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
float getGammaHigh2() const
std::string preshClusterCollectionY_
float getAlphaLow3() const
double energy() const
cluster energy
void produce(edm::Event &evt, const edm::EventSetup &es) override
~PreshowerPhiClusterProducer() override
float getConstBEta2() const
float getAlphaLow1() const
XYZPointD XYZPoint
point in space with cartesian internal representation
float getGammaHigh3() const
std::vector< Item >::const_iterator const_iterator
float getAlphaLow0() const
float getConstBEta0() const
edm::EDGetTokenT< reco::SuperClusterCollection > endcapSClusterToken_
edm::ESHandle< ESGain > esgain_
float getConstBEta1() const
const self & getMap() const
edm::EDGetTokenT< EcalRecHitCollection > preshHitToken_
edm::ESGetToken< ESMIPToGeVConstant, ESMIPToGeVConstantRcd > esMIPToGeVToken_
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
void setPreshowerEnergyPlane1(double preshowerEnergy1)
PreshowerPhiClusterProducer(const edm::ParameterSet &ps)
*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 getGammaLow2() const
float esPhiClusterDeltaPhi_