25 std::string energyCorrectorName_,
34 LogTrace(
"EgammaSCEnergyCorrectionAlgo")<<
"::applyCorrection" << std::endl;
36 LogTrace()<<
" Will correct now.... " << std::endl;
43 LogTrace(
"EgammaSCEnergyCorrectionAlgo")<<
" Seed cluster energy... " << seedC->energy() << std::endl;
48 LogTrace(
"EgammaSCEnergyCorrectionAlgo")<<
" The seed cluster used algo " << theAlgo;
53 std::vector<std::pair<DetId, float> > seedHits = seedC->hitsAndFractions();
56 LogTrace(
"EgammaSCEnergyCorrectionAlgo")<<
" seed cluster location == " << theBase << std::endl;
61 LogTrace(
"EgammaSCEnergyCorrectionAlgo")<<
" nCryGT2Sigma " << nCryGT2Sigma << std::endl;
65 float bremsEnergy = cl.
energy() - seedC->energy();
67 LogTrace(
"EgammaSCEnergyCorrectionAlgo")<<
" bremsEnergy " << bremsEnergy << std::endl;
92 if (energyCorrectorName_==
"EcalClusterEnergyCorrection") newEnergy = tmp.
rawEnergy() + energyCorrectionFunction->
getValue(tmp, modeEB_);
93 if (energyCorrectorName_==
"EcalClusterEnergyCorrectionObjectSpecific") {
95 newEnergy = energyCorrectionFunction->
getValue(tmp, modeEB_);
99 if (energyCorrectorName_==
"EcalClusterEnergyCorrection") newEnergy = tmp.
rawEnergy() + tmp.
preshowerEnergy() + energyCorrectionFunction->
getValue(tmp, modeEE_);
100 if (energyCorrectorName_==
"EcalClusterEnergyCorrectionObjectSpecific") newEnergy = energyCorrectionFunction->
getValue(tmp, modeEE_);
104 newEnergy = seedC->energy()/
fNCrystals(nCryGT2Sigma, theAlgo, theBase)+bremsEnergy;
109 LogTrace(
"EgammaSCEnergyCorrectionAlgo")<<
" UNCORRECTED SC has energy... " << cl.
energy() << std::endl;
110 LogTrace(
"EgammaSCEnergyCorrectionAlgo")<<
" CORRECTED SC has energy... " << newEnergy << std::endl;
123 float p0 = 0,
p1 = 0,
p2 = 0,
p3 = 0,
p4 = 0;
136 else if (nCry>10 && nCry<=30)
152 if (x > 40.
f) x = 40.f;
157 LogTrace(
"EgammaSCEnergyCorrectionAlgo") <<
"ERROR! HybridEFRYsc called" << std::endl;
168 if (x > 16.
f) x = 16.f;
177 if (x > 16.
f) x = 16.f;
182 LogTrace(
"EgammaSCEnergyCorrectionAlgo")<<
"trying to correct unknown cluster!!!" << std::endl;
185 result = p0 + x*(
p1 + x*(
p2 + x*(
p3 + x*
p4)));
189 float const ebfact = 1.f/0.965f;
190 float const eefact = 1.f/0.975f;
206 std::vector<std::pair<DetId,float > >
const & hits = seed.hitsAndFractions();
209 LogTrace(
"EgammaSCEnergyCorrectionAlgo") <<
" EgammaSCEnergyCorrectionAlgo::nCrystalsGT2Sigma" << std::endl;
210 LogTrace(
"EgammaSCEnergyCorrectionAlgo") <<
" Will calculate number of crystals above 2sigma noise" << std::endl;
212 LogTrace(
"EgammaSCEnergyCorrectionAlgo") <<
" There are " << hits.size() <<
" recHits" << std::endl;
215 std::vector<std::pair<DetId,float > >::const_iterator
hit;
217 for(hit = hits.begin(); hit != hits.end(); hit++) {
219 aHit = rhc.
find((*hit).first);
223 LogTrace(
"EgammaSCEnergyCorrectionAlgo") <<
" " << nCry <<
" of these above 2sigma noise" << std::endl;
236 double crackcor = 1.;
242 cc->energy()*(crackCorrectionFunction->
getValue(*cc)-1.)) /
267 float seedBCene = seedBC->energy();
268 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)
virtual float getValue(const reco::BasicCluster &, const EcalRecHitCollection &) const =0
void setEtaWidth(double ew)
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
ESHandle< TrackerGeometry > geometry
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