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 147 of file PFClusterEMEnergyCorrector.cc.
154 for (
unsigned int idx = 0;
idx <
cs.size(); ++
idx) {
157 float ePS1 = 0., ePS2 = 0.;
171 int bunchspacing = 450;
175 bunchspacing = *bunchSpacingH;
182 std::vector<edm::ESHandle<GBRForestD> > forestH_mean(ncor);
183 std::vector<edm::ESHandle<GBRForestD> > forestH_sigma(ncor);
185 if (bunchspacing == 25) {
186 for (
unsigned int icor = 0; icor < ncor; ++icor) {
191 for (
unsigned int icor = 0; icor < ncor; ++icor) {
197 std::array<float, 5> eval;
198 for (
unsigned int idx = 0;
idx <
cs.size(); ++
idx) {
201 float ePS1 = 0., ePS2 = 0.;
206 double pt = cluster.
pt();
211 double invE = (
e == 0.) ? 0. : 1. /
e;
212 int size = lazyTool.n5x5(cluster);
218 ietaix = ebseed.
ieta();
219 iphiiy = ebseed.iphi();
222 ietaix = eeseed.
ix();
223 iphiiy = eeseed.iy();
240 const GBRForestD &meanforest = *forestH_mean[coridx].product();
241 const GBRForestD &sigmaforest = *forestH_sigma[coridx].product();
248 eval[3] = ePS1 * invE;
249 eval[4] = ePS2 * invE;
253 double rawmean = meanforest.
GetResponse(eval.data());
254 double rawsigma = sigmaforest.
GetResponse(eval.data());
264 double ecor = vdt::fast_exp(
mean) *
e;
265 double sigmacor = sigma * ecor;
283 <<
"This version of PFCluster corrections requires the SrFlagCollection information to proceed!\n";
286 std::vector<edm::ESHandle<GBRForestD> > forestH_mean(ncor);
287 std::vector<edm::ESHandle<GBRForestD> > forestH_sigma(ncor);
289 for (
unsigned int icor = 0; icor < ncor; ++icor) {
294 std::array<float, 6> evalEB;
295 std::array<float, 5> evalEE;
297 for (
unsigned int idx = 0;
idx <
cs.size(); ++
idx) {
300 float ePS1 = 0., ePS2 = 0.;
305 double pt = cluster.
pt();
310 double invE = (
e == 0.) ? 0. : 1. /
e;
311 int size = lazyTool.n5x5(cluster);
312 int reducedHits =
size;
320 ietaix = ebseed.
ieta();
321 iphiiy = ebseed.iphi();
324 ietaix = eeseed.
ix();
325 iphiiy = eeseed.iy();
329 int signeta = (ietaix > 0) ? 1 : -1;
330 int ietamod20 = (
std::abs(ietaix) < 26) ? ietaix - signeta : (ietaix - 26 * signeta) % 20;
331 int iphimod20 = (iphiiy - 1) % 20;
335 auto ecalUnit = readoutTool.readOutUnitOf(static_cast<EBDetId>(cluster.
seed()));
337 if (srf != ebSrFlags->
end())
338 clusFlag = srf->value();
342 auto ecalUnit = readoutTool.readOutUnitOf(static_cast<EEDetId>(cluster.
seed()));
344 if (srf != eeSrFlags->
end())
345 clusFlag = srf->value();
365 int ZS_bit = clusFlag >> 0 & 1;
366 int FR_bit = clusFlag >> 1 & 1;
368 if (ZS_bit != 0 && FR_bit == 0)
373 else if (
pt >= 2.5 &&
pt < 6.)
378 if (ZS_bit == 0 || clusFlag > 7) {
380 <<
"We can only correct regions readout in ZS (flag 1,5) or FULL readout (flag 3,7). Flag " << clusFlag
381 <<
" is not recognized."
383 <<
"Assuming FULL readout and continuing";
386 const GBRForestD &meanforest = *forestH_mean[coridx].product();
387 const GBRForestD &sigmaforest = *forestH_sigma[coridx].product();
394 evalEB[3] = ietamod20;
395 evalEB[4] = iphimod20;
396 evalEB[5] = reducedHits;
401 evalEE[3] = (ePS1 + ePS2) * invE;
402 evalEE[4] = reducedHits;
427 double ecor = iseb ? vdt::fast_exp(
mean) *
e : vdt::fast_exp(
mean) * (
e + ePS1 + ePS2);
428 double sigmacor = sigma * ecor;
430 LogDebug(
"PFClusterEMEnergyCorrector")
431 <<
"ieta : iphi : ietamod20 : iphimod20 : size : reducedHits = " << ietaix <<
" " << iphiiy <<
" " << ietamod20
432 <<
" " << iphimod20 <<
" " <<
size <<
" " << reducedHits <<
"\n"
433 <<
"isEB : eraw : ePS1 : ePS2 : (eps1+eps2)/raw : Flag = " << iseb <<
" " << evale <<
" " << ePS1 <<
" " << ePS2
434 <<
" " << (ePS1 + ePS2) / evale <<
" " << clusFlag <<
"\n"
435 <<
"response : correction = " <<
exp(
mean) <<
" " << ecor;
References funct::abs(), applyCrackCorrections_, applyMVACorrections_, trackingPlots::assoc, autoDetectBunchSpacing_, bunchSpacing_, bunchSpacingManual_, calibrator_, condnames_mean_25ns_, condnames_mean_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(), forestMeanTokens_25ns_, forestMeanTokens_50ns_, forestSigmaTokens_25ns_, forestSigmaTokens_50ns_, EcalClusterLazyToolsBase::ESGetTokens::get(), getAssociatedPSEnergy(), edm::Event::getByToken(), edm::EventSetup::getHandle(), 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_.