33 LogTrace(
"EgammaSCEnergyCorrectionAlgo")<<
"::applyCorrection" << std::endl;
35 LogTrace()<<
" Will correct now.... " << std::endl;
42 LogTrace(
"EgammaSCEnergyCorrectionAlgo")<<
" Seed cluster energy... " << seedC->energy() << std::endl;
47 LogTrace(
"EgammaSCEnergyCorrectionAlgo")<<
" The seed cluster used algo " << theAlgo;
52 std::vector<std::pair<DetId, float> > seedHits = seedC->hitsAndFractions();
55 LogTrace(
"EgammaSCEnergyCorrectionAlgo")<<
" seed cluster location == " << theBase << std::endl;
60 LogTrace(
"EgammaSCEnergyCorrectionAlgo")<<
" nCryGT2Sigma " << nCryGT2Sigma << std::endl;
64 float bremsEnergy = cl.
energy() - seedC->energy();
66 LogTrace(
"EgammaSCEnergyCorrectionAlgo")<<
" bremsEnergy " << bremsEnergy << std::endl;
91 if (energyCorrectorName_==
"EcalClusterEnergyCorrection") newEnergy = tmp.
rawEnergy() + energyCorrectionFunction->
getValue(tmp, modeEB_);
92 if (energyCorrectorName_==
"EcalClusterEnergyCorrectionObjectSpecific") {
94 newEnergy = energyCorrectionFunction->
getValue(tmp, modeEB_);
98 if (energyCorrectorName_==
"EcalClusterEnergyCorrection") newEnergy = tmp.
rawEnergy() + tmp.
preshowerEnergy() + energyCorrectionFunction->
getValue(tmp, modeEE_);
99 if (energyCorrectorName_==
"EcalClusterEnergyCorrectionObjectSpecific") newEnergy = energyCorrectionFunction->
getValue(tmp, modeEE_);
103 newEnergy = seedC->energy()/
fNCrystals(nCryGT2Sigma, theAlgo, theBase)+bremsEnergy;
108 LogTrace(
"EgammaSCEnergyCorrectionAlgo")<<
" UNCORRECTED SC has energy... " << cl.
energy() << std::endl;
109 LogTrace(
"EgammaSCEnergyCorrectionAlgo")<<
" CORRECTED SC has energy... " << newEnergy << std::endl;
122 float p0 = 0,
p1 = 0,
p2 = 0,
p3 = 0,
p4 = 0;
135 else if (nCry>10 && nCry<=30)
151 if (x > 40.
f) x = 40.f;
156 LogTrace(
"EgammaSCEnergyCorrectionAlgo") <<
"ERROR! HybridEFRYsc called" << std::endl;
167 if (x > 16.
f) x = 16.f;
176 if (x > 16.
f) x = 16.f;
181 LogTrace(
"EgammaSCEnergyCorrectionAlgo")<<
"trying to correct unknown cluster!!!" << std::endl;
184 result = p0 + x*(
p1 + x*(
p2 + x*(
p3 + x*
p4)));
188 float const ebfact = 1.f/0.965f;
189 float const eefact = 1.f/0.975f;
205 std::vector<std::pair<DetId,float > >
const &
hits = seed.hitsAndFractions();
208 LogTrace(
"EgammaSCEnergyCorrectionAlgo") <<
" EgammaSCEnergyCorrectionAlgo::nCrystalsGT2Sigma" << std::endl;
209 LogTrace(
"EgammaSCEnergyCorrectionAlgo") <<
" Will calculate number of crystals above 2sigma noise" << std::endl;
211 LogTrace(
"EgammaSCEnergyCorrectionAlgo") <<
" There are " << hits.size() <<
" recHits" << std::endl;
214 std::vector<std::pair<DetId,float > >::const_iterator
hit;
216 for(hit = hits.begin(); hit != hits.end(); hit++) {
218 aHit = rhc.
find((*hit).first);
222 LogTrace(
"EgammaSCEnergyCorrectionAlgo") <<
" " << nCry <<
" of these above 2sigma noise" << std::endl;
235 double crackcor = 1.;
241 cc->energy()*(crackCorrectionFunction->
getValue(*cc)-1.)) /
266 float seedBCene = seedBC->energy();
267 float correctedSeedBCene = localContCorrectionFunction->
getValue(*seedBC,dummy) * seedBCene;
reco::SuperCluster applyCorrection(const reco::SuperCluster &cl, const EcalRecHitCollection &rhc, reco::CaloCluster::AlgoId theAlgo, const CaloSubdetectorGeometry *geometry, EcalClusterFunctionBaseClass *energyCorrectionFunction, std::string energyCorrectorName_, int modeEB_, int modeEE_)
void Calculate_Covariances(const reco::SuperCluster &passedCluster)
EgammaSCEnergyCorrectionAlgo(float noise, reco::CaloCluster::AlgoId theAlgo, const edm::ParameterSet &pset)
float fNCrystals(int nCry, reco::CaloCluster::AlgoId theAlgo, EcalSubdetector theBase) const
std::vector< EcalRecHit >::const_iterator const_iterator
void setEnergy(double energy)
void setPhiWidth(double pw)
void setEtaWidth(double ew)
virtual float getValue(const reco::BasicCluster &, const EcalRecHitCollection &) const =0
float sigmaElectronicNoise_
double energy() const
cluster energy
int nCrystalsGT2Sigma(reco::BasicCluster const &seed, EcalRecHitCollection const &rhc) const
reco::SuperCluster applyCrackCorrection(const reco::SuperCluster &cl, EcalClusterFunctionBaseClass *crackCorrectionFunction)
reco::SuperCluster applyLocalContCorrection(const reco::SuperCluster &cl, EcalClusterFunctionBaseClass *localContCorrectionFunction)
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
std::vector< std::vector< double > > tmp
iterator find(key_type k)
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
const CaloClusterPtr & seed() const
seed BasicCluster
double preshowerEnergy() const
energy deposited in preshower
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents