51 endcapSClusterToken_ =
60 produces< reco::PreshowerClusterCollection >(preshClusterCollectionX_);
61 produces< reco::PreshowerClusterCollection >(preshClusterCollectionY_);
62 produces< reco::SuperClusterCollection >(assocSClusterCollection_);
64 float esStripECut = ps.
getParameter<
double>(
"esStripEnergyCut");
65 esPhiClusterDeltaEta_ = ps.
getParameter<
double>(
"esPhiClusterDeltaEta");
66 esPhiClusterDeltaPhi_ = ps.
getParameter<
double>(
"esPhiClusterDeltaPhi");
104 evt.
getByToken(endcapSClusterToken_, pSuperClusters);
112 LogTrace(
"EcalClusters") <<
"PreshowerPhiClusterProducerInfo: ### Total # of preshower RecHits: "<< rechits->
size();
115 std::map<DetId, EcalRecHit> rechits_map;
117 for (it = rechits->
begin(); it != rechits->
end(); it++) {
119 if (it->recoFlag()==1 || it->recoFlag()==14 || (it->recoFlag()<=10 && it->recoFlag()>=5))
continue;
121 rechits_map.insert(std::make_pair(it->id(), *it));
124 std::set<DetId> used_strips;
126 LogTrace(
"EcalClusters") <<
"PreshowerPhiClusterProducerInfo: ### rechits_map of size " << rechits_map.size() <<
" was created!";
132 reco::SuperClusterCollection::const_iterator it_super;
134 for (it_super=SClusts->begin(); it_super!=SClusts->end(); ++it_super) {
142 LogTrace(
"EcalClusters")<<
" superE = " << it_super->energy() <<
" superETA = " << it_super->eta() <<
" superPHI = " << it_super->phi() ;
155 for ( ; bc_iter !=it_super->clustersEnd(); ++bc_iter) {
157 refPhi = (*bc_iter)->phi();
168 maxDeltaPhi += esPhiClusterDeltaPhi_;
169 minDeltaPhi -= esPhiClusterDeltaPhi_;
172 for (bc_iter = it_super->clustersBegin() ; bc_iter !=it_super->clustersEnd(); ++bc_iter) {
176 double X = (*bc_iter)->x();
177 double Y = (*bc_iter)->y();
178 double Z = (*bc_iter)->z();
190 if (status_p1->getStatusCode() == 1) condP1 = 0;
191 if (status_p2->getStatusCode() == 1) condP2 = 0;
192 }
else if (strip1 ==
ESDetId(0)) {
194 }
else if (strip2 ==
ESDetId(0)) {
201 reco::PreshowerCluster cl1 = presh_algo->makeOneCluster(strip1,&used_strips,&rechits_map,geometry_p,topology_p,esPhiClusterDeltaEta_,minDeltaPhi,maxDeltaPhi);
203 clusters1.push_back(cl1);
207 reco::PreshowerCluster cl2 = presh_algo->makeOneCluster(strip2,&used_strips,&rechits_map,geometry_p,topology_p,esPhiClusterDeltaEta_,minDeltaPhi,maxDeltaPhi);
209 clusters2.push_back(cl2);
218 LogTrace(
"EcalClusters") <<
" For SC #" << isc-1 <<
", containing "
219 << it_super->clustersSize()
220 <<
" basic clusters, PreshowerPhiClusterAlgo made "
221 << clusters1.size() <<
" in X plane and "
223 <<
" in Y plane " <<
" preshower clusters " ;
226 if(e1+e2 > 1.0
e-10) {
231 if (condP1 == 1 && condP2 == 1) {
232 deltaE = gamma0_*(e1 + alpha0_*e2);
233 }
else if (condP1 == 1 && condP2 == 0) {
234 deltaE = gamma1_*(e1 + alpha1_*e2);
235 }
else if (condP1 == 0 && condP2 == 1) {
236 deltaE = gamma2_*(e1 + alpha2_*e2);
237 }
else if (condP1 == 0 && condP2 == 0) {
238 deltaE = gamma3_*(e1 + alpha3_*e2);
243 float E = it_super->energy() + deltaE;
245 LogTrace(
"EcalClusters") <<
" Creating corrected SC ";
249 sc.setPreshowerEnergyPlane2(e2*mip_);
250 if (condP1 == 1 && condP2 == 1) sc.setPreshowerPlanesStatus(0);
251 else if (condP1 == 1 && condP2 == 0) sc.setPreshowerPlanesStatus(1);
252 else if (condP1 == 0 && condP2 == 1) sc.setPreshowerPlanesStatus(2);
253 else if (condP1 == 0 && condP2 == 0) sc.setPreshowerPlanesStatus(3);
256 if (sc.energy()*
sin(sc.position().theta())>etThresh_ )
257 new_SC.push_back(sc);
259 new_SC.push_back(sc);
265 clusters_p1->assign(clusters1.begin(), clusters1.end());
266 clusters_p2->assign(clusters2.begin(), clusters2.end());
268 evt.
put( clusters_p1, preshClusterCollectionX_ );
269 evt.
put( clusters_p2, preshClusterCollectionY_ );
270 LogTrace(
"EcalClusters") <<
"Preshower clusters added to the event" ;
273 superclusters_p->assign(new_SC.begin(), new_SC.end());
274 evt.
put(superclusters_p, assocSClusterCollection_);
275 LogTrace(
"EcalClusters") <<
"Corrected SClusters added to the event" ;
277 if (topology_p)
delete topology_p;
283 const ESGain *gain = esgain_.product();
const double Z[kNumberCalorimeter]
T getParameter(std::string const &) const
float getConstAEta1() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void push_back(Ptr< T > const &iPtr)
const self & getMap() const
float getESValueLow() const
Sin< T >::type sin(const T &t)
float getConstAEta2() const
std::vector< EcalRecHit >::const_iterator const_iterator
float getGammaLow2() const
void set(const edm::EventSetup &es)
float getAlphaHigh3() const
float getGammaHigh2() const
float getConstAEta0() const
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void setBCRef(const CaloClusterPtr &r)
DetIds of component RecHits – now inherited from CaloCluster.
const_iterator find(uint32_t rawId) const
float getConstBEta0() const
virtual void produce(edm::Event &evt, const edm::EventSetup &es)
std::vector< PreshowerCluster > PreshowerClusterCollection
collection of PreshowerCluster objects
double energy() const
cluster energy
float getConstBEta2() const
float getConstAEta3() const
float getGammaHigh3() const
float getConstBEta1() const
float getGammaHigh1() const
const_iterator end() const
double deltaPhi(double phi1, double phi2)
float getGammaLow3() const
float getGammaLow0() const
float getAlphaHigh0() const
float getAlphaLow3() const
float getAlphaHigh2() const
float getAlphaLow2() const
T const * product() const
std::vector< Item >::const_iterator const_iterator
float getGammaLow1() const
float getAlphaHigh1() const
ESHandle< TrackerGeometry > geometry
~PreshowerPhiClusterProducer()
float getConstBEta3() const
float getGammaHigh0() const
float getAlphaLow1() const
float getESValueHigh() const
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 getAlphaLow0() const
const_iterator begin() const