72 endcapSClusterToken_ =
74 caloGeometryToken_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
76 PreshowerClusterShapeCollectionX_ = ps.
getParameter<
string>(
"PreshowerClusterShapeCollectionX");
77 PreshowerClusterShapeCollectionY_ = ps.
getParameter<
string>(
"PreshowerClusterShapeCollectionY");
79 produces<reco::PreshowerClusterShapeCollection>(PreshowerClusterShapeCollectionX_);
80 produces<reco::PreshowerClusterShapeCollection>(PreshowerClusterShapeCollectionY_);
82 float preshStripECut = ps.
getParameter<
double>(
"preshStripEnergyCut");
85 string debugString = ps.
getParameter<
string>(
"debugLevel");
87 string tmpPath = ps.
getUntrackedParameter<
string>(
"pathToWeightFiles",
"RecoEcal/EgammaClusterProducers/data/");
91 LogTrace(
"EcalClusters") <<
"PreshowerClusterShapeProducer:presh_pi0_algo class instantiated ";
101 LogTrace(
"EcalClusters") <<
"\n ....... Event " << evt.
id() <<
" with Number = " << nEvt_ + 1
102 <<
" is analyzing ....... ";
113 auto ps_cl_for_pi0_disc_x = std::make_unique<reco::PreshowerClusterShapeCollection>();
114 auto ps_cl_for_pi0_disc_y = std::make_unique<reco::PreshowerClusterShapeCollection>();
116 std::unique_ptr<CaloSubdetectorTopology> topology_p;
118 topology_p = std::make_unique<EcalPreshowerTopology>();
125 LogTrace(
"EcalClusters") <<
"PreshowerClusterShapeProducer: ### Total # of preshower RecHits: " << rechits->
size();
130 map<DetId, EcalRecHit> rechits_map;
132 for (it = rechits->
begin(); it != rechits->
end(); it++) {
133 rechits_map.insert(make_pair(it->id(), *it));
136 LogTrace(
"EcalClusters") <<
"PreshowerClusterShapeProducer: ### Preshower RecHits_map of size " << rechits_map.size()
148 evt.
getByToken(endcapSClusterToken_, pSuperClusters);
150 LogTrace(
"EcalClusters") <<
"### Total # Endcap Superclusters: " << SClusts->size();
152 SuperClusterCollection::const_iterator it_s;
153 for (it_s = SClusts->begin(); it_s != SClusts->end(); it_s++) {
156 float SC_eta = it_super->eta();
158 LogTrace(
"EcalClusters") <<
"PreshowerClusterShapeProducer: superCl_E = " << it_super->energy()
159 <<
" superCl_Et = " << it_super->energy() *
sin(2 * atan(
exp(-it_super->eta())))
160 <<
" superCl_Eta = " << SC_eta <<
" superCl_Phi = " << it_super->phi();
162 if (fabs(SC_eta) >= 1.65 && fabs(SC_eta) <= 2.5) {
164 const GlobalPoint pointSC(it_super->x(), it_super->y(), it_super->z());
165 LogTrace(
"EcalClusters") <<
"SC centroind = " << pointSC;
174 vector<float> vout_stripE1 = presh_pi0_algo->findPreshVector(stripX, &rechits_map, topology_p.get());
175 vector<float> vout_stripE2 = presh_pi0_algo->findPreshVector(stripY, &rechits_map, topology_p.get());
177 LogTrace(
"EcalClusters") <<
"PreshowerClusterShapeProducer : ES Energy vector associated to the given SC = ";
178 for (
int k1 = 0; k1 < 11; k1++) {
179 LogTrace(
"EcalClusters") << vout_stripE1[k1] <<
" ";
182 for (
int k1 = 0; k1 < 11; k1++) {
183 LogTrace(
"EcalClusters") << vout_stripE2[k1] <<
" ";
188 ps_cl_x.push_back(ps1);
192 ps_cl_y.push_back(ps2);
198 ps_cl_for_pi0_disc_x->assign(ps_cl_x.begin(), ps_cl_x.end());
199 ps_cl_for_pi0_disc_y->assign(ps_cl_y.begin(), ps_cl_y.end());
201 evt.
put(
std::move(ps_cl_for_pi0_disc_x), PreshowerClusterShapeCollectionX_);
202 evt.
put(
std::move(ps_cl_for_pi0_disc_y), PreshowerClusterShapeCollectionY_);
203 LogTrace(
"EcalClusters") <<
"PreshowerClusterShapeCollection added to the event";
207 LogDebug(
"PiZeroDiscriminatorDebug") << ostr.str();
T getUntrackedParameter(std::string const &, T const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void setSCRef(const SuperClusterRef &r)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
Sin< T >::type sin(const T &t)
std::vector< EcalRecHit >::const_iterator const_iterator
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
Exp< T >::type exp(const T &t)
std::string PreshowerClusterShapeCollectionY_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
std::string PreshowerClusterShapeCollectionX_
std::vector< PreshowerClusterShape > PreshowerClusterShapeCollection
collection of PreshowerClusterShape objects
const_iterator end() const
void produce(edm::Event &evt, const edm::EventSetup &es) override
T const * product() const
XYZPointD XYZPoint
point in space with cartesian internal representation
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::SuperClusterCollection > endcapSClusterToken_
~PreshowerClusterShapeProducer() override
EndcapPiZeroDiscriminatorAlgo * presh_pi0_algo
edm::EDGetTokenT< EcalRecHitCollection > preshHitToken_
PreshowerClusterShapeProducer(const edm::ParameterSet &ps)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const_iterator begin() const