71 endcapSClusterToken_ =
73 caloGeometryToken_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
75 PreshowerClusterShapeCollectionX_ = ps.
getParameter<
string>(
"PreshowerClusterShapeCollectionX");
76 PreshowerClusterShapeCollectionY_ = ps.
getParameter<
string>(
"PreshowerClusterShapeCollectionY");
78 produces<reco::PreshowerClusterShapeCollection>(PreshowerClusterShapeCollectionX_);
79 produces<reco::PreshowerClusterShapeCollection>(PreshowerClusterShapeCollectionY_);
81 float preshStripECut = ps.
getParameter<
double>(
"preshStripEnergyCut");
84 string debugString = ps.
getParameter<
string>(
"debugLevel");
86 string tmpPath = ps.
getUntrackedParameter<
string>(
"pathToWeightFiles",
"RecoEcal/EgammaClusterProducers/data/");
90 LogTrace(
"EcalClusters") <<
"PreshowerClusterShapeProducer:presh_pi0_algo class instantiated ";
100 LogTrace(
"EcalClusters") <<
"\n ....... Event " << evt.
id() <<
" with Number = " << nEvt_ + 1
101 <<
" is analyzing ....... ";
112 auto ps_cl_for_pi0_disc_x = std::make_unique<reco::PreshowerClusterShapeCollection>();
113 auto ps_cl_for_pi0_disc_y = std::make_unique<reco::PreshowerClusterShapeCollection>();
115 std::unique_ptr<CaloSubdetectorTopology> topology_p;
117 topology_p = std::make_unique<EcalPreshowerTopology>();
124 LogTrace(
"EcalClusters") <<
"PreshowerClusterShapeProducer: ### Total # of preshower RecHits: " <<
rechits->size();
129 map<DetId, EcalRecHit> rechits_map;
132 rechits_map.insert(make_pair(it->id(), *it));
135 LogTrace(
"EcalClusters") <<
"PreshowerClusterShapeProducer: ### Preshower RecHits_map of size " << rechits_map.size()
147 evt.
getByToken(endcapSClusterToken_, pSuperClusters);
149 LogTrace(
"EcalClusters") <<
"### Total # Endcap Superclusters: " << SClusts->size();
151 SuperClusterCollection::const_iterator it_s;
152 for (it_s = SClusts->begin(); it_s != SClusts->end(); it_s++) {
155 float SC_eta = it_super->eta();
157 LogTrace(
"EcalClusters") <<
"PreshowerClusterShapeProducer: superCl_E = " << it_super->energy()
158 <<
" superCl_Et = " << it_super->energy() *
sin(2 * atan(
exp(-it_super->eta())))
159 <<
" superCl_Eta = " << SC_eta <<
" superCl_Phi = " << it_super->phi();
161 if (fabs(SC_eta) >= 1.65 && fabs(SC_eta) <= 2.5) {
163 const GlobalPoint pointSC(it_super->x(), it_super->y(), it_super->z());
164 LogTrace(
"EcalClusters") <<
"SC centroind = " << pointSC;
173 vector<float> vout_stripE1 = presh_pi0_algo->findPreshVector(stripX, &rechits_map, topology_p.get());
174 vector<float> vout_stripE2 = presh_pi0_algo->findPreshVector(stripY, &rechits_map, topology_p.get());
176 LogTrace(
"EcalClusters") <<
"PreshowerClusterShapeProducer : ES Energy vector associated to the given SC = ";
177 for (
int k1 = 0; k1 < 11; k1++) {
178 LogTrace(
"EcalClusters") << vout_stripE1[k1] <<
" ";
181 for (
int k1 = 0; k1 < 11; k1++) {
182 LogTrace(
"EcalClusters") << vout_stripE2[k1] <<
" ";
187 ps_cl_x.push_back(ps1);
191 ps_cl_y.push_back(ps2);
197 ps_cl_for_pi0_disc_x->assign(ps_cl_x.begin(), ps_cl_x.end());
198 ps_cl_for_pi0_disc_y->assign(ps_cl_y.begin(), ps_cl_y.end());
200 evt.
put(
std::move(ps_cl_for_pi0_disc_x), PreshowerClusterShapeCollectionX_);
201 evt.
put(
std::move(ps_cl_for_pi0_disc_y), PreshowerClusterShapeCollectionY_);
202 LogTrace(
"EcalClusters") <<
"PreshowerClusterShapeCollection added to the event";
206 LogDebug(
"PiZeroDiscriminatorDebug") << ostr.str();
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void setSCRef(const SuperClusterRef &r)
Sin< T >::type sin(const T &t)
T const * product() const
std::vector< EcalRecHit >::const_iterator const_iterator
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
T getUntrackedParameter(std::string const &, T const &) const
std::string PreshowerClusterShapeCollectionY_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
std::string PreshowerClusterShapeCollectionX_
std::vector< PreshowerClusterShape > PreshowerClusterShapeCollection
collection of PreshowerClusterShape objects
#define DEFINE_FWK_MODULE(type)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
void produce(edm::Event &evt, const edm::EventSetup &es) override
XYZPointD XYZPoint
point in space with cartesian internal representation
edm::EDGetTokenT< reco::SuperClusterCollection > endcapSClusterToken_
~PreshowerClusterShapeProducer() override
EndcapPiZeroDiscriminatorAlgo * presh_pi0_algo
edm::EDGetTokenT< EcalRecHitCollection > preshHitToken_
PreshowerClusterShapeProducer(const edm::ParameterSet &ps)
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly