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 131 of file PFClusterEMEnergyCorrector.cc.
138 for (
unsigned int idx = 0;
idx <
cs.size(); ++
idx) {
141 float ePS1 = 0., ePS2 = 0.;
155 int bunchspacing = 450;
159 bunchspacing = *bunchSpacingH;
165 const std::vector<std::string> &condnames_sigma =
167 const unsigned int ncor = condnames_mean.size();
168 std::vector<edm::ESHandle<GBRForestD> > forestH_mean(ncor);
169 std::vector<edm::ESHandle<GBRForestD> > forestH_sigma(ncor);
171 for (
unsigned int icor = 0; icor < ncor; ++icor) {
176 std::array<float, 5> eval;
177 for (
unsigned int idx = 0;
idx <
cs.size(); ++
idx) {
180 float ePS1 = 0., ePS2 = 0.;
185 double pt = cluster.
pt();
190 double invE = (
e == 0.) ? 0. : 1. /
e;
191 int size = lazyTool.n5x5(cluster);
197 ietaix = ebseed.
ieta();
198 iphiiy = ebseed.iphi();
201 ietaix = eeseed.
ix();
202 iphiiy = eeseed.iy();
219 const GBRForestD &meanforest = *forestH_mean[coridx].product();
220 const GBRForestD &sigmaforest = *forestH_sigma[coridx].product();
227 eval[3] = ePS1 * invE;
228 eval[4] = ePS2 * invE;
232 double rawmean = meanforest.
GetResponse(eval.data());
233 double rawsigma = sigmaforest.
GetResponse(eval.data());
243 double ecor = vdt::fast_exp(
mean) *
e;
244 double sigmacor = sigma * ecor;
262 <<
"This version of PFCluster corrections requires the SrFlagCollection information to proceed!\n";
266 std::vector<edm::ESHandle<GBRForestD> > forestH_mean(ncor);
267 std::vector<edm::ESHandle<GBRForestD> > forestH_sigma(ncor);
269 for (
unsigned int icor = 0; icor < ncor; ++icor) {
274 std::array<float, 6> evalEB;
275 std::array<float, 5> evalEE;
277 for (
unsigned int idx = 0;
idx <
cs.size(); ++
idx) {
280 float ePS1 = 0., ePS2 = 0.;
285 double pt = cluster.
pt();
290 double invE = (
e == 0.) ? 0. : 1. /
e;
291 int size = lazyTool.n5x5(cluster);
292 int reducedHits =
size;
300 ietaix = ebseed.
ieta();
301 iphiiy = ebseed.iphi();
304 ietaix = eeseed.
ix();
305 iphiiy = eeseed.iy();
309 int signeta = (ietaix > 0) ? 1 : -1;
310 int ietamod20 = (
std::abs(ietaix) < 26) ? ietaix - signeta : (ietaix - 26 * signeta) % 20;
311 int iphimod20 = (iphiiy - 1) % 20;
315 auto ecalUnit = readoutTool.readOutUnitOf(static_cast<EBDetId>(cluster.
seed()));
317 if (srf != ebSrFlags->
end())
318 clusFlag = srf->value();
322 auto ecalUnit = readoutTool.readOutUnitOf(static_cast<EEDetId>(cluster.
seed()));
324 if (srf != eeSrFlags->
end())
325 clusFlag = srf->value();
345 int ZS_bit = clusFlag >> 0 & 1;
346 int FR_bit = clusFlag >> 1 & 1;
348 if (ZS_bit != 0 && FR_bit == 0)
353 else if (
pt >= 2.5 &&
pt < 6.)
358 if (ZS_bit == 0 || clusFlag > 7) {
360 <<
"We can only correct regions readout in ZS (flag 1,5) or FULL readout (flag 3,7). Flag " << clusFlag
361 <<
" is not recognized."
363 <<
"Assuming FULL readout and continuing";
366 const GBRForestD &meanforest = *forestH_mean[coridx].product();
367 const GBRForestD &sigmaforest = *forestH_sigma[coridx].product();
374 evalEB[3] = ietamod20;
375 evalEB[4] = iphimod20;
376 evalEB[5] = reducedHits;
381 evalEE[3] = (ePS1 + ePS2) * invE;
382 evalEE[4] = reducedHits;
407 double ecor = iseb ? vdt::fast_exp(
mean) *
e : vdt::fast_exp(
mean) * (
e + ePS1 + ePS2);
408 double sigmacor = sigma * ecor;
410 LogDebug(
"PFClusterEMEnergyCorrector")
411 <<
"ieta : iphi : ietamod20 : iphimod20 : size : reducedHits = " << ietaix <<
" " << iphiiy <<
" " << ietamod20
412 <<
" " << iphimod20 <<
" " <<
size <<
" " << reducedHits <<
"\n"
413 <<
"isEB : eraw : ePS1 : ePS2 : (eps1+eps2)/raw : Flag = " << iseb <<
" " << evale <<
" " << ePS1 <<
" " << ePS2
414 <<
" " << (ePS1 + ePS2) / evale <<
" " << clusFlag <<
"\n"
415 <<
"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_, 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_.