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>();
134 produces<reco::PreshowerClusterCollection>(preshClusterCollectionX_);
135 produces<reco::PreshowerClusterCollection>(preshClusterCollectionY_);
136 produces<reco::SuperClusterCollection>(assocSClusterCollection_);
138 float preshStripECut = ps.
getParameter<
double>(
"preshStripEnergyCut");
139 int preshSeededNst = ps.
getParameter<
int>(
"preshSeededNstrip");
140 preshClustECut = ps.
getParameter<
double>(
"preshClusterEnergyCut");
163 auto clusters_p1 = std::make_unique<reco::PreshowerClusterCollection>();
164 auto clusters_p2 = std::make_unique<reco::PreshowerClusterCollection>();
166 auto superclusters_p = std::make_unique<reco::SuperClusterCollection>();
168 std::unique_ptr<CaloSubdetectorTopology> topology_p;
170 topology_p = std::make_unique<EcalPreshowerTopology>();
173 evt.
getByToken(endcapSClusterToken_, pSuperClusters);
181 LogTrace(
"EcalClusters") <<
"PreshowerClusterProducerInfo: ### Total # of preshower RecHits: " <<
rechits->size();
184 std::map<DetId, EcalRecHit> rechits_map;
188 if (it->recoFlag() == 1 || it->recoFlag() == 14 || (it->recoFlag() <= 10 && it->recoFlag() >= 5))
191 rechits_map.insert(std::make_pair(it->id(), *it));
194 std::set<DetId> used_strips;
196 LogTrace(
"EcalClusters") <<
"PreshowerClusterProducerInfo: ### rechits_map of size " << rechits_map.size()
203 reco::SuperClusterCollection::const_iterator it_super;
205 for (it_super = SClusts->begin(); it_super != SClusts->end(); ++it_super) {
212 LogTrace(
"EcalClusters") <<
" superE = " << it_super->energy() <<
" superETA = " << it_super->eta()
213 <<
" superPHI = " << it_super->phi();
219 for (; bc_iter != it_super->clustersEnd(); ++bc_iter) {
222 double X = (*bc_iter)->x();
223 double Y = (*bc_iter)->y();
224 double Z = (*bc_iter)->z();
236 if (status_p1->getStatusCode() == 1)
238 if (status_p2->getStatusCode() == 1)
240 }
else if (strip1 ==
ESDetId(0))
247 for (
int i = 0;
i < preshNclust_;
i++) {
249 presh_algo->makeOneCluster(strip1, &used_strips, &rechits_map, geometry_p, topology_p.get());
251 if (cl1.
energy() > preshClustECut) {
252 clusters1.push_back(cl1);
256 presh_algo->makeOneCluster(strip2, &used_strips, &rechits_map, geometry_p, topology_p.get());
257 cl2.setBCRef(*bc_iter);
259 if (
cl2.energy() > preshClustECut) {
260 clusters2.push_back(
cl2);
270 LogTrace(
"EcalClusters") <<
" For SC #" << isc - 1 <<
", containing " << it_super->clustersSize()
271 <<
" basic clusters, PreshowerClusterAlgo made " << clusters1.size() <<
" in X plane and " 272 << clusters2.size() <<
" in Y plane " 273 <<
" preshower clusters ";
276 if (
e1 + e2 > 1.0
e-10) {
280 if (condP1 == 1 && condP2 == 1) {
281 deltaE = gamma0_ * (
e1 + alpha0_ * e2);
282 }
else if (condP1 == 1 && condP2 == 0) {
283 deltaE = gamma1_ * (
e1 + alpha1_ * e2);
284 }
else if (condP1 == 0 && condP2 == 1) {
285 deltaE = gamma2_ * (
e1 + alpha2_ * e2);
286 }
else if (condP1 == 0 && condP2 == 0) {
287 deltaE = gamma3_ * (
e1 + alpha3_ * e2);
292 float E = it_super->energy() +
deltaE;
294 LogTrace(
"EcalClusters") <<
" Creating corrected SC ";
297 if (condP1 == 1 && condP2 == 1)
299 else if (condP1 == 1 && condP2 == 0)
300 sc.setPreshowerPlanesStatus(1);
301 else if (condP1 == 0 && condP2 == 1)
302 sc.setPreshowerPlanesStatus(2);
303 else if (condP1 == 0 && condP2 == 0)
304 sc.setPreshowerPlanesStatus(3);
306 if (sc.energy() *
sin(sc.position().theta()) > etThresh_)
307 new_SC.push_back(sc);
308 LogTrace(
"EcalClusters") <<
" SuperClusters energies: new E = " << sc.energy()
309 <<
" vs. old E =" << it_super->energy();
314 clusters_p1->assign(clusters1.begin(), clusters1.end());
315 clusters_p2->assign(clusters2.begin(), clusters2.end());
317 evt.
put(
std::move(clusters_p1), preshClusterCollectionX_);
318 evt.
put(
std::move(clusters_p2), preshClusterCollectionY_);
319 LogTrace(
"EcalClusters") <<
"Preshower clusters added to the event";
322 superclusters_p->assign(new_SC.begin(), new_SC.end());
323 evt.
put(
std::move(superclusters_p), assocSClusterCollection_);
324 LogTrace(
"EcalClusters") <<
"Corrected SClusters added to the event";
335 esMIPToGeV_ = es.
getHandle(esMIPToGeVToken_);
340 esChannelStatus_ = es.
getHandle(esChannelStatusToken_);
342 esEEInterCalib_ = es.
getHandle(esEEInterCalibToken_);
361 esMissingECalib_ = es.
getHandle(esMissingECalibToken_);
float getAlphaHigh1() const
~PreshowerClusterProducer() override
T getParameter(std::string const &) const
float getESValueHigh() const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::ESGetToken< ESEEIntercalibConstants, ESEEIntercalibConstantsRcd > esEEInterCalibToken_
float getConstAEta0() const
float getConstAEta1() const
edm::ESHandle< ESMissingEnergyCalibration > esMissingECalib_
float getConstAEta3() const
#define DEFINE_FWK_MODULE(type)
void push_back(Ptr< T > const &iPtr)
edm::ESHandle< ESGain > esgain_
std::string preshClusterCollectionY_
edm::ESGetToken< ESMIPToGeVConstant, ESMIPToGeVConstantRcd > esMIPToGeVToken_
Sin< T >::type sin(const T &t)
float getGammaLow1() const
T const * product() const
std::vector< EcalRecHit >::const_iterator const_iterator
PreshowerClusterAlgo * presh_algo
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const_iterator find(uint32_t rawId) const
float getConstAEta2() const
float getGammaHigh1() const
float getAlphaHigh2() const
float getAlphaHigh3() const
float getAlphaHigh0() const
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.
float getGammaHigh0() const
float getAlphaLow2() const
float getESValueLow() const
std::vector< PreshowerCluster > PreshowerClusterCollection
collection of PreshowerCluster objects
edm::ESGetToken< ESGain, ESGainRcd > esGainToken_
float getConstBEta3() const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
float getGammaHigh2() const
edm::ESGetToken< ESChannelStatus, ESChannelStatusRcd > esChannelStatusToken_
edm::ESHandle< ESMIPToGeVConstant > esMIPToGeV_
float getAlphaLow3() const
std::string preshClusterCollectionX_
edm::ESHandle< ESEEIntercalibConstants > esEEInterCalib_
double energy() const
cluster energy
void setPreshowerPlanesStatus(const uint32_t &status)
edm::EDGetTokenT< EcalRecHitCollection > preshHitsToken_
float getConstBEta2() const
float getAlphaLow1() const
XYZPointD XYZPoint
point in space with cartesian internal representation
PreshowerClusterProducer(const edm::ParameterSet &ps)
float getGammaHigh3() const
void set(const edm::EventSetup &es)
std::vector< Item >::const_iterator const_iterator
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
float getAlphaLow0() const
float getConstBEta0() const
edm::ESGetToken< ESMissingEnergyCalibration, ESMissingEnergyCalibrationRcd > esMissingECalibToken_
float getConstBEta1() const
std::string assocSClusterCollection_
const self & getMap() const
void produce(edm::Event &evt, const edm::EventSetup &es) override
edm::EDGetTokenT< reco::SuperClusterCollection > endcapSClusterToken_
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
*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