45 endcapSClusterToken_ =
48 PreshowerClusterShapeCollectionX_ = ps.
getParameter<
string>(
"PreshowerClusterShapeCollectionX");
49 PreshowerClusterShapeCollectionY_ = ps.
getParameter<
string>(
"PreshowerClusterShapeCollectionY");
51 produces< reco::PreshowerClusterShapeCollection >(PreshowerClusterShapeCollectionX_);
52 produces< reco::PreshowerClusterShapeCollection >(PreshowerClusterShapeCollectionY_);
54 float preshStripECut = ps.
getParameter<
double>(
"preshStripEnergyCut");
57 string debugString = ps.
getParameter<
string>(
"debugLevel");
60 string tmpPath = ps.
getUntrackedParameter<
string>(
"pathToWeightFiles",
"RecoEcal/EgammaClusterProducers/data/");
64 LogTrace(
"EcalClusters") <<
"PreshowerClusterShapeProducer:presh_pi0_algo class instantiated " ;
73 delete presh_pi0_algo;
81 LogTrace(
"EcalClusters") <<
"\n ....... Event " << evt.
id() <<
" with Number = " << nEvt_+1 <<
" is analyzing ....... " ;
95 auto ps_cl_for_pi0_disc_x = std::make_unique<reco::PreshowerClusterShapeCollection>();
96 auto ps_cl_for_pi0_disc_y = std::make_unique<reco::PreshowerClusterShapeCollection>();
99 std::unique_ptr<CaloSubdetectorTopology> topology_p;
101 topology_p = std::make_unique<EcalPreshowerTopology>();
109 LogTrace(
"EcalClusters") <<
"PreshowerClusterShapeProducer: ### Total # of preshower RecHits: " << rechits->
size() ;
114 map<DetId, EcalRecHit> rechits_map;
116 for (it = rechits->
begin(); it != rechits->
end(); it++) {
117 rechits_map.insert(make_pair(it->id(), *it));
120 LogTrace(
"EcalClusters") <<
"PreshowerClusterShapeProducer: ### Preshower RecHits_map of size " << rechits_map.size() <<
" was created!" ;
131 evt.
getByToken(endcapSClusterToken_, pSuperClusters);
133 LogTrace(
"EcalClusters") <<
"### Total # Endcap Superclusters: " << SClusts->size() ;
135 SuperClusterCollection::const_iterator it_s;
136 for ( it_s=SClusts->begin(); it_s!=SClusts->end(); it_s++ ) {
140 float SC_eta = it_super->eta();
142 LogTrace(
"EcalClusters") <<
"PreshowerClusterShapeProducer: superCl_E = " << it_super->energy() <<
" superCl_Et = " << it_super->energy()*
sin(2*atan(
exp(-it_super->eta()))) <<
" superCl_Eta = " << SC_eta <<
" superCl_Phi = " << it_super->phi() ;
145 if(fabs(SC_eta) >= 1.65 && fabs(SC_eta) <= 2.5)
149 const GlobalPoint pointSC(it_super->x(),it_super->y(),it_super->z());
150 LogTrace(
"EcalClusters") <<
"SC centroind = " << pointSC ;
159 vector<float> vout_stripE1 = presh_pi0_algo->findPreshVector(stripX, &rechits_map, topology_p.get());
160 vector<float> vout_stripE2 = presh_pi0_algo->findPreshVector(stripY, &rechits_map, topology_p.get());
162 LogTrace(
"EcalClusters") <<
"PreshowerClusterShapeProducer : ES Energy vector associated to the given SC = " ;
163 for(
int k1=0;k1<11;k1++) {
164 LogTrace(
"EcalClusters") << vout_stripE1[k1] <<
" " ;
167 for(
int k1=0;k1<11;k1++) {
168 LogTrace(
"EcalClusters") << vout_stripE2[k1] <<
" " ;
173 ps_cl_x.push_back(ps1);
177 ps_cl_y.push_back(ps2);
184 ps_cl_for_pi0_disc_x->assign(ps_cl_x.begin(), ps_cl_x.end());
185 ps_cl_for_pi0_disc_y->assign(ps_cl_y.begin(), ps_cl_y.end());
187 evt.
put(
std::move(ps_cl_for_pi0_disc_x), PreshowerClusterShapeCollectionX_);
188 evt.
put(
std::move(ps_cl_for_pi0_disc_y), PreshowerClusterShapeCollectionY_);
189 LogTrace(
"EcalClusters") <<
"PreshowerClusterShapeCollection added to the event" ;
193 LogDebug(
"PiZeroDiscriminatorDebug") << ostr.str();
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
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
Sin< T >::type sin(const T &t)
std::vector< EcalRecHit >::const_iterator const_iterator
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
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
~PreshowerClusterShapeProducer() override
ESHandle< TrackerGeometry > geometry
PreshowerClusterShapeProducer(const edm::ParameterSet &ps)
const_iterator begin() const