97 double ePS1=0, ePS2=0;
100 const auto clustops = std::equal_range(
assoc.begin(),
104 for(
auto i_ps = clustops.first; i_ps != clustops.second; ++i_ps) {
106 switch( psclus->layer() ) {
108 ePS1 += psclus->energy();
111 ePS2 += psclus->energy();
126 int bunchspacing = 450;
131 bunchspacing = *bunchSpacingH;
140 const unsigned int ncor = condnames_mean.size();
142 std::vector<edm::ESHandle<GBRForestD> > forestH_mean(ncor);
143 std::vector<edm::ESHandle<GBRForestD> > forestH_sigma(ncor);
145 for (
unsigned int icor=0; icor<ncor; ++icor) {
150 std::array<float,5> eval;
156 const double meanlimlow = -0.336;
157 const double meanlimhigh = 0.916;
158 const double meanoffset = meanlimlow + 0.5*(meanlimhigh-meanlimlow);
159 const double meanscale = 0.5*(meanlimhigh-meanlimlow);
161 const double sigmalimlow = 0.001;
162 const double sigmalimhigh = 0.4;
163 const double sigmaoffset = sigmalimlow + 0.5*(sigmalimhigh-sigmalimlow);
164 const double sigmascale = 0.5*(sigmalimhigh-sigmalimlow);
171 double pt = cluster.
pt();
180 double invE = (e == 0.) ? 0. : 1./
e;
182 int size = lazyTool.n5x5(cluster);
200 const GBRForestD &meanforest = *forestH_mean[coridx].product();
201 const GBRForestD &sigmaforest = *forestH_sigma[coridx].product();
208 ietaix = ebseed.
ieta();
209 iphiiy = ebseed.iphi();
213 ietaix = eeseed.
ix();
214 iphiiy = eeseed.iy();
219 double ePS1=0, ePS2=0;
222 const auto clustops = std::equal_range(
assoc.begin(),
226 for(
auto i_ps = clustops.first; i_ps != clustops.second; ++i_ps) {
228 switch( psclus->layer() ) {
230 ePS1 += psclus->energy();
233 ePS2 += psclus->energy();
251 double rawmean = meanforest.
GetResponse(eval.data());
252 double rawsigma = sigmaforest.
GetResponse(eval.data());
255 double mean = meanoffset + meanscale*vdt::fast_sin(rawmean);
256 double sigma = sigmaoffset + sigmascale*vdt::fast_sin(rawsigma);
260 double ecor =
exp(mean)*
e;
261 double sigmacor = sigma*ecor;
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
std::vector< std::string > _condnames_mean_50ns
double GetResponse(const float *vector) const
bool _applyCrackCorrections
bool _applyMVACorrections
auto_ptr< ClusterSequence > cs
std::vector< std::string > _condnames_sigma_25ns
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double pt() const
transverse momentum, massless approximation
std::vector< std::string > _condnames_mean_25ns
edm::EDGetTokenT< unsigned int > bunchSpacing_
edm::EDGetTokenT< EcalRecHitCollection > _recHitsEB
std::unique_ptr< PFEnergyCalibration > _calibrator
void setCorrectedEnergy(double cenergy)
int ieta() const
get the crystal ieta
double energy() const
cluster energy
DetId seed() const
return DetId of seed
bool sortByKey(const EEPSPair &a, const EEPSPair &b)
edm::EDGetTokenT< EcalRecHitCollection > _recHitsEE
std::vector< std::string > _condnames_sigma_50ns
bool autoDetectBunchSpacing_
void setCorrectedEnergyUncertainty(float energyerr)
double _maxPtForMVAEvaluation