a hit can be ZS or forced ZS. A hit can be in Full readout or Forced to be FULL readout if it is ZS, then clusFlag (in binary) = 0001 if it is forced ZS, then clusFlag (in binary) = 0101 if it is FR, then clusFlag (in binary) = 0011 if it is forced FR, then clusFlag (in binary) = 0111 i.e 3rd bit is set. Even if it is forced, we should mark it is as ZS or FR. To take care of it, just check the LSB and second LSB(SLSB)
it is clusFlag==1, 5
Definition at line 133 of file PFClusterEMEnergyCorrector.cc.
140 for (
unsigned int idx = 0;
idx <
cs.size(); ++
idx) {
143 float ePS1 = 0., ePS2 = 0.;
157 int bunchspacing = 450;
161 bunchspacing = *bunchSpacingH;
167 const std::vector<std::string> &condnames_sigma =
169 const unsigned int ncor = condnames_mean.size();
170 std::vector<edm::ESHandle<GBRForestD> > forestH_mean(ncor);
171 std::vector<edm::ESHandle<GBRForestD> > forestH_sigma(ncor);
173 for (
unsigned int icor = 0; icor < ncor; ++icor) {
178 std::array<float, 5> eval;
179 for (
unsigned int idx = 0;
idx <
cs.size(); ++
idx) {
182 float ePS1 = 0., ePS2 = 0.;
187 double pt = cluster.
pt();
192 double invE = (
e == 0.) ? 0. : 1. /
e;
193 int size = lazyTool.n5x5(cluster);
199 ietaix = ebseed.
ieta();
200 iphiiy = ebseed.iphi();
203 ietaix = eeseed.
ix();
204 iphiiy = eeseed.iy();
221 const GBRForestD &meanforest = *forestH_mean[coridx].product();
222 const GBRForestD &sigmaforest = *forestH_sigma[coridx].product();
229 eval[3] = ePS1 * invE;
230 eval[4] = ePS2 * invE;
234 double rawmean = meanforest.
GetResponse(eval.data());
235 double rawsigma = sigmaforest.
GetResponse(eval.data());
245 double ecor = vdt::fast_exp(
mean) *
e;
246 double sigmacor = sigma * ecor;
264 <<
"This version of PFCluster corrections requires the SrFlagCollection information to proceed!\n";
268 std::vector<edm::ESHandle<GBRForestD> > forestH_mean(ncor);
269 std::vector<edm::ESHandle<GBRForestD> > forestH_sigma(ncor);
271 for (
unsigned int icor = 0; icor < ncor; ++icor) {
276 std::array<float, 6> evalEB;
277 std::array<float, 5> evalEE;
279 for (
unsigned int idx = 0;
idx <
cs.size(); ++
idx) {
282 float ePS1 = 0., ePS2 = 0.;
287 double pt = cluster.
pt();
292 double invE = (
e == 0.) ? 0. : 1. /
e;
293 int size = lazyTool.n5x5(cluster);
294 int reducedHits =
size;
302 ietaix = ebseed.
ieta();
303 iphiiy = ebseed.iphi();
306 ietaix = eeseed.
ix();
307 iphiiy = eeseed.iy();
311 int signeta = (ietaix > 0) ? 1 : -1;
312 int ietamod20 = (
std::abs(ietaix) < 26) ? ietaix - signeta : (ietaix - 26 * signeta) % 20;
313 int iphimod20 = (iphiiy - 1) % 20;
317 auto ecalUnit = readoutTool.readOutUnitOf(static_cast<EBDetId>(cluster.
seed()));
319 if (srf != ebSrFlags->
end())
320 clusFlag = srf->value();
324 auto ecalUnit = readoutTool.readOutUnitOf(static_cast<EEDetId>(cluster.
seed()));
326 if (srf != eeSrFlags->
end())
327 clusFlag = srf->value();
347 int ZS_bit = clusFlag >> 0 & 1;
348 int FR_bit = clusFlag >> 1 & 1;
350 if (ZS_bit != 0 && FR_bit == 0)
355 else if (
pt >= 2.5 &&
pt < 6.)
360 if (ZS_bit == 0 || clusFlag > 7) {
362 <<
"We can only correct regions readout in ZS (flag 1,5) or FULL readout (flag 3,7). Flag " << clusFlag
363 <<
" is not recognized."
365 <<
"Assuming FULL readout and continuing";
368 const GBRForestD &meanforest = *forestH_mean[coridx].product();
369 const GBRForestD &sigmaforest = *forestH_sigma[coridx].product();
376 evalEB[3] = ietamod20;
377 evalEB[4] = iphimod20;
378 evalEB[5] = reducedHits;
383 evalEE[3] = (ePS1 + ePS2) * invE;
384 evalEE[4] = reducedHits;
409 double ecor = iseb ? vdt::fast_exp(
mean) *
e : vdt::fast_exp(
mean) * (
e + ePS1 + ePS2);
410 double sigmacor = sigma * ecor;
412 LogDebug(
"PFClusterEMEnergyCorrector")
413 <<
"ieta : iphi : ietamod20 : iphimod20 : size : reducedHits = " << ietaix <<
" " << iphiiy <<
" " << ietamod20
414 <<
" " << iphimod20 <<
" " <<
size <<
" " << reducedHits <<
"\n"
415 <<
"isEB : eraw : ePS1 : ePS2 : (eps1+eps2)/raw : Flag = " << iseb <<
" " << evale <<
" " << ePS1 <<
" " << ePS2
416 <<
" " << (ePS1 + ePS2) / evale <<
" " << clusFlag <<
"\n"
417 <<
"response : correction = " <<
exp(
mean) <<
" " << ecor;
References funct::abs(), applyCrackCorrections_, applyMVACorrections_, trackingPlots::assoc, autoDetectBunchSpacing_, bunchSpacing_, bunchSpacingManual_, calibrator_, condnames_mean_, condnames_mean_25ns_, condnames_mean_50ns_, condnames_sigma_, condnames_sigma_25ns_, condnames_sigma_50ns_, fwrapper::cs, MillePedeFileConverter_cfg::e, ebSrFlagToken_, PFLayer::ECAL_BARREL, ecalClusterToolsESGetTokens_, ecalReadoutToolsESGetTokens_, eeSrFlagToken_, edm::SortedCollection< T, SORT >::end(), reco::PFCluster::energy(), JetChargeProducer_cfi::exp, edm::SortedCollection< T, SORT >::find(), EcalClusterLazyToolsBase::ESGetTokens::get(), edm::EventSetup::get(), get, getAssociatedPSEnergy(), edm::Event::getByToken(), GBRForestD::GetResponse(), heavyIonCSV_trainingSettings::idx, EBDetId::ieta(), edm::HandleBase::isValid(), EEDetId::ix(), reco::PFCluster::layer(), LogDebug, maxPtForMVAEvaluation_, SiStripPI::mean, meanoffsetEB_, meanoffsetEE_, meanscaleEB_, meanscaleEE_, min(), DiDispStaMuonMonitor_cfi::pt, reco::PFCluster::pt(), recHitsEB_, recHitsEE_, reco::CaloCluster::seed(), reco::CaloCluster::setCorrectedEnergy(), reco::CaloCluster::setCorrectedEnergyUncertainty(), setEnergyUncertainty_, sigmaoffsetEB_, sigmaoffsetEE_, sigmascaleEB_, sigmascaleEE_, findQualityFiles::size, and srfAwareCorrection_.