|
|
#include <PFEGammaAlgo.h>
|
int | attachPSClusters (const PFClusterElement *, ClusterMap::mapped_type &) |
|
reco::SuperCluster | buildRefinedSuperCluster (const ProtoEGObject &) |
|
float | calculateEleMVA (const ProtoEGObject &, reco::PFCandidateEGammaExtra &) const |
|
void | dumpCurrentRefinableObjects () const |
|
float | evaluateSingleLegMVA (const reco::PFBlockRef &blockref, const reco::Vertex &primaryVtx, unsigned int trackIndex) |
|
void | fillExtraInfo (const ProtoEGObject &, reco::PFCandidateEGammaExtra &) |
|
EgammaObjects | fillPFCandidates (const std::list< ProtoEGObject > &) |
|
void | initializeProtoCands (std::list< ProtoEGObject > &) |
|
bool | isMuon (const reco::PFBlockElement &) |
|
bool | isPrimaryTrack (const reco::PFBlockElementTrack &KfEl, const reco::PFBlockElementGsfTrack &GsfEl) |
|
void | linkKFTrackToECAL (PFKFElement const *, ProtoEGObject &) |
|
void | linkRefinableObjectBremTangentsToECAL (ProtoEGObject &) |
|
void | linkRefinableObjectConvSecondaryKFsToSecondaryKFs (ProtoEGObject &) |
|
void | linkRefinableObjectECALToSingleLegConv (ProtoEGObject &) |
|
void | linkRefinableObjectGSFTracksToKFs (ProtoEGObject &) |
|
void | linkRefinableObjectKFTracksToECAL (ProtoEGObject &) |
|
void | linkRefinableObjectPrimaryGSFTrackToECAL (ProtoEGObject &) |
|
void | linkRefinableObjectPrimaryGSFTrackToHCAL (ProtoEGObject &) |
|
void | linkRefinableObjectPrimaryKFsToSecondaryKFs (ProtoEGObject &) |
|
void | linkRefinableObjectSecondaryKFsToECAL (ProtoEGObject &) |
|
void | mergeROsByAnyLink (std::list< ProtoEGObject > &) |
|
void | removeOrLinkECALClustersToKFTracks () |
|
void | unlinkRefinableObjectKFandECALMatchedToHCAL (ProtoEGObject &, bool removeFreeECAL=false, bool removeSCECAL=false) |
|
void | unlinkRefinableObjectKFandECALWithBadEoverP (ProtoEGObject &) |
|
bool | unwrapSuperCluster (const reco::PFBlockElementSuperCluster *, std::vector< FlaggedPtr< const PFClusterElement >> &, ClusterMap &) |
|
Definition at line 62 of file PFEGammaAlgo.h.
◆ ClusterMap
◆ EEtoPSAssociation
◆ KFValMap
◆ PFBremElement
◆ PFClusterElement
◆ PFGSFElement
◆ PFKFElement
◆ PFSCElement
◆ PFEGammaAlgo()
◆ attachPSClusters()
int PFEGammaAlgo::attachPSClusters |
( |
const PFClusterElement * |
, |
|
|
ClusterMap::mapped_type & |
|
|
) |
| |
|
private |
Definition at line 902 of file PFEGammaAlgo.cc.
906 EEtoPSElement ecalkey(clusptr.
key(), clusptr);
908 std::equal_range(
eetops_.cbegin(),
eetops_.cend(), ecalkey, [](
const EEtoPSElement&
a,
const EEtoPSElement&
b) {
909 return a.first <
b.first;
913 for (
auto pscl = assc_ps.first; pscl != assc_ps.second; ++pscl) {
914 if (pscl->second ==
temp) {
915 const ClusterElement* pstemp =
docast(
const ClusterElement*, ps1.get());
916 eslist.emplace_back(pstemp);
922 for (
auto pscl = assc_ps.first; pscl != assc_ps.second; ++pscl) {
923 if (pscl->second ==
temp) {
924 const ClusterElement* pstemp =
docast(
const ClusterElement*, ps2.get());
925 eslist.emplace_back(pstemp);
929 return eslist.size();
References _splayedblock, a, b, docast, PFLayer::ECAL_BARREL, eetops_, edm::Ptr< T >::key(), reco::PFBlockElement::PS1, reco::PFBlockElement::PS2, edm::refToPtr(), and groupFilesInBlocks::temp.
Referenced by linkKFTrackToECAL(), linkRefinableObjectBremTangentsToECAL(), linkRefinableObjectPrimaryGSFTrackToECAL(), linkRefinableObjectSecondaryKFsToECAL(), and unwrapSuperCluster().
◆ buildRefinedSuperCluster()
Definition at line 1789 of file PFEGammaAlgo.cc.
1790 if (RO.ecalclusters.empty()) {
1796 std::vector<const reco::PFCluster*> bare_ptrs;
1798 double posX(0),
posY(0), posZ(0), rawSCEnergy(0), corrSCEnergy(0), corrPSEnergy(0), ps1_energy(0.0), ps2_energy(0.0);
1799 for (
auto& clus : RO.ecalclusters) {
1803 auto clusptr = edm::refToPtr<reco::PFClusterCollection>(clus->clusterRef());
1804 bare_ptrs.push_back(clusptr.get());
1806 const double cluseraw = clusptr->energy();
1807 double cluscalibe = clusptr->correctedEnergy();
1809 posX += cluseraw * cluspos.X();
1810 posY += cluseraw * cluspos.Y();
1811 posZ += cluseraw * cluspos.Z();
1813 if (isEE && RO.ecal2ps.count(clus.get())) {
1814 const auto& psclusters = RO.ecal2ps.at(clus.get());
1816 std::vector<reco::PFCluster const*> psClusterPointers;
1817 psClusterPointers.reserve(psclusters.size());
1818 for (
auto const& psc : psclusters) {
1819 psClusterPointers.push_back(psc->clusterRef().get());
1824 ePS1 = calibratedEnergies.ps1Energy;
1825 ePS2 = calibratedEnergies.ps2Energy;
1832 rawSCEnergy += cluseraw;
1833 corrSCEnergy += cluscalibe;
1836 corrPSEnergy += ePS1 + ePS2;
1838 posX /= rawSCEnergy;
1839 posY /= rawSCEnergy;
1840 posZ /= rawSCEnergy;
1845 auto clusptr = edm::refToPtr<reco::PFClusterCollection>(RO.ecalclusters.front()->clusterRef());
1846 new_sc.setCorrectedEnergy(corrSCEnergy);
1847 new_sc.setSeed(clusptr);
1848 new_sc.setPreshowerEnergyPlane1(ps1_energy);
1849 new_sc.setPreshowerEnergyPlane2(ps2_energy);
1850 new_sc.setPreshowerEnergy(corrPSEnergy);
1851 for (
const auto& clus : RO.ecalclusters) {
1852 clusptr = edm::refToPtr<reco::PFClusterCollection>(clus->clusterRef());
1853 new_sc.addCluster(clusptr);
1854 auto& hits_and_fractions = clusptr->hitsAndFractions();
1855 for (
auto& hit_and_fraction : hits_and_fractions) {
1856 new_sc.addHitAndFraction(hit_and_fraction.first, hit_and_fraction.second);
1859 if (RO.ecal2ps.count(clus.get())) {
1860 const auto& cluspsassociation = RO.ecal2ps.at(clus.get());
1864 for (
const auto& pscluselem : cluspsassociation) {
1867 auto found_pscluster =
1869 if (found_pscluster == new_sc.preshowerClustersEnd()) {
1871 new_sc.addPreshowerCluster(psclus);
1874 throw cms::Exception(
"PFECALSuperClusterAlgo::buildSuperCluster")
1875 <<
"Found a PS cluster matched to more than one EE cluster!" << std::endl
1876 << std::hex << psclus.
get() <<
" == " << found_pscluster->get() <<
std::dec << std::endl;
1885 new_sc.setEtaWidth(pfwidth.pflowEtaWidth());
1886 new_sc.setPhiWidth(pfwidth.pflowPhiWidth());
References reco::SuperCluster::addCluster(), reco::CaloCluster::addHitAndFraction(), reco::SuperCluster::addPreshowerCluster(), PFEGammaAlgo::PFEGConfigInfo::applyCrackCorrections, PFEnergyCalibration::calibrateEndcapClusterEnergies(), cfg_, channelStatus_, PFEnergyCalibration::CalibratedEndcapPFClusterEnergies::clusterEnergy, TauDecayModes::dec, PFEGammaAlgo::ProtoEGObject::ecal2ps, PFLayer::ECAL_ENDCAP, PFEGammaAlgo::ProtoEGObject::ecalclusters, Exception, spr::find(), edm::Ptr< T >::get(), PFClusterWidthAlgo::pflowEtaWidth(), PFClusterWidthAlgo::pflowPhiWidth(), RecoTauValidation_cfi::posX, RecoTauValidation_cfi::posY, reco::SuperCluster::preshowerClustersBegin(), reco::SuperCluster::preshowerClustersEnd(), reco::SuperCluster::rawEnergy(), reco::CaloCluster::setCorrectedEnergy(), reco::SuperCluster::setEtaWidth(), reco::SuperCluster::setPhiWidth(), reco::SuperCluster::setPreshowerEnergy(), reco::SuperCluster::setPreshowerEnergyPlane1(), reco::SuperCluster::setPreshowerEnergyPlane2(), reco::SuperCluster::setSeed(), and thePFEnergyCalibration_.
Referenced by fillPFCandidates().
◆ calculateEleMVA()
Definition at line 1604 of file PFEGammaAlgo.cc.
1605 if (ro.primaryGSFs.empty()) {
1608 const PFGSFElement* gsfElement = ro.primaryGSFs.front();
1610 if (!ro.primaryKFs.empty()) {
1611 kfElement = ro.primaryKFs.front();
1613 auto const& refGsf = gsfElement->GsftrackRef();
1615 constexpr
float mEl = 0.000511;
1616 const double eInGsf = std::hypot(refGsf->pMode(), mEl);
1617 double dEtGsfEcal = 1e6;
1619 const double eneHcalGsf =
1620 std::accumulate(ro.hcalClusters.begin(), ro.hcalClusters.end(), 0.0, [](
const double a,
auto const&
b) {
1621 return a +
b->clusterRef()->energy();
1623 if (!ro.primaryKFs.empty()) {
1624 refKf = ro.primaryKFs.front()->trackRef();
1626 const double eOutGsf = gsfElement->Pout().t();
1627 const double etaOutGsf = gsfElement->positionAtECALEntrance().eta();
1628 double firstEcalGsfEnergy{0.0};
1629 double otherEcalGsfEnergy{0.0};
1630 double ecalBremEnergy{0.0};
1632 std::vector<const reco::PFCluster*> gsfCluster;
1633 for (
const auto&
ecal : ro.ecalclusters) {
1634 const double cenergy =
ecal->clusterRef()->correctedEnergy();
1635 bool hasgsf = ro.localMap.contains(gsfElement,
ecal.get());
1636 bool haskf = ro.localMap.contains(kfElement,
ecal.get());
1637 bool hasbrem =
false;
1638 for (
const auto& brem : ro.brems) {
1639 if (ro.localMap.contains(brem,
ecal.get())) {
1643 if (hasbrem &&
ecal.get() != ro.electronClusters[0]) {
1644 ecalBremEnergy += cenergy;
1646 if (!hasbrem &&
ecal.get() != ro.electronClusters[0]) {
1648 otherEcalGsfEnergy += cenergy;
1650 ecalBremEnergy += cenergy;
1651 if (!(hasgsf || haskf))
1652 otherEcalGsfEnergy += cenergy;
1656 if (ro.electronClusters[0]) {
1659 firstEcalGsfEnergy = cref->correctedEnergy();
1660 dEtGsfEcal = cref->positionREP().eta() - etaOutGsf;
1661 gsfCluster.push_back(cref.
get());
1667 float firstBrem{-1.0f};
1668 float earlyBrem{-1.0f};
1669 float lateBrem{-1.0f};
1670 if (ro.nBremsWithClusters > 0) {
1671 firstBrem = ro.firstBrem;
1672 earlyBrem = ro.firstBrem < 4 ? 1.0f : 0.0f;
1673 lateBrem = ro.lateBrem == 1 ? 1.0f : 0.0f;
1677 if (firstEcalGsfEnergy > 0.0) {
1678 if (refGsf.isNonnull()) {
1681 const float ptGsf = refGsf->ptMode();
1682 const float etaGsf = refGsf->etaMode();
1684 const double ptModeErrorGsf = refGsf->ptModeError();
1685 float ptModeErrOverPtGsf = (ptModeErrorGsf > 0. ? ptModeErrorGsf / ptGsf : 1.0);
1686 float chi2Gsf = refGsf->normalizedChi2();
1687 float dPtOverPtGsf = (ptGsf - gsfElement->Pout().pt()) / ptGsf;
1689 float nHitKf = refKf.
isNonnull() ? refKf->hitPattern().trackerLayersWithMeasurement() : 0;
1690 float chi2Kf = refKf.
isNonnull() ? refKf->normalizedChi2() : -0.01;
1693 float eTotPinMode = (firstEcalGsfEnergy + otherEcalGsfEnergy + ecalBremEnergy) / eInGsf;
1694 float eGsfPoutMode = firstEcalGsfEnergy / eOutGsf;
1695 float eTotBremPinPoutMode = (ecalBremEnergy + otherEcalGsfEnergy) / (eInGsf - eOutGsf);
1696 float dEtaGsfEcalClust =
std::abs(dEtGsfEcal);
1698 float hOverHe = eneHcalGsf / (eneHcalGsf + firstEcalGsfEnergy);
1705 dPtOverPtGsf = std::clamp(dPtOverPtGsf, -0.2
f, 1.0
f);
1706 ptModeErrOverPtGsf =
std::min(ptModeErrOverPtGsf, 0.3
f);
1709 eTotPinMode = std::clamp(eTotPinMode, 0.0
f, 5.0
f);
1710 eGsfPoutMode = std::clamp(eGsfPoutMode, 0.0
f, 5.0
f);
1711 eTotBremPinPoutMode = std::clamp(eTotBremPinPoutMode, 0.0
f, 5.0
f);
1712 dEtaGsfEcalClust =
std::min(dEtaGsfEcalClust, 0.1
f);
1713 logSigmaEtaEta =
std::max(logSigmaEtaEta, -14.0
f);
1755 eTotBremPinPoutMode,
References _currentblock, a, funct::abs(), b, PFEGammaAlgo::ProtoEGObject::brems, CommutativePairs< T >::contains(), MillePedeFileConverter_cfg::e, PFEGammaAlgo::ProtoEGObject::ecalclusters, PFEGammaAlgo::GBRForests::ele_, PFEGammaAlgo::ProtoEGObject::electronClusters, f, PFEGammaAlgo::ProtoEGObject::firstBrem, gbrForests_, edm::Ref< C, T, F >::get(), reco::PFBlockElementGsfTrack::GsftrackRef(), PFEGammaAlgo::ProtoEGObject::hcalClusters, edm::Ref< C, T, F >::isNonnull(), PFEGammaAlgo::ProtoEGObject::lateBrem, PFEGammaAlgo::ProtoEGObject::localMap, dqm-mbProfile::log, SiStripPI::max, min(), PFEGammaAlgo::ProtoEGObject::nBremsWithClusters, PFClusterWidthAlgo::pflowSigmaEtaEta(), reco::PFBlockElementGsfTrack::positionAtECALEntrance(), reco::PFBlockElementGsfTrack::Pout(), PFEGammaAlgo::ProtoEGObject::primaryGSFs, PFEGammaAlgo::ProtoEGObject::primaryKFs, reco::PFCandidateEGammaExtra::setDeltaEta(), reco::PFCandidateEGammaExtra::setEarlyBrem(), reco::PFCandidateEGammaExtra::setGsfElectronClusterRef(), reco::PFCandidateEGammaExtra::setGsfTrackPout(), reco::PFCandidateEGammaExtra::setHadEnergy(), reco::PFCandidateEGammaExtra::setLateBrem(), reco::PFCandidateEGammaExtra::setSigmaEtaEta(), and electronIdCutBasedExt_cfi::sigmaEtaEta.
Referenced by fillPFCandidates().
◆ dumpCurrentRefinableObjects()
void PFEGammaAlgo::dumpCurrentRefinableObjects |
( |
| ) |
const |
|
private |
Definition at line 932 of file PFEGammaAlgo.cc.
936 <<
"Dumping " << refinableObjects.size() <<
" refinable objects for this block: " << std::endl;
937 for (
const auto& ro : refinableObjects) {
938 std::stringstream
info;
939 info <<
"Refinable Object:" << std::endl;
941 info <<
"\tSuperCluster element attached to object:" << std::endl <<
'\t';
942 ro.parentSC->Dump(
info,
"\t");
945 if (ro.electronSeed.isNonnull()) {
946 info <<
"\tGSF element attached to object:" << std::endl;
947 ro.primaryGSFs.front()->Dump(
info,
"\t");
949 info <<
"firstBrem : " << ro.firstBrem <<
" lateBrem : " << ro.lateBrem
950 <<
" nBrems with cluster : " << ro.nBremsWithClusters << std::endl;
952 if (ro.electronClusters.size() && ro.electronClusters[0]) {
953 info <<
"electron cluster : ";
954 ro.electronClusters[0]->Dump(
info,
"\t");
957 info <<
" no electron cluster." << std::endl;
960 if (ro.primaryKFs.size()) {
961 info <<
"\tPrimary KF tracks attached to object: " << std::endl;
962 for (
const auto& kf : ro.primaryKFs) {
963 kf->Dump(
info,
"\t");
967 if (ro.secondaryKFs.size()) {
968 info <<
"\tSecondary KF tracks attached to object: " << std::endl;
969 for (
const auto& kf : ro.secondaryKFs) {
970 kf->Dump(
info,
"\t");
974 if (ro.brems.size()) {
975 info <<
"\tBrem tangents attached to object: " << std::endl;
976 for (
const auto& brem : ro.brems) {
977 brem->Dump(
info,
"\t");
981 if (ro.ecalclusters.size()) {
982 info <<
"\tECAL clusters attached to object: " << std::endl;
983 for (
const auto& clus : ro.ecalclusters) {
984 clus->Dump(
info,
"\t");
986 if (ro.ecal2ps.find(clus) != ro.ecal2ps.end()) {
987 for (
const auto& psclus : ro.ecal2ps.at(clus)) {
988 info <<
"\t\t Attached PS Cluster: ";
989 psclus->Dump(
info,
"");
References info().
Referenced by operator()().
◆ evaluateSingleLegMVA()
Definition at line 460 of file PFEGammaAlgo.cc.
468 const float chi2 =
elements[trackIndex].trackRef()->chi2() /
elements[trackIndex].trackRef()->ndof();
469 const float nlost =
elements[trackIndex].trackRef()->missingInnerHits();
470 const float nLayers =
elements[trackIndex].trackRef()->hitPattern().trackerLayersWithMeasurement();
472 const float stip =
elements[trackIndex].trackRefPF()->STIP();
476 std::multimap<double, unsigned int> ecalAssoTrack;
477 block.associatedElements(
479 std::multimap<double, unsigned int> hcalAssoTrack;
480 block.associatedElements(
482 if (!ecalAssoTrack.empty()) {
483 for (
auto& itecal : ecalAssoTrack) {
484 linkedE = linkedE +
elements[itecal.second].clusterRef()->energy();
487 if (!hcalAssoTrack.empty()) {
488 for (
auto& ithcal : hcalAssoTrack) {
489 linkedH = linkedH +
elements[ithcal.second].clusterRef()->energy();
492 const float eOverPt = linkedE /
elements[trackIndex].trackRef()->pt();
493 const float hOverPt = linkedH /
elements[trackIndex].trackRef()->pt();
495 elements[trackIndex].trackRef()->innerPosition().Y() - primaryVtx.
y(),
496 elements[trackIndex].trackRef()->innerPosition().Z() - primaryVtx.
z());
497 double vtxPhi = rvtx.
phi();
References groupFilesInBlocks::block, hltPixelTracks_cff::chi2, delPhi(), SiPixelRawToDigiRegional_cfi::deltaPhi, reco::PFBlockElement::ECAL, bookConverter::elements, gbrForests_, reco::PFBlockElement::HCAL, reco::PFBlock::LINKTEST_ALL, MuonTCMETValueMapProducer_cff::nLayers, PV3DBase< T, PVType, FrameType >::phi(), VtxSmearedParameters_cfi::Phi, PFEGammaAlgo::GBRForests::singleLeg_, listHistos::trackPt, X, reco::Vertex::x(), reco::Vertex::y(), and reco::Vertex::z().
Referenced by fillPFCandidates(), and linkRefinableObjectECALToSingleLegConv().
◆ fillExtraInfo()
Definition at line 1768 of file PFEGammaAlgo.cc.
1773 for (
auto&
ecal : RO.ecalclusters) {
1774 NotCloserToOther<reco::PFBlockElement::ECAL, reco::PFBlockElement::TRACK, true> ECALToTracks(
_currentblock,
1776 auto notmatchedkf = std::partition(KFbegin, KFend, ECALToTracks);
1777 auto notconvkf = std::partition(KFbegin, notmatchedkf, [](
auto const&
x) {
return x->trackType(ConvType); });
1779 for (
auto kf = notconvkf; kf != notmatchedkf; ++kf) {
References _currentblock, _splayedblock, reco::PFCandidateEGammaExtra::addExtraNonConvTrack(), docast, PFEGammaAlgo::ProtoEGObject::ecalclusters, reco::PFBlockElement::TRACK, and x.
Referenced by fillPFCandidates().
◆ fillPFCandidates()
Definition at line 1469 of file PFEGammaAlgo.cc.
1473 output.candidates.reserve(ROs.size());
1474 output.candidateExtras.reserve(ROs.size());
1475 output.refinedSuperClusters.reserve(ROs.size());
1477 for (
auto& RO : ROs) {
1483 if (!RO.primaryGSFs.empty() || !RO.primaryKFs.empty()) {
1488 if (!RO.primaryKFs.empty()) {
1489 cand.setCharge(RO.primaryKFs[0]->trackRef()->charge());
1491 cand.setTrackRef(RO.primaryKFs[0]->trackRef());
1492 cand.setVertex(RO.primaryKFs[0]->trackRef()->vertex());
1495 if (!RO.primaryGSFs.empty()) {
1496 cand.setCharge(RO.primaryGSFs[0]->GsftrackRef()->chargeMode());
1498 cand.setGsfTrackRef(RO.primaryGSFs[0]->GsftrackRef());
1499 cand.setVertex(RO.primaryGSFs[0]->GsftrackRef()->vertex());
1505 cand.setSuperClusterRef(RO.parentSC->superClusterRef());
1510 for (
const auto& brem : RO.brems) {
1514 for (
const auto&
ecal : RO.ecalclusters) {
1517 if (RO.ecal2ps.count(clus)) {
1518 for (
auto& psclus : RO.ecal2ps.at(clus)) {
1524 for (
const auto& kf : RO.secondaryKFs) {
1527 bool no_conv_ref =
true;
1528 for (
const auto& convref : convrefs) {
1529 if (convref.isNonnull() && convref.isAvailable()) {
1531 no_conv_ref =
false;
1538 const auto& mvavalmapped = RO.singleLegConversionMvaMap.find(kf);
1541 float mvaval = (mvavalmapped != RO.singleLegConversionMvaMap.end()
1542 ? mvavalmapped->second
1553 float trkTime = 0, trkTimeErr = -1;
1554 if (!RO.primaryGSFs.empty() && RO.primaryGSFs[0]->isTimeValid()) {
1555 trkTime = RO.primaryGSFs[0]->time();
1556 trkTimeErr = RO.primaryGSFs[0]->timeError();
1557 }
else if (!RO.primaryKFs.empty() && RO.primaryKFs[0]->isTimeValid()) {
1558 trkTime = RO.primaryKFs[0]->time();
1559 trkTimeErr = RO.primaryKFs[0]->timeError();
1561 if (trkTimeErr >= 0) {
1562 cand.setTime(trkTime, trkTimeErr);
1570 const double scE = the_sc.
energy();
1574 egDir = egDir.Unit();
1577 cand.setPositionAtECALEntrance(ecalPOS_f);
1584 cand.setPositionAtECALEntrance(
gsf->positionAtECALEntrance());
1590 cand.setPositionAtECALEntrance(kf->positionAtECALEntrance());
1595 xtra.
setMVA(eleMVAValue);
1596 cand.set_mva_e_pi(eleMVAValue);
1598 output.candidateExtras.push_back(xtra);
References _currentblock, reco::PFCandidateEGammaExtra::addConversionRef(), reco::PFCandidateEGammaExtra::addSingleLegConvTrackRefMva(), buildRefinedSuperCluster(), calculateEleMVA(), cfg_, reco::CaloCluster::energy(), evaluateSingleLegMVA(), fillExtraInfo(), ntupleEnum::gsf, reco::PFBlockElement::index(), edm::Ref< C, T, F >::index(), convertSQLitetoXML_cfg::output, p4, reco::Vertex::position(), reco::CaloCluster::position(), reco::PFBlockElementTrack::positionAtECALEntrance(), primaryVertex_, PFEGammaAlgo::PFEGConfigInfo::produceEGCandsWithNoSuperCluster, reco::SuperCluster::rawEnergy(), reco::SuperCluster::seed(), reco::PFCandidateEGammaExtra::setGsfTrackRef(), reco::PFCandidateEGammaExtra::setKfTrackRef(), reco::PFCandidateEGammaExtra::setMVA(), reco::PFCandidateEGammaExtra::setSuperClusterPFECALRef(), and reco::PFCandidateEGammaExtra::setSuperClusterRef().
Referenced by operator()().
◆ initializeProtoCands()
void PFEGammaAlgo::initializeProtoCands |
( |
std::list< ProtoEGObject > & |
| ) |
|
|
private |
Definition at line 656 of file PFEGammaAlgo.cc.
661 LOGDRESSED(
"PFEGammaAlgo") <<
"creating SC-based proto-object" << std::endl
662 <<
"\tSC at index: " << element->index() <<
" has type: " << element->type()
664 element.setFlag(
false);
665 ProtoEGObject fromSC;
666 fromSC.nBremsWithClusters = -1;
667 fromSC.firstBrem = -1;
668 fromSC.lateBrem = -1;
672 bool sc_success =
unwrapSuperCluster(fromSC.parentSC, fromSC.ecalclusters, fromSC.ecal2ps);
687 egobjs.insert(egobjs.end(), fromSC);
695 LOGDRESSED(
"PFEGammaAlgo") <<
"creating GSF-based proto-object" << std::endl
696 <<
"\tGSF at index: " << element->index() <<
" has type: " << element->type()
702 element.setFlag(
false);
704 ProtoEGObject fromGSF;
705 fromGSF.nBremsWithClusters = -1;
706 fromGSF.firstBrem = -1;
707 fromGSF.lateBrem = 0;
708 gsfref_forextra = elementAsGSF->GsftrackRef();
712 fromGSF.electronSeed = theseedref;
714 if (fromGSF.electronSeed.isNull() || !fromGSF.electronSeed.isAvailable()) {
715 std::stringstream gsf_err;
716 elementAsGSF->Dump(gsf_err,
"\t");
718 <<
"Found a GSF track with no seed! This should not happen!" << std::endl
719 << gsf_err.str() << std::endl;
723 element.setFlag(
false);
725 fromGSF.primaryGSFs.push_back(elementAsGSF);
730 if (dist == 0.001
f) {
732 fromGSF.brems.push_back(eAsBrem);
733 fromGSF.localMap.insert(eAsBrem, elementAsGSF);
740 if (fromGSF.electronSeed->isEcalDriven()) {
743 LOGDRESSED(
"PFEGammaAlgo") <<
"GSF-based proto-object is ECAL driven, merging SC-cand" << std::endl;
744 LOGVERB(
"PFEGammaAlgo") <<
"ECAL Seed Ptr: " << fromGSF.electronSeed.get()
745 <<
" isAvailable: " << fromGSF.electronSeed.isAvailable()
746 <<
" isNonnull: " << fromGSF.electronSeed.isNonnull() << std::endl;
747 SeedMatchesToProtoObject sctoseedmatch(fromGSF.electronSeed);
748 auto objsbegin = egobjs.begin();
749 auto objsend = egobjs.end();
751 auto clusmatch = std::find_if(objsbegin, objsend, sctoseedmatch);
752 if (clusmatch != objsend) {
753 fromGSF.parentSC = clusmatch->parentSC;
754 fromGSF.ecalclusters =
std::move(clusmatch->ecalclusters);
755 fromGSF.ecal2ps =
std::move(clusmatch->ecal2ps);
756 egobjs.erase(clusmatch);
757 }
else if (fromGSF.electronSeed.isAvailable() && fromGSF.electronSeed.isNonnull()) {
761 LOGDRESSED(
"PFEGammaAlgo") <<
"Encountered the known GSF-SC splitting bug "
762 <<
" in PFBlockAlgo! We should really fix this!" << std::endl;
764 std::stringstream gsf_err;
765 elementAsGSF->Dump(gsf_err,
"\t");
767 <<
"Expected SuperCluster from ECAL driven GSF seed "
768 <<
"was not found in the block!" << std::endl
769 << gsf_err.str() << std::endl;
773 egobjs.insert(egobjs.end(), fromGSF);
References _currentblock, _currentlinks, _splayedblock, PFEGammaAlgo::ProtoEGObject::brems, docast, reco::PFBlockElementGsfTrack::Dump(), PFEGammaAlgo::ProtoEGObject::ecal2ps, PFEGammaAlgo::ProtoEGObject::ecalclusters, PFEGammaAlgo::ProtoEGObject::electronSeed, Exception, f, PFEGammaAlgo::ProtoEGObject::firstBrem, edm::Ref< C, T, F >::get(), reco::PFBlockElementGsfTrack::GsftrackRef(), reco::PFBlockElement::index(), CommutativePairs< T >::insert(), edm::Ref< C, T, F >::isAvailable(), edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::isNull(), PFEGammaAlgo::ProtoEGObject::lateBrem, reco::PFBlock::LINKTEST_ALL, PFEGammaAlgo::ProtoEGObject::localMap, LOGDRESSED, LOGVERB, eostools::move(), PFEGammaAlgo::ProtoEGObject::nBremsWithClusters, PFEGammaAlgo::ProtoEGObject::parentBlock, PFEGammaAlgo::ProtoEGObject::parentSC, PFEGammaAlgo::ProtoEGObject::primaryGSFs, reco::PFBlockElement::T_FROM_GAMMACONV, reco::PFBlockElementGsfTrack::trackType(), and unwrapSuperCluster().
Referenced by operator()().
◆ isMuon()
◆ isPrimaryTrack()
◆ linkKFTrackToECAL()
Definition at line 1296 of file PFEGammaAlgo.cc.
1297 std::vector<FlaggedPtr<const PFClusterElement>>& currentECAL = RO.ecalclusters;
1300 NotCloserToOther<reco::PFBlockElement::TRACK, reco::PFBlockElement::ECAL> kfTrackToECALs(
_currentblock, kfflagged);
1301 NotCloserToOther<reco::PFBlockElement::GSF, reco::PFBlockElement::ECAL> kfTrackGSFToECALs(
_currentblock, kfflagged);
1303 auto notmatched_sc = std::partition(currentECAL.begin(), currentECAL.end(), kfTrackToECALs);
1305 notmatched_sc = std::partition(currentECAL.begin(), notmatched_sc, kfTrackGSFToECALs);
1306 for (
auto ecalitr = currentECAL.begin(); ecalitr != notmatched_sc; ++ecalitr) {
1310 LOGDRESSED(
"PFEGammaAlgo::linkKFTracktoECAL()") <<
"Found a cluster already in RO by KF extrapolation"
1311 <<
" at ECAL surface!" << std::endl
1312 << *elemascluster << std::endl;
1313 RO.localMap.insert(elemascluster, kfflagged);
1316 auto notmatched_blk = std::partition(ECALbegin, ECALend, kfTrackToECALs);
1318 notmatched_blk = std::partition(ECALbegin, notmatched_blk, kfTrackGSFToECALs);
1319 for (
auto ecalitr = ECALbegin; ecalitr != notmatched_blk; ++ecalitr) {
1321 if (addPFClusterToROSafe(elemascluster, RO)) {
1323 ecalitr->setFlag(
false);
1325 LOGDRESSED(
"PFEGammaAlgo::linkKFTracktoECAL()") <<
"Found a cluster not in RO by KF extrapolation"
1326 <<
" at ECAL surface!" << std::endl
1327 << *elemascluster << std::endl;
1328 RO.localMap.insert(elemascluster, kfflagged);
References _currentblock, _splayedblock, attachPSClusters(), docast, reco::PFBlockElement::ECAL, PFEGammaAlgo::ProtoEGObject::ecal2ps, PFEGammaAlgo::ProtoEGObject::ecalclusters, CommutativePairs< T >::insert(), PFEGammaAlgo::ProtoEGObject::localMap, and LOGDRESSED.
Referenced by linkRefinableObjectKFTracksToECAL().
◆ linkRefinableObjectBremTangentsToECAL()
void PFEGammaAlgo::linkRefinableObjectBremTangentsToECAL |
( |
ProtoEGObject & |
RO | ) |
|
|
private |
Definition at line 1333 of file PFEGammaAlgo.cc.
1334 if (RO.brems.empty())
1338 int lastBremTrajPos = -1;
1339 for (
auto& brem : RO.brems) {
1340 bool has_clusters =
false;
1341 TrajPos = (brem->indTrajPoint()) - 2;
1344 NotCloserToOther<reco::PFBlockElement::BREM, reco::PFBlockElement::ECAL> BremToECALs(
_currentblock, brem);
1346 auto RSCBegin = RO.ecalclusters.begin();
1347 auto RSCEnd = RO.ecalclusters.end();
1348 auto notmatched_rsc = std::partition(RSCBegin, RSCEnd, BremToECALs);
1349 for (
auto ecal = RSCBegin;
ecal != notmatched_rsc; ++
ecal) {
1350 float deta =
std::abs((*ecal)->clusterRef()->positionREP().eta() - brem->positionAtECALEntrance().eta());
1352 has_clusters =
true;
1353 if (lastBremTrajPos == -1 || lastBremTrajPos < TrajPos) {
1354 lastBremTrajPos = TrajPos;
1356 if (FirstBrem == -1 || TrajPos < FirstBrem) {
1357 FirstBrem = TrajPos;
1358 RO.firstBrem = TrajPos;
1360 LOGDRESSED(
"PFEGammaAlgo::linkBremToECAL()") <<
"Found a cluster already in SC linked to brem extrapolation"
1361 <<
" at ECAL surface!" << std::endl;
1362 RO.localMap.insert(
ecal->get(), brem);
1366 auto notmatched_block = std::partition(ECALbegin, ECALend, BremToECALs);
1367 for (
auto ecal = ECALbegin;
ecal != notmatched_block; ++
ecal) {
1368 float deta =
std::abs((*ecal)->clusterRef()->positionREP().eta() - brem->positionAtECALEntrance().eta());
1370 has_clusters =
true;
1371 if (lastBremTrajPos == -1 || lastBremTrajPos < TrajPos) {
1372 lastBremTrajPos = TrajPos;
1374 if (FirstBrem == -1 || TrajPos < FirstBrem) {
1376 FirstBrem = TrajPos;
1377 RO.firstBrem = TrajPos;
1380 if (addPFClusterToROSafe(elemasclus, RO)) {
1383 RO.localMap.insert(
ecal->get(), brem);
1384 ecal->setFlag(
false);
1385 LOGDRESSED(
"PFEGammaAlgo::linkBremToECAL()") <<
"Found a cluster not already associated by brem extrapolation"
1386 <<
" at ECAL surface!" << std::endl;
1391 if (RO.nBremsWithClusters == -1)
1392 RO.nBremsWithClusters = 0;
1393 ++RO.nBremsWithClusters;
References _currentblock, _splayedblock, funct::abs(), attachPSClusters(), PFEGammaAlgo::ProtoEGObject::brems, docast, bsc_activity_cfg::ecal, reco::PFBlockElement::ECAL, PFEGammaAlgo::ProtoEGObject::ecal2ps, PFEGammaAlgo::ProtoEGObject::ecalclusters, PFEGammaAlgo::ProtoEGObject::firstBrem, CommutativePairs< T >::insert(), PFEGammaAlgo::ProtoEGObject::localMap, LOGDRESSED, and PFEGammaAlgo::ProtoEGObject::nBremsWithClusters.
Referenced by operator()().
◆ linkRefinableObjectConvSecondaryKFsToSecondaryKFs()
void PFEGammaAlgo::linkRefinableObjectConvSecondaryKFsToSecondaryKFs |
( |
ProtoEGObject & |
RO | ) |
|
|
private |
Definition at line 1398 of file PFEGammaAlgo.cc.
1401 auto BeginROskfs = RO.secondaryKFs.begin();
1402 auto EndROskfs = RO.secondaryKFs.end();
1403 auto ronotconv = std::partition(BeginROskfs, EndROskfs, [](
auto const&
x) {
return x->trackType(ConvType); });
1405 for (
size_t idx = 0;
idx < convkfs_end; ++
idx) {
1406 auto const& secKFs =
1408 NotCloserToOther<reco::PFBlockElement::TRACK, reco::PFBlockElement::TRACK, true> TracksToTracks(
_currentblock,
1410 auto notmatched = std::partition(KFbegin, KFend, TracksToTracks);
1411 notmatched = std::partition(KFbegin, notmatched, [](
auto const&
x) {
return x->trackType(ConvType); });
1412 for (
auto kf = KFbegin; kf != notmatched; ++kf) {
1414 RO.secondaryKFs.push_back(elemaskf);
1415 RO.localMap.insert(secKFs[
idx], kf->get());
References _currentblock, _splayedblock, HLT_FULL_cff::distance, docast, heavyIonCSV_trainingSettings::idx, CommutativePairs< T >::insert(), PFEGammaAlgo::ProtoEGObject::localMap, PFEGammaAlgo::ProtoEGObject::secondaryKFs, reco::PFBlockElement::TRACK, and x.
Referenced by operator()().
◆ linkRefinableObjectECALToSingleLegConv()
void PFEGammaAlgo::linkRefinableObjectECALToSingleLegConv |
( |
ProtoEGObject & |
RO | ) |
|
|
private |
Definition at line 1421 of file PFEGammaAlgo.cc.
1424 for (
auto&
ecal : RO.ecalclusters) {
1425 NotCloserToOther<reco::PFBlockElement::ECAL, reco::PFBlockElement::TRACK, true> ECALToTracks(
_currentblock,
1427 auto notmatchedkf = std::partition(KFbegin, KFend, ECALToTracks);
1428 auto notconvkf = std::partition(KFbegin, notmatchedkf, [](
auto const&
x) {
return x->trackType(ConvType); });
1430 for (
auto kf = KFbegin; kf != notconvkf; ++kf) {
1432 RO.secondaryKFs.push_back(elemaskf);
1433 RO.localMap.insert(
ecal.get(), elemaskf);
1437 for (
auto kf = notconvkf; kf != notmatchedkf; ++kf) {
1441 RO.secondaryKFs.push_back(elemaskf);
1442 RO.localMap.insert(
ecal.get(), elemaskf);
1445 RO.singleLegConversionMvaMap.emplace(elemaskf, mvaval);
References _currentblock, _splayedblock, cfg_, docast, PFEGammaAlgo::ProtoEGObject::ecalclusters, evaluateSingleLegMVA(), CommutativePairs< T >::insert(), PFEGammaAlgo::ProtoEGObject::localMap, PFEGammaAlgo::PFEGConfigInfo::mvaConvCut, primaryVertex_, PFEGammaAlgo::ProtoEGObject::secondaryKFs, PFEGammaAlgo::ProtoEGObject::singleLegConversionMvaMap, reco::PFBlockElement::TRACK, and x.
Referenced by operator()().
◆ linkRefinableObjectGSFTracksToKFs()
void PFEGammaAlgo::linkRefinableObjectGSFTracksToKFs |
( |
ProtoEGObject & |
RO | ) |
|
|
private |
Definition at line 1160 of file PFEGammaAlgo.cc.
1166 for (
auto& gsfflagged : RO.primaryGSFs) {
1169 if (RO.electronSeed.isNull() || seedtk->trackType(convType))
1171 NotCloserToOther<reco::PFBlockElement::GSF, reco::PFBlockElement::TRACK> gsfTrackToKFs(
_currentblock, seedtk);
1173 auto notlinked = std::partition(KFbegin, KFend, gsfTrackToKFs);
1175 for (
auto kft = KFbegin; kft != notlinked; ++kft) {
1179 if (
isPrimaryTrack(*elemaskf, *seedtk) && !elemaskf->trackType(convType)) {
1180 kft->setFlag(
false);
1181 RO.primaryKFs.push_back(elemaskf);
1182 RO.localMap.insert(seedtk, elemaskf);
1183 }
else if (elemaskf->trackType(convType)) {
1184 kft->setFlag(
false);
1185 RO.secondaryKFs.push_back(elemaskf);
1186 RO.localMap.insert(seedtk, elemaskf);
References _currentblock, _splayedblock, docast, PFEGammaAlgo::ProtoEGObject::electronSeed, relativeConstraints::empty, CommutativePairs< T >::insert(), edm::Ref< C, T, F >::isNull(), isPrimaryTrack(), PFEGammaAlgo::ProtoEGObject::localMap, PFEGammaAlgo::ProtoEGObject::primaryGSFs, PFEGammaAlgo::ProtoEGObject::primaryKFs, PFEGammaAlgo::ProtoEGObject::secondaryKFs, reco::PFBlockElement::T_FROM_GAMMACONV, reco::PFBlockElement::TRACK, reco::PFBlockElementTrack::trackType(), and reco::PFBlockElementGsfTrack::trackType().
Referenced by operator()().
◆ linkRefinableObjectKFTracksToECAL()
void PFEGammaAlgo::linkRefinableObjectKFTracksToECAL |
( |
ProtoEGObject & |
RO | ) |
|
|
private |
◆ linkRefinableObjectPrimaryGSFTrackToECAL()
void PFEGammaAlgo::linkRefinableObjectPrimaryGSFTrackToECAL |
( |
ProtoEGObject & |
RO | ) |
|
|
private |
Definition at line 1223 of file PFEGammaAlgo.cc.
1225 RO.electronClusters.push_back(
nullptr);
1230 for (
auto& primgsf : RO.primaryGSFs) {
1231 NotCloserToOther<reco::PFBlockElement::GSF, reco::PFBlockElement::ECAL> gsfTracksToECALs(
_currentblock, primgsf);
1233 auto notmatched_blk = std::partition(ECALbegin, ECALend, gsfTracksToECALs);
1235 std::partition(ECALbegin, notmatched_blk, [&primgsf](
auto const&
x) {
return compatibleEoPOut(*
x, *primgsf); });
1237 auto notmatched_sc = std::partition(RO.ecalclusters.begin(), RO.ecalclusters.end(), gsfTracksToECALs);
1238 notmatched_sc = std::partition(
1239 RO.ecalclusters.begin(), notmatched_sc, [&primgsf](
auto const&
x) {
return compatibleEoPOut(*
x, *primgsf); });
1241 for (
auto ecal = RO.ecalclusters.begin();
ecal != notmatched_sc; ++
ecal) {
1244 LOGDRESSED(
"PFEGammaAlgo::linkGSFTracktoECAL()") <<
"Found a cluster already in RO by GSF extrapolation"
1245 <<
" at ECAL surface!" << std::endl
1246 << *elemascluster << std::endl;
1248 RO.localMap.insert(primgsf,
temp.get());
1251 for (
auto ecal = ECALbegin;
ecal != notmatched_blk; ++
ecal) {
1253 LOGDRESSED(
"PFEGammaAlgo::linkGSFTracktoECAL()") <<
"Found a cluster not already in RO by GSF extrapolation"
1254 <<
" at ECAL surface!" << std::endl
1255 << *elemascluster << std::endl;
1256 if (addPFClusterToROSafe(elemascluster, RO)) {
1258 RO.localMap.insert(primgsf, elemascluster);
1259 ecal->setFlag(
false);
References _currentblock, _splayedblock, attachPSClusters(), docast, bsc_activity_cfg::ecal, reco::PFBlockElement::ECAL, PFEGammaAlgo::ProtoEGObject::ecal2ps, PFEGammaAlgo::ProtoEGObject::ecalclusters, PFEGammaAlgo::ProtoEGObject::electronClusters, relativeConstraints::empty, CommutativePairs< T >::insert(), PFEGammaAlgo::ProtoEGObject::localMap, LOGDRESSED, PFEGammaAlgo::ProtoEGObject::primaryGSFs, groupFilesInBlocks::temp, and x.
Referenced by operator()().
◆ linkRefinableObjectPrimaryGSFTrackToHCAL()
void PFEGammaAlgo::linkRefinableObjectPrimaryGSFTrackToHCAL |
( |
ProtoEGObject & |
RO | ) |
|
|
private |
Definition at line 1266 of file PFEGammaAlgo.cc.
1271 for (
auto& primgsf : RO.primaryGSFs) {
1272 NotCloserToOther<reco::PFBlockElement::GSF, reco::PFBlockElement::HCAL> gsfTracksToHCALs(
_currentblock, primgsf);
1273 auto notmatched = std::partition(HCALbegin, HCALend, gsfTracksToHCALs);
1274 for (
auto hcal = HCALbegin;
hcal != notmatched; ++
hcal) {
1277 LOGDRESSED(
"PFEGammaAlgo::linkGSFTracktoECAL()")
1278 <<
"Found an HCAL cluster associated to GSF extrapolation" << std::endl;
1279 RO.hcalClusters.push_back(
temp.get());
1280 RO.localMap.insert(primgsf,
temp.get());
1281 hcal->setFlag(
false);
References _currentblock, _splayedblock, docast, relativeConstraints::empty, reco::PFBlockElement::HCAL, hltEgammaHLTExtra_cfi::hcal, PFEGammaAlgo::ProtoEGObject::hcalClusters, CommutativePairs< T >::insert(), PFEGammaAlgo::ProtoEGObject::localMap, LOGDRESSED, PFEGammaAlgo::ProtoEGObject::primaryGSFs, and groupFilesInBlocks::temp.
Referenced by operator()().
◆ linkRefinableObjectPrimaryKFsToSecondaryKFs()
void PFEGammaAlgo::linkRefinableObjectPrimaryKFsToSecondaryKFs |
( |
ProtoEGObject & |
RO | ) |
|
|
private |
Definition at line 1192 of file PFEGammaAlgo.cc.
1198 for (
auto& primkf : RO.primaryKFs) {
1200 if (primkf->trackType(convType)) {
1201 throw cms::Exception(
"PFEGammaAlgo::linkRefinableObjectPrimaryKFsToSecondaryKFs()")
1202 <<
"A KF track from conversion has been assigned as a primary!!" << std::endl;
1204 NotCloserToOther<reco::PFBlockElement::TRACK, reco::PFBlockElement::TRACK, true> kfTrackToKFs(
_currentblock,
1207 auto notlinked = std::partition(KFbegin, KFend, kfTrackToKFs);
1209 for (
auto kft = KFbegin; kft != notlinked; ++kft) {
1213 if (elemaskf->trackType(convType)) {
1214 kft->setFlag(
false);
1215 RO.secondaryKFs.push_back(elemaskf);
1216 RO.localMap.insert(primkf, elemaskf);
References _currentblock, _splayedblock, docast, relativeConstraints::empty, Exception, CommutativePairs< T >::insert(), PFEGammaAlgo::ProtoEGObject::localMap, PFEGammaAlgo::ProtoEGObject::primaryKFs, PFEGammaAlgo::ProtoEGObject::secondaryKFs, reco::PFBlockElement::T_FROM_GAMMACONV, reco::PFBlockElement::TRACK, and reco::PFBlockElementTrack::trackType().
Referenced by operator()().
◆ linkRefinableObjectSecondaryKFsToECAL()
void PFEGammaAlgo::linkRefinableObjectSecondaryKFsToECAL |
( |
ProtoEGObject & |
RO | ) |
|
|
private |
Definition at line 1451 of file PFEGammaAlgo.cc.
1454 for (
auto& skf : RO.secondaryKFs) {
1455 NotCloserToOther<reco::PFBlockElement::TRACK, reco::PFBlockElement::ECAL, false> TracksToECALwithCut(
1457 auto notmatched = std::partition(ECALbegin, ECALend, TracksToECALwithCut);
1458 for (
auto ecal = ECALbegin;
ecal != notmatched; ++
ecal) {
1460 if (addPFClusterToROSafe(elemascluster, RO)) {
1462 RO.localMap.insert(skf, elemascluster);
1463 ecal->setFlag(
false);
References _currentblock, _splayedblock, attachPSClusters(), docast, bsc_activity_cfg::ecal, reco::PFBlockElement::ECAL, PFEGammaAlgo::ProtoEGObject::ecal2ps, f, CommutativePairs< T >::insert(), PFEGammaAlgo::ProtoEGObject::localMap, and PFEGammaAlgo::ProtoEGObject::secondaryKFs.
Referenced by operator()().
◆ mergeROsByAnyLink()
void PFEGammaAlgo::mergeROsByAnyLink |
( |
std::list< ProtoEGObject > & |
| ) |
|
|
private |
Definition at line 1080 of file PFEGammaAlgo.cc.
1083 bool check_for_merge =
true;
1084 while (check_for_merge) {
1089 for (
auto it1 = ROs.begin(); it1 != ROs.end(); ++it1) {
1090 auto find_start = it1;
1092 auto has_merge = std::find_if(find_start, ROs.end(), std::bind(testIfROMergableByLink, _1, *it1));
1093 if (has_merge != ROs.end() && it1 != ROs.begin()) {
1098 ProtoEGObject& thefront = ROs.front();
1099 auto mergestart = ROs.begin();
1101 auto nomerge = std::partition(mergestart, ROs.end(), std::bind(testIfROMergableByLink, _1, thefront));
1102 if (nomerge != mergestart) {
1103 LOGDRESSED(
"PFEGammaAlgo::mergeROsByAnyLink()")
1104 <<
"Found objects " <<
std::distance(mergestart, nomerge) <<
" to merge by links to the front!" << std::endl;
1105 for (
auto roToMerge = mergestart; roToMerge != nomerge; ++roToMerge) {
1108 if (!thefront.ecalclusters.empty() && !roToMerge->ecalclusters.empty()) {
1109 if (thefront.ecalclusters.front()->clusterRef()->layer() !=
1110 roToMerge->ecalclusters.front()->clusterRef()->layer()) {
1111 LOGWARN(
"PFEGammaAlgo::mergeROsByAnyLink") <<
"Tried to merge EB and EE clusters! Skipping!";
1112 ROs.push_back(*roToMerge);
1117 thefront.ecalclusters.insert(
1118 thefront.ecalclusters.end(), roToMerge->ecalclusters.begin(), roToMerge->ecalclusters.end());
1119 thefront.ecal2ps.insert(roToMerge->ecal2ps.begin(), roToMerge->ecal2ps.end());
1120 thefront.secondaryKFs.insert(
1121 thefront.secondaryKFs.end(), roToMerge->secondaryKFs.begin(), roToMerge->secondaryKFs.end());
1123 thefront.localMap.concatenate(roToMerge->localMap);
1125 if (!thefront.parentSC && roToMerge->parentSC) {
1126 thefront.parentSC = roToMerge->parentSC;
1128 if (thefront.electronSeed.isNull() && roToMerge->electronSeed.isNonnull()) {
1129 thefront.electronSeed = roToMerge->electronSeed;
1130 thefront.primaryGSFs.insert(
1131 thefront.primaryGSFs.end(), roToMerge->primaryGSFs.begin(), roToMerge->primaryGSFs.end());
1132 thefront.primaryKFs.insert(
1133 thefront.primaryKFs.end(), roToMerge->primaryKFs.begin(), roToMerge->primaryKFs.end());
1134 thefront.brems.insert(thefront.brems.end(), roToMerge->brems.begin(), roToMerge->brems.end());
1135 thefront.electronClusters = roToMerge->electronClusters;
1136 thefront.nBremsWithClusters = roToMerge->nBremsWithClusters;
1137 thefront.firstBrem = roToMerge->firstBrem;
1138 thefront.lateBrem = roToMerge->lateBrem;
1139 }
else if (thefront.electronSeed.isNonnull() && roToMerge->electronSeed.isNonnull()) {
1140 LOGDRESSED(
"PFEGammaAlgo::mergeROsByAnyLink")
1141 <<
"Need to implement proper merging of two gsf candidates!" << std::endl;
1144 ROs.erase(mergestart, nomerge);
1146 ROs.push_back(ROs.front());
1149 check_for_merge =
false;
1152 LOGDRESSED(
"PFEGammaAlgo::mergeROsByAnyLink()")
1153 <<
"After merging by links there are: " << ROs.size() <<
" refinable EGamma objects!" << std::endl;
References PFEGammaAlgo::ProtoEGObject::brems, CommutativePairs< T >::concatenate(), HLT_FULL_cff::distance, PFEGammaAlgo::ProtoEGObject::ecal2ps, PFEGammaAlgo::ProtoEGObject::ecalclusters, PFEGammaAlgo::ProtoEGObject::electronClusters, PFEGammaAlgo::ProtoEGObject::electronSeed, PFEGammaAlgo::ProtoEGObject::firstBrem, edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::isNull(), PFEGammaAlgo::ProtoEGObject::lateBrem, PFEGammaAlgo::ProtoEGObject::localMap, LOGDRESSED, LOGWARN, PFEGammaAlgo::ProtoEGObject::nBremsWithClusters, PFEGammaAlgo::ProtoEGObject::parentSC, PFEGammaAlgo::ProtoEGObject::primaryGSFs, PFEGammaAlgo::ProtoEGObject::primaryKFs, PFEGammaAlgo::ProtoEGObject::secondaryKFs, and std::swap().
Referenced by operator()().
◆ operator()()
Definition at line 528 of file PFEGammaAlgo.cc.
529 LOGVERB(
"PFEGammaAlgo") <<
"Resetting PFEGammaAlgo for new block and running!" << std::endl;
537 std::list<ProtoEGObject> refinableObjects;
545 LOGVERB(
"PFEGammaAlgo") <<
"Splaying block" << std::endl;
552 const size_t itype = (size_t)pfelement.type();
560 std::stringstream splayout;
561 for (
size_t itype = 0; itype <
_splayedblock.size(); ++itype) {
562 splayout <<
"\tType: " << itype <<
" indices: ";
564 splayout << flaggedelement->index() <<
' ';
567 splayout << std::endl;
569 LOGVERB(
"PFEGammaAlgo") << splayout.str();
577 LOGDRESSED(
"PFEGammaAlgo") <<
"Initialized " << refinableObjects.size() <<
" proto-EGamma objects" << std::endl;
588 for (
auto& RO : refinableObjects) {
603 LOGDRESSED(
"PFEGammaAlgo") <<
"Dumping after GSF and KF Track (Primary) Linking : " << std::endl;
609 LOGDRESSED(
"PFEGammaAlgo") <<
"Dumping after first merging operation : " << std::endl;
615 for (
auto& RO : refinableObjects) {
625 LOGDRESSED(
"PFEGammaAlgo") <<
"Dumping after ECAL to Track (Secondary) Linking : " << std::endl;
631 LOGDRESSED(
"PFEGammaAlgo") <<
"There are " << refinableObjects.size() <<
" after the 2nd merging step." << std::endl;
635 for (
auto& RO : refinableObjects) {
642 std::sort(RO.ecalclusters.begin(), RO.ecalclusters.end(), [](
auto const&
a,
auto const&
b) {
643 return (
a->clusterRef()->correctedEnergy() >
b->clusterRef()->correctedEnergy());
645 setROElectronCluster(RO);
648 LOGDRESSED(
"PFEGammaAlgo") <<
"There are " << refinableObjects.size() <<
" after the unlinking and vetos step."
References _currentblock, _currentlinks, _splayedblock, a, b, reco::CaloCluster::badHcalMarker, groupFilesInBlocks::block, dumpCurrentRefinableObjects(), fillPFCandidates(), HCAL, initializeProtoCands(), isMuon(), linkRefinableObjectBremTangentsToECAL(), linkRefinableObjectConvSecondaryKFsToSecondaryKFs(), linkRefinableObjectECALToSingleLegConv(), linkRefinableObjectGSFTracksToKFs(), linkRefinableObjectKFTracksToECAL(), linkRefinableObjectPrimaryGSFTrackToECAL(), linkRefinableObjectPrimaryGSFTrackToHCAL(), linkRefinableObjectPrimaryKFsToSecondaryKFs(), linkRefinableObjectSecondaryKFsToECAL(), LOGDRESSED, LOGVERB, mergeROsByAnyLink(), removeOrLinkECALClustersToKFTracks(), jetUpdater_cfi::sort, unlinkRefinableObjectKFandECALMatchedToHCAL(), and unlinkRefinableObjectKFandECALWithBadEoverP().
◆ removeOrLinkECALClustersToKFTracks()
void PFEGammaAlgo::removeOrLinkECALClustersToKFTracks |
( |
| ) |
|
|
private |
Definition at line 1001 of file PFEGammaAlgo.cc.
1002 typedef std::multimap<double, unsigned> MatchedMap;
1006 MatchedMap matchedGSFs, matchedECALs;
1007 std::unordered_map<GsfTrackElementPtr, MatchedMap> gsf_ecal_cache;
1009 matchedGSFs.clear();
1012 if (matchedGSFs.empty()) {
1016 std::partial_sort(ecalbegin, ecalbegin + 1, ecalend, closestTrackToECAL);
1024 if (dist_sc != -1.0
f) {
1030 if (dist != -1.0
f && closestECAL.flag()) {
1031 bool gsflinked =
false;
1039 if (!gsf_ecal_cache.count(elemasgsf)) {
1040 matchedECALs.clear();
1046 gsf_ecal_cache.emplace(elemasgsf, matchedECALs);
1047 MatchedMap().swap(matchedECALs);
1049 const MatchedMap& ecal_matches = gsf_ecal_cache[elemasgsf];
1050 if (!ecal_matches.empty()) {
1051 if (ecal_matches.begin()->second == closestECAL->index()) {
1057 if (!gsflinked && !inSC) {
1062 const int nexhits = trackref->missingInnerHits();
1063 bool fromprimaryvertex =
false;
1066 fromprimaryvertex =
true;
1072 closestECAL.setFlag(
false);
References _currentblock, _currentlinks, _splayedblock, docast, reco::PFBlockElement::ECAL, relativeConstraints::empty, f, reco::PFBlockElement::GSF, reco::PFBlockElement::index(), PFTrackAlgoTools::isGoodForEGMPrimary(), reco::PFBlock::LINKTEST_ALL, primaryVertex_, reco::PFBlockElement::SC, reco::PFBlockElement::T_FROM_GAMMACONV, reco::PFBlockElement::TRACK, reco::PFBlockElementTrack::trackRef(), reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), and reco::PFBlockElementGsfTrack::trackType().
Referenced by operator()().
◆ unlinkRefinableObjectKFandECALMatchedToHCAL()
void PFEGammaAlgo::unlinkRefinableObjectKFandECALMatchedToHCAL |
( |
ProtoEGObject & |
RO, |
|
|
bool |
removeFreeECAL = false , |
|
|
bool |
removeSCECAL = false |
|
) |
| |
|
private |
Definition at line 1967 of file PFEGammaAlgo.cc.
1970 std::vector<bool> cluster_in_sc;
1971 auto ecal_begin = RO.ecalclusters.begin();
1972 auto ecal_end = RO.ecalclusters.end();
1975 for (
auto secd_kf = RO.secondaryKFs.begin(); secd_kf != RO.secondaryKFs.end(); ++secd_kf) {
1976 bool remove_this_kf =
false;
1977 NotCloserToOther<reco::PFBlockElement::TRACK, reco::PFBlockElement::HCAL> tracksToHCALs(
_currentblock, *secd_kf);
1981 const float secpin = trkRef->p();
1983 for (
auto ecal = ecal_begin;
ecal != ecal_end; ++
ecal) {
1984 const double ecalenergy = (*ecal)->clusterRef()->correctedEnergy();
1987 if (cluster_in_sc.size() < clus_idx + 1) {
1992 cluster_in_sc.push_back(dist != -1.0
f);
1999 if (RO.localMap.contains(
ecal->get(), *secd_kf)) {
2000 auto hcal_matched = std::partition(hcal_begin, hcal_end, tracksToHCALs);
2001 for (
auto hcalclus = hcal_begin; hcalclus != hcal_matched; ++hcalclus) {
2003 const double hcalenergy = clusthcal->
clusterRef()->energy();
2004 const double hpluse = ecalenergy + hcalenergy;
2005 const bool isHoHE = ((hcalenergy / hpluse) > 0.1 &&
goodTrack);
2006 const bool isHoE = (hcalenergy > ecalenergy);
2007 const bool isPoHE = (secpin > hpluse);
2008 if (cluster_in_sc[clus_idx]) {
2009 if (isHoE || isPoHE) {
2010 LOGDRESSED(
"PFEGammaAlgo") <<
"REJECTED TRACK FOR H/E or P/(H+E), CLUSTER IN SC"
2011 <<
" H/H+E " << (hcalenergy / hpluse) <<
" H/E " << (hcalenergy > ecalenergy)
2012 <<
" P/(H+E) " << (secpin / hpluse) <<
" HCAL ENE " << hcalenergy
2013 <<
" ECAL ENE " << ecalenergy <<
" secPIN " << secpin <<
" Algo Track "
2014 << trkRef->algo() << std::endl;
2015 remove_this_kf =
true;
2019 LOGDRESSED(
"PFEGammaAlgo") <<
"REJECTED TRACK FOR H/H+E, CLUSTER NOT IN SC"
2020 <<
" H/H+E " << (hcalenergy / hpluse) <<
" H/E " << (hcalenergy > ecalenergy)
2021 <<
" P/(H+E) " << (secpin / hpluse) <<
" HCAL ENE " << hcalenergy
2022 <<
" ECAL ENE " << ecalenergy <<
" secPIN " << secpin <<
" Algo Track "
2023 << trkRef->algo() << std::endl;
2024 remove_this_kf =
true;
2030 if (remove_this_kf) {
2031 secd_kf = RO.secondaryKFs.erase(secd_kf);
2032 if (secd_kf == RO.secondaryKFs.end())
References _currentblock, _currentlinks, _splayedblock, reco::PFBlockElementCluster::clusterRef(), CommutativePairs< T >::contains(), HLT_FULL_cff::distance, docast, bsc_activity_cfg::ecal, PFEGammaAlgo::ProtoEGObject::ecalclusters, f, spr::goodTrack(), reco::PFBlockElement::HCAL, PFTrackAlgoTools::isGoodForEGM(), reco::PFBlock::LINKTEST_ALL, PFEGammaAlgo::ProtoEGObject::localMap, LOGDRESSED, PFEGammaAlgo::ProtoEGObject::parentSC, and PFEGammaAlgo::ProtoEGObject::secondaryKFs.
Referenced by operator()().
◆ unlinkRefinableObjectKFandECALWithBadEoverP()
void PFEGammaAlgo::unlinkRefinableObjectKFandECALWithBadEoverP |
( |
ProtoEGObject & |
RO | ) |
|
|
private |
Definition at line 1894 of file PFEGammaAlgo.cc.
1896 if (RO.primaryGSFs.empty())
1899 const double Pin_gsf = RO.primaryGSFs.front()->GsftrackRef()->pMode();
1900 const double gsfOuterEta = RO.primaryGSFs.front()->positionAtECALEntrance().Eta();
1901 double tot_ecal = 0.0;
1902 std::vector<double> min_brem_dists;
1903 std::vector<double> closest_brem_eta;
1905 for (
const auto&
ecal : RO.ecalclusters) {
1906 tot_ecal +=
ecal->clusterRef()->correctedEnergy();
1909 double min_brem_dist = 5000.0;
1910 double eta = -999.0;
1911 for (
const auto& brem : RO.brems) {
1913 if (dist < min_brem_dist && dist != -1.0
f) {
1914 min_brem_dist = dist;
1915 eta = brem->positionAtECALEntrance().Eta();
1918 min_brem_dists.push_back(min_brem_dist);
1919 closest_brem_eta.push_back(
eta);
1924 for (
auto secd_kf = RO.secondaryKFs.begin(); secd_kf != RO.secondaryKFs.end(); ++secd_kf) {
1926 const float secpin = (*secd_kf)->trackRef()->p();
1927 bool remove_this_kf =
false;
1928 for (
auto ecal = RO.ecalclusters.begin();
ecal != RO.ecalclusters.end(); ++
ecal) {
1930 const float minbremdist = min_brem_dists[bremidx];
1931 const double ecalenergy = (*ecal)->clusterRef()->correctedEnergy();
1932 const double Epin = ecalenergy / secpin;
1933 const double detaGsf =
std::abs(gsfOuterEta - (*ecal)->clusterRef()->positionREP().Eta());
1934 const double detaBrem =
std::abs(closest_brem_eta[bremidx] - (*ecal)->clusterRef()->positionREP().Eta());
1936 bool kf_matched = RO.localMap.contains(
ecal->get(), *secd_kf);
1938 const float tkdist =
1944 if (Epin > 3 && kf_matched && tkdist != -1.0
f && tkdist < minbremdist && detaGsf > 0.05 && detaBrem > 0.015) {
1945 double res_with =
std::abs((tot_ecal - Pin_gsf) / Pin_gsf);
1946 double res_without =
std::abs((tot_ecal - ecalenergy - Pin_gsf) / Pin_gsf);
1947 if (res_without < res_with) {
1948 LOGDRESSED(
"PFEGammaAlgo") <<
" REJECTED_RES totenergy " << tot_ecal <<
" Pin_gsf " << Pin_gsf
1949 <<
" cluster to secondary " << ecalenergy <<
" res_with " << res_with
1950 <<
" res_without " << res_without << std::endl;
1951 tot_ecal -= ecalenergy;
1952 remove_this_kf =
true;
1953 ecal = RO.ecalclusters.erase(
ecal);
1954 if (
ecal == RO.ecalclusters.end())
1959 if (remove_this_kf) {
1960 secd_kf = RO.secondaryKFs.erase(secd_kf);
1961 if (secd_kf == RO.secondaryKFs.end())
References _currentblock, _currentlinks, funct::abs(), PFEGammaAlgo::ProtoEGObject::brems, CommutativePairs< T >::contains(), HLT_FULL_cff::distance, bsc_activity_cfg::ecal, PFEGammaAlgo::ProtoEGObject::ecalclusters, PVValHelper::eta, f, reco::PFBlock::LINKTEST_ALL, PFEGammaAlgo::ProtoEGObject::localMap, LOGDRESSED, PFEGammaAlgo::ProtoEGObject::primaryGSFs, and PFEGammaAlgo::ProtoEGObject::secondaryKFs.
Referenced by operator()().
◆ unwrapSuperCluster()
Definition at line 777 of file PFEGammaAlgo.cc.
780 ecalclusters.clear();
782 LOGVERB(
"PFEGammaAlgo") <<
"Pointer to SC element: 0x" << std::hex << thesc <<
std::dec << std::endl
783 <<
"cleared ecalclusters and ecal2ps!" << std::endl;
788 if (ecalbegin == ecalend && hgcalbegin == hgcalend) {
789 LOGERR(
"PFEGammaAlgo::unwrapSuperCluster()") <<
"There are no ECAL elements in a block with imported SC!"
790 <<
" This is a bug we should fix this!" << std::endl;
797 <<
"SuperCluster pointed to by block element is null!" << std::endl;
799 LOGDRESSED(
"PFEGammaAlgo") <<
"Got a valid super cluster ref! 0x" << std::hex << scref.
get() <<
std::dec << std::endl;
800 const size_t nscclusters = scref->clustersSize();
801 const size_t nscpsclusters = scref->preshowerClustersSize();
802 size_t npfpsclusters = 0;
803 size_t npfclusters = 0;
804 LOGDRESSED(
"PFEGammaAlgo") <<
"Precalculated cluster multiplicities: " << nscclusters <<
' ' << nscpsclusters
806 NotCloserToOther<reco::PFBlockElement::SC, reco::PFBlockElement::ECAL> ecalClustersInSC(
_currentblock, thesc);
807 NotCloserToOther<reco::PFBlockElement::SC, reco::PFBlockElement::HGCAL> hgcalClustersInSC(
_currentblock, thesc);
808 auto ecalfirstnotinsc = std::partition(ecalbegin, ecalend, ecalClustersInSC);
809 auto hgcalfirstnotinsc = std::partition(hgcalbegin, hgcalend, hgcalClustersInSC);
819 std::vector<const ClusterElement*> safePFClusters =
820 is_pf_sc ? std::vector<const ClusterElement*>()
823 if (ecalfirstnotinsc == ecalbegin && hgcalfirstnotinsc == hgcalbegin) {
824 LOGERR(
"PFEGammaAlgo::unwrapSuperCluster()") <<
"No associated block elements to SuperCluster!"
825 <<
" This is a bug we should fix!" << std::endl;
831 if (is_pf_sc && nscclusters != npfclusters) {
832 std::stringstream sc_err;
833 thesc->
Dump(sc_err,
"\t");
835 <<
"The number of found ecal elements (" << nscclusters <<
") in block is not the same as"
836 <<
" the number of ecal PF clusters reported by the PFSuperCluster"
837 <<
" itself (" << npfclusters <<
")! This should not happen!" << std::endl
838 << sc_err.str() << std::endl;
840 for (
auto ecalitr = ecalbegin; ecalitr != ecalfirstnotinsc; ++ecalitr) {
845 if (!is_pf_sc &&
std::find(safePFClusters.begin(), safePFClusters.end(), elemascluster) == safePFClusters.end())
849 ecalclusters.emplace_back(elemascluster,
true);
851 ecalitr->setFlag(
false);
855 auto emplaceresult = ecal2ps.emplace(elemascluster, ClusterMap::mapped_type());
856 if (!emplaceresult.second) {
857 std::stringstream clus_err;
858 elemascluster->Dump(clus_err,
"\t");
860 <<
"List of pointers to ECAL block elements contains non-unique items!"
861 <<
" This is very bad!" << std::endl
862 <<
"cluster ptr = 0x" << std::hex << elemascluster <<
std::dec << std::endl
863 << clus_err.str() << std::endl;
865 ClusterMap::mapped_type& eslist = emplaceresult.first->second;
869 for (
auto hgcalitr = hgcalbegin; hgcalitr != hgcalfirstnotinsc; ++hgcalitr) {
874 if (!is_pf_sc &&
std::find(safePFClusters.begin(), safePFClusters.end(), elemascluster) == safePFClusters.end())
878 ecalclusters.emplace_back(elemascluster,
true);
880 hgcalitr->setFlag(
false);
897 LOGDRESSED(
"PFEGammaAlgo") <<
" Unwrapped SC has " << npfclusters <<
" ECAL sub-clusters"
898 <<
" and " << npfpsclusters <<
" PreShower layers 1 & 2 clusters!" << std::endl;
References _currentblock, _splayedblock, attachPSClusters(), TauDecayModes::dec, HLT_FULL_cff::distance, docast, reco::PFBlockElementCluster::Dump(), reco::PFBlockElementSuperCluster::Dump(), reco::PFBlockElement::ECAL, Exception, spr::find(), reco::PFBlockElementSuperCluster::fromPFSuperCluster(), edm::Ref< C, T, F >::get(), reco::PFBlockElement::HGCAL, edm::Ref< C, T, F >::isAvailable(), edm::Ref< C, T, F >::isNonnull(), LOGDRESSED, LOGERR, LOGVERB, and reco::PFBlockElementSuperCluster::superClusterRef().
Referenced by initializeProtoCands().
◆ _currentblock
Definition at line 144 of file PFEGammaAlgo.h.
Referenced by calculateEleMVA(), fillExtraInfo(), fillPFCandidates(), initializeProtoCands(), isMuon(), linkKFTrackToECAL(), linkRefinableObjectBremTangentsToECAL(), linkRefinableObjectConvSecondaryKFsToSecondaryKFs(), linkRefinableObjectECALToSingleLegConv(), linkRefinableObjectGSFTracksToKFs(), linkRefinableObjectPrimaryGSFTrackToECAL(), linkRefinableObjectPrimaryGSFTrackToHCAL(), linkRefinableObjectPrimaryKFsToSecondaryKFs(), linkRefinableObjectSecondaryKFsToECAL(), operator()(), removeOrLinkECALClustersToKFTracks(), unlinkRefinableObjectKFandECALMatchedToHCAL(), unlinkRefinableObjectKFandECALWithBadEoverP(), and unwrapSuperCluster().
◆ _currentlinks
◆ _splayedblock
Definition at line 148 of file PFEGammaAlgo.h.
Referenced by attachPSClusters(), fillExtraInfo(), initializeProtoCands(), linkKFTrackToECAL(), linkRefinableObjectBremTangentsToECAL(), linkRefinableObjectConvSecondaryKFsToSecondaryKFs(), linkRefinableObjectECALToSingleLegConv(), linkRefinableObjectGSFTracksToKFs(), linkRefinableObjectKFTracksToECAL(), linkRefinableObjectPrimaryGSFTrackToECAL(), linkRefinableObjectPrimaryGSFTrackToHCAL(), linkRefinableObjectPrimaryKFsToSecondaryKFs(), linkRefinableObjectSecondaryKFsToECAL(), operator()(), removeOrLinkECALClustersToKFTracks(), unlinkRefinableObjectKFandECALMatchedToHCAL(), and unwrapSuperCluster().
◆ cfg_
◆ channelStatus_
◆ eetops_
◆ gbrForests_
◆ primaryVertex_
◆ thePFEnergyCalibration_
void setHadEnergy(float val)
set the had energy. The cluster energies should be entered before
void linkRefinableObjectPrimaryGSFTrackToECAL(ProtoEGObject &)
bool trackType(TrackType trType) const override
void mergeROsByAnyLink(std::list< ProtoEGObject > &)
std::vector< std::vector< FlaggedPtr< const reco::PFBlockElement > > > _splayedblock
reco::PFBlockElementGsfTrack PFGSFElement
void linkRefinableObjectConvSecondaryKFsToSecondaryKFs(ProtoEGObject &)
void setDeltaEta(float val)
set the delta eta
PFEGConfigInfo const & cfg_
double z() const
z coordinate
void addExtraNonConvTrack(const reco::PFBlockRef &blk, const reco::PFBlockElementTrack &tkref)
track counting for electrons and photons
ESChannelStatus const & channelStatus_
void linkRefinableObjectECALToSingleLegConv(ProtoEGObject &)
void addConversionRef(const reco::ConversionRef &convref)
add Conversions from PF
bool applyCrackCorrections
const reco::TrackRef & trackRef() const override
T const * get() const
Returns C++ pointer to the item.
GBRForests const & gbrForests_
const Point & position() const
position
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
T const * get() const
Returns C++ pointer to the item.
trackRef_iterator tracks_end() const
last iterator over tracks
float evaluateSingleLegMVA(const reco::PFBlockRef &blockref, const reco::Vertex &primaryVtx, unsigned int trackIndex)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void setSuperClusterRef(reco::SuperClusterRef sc)
set reference to the corresponding supercluster
edm::Ptr< CaloCluster > CaloClusterPtr
void setMVA(float val)
set the result (mostly for debugging)
void Dump(std::ostream &out=std::cout, const char *tab=" ") const override
print the object inside the element
void setEarlyBrem(float val)
set EarlyBrem
void unlinkRefinableObjectKFandECALWithBadEoverP(ProtoEGObject &)
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
primaryVertex
hltOfflineBeamSpot for HLTMON
void setGsfElectronClusterRef(const reco::PFBlockRef &blk, const reco::PFBlockElementCluster &ref)
set gsf electron cluster ref
void setKfTrackRef(const reco::TrackRef &ref)
set kf track reference
reco::PFBlockElementBrem PFBremElement
reco::Vertex const & primaryVertex_
bool isPrimaryTrack(const reco::PFBlockElementTrack &KfEl, const reco::PFBlockElementGsfTrack &GsfEl)
void setGsfTrackPout(const math::XYZTLorentzVector &pout)
set the pout (not trivial to get from the GSF track)
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
const PFRecTrackRef & trackRefPF() const override
float calculateEleMVA(const ProtoEGObject &, reco::PFCandidateEGammaExtra &) const
reco::PFBlockElementCluster PFClusterElement
const std::unique_ptr< const GBRForest > ele_
reco::PFBlockRef _currentblock
void setLateBrem(float val)
set LateBrem
void fillExtraInfo(const ProtoEGObject &, reco::PFCandidateEGammaExtra &)
void linkRefinableObjectBremTangentsToECAL(ProtoEGObject &)
void initAlphaGamma_ESplanes_fromDB(const ESEEIntercalibConstants *esEEInterCalib)
void setGsfTrackRef(const reco::GsfTrackRef &ref)
set gsftrack reference
trackRef_iterator tracks_begin() const
first iterator over tracks
void linkRefinableObjectGSFTracksToKFs(ProtoEGObject &)
void setSuperClusterPFECALRef(reco::SuperClusterRef sc)
set reference to the corresponding supercluster
XYZPointD XYZPoint
point in space with cartesian internal representation
static double delPhi(const double phi1, const double phi2)
const CaloClusterPtr & seed() const
seed BasicCluster
void setSigmaEtaEta(float val)
set the sigmaetaeta
reco::PFBlockElementTrack PFKFElement
void initializeProtoCands(std::list< ProtoEGObject > &)
bool isPrimary(const SimTrack &simTrk, const PSimHit *simHit)
double x() const
x coordinate
bool isNonnull() const
Checks for non-null.
void linkRefinableObjectPrimaryKFsToSecondaryKFs(ProtoEGObject &)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
const std::unique_ptr< const GBRForest > singleLeg_
void removeOrLinkECALClustersToKFTracks()
void addSingleLegConvTrackRefMva(const std::pair< reco::TrackRef, float > &trackrefmva)
add Single Leg Conversion TrackRef
int attachPSClusters(const PFClusterElement *, ClusterMap::mapped_type &)
void linkRefinableObjectKFTracksToECAL(ProtoEGObject &)
void linkRefinableObjectSecondaryKFsToECAL(ProtoEGObject &)
std::map< unsigned int, Link > LinkData
Abstract base class for a PFBlock element (track, cluster...)
const SuperClusterRef & superClusterRef() const
const math::XYZPoint & position() const
cluster centroid position
double y() const
y coordinate
static bool isMuon(const reco::PFBlockElement &elt)
void linkKFTrackToECAL(PFKFElement const *, ProtoEGObject &)
Log< level::Info, true > LogVerbatim
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
void linkRefinableObjectPrimaryGSFTrackToHCAL(ProtoEGObject &)
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
reco::PFBlock::LinkData _currentlinks
bool isMuon(const reco::PFBlockElement &)
const GsfPFRecTrackRef & GsftrackRefPF() const
const PFClusterRef & clusterRef() const override
reco::PFCluster::EEtoPSAssociation const & eetops_
reco::PFBlockElementSuperCluster PFSCElement
Particle reconstructed by the particle flow algorithm.
bool unwrapSuperCluster(const reco::PFBlockElementSuperCluster *, std::vector< FlaggedPtr< const PFClusterElement >> &, ClusterMap &)
Abs< T >::type abs(const T &t)
unsigned int index
index type
CalibratedEndcapPFClusterEnergies calibrateEndcapClusterEnergies(reco::PFCluster const &eeCluster, std::vector< reco::PFCluster const * > const &psClusterPointers, ESChannelStatus const &channelStatus, bool applyCrackCorrections) const
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
void dumpCurrentRefinableObjects() const
double energy() const
cluster energy
Geom::Phi< T > phi() const
reco::SuperCluster buildRefinedSuperCluster(const ProtoEGObject &)
bool fromPFSuperCluster() const
EgammaObjects fillPFCandidates(const std::list< ProtoEGObject > &)
void unlinkRefinableObjectKFandECALMatchedToHCAL(ProtoEGObject &, bool removeFreeECAL=false, bool removeSCECAL=false)
bool produceEGCandsWithNoSuperCluster
PFEnergyCalibration thePFEnergyCalibration_