|
|
#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 901 of file PFEGammaAlgo.cc.
905 EEtoPSElement ecalkey(clusptr.
key(), clusptr);
907 std::equal_range(
eetops_.cbegin(),
eetops_.cend(), ecalkey, [](
const EEtoPSElement&
a,
const EEtoPSElement&
b) {
908 return a.first <
b.first;
912 for (
auto pscl = assc_ps.first; pscl != assc_ps.second; ++pscl) {
913 if (pscl->second ==
temp) {
914 const ClusterElement* pstemp =
docast(
const ClusterElement*, ps1.get());
915 eslist.emplace_back(pstemp);
921 for (
auto pscl = assc_ps.first; pscl != assc_ps.second; ++pscl) {
922 if (pscl->second ==
temp) {
923 const ClusterElement* pstemp =
docast(
const ClusterElement*, ps2.get());
924 eslist.emplace_back(pstemp);
928 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 1786 of file PFEGammaAlgo.cc.
1787 if (RO.ecalclusters.empty()) {
1793 std::vector<const reco::PFCluster*> bare_ptrs;
1795 double posX(0),
posY(0), posZ(0), rawSCEnergy(0), corrSCEnergy(0), corrPSEnergy(0), ps1_energy(0.0), ps2_energy(0.0);
1796 for (
auto& clus : RO.ecalclusters) {
1800 auto clusptr = edm::refToPtr<reco::PFClusterCollection>(clus->clusterRef());
1801 bare_ptrs.push_back(clusptr.get());
1803 const double cluseraw = clusptr->energy();
1804 double cluscalibe = clusptr->correctedEnergy();
1806 posX += cluseraw * cluspos.X();
1807 posY += cluseraw * cluspos.Y();
1808 posZ += cluseraw * cluspos.Z();
1810 if (isEE && RO.ecal2ps.count(clus.get())) {
1811 const auto& psclusters = RO.ecal2ps.at(clus.get());
1813 std::vector<reco::PFCluster const*> psClusterPointers;
1814 for (
auto const& psc : psclusters) {
1815 psClusterPointers.push_back(psc->clusterRef().get());
1820 ePS1 = calibratedEnergies.ps1Energy;
1821 ePS2 = calibratedEnergies.ps2Energy;
1828 rawSCEnergy += cluseraw;
1829 corrSCEnergy += cluscalibe;
1832 corrPSEnergy += ePS1 + ePS2;
1834 posX /= rawSCEnergy;
1835 posY /= rawSCEnergy;
1836 posZ /= rawSCEnergy;
1841 auto clusptr = edm::refToPtr<reco::PFClusterCollection>(RO.ecalclusters.front()->clusterRef());
1842 new_sc.setCorrectedEnergy(corrSCEnergy);
1843 new_sc.setSeed(clusptr);
1844 new_sc.setPreshowerEnergyPlane1(ps1_energy);
1845 new_sc.setPreshowerEnergyPlane2(ps2_energy);
1846 new_sc.setPreshowerEnergy(corrPSEnergy);
1847 for (
const auto& clus : RO.ecalclusters) {
1848 clusptr = edm::refToPtr<reco::PFClusterCollection>(clus->clusterRef());
1849 new_sc.addCluster(clusptr);
1850 auto& hits_and_fractions = clusptr->hitsAndFractions();
1851 for (
auto& hit_and_fraction : hits_and_fractions) {
1852 new_sc.addHitAndFraction(hit_and_fraction.first, hit_and_fraction.second);
1855 if (RO.ecal2ps.count(clus.get())) {
1856 const auto& cluspsassociation = RO.ecal2ps.at(clus.get());
1860 for (
const auto& pscluselem : cluspsassociation) {
1863 auto found_pscluster =
1865 if (found_pscluster == new_sc.preshowerClustersEnd()) {
1867 new_sc.addPreshowerCluster(psclus);
1870 throw cms::Exception(
"PFECALSuperClusterAlgo::buildSuperCluster")
1871 <<
"Found a PS cluster matched to more than one EE cluster!" << std::endl
1872 << std::hex << psclus.
get() <<
" == " << found_pscluster->get() <<
std::dec << std::endl;
1881 new_sc.setEtaWidth(pfwidth.pflowEtaWidth());
1882 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 1601 of file PFEGammaAlgo.cc.
1602 if (ro.primaryGSFs.empty()) {
1605 const PFGSFElement* gsfElement = ro.primaryGSFs.front();
1607 if (!ro.primaryKFs.empty()) {
1608 kfElement = ro.primaryKFs.front();
1610 auto const& refGsf = gsfElement->GsftrackRef();
1612 constexpr
float mEl = 0.000511;
1613 const double eInGsf = std::hypot(refGsf->pMode(), mEl);
1614 double dEtGsfEcal = 1e6;
1616 const double eneHcalGsf =
1617 std::accumulate(ro.hcalClusters.begin(), ro.hcalClusters.end(), 0.0, [](
const double a,
auto const&
b) {
1618 return a +
b->clusterRef()->energy();
1620 if (!ro.primaryKFs.empty()) {
1621 refKf = ro.primaryKFs.front()->trackRef();
1623 const double eOutGsf = gsfElement->Pout().t();
1624 const double etaOutGsf = gsfElement->positionAtECALEntrance().eta();
1625 double firstEcalGsfEnergy{0.0};
1626 double otherEcalGsfEnergy{0.0};
1627 double ecalBremEnergy{0.0};
1629 std::vector<const reco::PFCluster*> gsfCluster;
1630 for (
const auto&
ecal : ro.ecalclusters) {
1631 const double cenergy =
ecal->clusterRef()->correctedEnergy();
1632 bool hasgsf = ro.localMap.contains(gsfElement,
ecal.get());
1633 bool haskf = ro.localMap.contains(kfElement,
ecal.get());
1634 bool hasbrem =
false;
1635 for (
const auto& brem : ro.brems) {
1636 if (ro.localMap.contains(brem,
ecal.get())) {
1640 if (hasbrem &&
ecal.get() != ro.electronClusters[0]) {
1641 ecalBremEnergy += cenergy;
1643 if (!hasbrem &&
ecal.get() != ro.electronClusters[0]) {
1645 otherEcalGsfEnergy += cenergy;
1647 ecalBremEnergy += cenergy;
1648 if (!(hasgsf || haskf))
1649 otherEcalGsfEnergy += cenergy;
1653 if (ro.electronClusters[0]) {
1656 firstEcalGsfEnergy = cref->correctedEnergy();
1657 dEtGsfEcal = cref->positionREP().eta() - etaOutGsf;
1658 gsfCluster.push_back(cref.
get());
1664 float firstBrem{-1.0f};
1665 float earlyBrem{-1.0f};
1666 float lateBrem{-1.0f};
1667 if (ro.nBremsWithClusters > 0) {
1668 firstBrem = ro.firstBrem;
1669 earlyBrem = ro.firstBrem < 4 ? 1.0f : 0.0f;
1670 lateBrem = ro.lateBrem == 1 ? 1.0f : 0.0f;
1674 if (firstEcalGsfEnergy > 0.0) {
1675 if (refGsf.isNonnull()) {
1678 const float ptGsf = refGsf->ptMode();
1679 const float etaGsf = refGsf->etaMode();
1681 const double ptModeErrorGsf = refGsf->ptModeError();
1682 float ptModeErrOverPtGsf = (ptModeErrorGsf > 0. ? ptModeErrorGsf / ptGsf : 1.0);
1683 float chi2Gsf = refGsf->normalizedChi2();
1684 float dPtOverPtGsf = (ptGsf - gsfElement->Pout().pt()) / ptGsf;
1686 float nHitKf = refKf.
isNonnull() ? refKf->hitPattern().trackerLayersWithMeasurement() : 0;
1687 float chi2Kf = refKf.
isNonnull() ? refKf->normalizedChi2() : -0.01;
1690 float eTotPinMode = (firstEcalGsfEnergy + otherEcalGsfEnergy + ecalBremEnergy) / eInGsf;
1691 float eGsfPoutMode = firstEcalGsfEnergy / eOutGsf;
1692 float eTotBremPinPoutMode = (ecalBremEnergy + otherEcalGsfEnergy) / (eInGsf - eOutGsf);
1693 float dEtaGsfEcalClust =
std::abs(dEtGsfEcal);
1695 float hOverHe = eneHcalGsf / (eneHcalGsf + firstEcalGsfEnergy);
1702 dPtOverPtGsf = std::clamp(dPtOverPtGsf, -0.2
f, 1.0
f);
1703 ptModeErrOverPtGsf =
std::min(ptModeErrOverPtGsf, 0.3
f);
1706 eTotPinMode = std::clamp(eTotPinMode, 0.0
f, 5.0
f);
1707 eGsfPoutMode = std::clamp(eGsfPoutMode, 0.0
f, 5.0
f);
1708 eTotBremPinPoutMode = std::clamp(eTotBremPinPoutMode, 0.0
f, 5.0
f);
1709 dEtaGsfEcalClust =
std::min(dEtaGsfEcalClust, 0.1
f);
1710 logSigmaEtaEta =
std::max(logSigmaEtaEta, -14.0
f);
1752 eTotBremPinPoutMode,
References _currentblock, a, funct::abs(), b, PFEGammaAlgo::ProtoEGObject::brems, CommutativePairs< T >::contains(), MillePedeFileConverter_cfg::e, bsc_activity_cfg::ecal, 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 931 of file PFEGammaAlgo.cc.
935 <<
"Dumping " << refinableObjects.size() <<
" refinable objects for this block: " << std::endl;
936 for (
const auto& ro : refinableObjects) {
937 std::stringstream
info;
938 info <<
"Refinable Object:" << std::endl;
940 info <<
"\tSuperCluster element attached to object:" << std::endl <<
'\t';
941 ro.parentSC->Dump(
info,
"\t");
944 if (ro.electronSeed.isNonnull()) {
945 info <<
"\tGSF element attached to object:" << std::endl;
946 ro.primaryGSFs.front()->Dump(
info,
"\t");
948 info <<
"firstBrem : " << ro.firstBrem <<
" lateBrem : " << ro.lateBrem
949 <<
" nBrems with cluster : " << ro.nBremsWithClusters << std::endl;
951 if (ro.electronClusters.size() && ro.electronClusters[0]) {
952 info <<
"electron cluster : ";
953 ro.electronClusters[0]->Dump(
info,
"\t");
956 info <<
" no electron cluster." << std::endl;
959 if (ro.primaryKFs.size()) {
960 info <<
"\tPrimary KF tracks attached to object: " << std::endl;
961 for (
const auto& kf : ro.primaryKFs) {
962 kf->Dump(
info,
"\t");
966 if (ro.secondaryKFs.size()) {
967 info <<
"\tSecondary KF tracks attached to object: " << std::endl;
968 for (
const auto& kf : ro.secondaryKFs) {
969 kf->Dump(
info,
"\t");
973 if (ro.brems.size()) {
974 info <<
"\tBrem tangents attached to object: " << std::endl;
975 for (
const auto& brem : ro.brems) {
976 brem->Dump(
info,
"\t");
980 if (ro.ecalclusters.size()) {
981 info <<
"\tECAL clusters attached to object: " << std::endl;
982 for (
const auto& clus : ro.ecalclusters) {
983 clus->Dump(
info,
"\t");
985 if (ro.ecal2ps.find(clus) != ro.ecal2ps.end()) {
986 for (
const auto& psclus : ro.ecal2ps.at(clus)) {
987 info <<
"\t\t Attached PS Cluster: ";
988 psclus->Dump(
info,
"");
References info().
Referenced by operator()().
◆ evaluateSingleLegMVA()
Definition at line 459 of file PFEGammaAlgo.cc.
467 const float chi2 =
elements[trackIndex].trackRef()->chi2() /
elements[trackIndex].trackRef()->ndof();
468 const float nlost =
elements[trackIndex].trackRef()->hitPattern().numberOfLostHits(HitPattern::MISSING_INNER_HITS);
469 const float nLayers =
elements[trackIndex].trackRef()->hitPattern().trackerLayersWithMeasurement();
471 const float stip =
elements[trackIndex].trackRefPF()->STIP();
475 std::multimap<double, unsigned int> ecalAssoTrack;
476 block.associatedElements(
478 std::multimap<double, unsigned int> hcalAssoTrack;
479 block.associatedElements(
481 if (!ecalAssoTrack.empty()) {
482 for (
auto& itecal : ecalAssoTrack) {
483 linkedE = linkedE +
elements[itecal.second].clusterRef()->energy();
486 if (!hcalAssoTrack.empty()) {
487 for (
auto& ithcal : hcalAssoTrack) {
488 linkedH = linkedH +
elements[ithcal.second].clusterRef()->energy();
491 const float eOverPt = linkedE /
elements[trackIndex].trackRef()->pt();
492 const float hOverPt = linkedH /
elements[trackIndex].trackRef()->pt();
494 elements[trackIndex].trackRef()->innerPosition().Y() - primaryVtx.
y(),
495 elements[trackIndex].trackRef()->innerPosition().Z() - primaryVtx.
z());
496 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 1765 of file PFEGammaAlgo.cc.
1770 for (
auto&
ecal : RO.ecalclusters) {
1771 NotCloserToOther<reco::PFBlockElement::ECAL, reco::PFBlockElement::TRACK, true> ECALToTracks(
_currentblock,
1773 auto notmatchedkf = std::partition(KFbegin, KFend, ECALToTracks);
1774 auto notconvkf = std::partition(KFbegin, notmatchedkf, [](
auto const&
x) {
return x->trackType(ConvType); });
1776 for (
auto kf = notconvkf; kf != notmatchedkf; ++kf) {
References _currentblock, _splayedblock, reco::PFCandidateEGammaExtra::addExtraNonConvTrack(), docast, bsc_activity_cfg::ecal, PFEGammaAlgo::ProtoEGObject::ecalclusters, reco::PFBlockElement::TRACK, and x.
Referenced by fillPFCandidates().
◆ fillPFCandidates()
Definition at line 1468 of file PFEGammaAlgo.cc.
1472 output.candidates.reserve(ROs.size());
1473 output.candidateExtras.reserve(ROs.size());
1474 output.refinedSuperClusters.reserve(ROs.size());
1476 for (
auto& RO : ROs) {
1482 if (!RO.primaryGSFs.empty() || !RO.primaryKFs.empty()) {
1487 if (!RO.primaryKFs.empty()) {
1488 cand.setCharge(RO.primaryKFs[0]->trackRef()->charge());
1490 cand.setTrackRef(RO.primaryKFs[0]->trackRef());
1493 if (!RO.primaryGSFs.empty()) {
1494 cand.setCharge(RO.primaryGSFs[0]->GsftrackRef()->chargeMode());
1496 cand.setGsfTrackRef(RO.primaryGSFs[0]->GsftrackRef());
1502 cand.setSuperClusterRef(RO.parentSC->superClusterRef());
1507 for (
const auto& brem : RO.brems) {
1511 for (
const auto&
ecal : RO.ecalclusters) {
1514 if (RO.ecal2ps.count(clus)) {
1515 for (
auto& psclus : RO.ecal2ps.at(clus)) {
1521 for (
const auto& kf : RO.secondaryKFs) {
1524 bool no_conv_ref =
true;
1525 for (
const auto& convref : convrefs) {
1526 if (convref.isNonnull() && convref.isAvailable()) {
1528 no_conv_ref =
false;
1535 const auto& mvavalmapped = RO.singleLegConversionMvaMap.find(kf);
1538 float mvaval = (mvavalmapped != RO.singleLegConversionMvaMap.end()
1539 ? mvavalmapped->second
1550 float trkTime = 0, trkTimeErr = -1;
1551 if (!RO.primaryGSFs.empty() && RO.primaryGSFs[0]->isTimeValid()) {
1552 trkTime = RO.primaryGSFs[0]->time();
1553 trkTimeErr = RO.primaryGSFs[0]->timeError();
1554 }
else if (!RO.primaryKFs.empty() && RO.primaryKFs[0]->isTimeValid()) {
1555 trkTime = RO.primaryKFs[0]->time();
1556 trkTimeErr = RO.primaryKFs[0]->timeError();
1558 if (trkTimeErr >= 0) {
1559 cand.setTime(trkTime, trkTimeErr);
1567 const double scE = the_sc.
energy();
1571 egDir = egDir.Unit();
1574 cand.setPositionAtECALEntrance(ecalPOS_f);
1581 cand.setPositionAtECALEntrance(
gsf->positionAtECALEntrance());
1587 cand.setPositionAtECALEntrance(kf->positionAtECALEntrance());
1592 xtra.
setMVA(eleMVAValue);
1593 cand.set_mva_e_pi(eleMVAValue);
1595 output.candidateExtras.push_back(xtra);
References _currentblock, reco::PFCandidateEGammaExtra::addConversionRef(), reco::PFCandidateEGammaExtra::addSingleLegConvTrackRefMva(), buildRefinedSuperCluster(), calculateEleMVA(), cfg_, bsc_activity_cfg::ecal, 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()
Definition at line 655 of file PFEGammaAlgo.cc.
660 LOGDRESSED(
"PFEGammaAlgo") <<
"creating SC-based proto-object" << std::endl
661 <<
"\tSC at index: " << element->index() <<
" has type: " << element->type()
663 element.setFlag(
false);
664 ProtoEGObject fromSC;
665 fromSC.nBremsWithClusters = -1;
666 fromSC.firstBrem = -1;
667 fromSC.lateBrem = -1;
671 bool sc_success =
unwrapSuperCluster(fromSC.parentSC, fromSC.ecalclusters, fromSC.ecal2ps);
686 egobjs.insert(egobjs.end(), fromSC);
694 LOGDRESSED(
"PFEGammaAlgo") <<
"creating GSF-based proto-object" << std::endl
695 <<
"\tGSF at index: " << element->index() <<
" has type: " << element->type()
701 element.setFlag(
false);
703 ProtoEGObject fromGSF;
704 fromGSF.nBremsWithClusters = -1;
705 fromGSF.firstBrem = -1;
706 fromGSF.lateBrem = 0;
707 gsfref_forextra = elementAsGSF->GsftrackRef();
711 fromGSF.electronSeed = theseedref;
713 if (fromGSF.electronSeed.isNull() || !fromGSF.electronSeed.isAvailable()) {
714 std::stringstream gsf_err;
715 elementAsGSF->Dump(gsf_err,
"\t");
717 <<
"Found a GSF track with no seed! This should not happen!" << std::endl
718 << gsf_err.str() << std::endl;
722 element.setFlag(
false);
724 fromGSF.primaryGSFs.push_back(elementAsGSF);
729 if (dist == 0.001
f) {
731 fromGSF.brems.push_back(eAsBrem);
732 fromGSF.localMap.insert(eAsBrem, elementAsGSF);
739 if (fromGSF.electronSeed->isEcalDriven()) {
742 LOGDRESSED(
"PFEGammaAlgo") <<
"GSF-based proto-object is ECAL driven, merging SC-cand" << std::endl;
743 LOGVERB(
"PFEGammaAlgo") <<
"ECAL Seed Ptr: " << fromGSF.electronSeed.get()
744 <<
" isAvailable: " << fromGSF.electronSeed.isAvailable()
745 <<
" isNonnull: " << fromGSF.electronSeed.isNonnull() << std::endl;
746 SeedMatchesToProtoObject sctoseedmatch(fromGSF.electronSeed);
747 auto objsbegin = egobjs.begin();
748 auto objsend = egobjs.end();
750 auto clusmatch = std::find_if(objsbegin, objsend, sctoseedmatch);
751 if (clusmatch != objsend) {
752 fromGSF.parentSC = clusmatch->parentSC;
753 fromGSF.ecalclusters =
std::move(clusmatch->ecalclusters);
754 fromGSF.ecal2ps =
std::move(clusmatch->ecal2ps);
755 egobjs.erase(clusmatch);
756 }
else if (fromGSF.electronSeed.isAvailable() && fromGSF.electronSeed.isNonnull()) {
760 LOGDRESSED(
"PFEGammaAlgo") <<
"Encountered the known GSF-SC splitting bug "
761 <<
" in PFBlockAlgo! We should really fix this!" << std::endl;
763 std::stringstream gsf_err;
764 elementAsGSF->Dump(gsf_err,
"\t");
766 <<
"Expected SuperCluster from ECAL driven GSF seed "
767 <<
"was not found in the block!" << std::endl
768 << gsf_err.str() << std::endl;
772 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 1295 of file PFEGammaAlgo.cc.
1296 std::vector<FlaggedPtr<const PFClusterElement>>& currentECAL = RO.ecalclusters;
1299 NotCloserToOther<reco::PFBlockElement::TRACK, reco::PFBlockElement::ECAL> kfTrackToECALs(
_currentblock, kfflagged);
1300 NotCloserToOther<reco::PFBlockElement::GSF, reco::PFBlockElement::ECAL> kfTrackGSFToECALs(
_currentblock, kfflagged);
1302 auto notmatched_sc = std::partition(currentECAL.begin(), currentECAL.end(), kfTrackToECALs);
1304 notmatched_sc = std::partition(currentECAL.begin(), notmatched_sc, kfTrackGSFToECALs);
1305 for (
auto ecalitr = currentECAL.begin(); ecalitr != notmatched_sc; ++ecalitr) {
1309 LOGDRESSED(
"PFEGammaAlgo::linkKFTracktoECAL()") <<
"Found a cluster already in RO by KF extrapolation"
1310 <<
" at ECAL surface!" << std::endl
1311 << *elemascluster << std::endl;
1312 RO.localMap.insert(elemascluster, kfflagged);
1315 auto notmatched_blk = std::partition(ECALbegin, ECALend, kfTrackToECALs);
1317 notmatched_blk = std::partition(ECALbegin, notmatched_blk, kfTrackGSFToECALs);
1318 for (
auto ecalitr = ECALbegin; ecalitr != notmatched_blk; ++ecalitr) {
1320 if (addPFClusterToROSafe(elemascluster, RO)) {
1322 ecalitr->setFlag(
false);
1324 LOGDRESSED(
"PFEGammaAlgo::linkKFTracktoECAL()") <<
"Found a cluster not in RO by KF extrapolation"
1325 <<
" at ECAL surface!" << std::endl
1326 << *elemascluster << std::endl;
1327 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 1332 of file PFEGammaAlgo.cc.
1333 if (RO.brems.empty())
1337 int lastBremTrajPos = -1;
1338 for (
auto& brem : RO.brems) {
1339 bool has_clusters =
false;
1340 TrajPos = (brem->indTrajPoint()) - 2;
1343 NotCloserToOther<reco::PFBlockElement::BREM, reco::PFBlockElement::ECAL> BremToECALs(
_currentblock, brem);
1345 auto RSCBegin = RO.ecalclusters.begin();
1346 auto RSCEnd = RO.ecalclusters.end();
1347 auto notmatched_rsc = std::partition(RSCBegin, RSCEnd, BremToECALs);
1348 for (
auto ecal = RSCBegin;
ecal != notmatched_rsc; ++
ecal) {
1349 float deta =
std::abs((*ecal)->clusterRef()->positionREP().eta() - brem->positionAtECALEntrance().eta());
1351 has_clusters =
true;
1352 if (lastBremTrajPos == -1 || lastBremTrajPos < TrajPos) {
1353 lastBremTrajPos = TrajPos;
1355 if (FirstBrem == -1 || TrajPos < FirstBrem) {
1356 FirstBrem = TrajPos;
1357 RO.firstBrem = TrajPos;
1359 LOGDRESSED(
"PFEGammaAlgo::linkBremToECAL()") <<
"Found a cluster already in SC linked to brem extrapolation"
1360 <<
" at ECAL surface!" << std::endl;
1361 RO.localMap.insert(
ecal->get(), brem);
1365 auto notmatched_block = std::partition(ECALbegin, ECALend, BremToECALs);
1366 for (
auto ecal = ECALbegin;
ecal != notmatched_block; ++
ecal) {
1367 float deta =
std::abs((*ecal)->clusterRef()->positionREP().eta() - brem->positionAtECALEntrance().eta());
1369 has_clusters =
true;
1370 if (lastBremTrajPos == -1 || lastBremTrajPos < TrajPos) {
1371 lastBremTrajPos = TrajPos;
1373 if (FirstBrem == -1 || TrajPos < FirstBrem) {
1375 FirstBrem = TrajPos;
1376 RO.firstBrem = TrajPos;
1379 if (addPFClusterToROSafe(elemasclus, RO)) {
1382 RO.localMap.insert(
ecal->get(), brem);
1383 ecal->setFlag(
false);
1384 LOGDRESSED(
"PFEGammaAlgo::linkBremToECAL()") <<
"Found a cluster not already associated by brem extrapolation"
1385 <<
" at ECAL surface!" << std::endl;
1390 if (RO.nBremsWithClusters == -1)
1391 RO.nBremsWithClusters = 0;
1392 ++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 1397 of file PFEGammaAlgo.cc.
1400 auto BeginROskfs = RO.secondaryKFs.begin();
1401 auto EndROskfs = RO.secondaryKFs.end();
1402 auto ronotconv = std::partition(BeginROskfs, EndROskfs, [](
auto const&
x) {
return x->trackType(ConvType); });
1404 for (
size_t idx = 0;
idx < convkfs_end; ++
idx) {
1405 auto const& secKFs =
1407 NotCloserToOther<reco::PFBlockElement::TRACK, reco::PFBlockElement::TRACK, true> TracksToTracks(
_currentblock,
1409 auto notmatched = std::partition(KFbegin, KFend, TracksToTracks);
1410 notmatched = std::partition(KFbegin, notmatched, [](
auto const&
x) {
return x->trackType(ConvType); });
1411 for (
auto kf = KFbegin; kf != notmatched; ++kf) {
1413 RO.secondaryKFs.push_back(elemaskf);
1414 RO.localMap.insert(secKFs[
idx], kf->get());
References _currentblock, _splayedblock, HLT_2018_cff::distance, docast, charmTagsComputerCvsB_cfi::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 1420 of file PFEGammaAlgo.cc.
1423 for (
auto&
ecal : RO.ecalclusters) {
1424 NotCloserToOther<reco::PFBlockElement::ECAL, reco::PFBlockElement::TRACK, true> ECALToTracks(
_currentblock,
1426 auto notmatchedkf = std::partition(KFbegin, KFend, ECALToTracks);
1427 auto notconvkf = std::partition(KFbegin, notmatchedkf, [](
auto const&
x) {
return x->trackType(ConvType); });
1429 for (
auto kf = KFbegin; kf != notconvkf; ++kf) {
1431 RO.secondaryKFs.push_back(elemaskf);
1432 RO.localMap.insert(
ecal.get(), elemaskf);
1436 for (
auto kf = notconvkf; kf != notmatchedkf; ++kf) {
1440 RO.secondaryKFs.push_back(elemaskf);
1441 RO.localMap.insert(
ecal.get(), elemaskf);
1444 RO.singleLegConversionMvaMap.emplace(elemaskf, mvaval);
References _currentblock, _splayedblock, cfg_, docast, bsc_activity_cfg::ecal, 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 1159 of file PFEGammaAlgo.cc.
1165 for (
auto& gsfflagged : RO.primaryGSFs) {
1168 if (RO.electronSeed.isNull() || seedtk->trackType(convType))
1170 NotCloserToOther<reco::PFBlockElement::GSF, reco::PFBlockElement::TRACK> gsfTrackToKFs(
_currentblock, seedtk);
1172 auto notlinked = std::partition(KFbegin, KFend, gsfTrackToKFs);
1174 for (
auto kft = KFbegin; kft != notlinked; ++kft) {
1178 if (
isPrimaryTrack(*elemaskf, *seedtk) && !elemaskf->trackType(convType)) {
1179 kft->setFlag(
false);
1180 RO.primaryKFs.push_back(elemaskf);
1181 RO.localMap.insert(seedtk, elemaskf);
1182 }
else if (elemaskf->trackType(convType)) {
1183 kft->setFlag(
false);
1184 RO.secondaryKFs.push_back(elemaskf);
1185 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 1222 of file PFEGammaAlgo.cc.
1224 RO.electronClusters.push_back(
nullptr);
1229 for (
auto& primgsf : RO.primaryGSFs) {
1230 NotCloserToOther<reco::PFBlockElement::GSF, reco::PFBlockElement::ECAL> gsfTracksToECALs(
_currentblock, primgsf);
1232 auto notmatched_blk = std::partition(ECALbegin, ECALend, gsfTracksToECALs);
1234 std::partition(ECALbegin, notmatched_blk, [&primgsf](
auto const&
x) {
return compatibleEoPOut(*
x, *primgsf); });
1236 auto notmatched_sc = std::partition(RO.ecalclusters.begin(), RO.ecalclusters.end(), gsfTracksToECALs);
1237 notmatched_sc = std::partition(
1238 RO.ecalclusters.begin(), notmatched_sc, [&primgsf](
auto const&
x) {
return compatibleEoPOut(*
x, *primgsf); });
1240 for (
auto ecal = RO.ecalclusters.begin();
ecal != notmatched_sc; ++
ecal) {
1243 LOGDRESSED(
"PFEGammaAlgo::linkGSFTracktoECAL()") <<
"Found a cluster already in RO by GSF extrapolation"
1244 <<
" at ECAL surface!" << std::endl
1245 << *elemascluster << std::endl;
1247 RO.localMap.insert(primgsf,
temp.get());
1250 for (
auto ecal = ECALbegin;
ecal != notmatched_blk; ++
ecal) {
1252 LOGDRESSED(
"PFEGammaAlgo::linkGSFTracktoECAL()") <<
"Found a cluster not already in RO by GSF extrapolation"
1253 <<
" at ECAL surface!" << std::endl
1254 << *elemascluster << std::endl;
1255 if (addPFClusterToROSafe(elemascluster, RO)) {
1257 RO.localMap.insert(primgsf, elemascluster);
1258 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 1265 of file PFEGammaAlgo.cc.
1270 for (
auto& primgsf : RO.primaryGSFs) {
1271 NotCloserToOther<reco::PFBlockElement::GSF, reco::PFBlockElement::HCAL> gsfTracksToHCALs(
_currentblock, primgsf);
1272 auto notmatched = std::partition(HCALbegin, HCALend, gsfTracksToHCALs);
1273 for (
auto hcal = HCALbegin;
hcal != notmatched; ++
hcal) {
1276 LOGDRESSED(
"PFEGammaAlgo::linkGSFTracktoECAL()")
1277 <<
"Found an HCAL cluster associated to GSF extrapolation" << std::endl;
1278 RO.hcalClusters.push_back(
temp.get());
1279 RO.localMap.insert(primgsf,
temp.get());
1280 hcal->setFlag(
false);
References _currentblock, _splayedblock, docast, relativeConstraints::empty, reco::PFBlockElement::HCAL, patCandidatesForDimuonsSequences_cff::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 1191 of file PFEGammaAlgo.cc.
1197 for (
auto& primkf : RO.primaryKFs) {
1199 if (primkf->trackType(convType)) {
1200 throw cms::Exception(
"PFEGammaAlgo::linkRefinableObjectPrimaryKFsToSecondaryKFs()")
1201 <<
"A KF track from conversion has been assigned as a primary!!" << std::endl;
1203 NotCloserToOther<reco::PFBlockElement::TRACK, reco::PFBlockElement::TRACK, true> kfTrackToKFs(
_currentblock,
1206 auto notlinked = std::partition(KFbegin, KFend, kfTrackToKFs);
1208 for (
auto kft = KFbegin; kft != notlinked; ++kft) {
1212 if (elemaskf->trackType(convType)) {
1213 kft->setFlag(
false);
1214 RO.secondaryKFs.push_back(elemaskf);
1215 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 1450 of file PFEGammaAlgo.cc.
1453 for (
auto& skf : RO.secondaryKFs) {
1454 NotCloserToOther<reco::PFBlockElement::TRACK, reco::PFBlockElement::ECAL, false> TracksToECALwithCut(
1456 auto notmatched = std::partition(ECALbegin, ECALend, TracksToECALwithCut);
1457 for (
auto ecal = ECALbegin;
ecal != notmatched; ++
ecal) {
1459 if (addPFClusterToROSafe(elemascluster, RO)) {
1461 RO.localMap.insert(skf, elemascluster);
1462 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()
Definition at line 1079 of file PFEGammaAlgo.cc.
1082 bool check_for_merge =
true;
1083 while (check_for_merge) {
1088 for (
auto it1 = ROs.begin(); it1 != ROs.end(); ++it1) {
1089 auto find_start = it1;
1091 auto has_merge = std::find_if(find_start, ROs.end(), std::bind(testIfROMergableByLink, _1, *it1));
1092 if (has_merge != ROs.end() && it1 != ROs.begin()) {
1097 ProtoEGObject& thefront = ROs.front();
1098 auto mergestart = ROs.begin();
1100 auto nomerge = std::partition(mergestart, ROs.end(), std::bind(testIfROMergableByLink, _1, thefront));
1101 if (nomerge != mergestart) {
1102 LOGDRESSED(
"PFEGammaAlgo::mergeROsByAnyLink()")
1103 <<
"Found objects " <<
std::distance(mergestart, nomerge) <<
" to merge by links to the front!" << std::endl;
1104 for (
auto roToMerge = mergestart; roToMerge != nomerge; ++roToMerge) {
1107 if (!thefront.ecalclusters.empty() && !roToMerge->ecalclusters.empty()) {
1108 if (thefront.ecalclusters.front()->clusterRef()->layer() !=
1109 roToMerge->ecalclusters.front()->clusterRef()->layer()) {
1110 LOGWARN(
"PFEGammaAlgo::mergeROsByAnyLink") <<
"Tried to merge EB and EE clusters! Skipping!";
1111 ROs.push_back(*roToMerge);
1116 thefront.ecalclusters.insert(
1117 thefront.ecalclusters.end(), roToMerge->ecalclusters.begin(), roToMerge->ecalclusters.end());
1118 thefront.ecal2ps.insert(roToMerge->ecal2ps.begin(), roToMerge->ecal2ps.end());
1119 thefront.secondaryKFs.insert(
1120 thefront.secondaryKFs.end(), roToMerge->secondaryKFs.begin(), roToMerge->secondaryKFs.end());
1122 thefront.localMap.concatenate(roToMerge->localMap);
1124 if (!thefront.parentSC && roToMerge->parentSC) {
1125 thefront.parentSC = roToMerge->parentSC;
1127 if (thefront.electronSeed.isNull() && roToMerge->electronSeed.isNonnull()) {
1128 thefront.electronSeed = roToMerge->electronSeed;
1129 thefront.primaryGSFs.insert(
1130 thefront.primaryGSFs.end(), roToMerge->primaryGSFs.begin(), roToMerge->primaryGSFs.end());
1131 thefront.primaryKFs.insert(
1132 thefront.primaryKFs.end(), roToMerge->primaryKFs.begin(), roToMerge->primaryKFs.end());
1133 thefront.brems.insert(thefront.brems.end(), roToMerge->brems.begin(), roToMerge->brems.end());
1134 thefront.electronClusters = roToMerge->electronClusters;
1135 thefront.nBremsWithClusters = roToMerge->nBremsWithClusters;
1136 thefront.firstBrem = roToMerge->firstBrem;
1137 thefront.lateBrem = roToMerge->lateBrem;
1138 }
else if (thefront.electronSeed.isNonnull() && roToMerge->electronSeed.isNonnull()) {
1139 LOGDRESSED(
"PFEGammaAlgo::mergeROsByAnyLink")
1140 <<
"Need to implement proper merging of two gsf candidates!" << std::endl;
1143 ROs.erase(mergestart, nomerge);
1145 ROs.push_back(ROs.front());
1148 check_for_merge =
false;
1151 LOGDRESSED(
"PFEGammaAlgo::mergeROsByAnyLink()")
1152 <<
"After merging by links there are: " << ROs.size() <<
" refinable EGamma objects!" << std::endl;
References PFEGammaAlgo::ProtoEGObject::brems, CommutativePairs< T >::concatenate(), HLT_2018_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 527 of file PFEGammaAlgo.cc.
528 LOGVERB(
"PFEGammaAlgo") <<
"Resetting PFEGammaAlgo for new block and running!" << std::endl;
536 std::list<ProtoEGObject> refinableObjects;
544 LOGVERB(
"PFEGammaAlgo") <<
"Splaying block" << std::endl;
551 const size_t itype = (size_t)pfelement.type();
559 std::stringstream splayout;
560 for (
size_t itype = 0; itype <
_splayedblock.size(); ++itype) {
561 splayout <<
"\tType: " << itype <<
" indices: ";
563 splayout << flaggedelement->index() <<
' ';
566 splayout << std::endl;
568 LOGVERB(
"PFEGammaAlgo") << splayout.str();
576 LOGDRESSED(
"PFEGammaAlgo") <<
"Initialized " << refinableObjects.size() <<
" proto-EGamma objects" << std::endl;
587 for (
auto& RO : refinableObjects) {
602 LOGDRESSED(
"PFEGammaAlgo") <<
"Dumping after GSF and KF Track (Primary) Linking : " << std::endl;
608 LOGDRESSED(
"PFEGammaAlgo") <<
"Dumping after first merging operation : " << std::endl;
614 for (
auto& RO : refinableObjects) {
624 LOGDRESSED(
"PFEGammaAlgo") <<
"Dumping after ECAL to Track (Secondary) Linking : " << std::endl;
630 LOGDRESSED(
"PFEGammaAlgo") <<
"There are " << refinableObjects.size() <<
" after the 2nd merging step." << std::endl;
634 for (
auto& RO : refinableObjects) {
641 std::sort(RO.ecalclusters.begin(), RO.ecalclusters.end(), [](
auto const&
a,
auto const&
b) {
642 return (
a->clusterRef()->correctedEnergy() >
b->clusterRef()->correctedEnergy());
644 setROElectronCluster(RO);
647 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(), unlinkRefinableObjectKFandECALMatchedToHCAL(), and unlinkRefinableObjectKFandECALWithBadEoverP().
◆ removeOrLinkECALClustersToKFTracks()
void PFEGammaAlgo::removeOrLinkECALClustersToKFTracks |
( |
| ) |
|
|
private |
Definition at line 1000 of file PFEGammaAlgo.cc.
1001 typedef std::multimap<double, unsigned> MatchedMap;
1005 MatchedMap matchedGSFs, matchedECALs;
1006 std::unordered_map<GsfTrackElementPtr, MatchedMap> gsf_ecal_cache;
1008 matchedGSFs.clear();
1011 if (matchedGSFs.empty()) {
1015 std::partial_sort(ecalbegin, ecalbegin + 1, ecalend, closestTrackToECAL);
1023 if (dist_sc != -1.0
f) {
1029 if (dist != -1.0
f && closestECAL.flag()) {
1030 bool gsflinked =
false;
1038 if (!gsf_ecal_cache.count(elemasgsf)) {
1039 matchedECALs.clear();
1045 gsf_ecal_cache.emplace(elemasgsf, matchedECALs);
1046 MatchedMap().swap(matchedECALs);
1048 const MatchedMap& ecal_matches = gsf_ecal_cache[elemasgsf];
1049 if (!ecal_matches.empty()) {
1050 if (ecal_matches.begin()->second == closestECAL->index()) {
1056 if (!gsflinked && !inSC) {
1061 const int nexhits = trackref->hitPattern().numberOfLostHits(HitPattern::MISSING_INNER_HITS);
1062 bool fromprimaryvertex =
false;
1065 fromprimaryvertex =
true;
1071 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 1963 of file PFEGammaAlgo.cc.
1966 std::vector<bool> cluster_in_sc;
1967 auto ecal_begin = RO.ecalclusters.begin();
1968 auto ecal_end = RO.ecalclusters.end();
1971 for (
auto secd_kf = RO.secondaryKFs.begin(); secd_kf != RO.secondaryKFs.end(); ++secd_kf) {
1972 bool remove_this_kf =
false;
1973 NotCloserToOther<reco::PFBlockElement::TRACK, reco::PFBlockElement::HCAL> tracksToHCALs(
_currentblock, *secd_kf);
1977 const float secpin = trkRef->p();
1979 for (
auto ecal = ecal_begin;
ecal != ecal_end; ++
ecal) {
1980 const double ecalenergy = (*ecal)->clusterRef()->correctedEnergy();
1983 if (cluster_in_sc.size() < clus_idx + 1) {
1988 cluster_in_sc.push_back(dist != -1.0
f);
1995 if (RO.localMap.contains(
ecal->get(), *secd_kf)) {
1996 auto hcal_matched = std::partition(hcal_begin, hcal_end, tracksToHCALs);
1997 for (
auto hcalclus = hcal_begin; hcalclus != hcal_matched; ++hcalclus) {
1999 dynamic_cast<const reco::PFBlockElementCluster*>(hcalclus->get());
2000 const double hcalenergy = clusthcal->
clusterRef()->energy();
2001 const double hpluse = ecalenergy + hcalenergy;
2002 const bool isHoHE = ((hcalenergy / hpluse) > 0.1 &&
goodTrack);
2003 const bool isHoE = (hcalenergy > ecalenergy);
2004 const bool isPoHE = (secpin > hpluse);
2005 if (cluster_in_sc[clus_idx]) {
2006 if (isHoE || isPoHE) {
2007 LOGDRESSED(
"PFEGammaAlgo") <<
"REJECTED TRACK FOR H/E or P/(H+E), CLUSTER IN SC"
2008 <<
" H/H+E " << (hcalenergy / hpluse) <<
" H/E " << (hcalenergy > ecalenergy)
2009 <<
" P/(H+E) " << (secpin / hpluse) <<
" HCAL ENE " << hcalenergy
2010 <<
" ECAL ENE " << ecalenergy <<
" secPIN " << secpin <<
" Algo Track "
2011 << trkRef->algo() << std::endl;
2012 remove_this_kf =
true;
2016 LOGDRESSED(
"PFEGammaAlgo") <<
"REJECTED TRACK FOR H/H+E, CLUSTER NOT IN SC"
2017 <<
" H/H+E " << (hcalenergy / hpluse) <<
" H/E " << (hcalenergy > ecalenergy)
2018 <<
" P/(H+E) " << (secpin / hpluse) <<
" HCAL ENE " << hcalenergy
2019 <<
" ECAL ENE " << ecalenergy <<
" secPIN " << secpin <<
" Algo Track "
2020 << trkRef->algo() << std::endl;
2021 remove_this_kf =
true;
2027 if (remove_this_kf) {
2028 secd_kf = RO.secondaryKFs.erase(secd_kf);
2029 if (secd_kf == RO.secondaryKFs.end())
References _currentblock, _currentlinks, _splayedblock, reco::PFBlockElementCluster::clusterRef(), CommutativePairs< T >::contains(), HLT_2018_cff::distance, 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 1890 of file PFEGammaAlgo.cc.
1892 if (RO.primaryGSFs.empty())
1895 const double Pin_gsf = RO.primaryGSFs.front()->GsftrackRef()->pMode();
1896 const double gsfOuterEta = RO.primaryGSFs.front()->positionAtECALEntrance().Eta();
1897 double tot_ecal = 0.0;
1898 std::vector<double> min_brem_dists;
1899 std::vector<double> closest_brem_eta;
1901 for (
const auto&
ecal : RO.ecalclusters) {
1902 tot_ecal +=
ecal->clusterRef()->correctedEnergy();
1905 double min_brem_dist = 5000.0;
1906 double eta = -999.0;
1907 for (
const auto& brem : RO.brems) {
1909 if (dist < min_brem_dist && dist != -1.0
f) {
1910 min_brem_dist = dist;
1911 eta = brem->positionAtECALEntrance().Eta();
1914 min_brem_dists.push_back(min_brem_dist);
1915 closest_brem_eta.push_back(
eta);
1920 for (
auto secd_kf = RO.secondaryKFs.begin(); secd_kf != RO.secondaryKFs.end(); ++secd_kf) {
1922 const float secpin = (*secd_kf)->trackRef()->p();
1923 bool remove_this_kf =
false;
1924 for (
auto ecal = RO.ecalclusters.begin();
ecal != RO.ecalclusters.end(); ++
ecal) {
1926 const float minbremdist = min_brem_dists[bremidx];
1927 const double ecalenergy = (*ecal)->clusterRef()->correctedEnergy();
1928 const double Epin = ecalenergy / secpin;
1929 const double detaGsf =
std::abs(gsfOuterEta - (*ecal)->clusterRef()->positionREP().Eta());
1930 const double detaBrem =
std::abs(closest_brem_eta[bremidx] - (*ecal)->clusterRef()->positionREP().Eta());
1932 bool kf_matched = RO.localMap.contains(
ecal->get(), *secd_kf);
1934 const float tkdist =
1940 if (Epin > 3 && kf_matched && tkdist != -1.0
f && tkdist < minbremdist && detaGsf > 0.05 && detaBrem > 0.015) {
1941 double res_with =
std::abs((tot_ecal - Pin_gsf) / Pin_gsf);
1942 double res_without =
std::abs((tot_ecal - ecalenergy - Pin_gsf) / Pin_gsf);
1943 if (res_without < res_with) {
1944 LOGDRESSED(
"PFEGammaAlgo") <<
" REJECTED_RES totenergy " << tot_ecal <<
" Pin_gsf " << Pin_gsf
1945 <<
" cluster to secondary " << ecalenergy <<
" res_with " << res_with
1946 <<
" res_without " << res_without << std::endl;
1947 tot_ecal -= ecalenergy;
1948 remove_this_kf =
true;
1949 ecal = RO.ecalclusters.erase(
ecal);
1950 if (
ecal == RO.ecalclusters.end())
1955 if (remove_this_kf) {
1956 secd_kf = RO.secondaryKFs.erase(secd_kf);
1957 if (secd_kf == RO.secondaryKFs.end())
References _currentblock, _currentlinks, funct::abs(), PFEGammaAlgo::ProtoEGObject::brems, CommutativePairs< T >::contains(), HLT_2018_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 776 of file PFEGammaAlgo.cc.
779 ecalclusters.clear();
781 LOGVERB(
"PFEGammaAlgo") <<
"Pointer to SC element: 0x" << std::hex << thesc <<
std::dec << std::endl
782 <<
"cleared ecalclusters and ecal2ps!" << std::endl;
787 if (ecalbegin == ecalend && hgcalbegin == hgcalend) {
788 LOGERR(
"PFEGammaAlgo::unwrapSuperCluster()") <<
"There are no ECAL elements in a block with imported SC!"
789 <<
" This is a bug we should fix this!" << std::endl;
796 <<
"SuperCluster pointed to by block element is null!" << std::endl;
798 LOGDRESSED(
"PFEGammaAlgo") <<
"Got a valid super cluster ref! 0x" << std::hex << scref.
get() <<
std::dec << std::endl;
799 const size_t nscclusters = scref->clustersSize();
800 const size_t nscpsclusters = scref->preshowerClustersSize();
801 size_t npfpsclusters = 0;
802 size_t npfclusters = 0;
803 LOGDRESSED(
"PFEGammaAlgo") <<
"Precalculated cluster multiplicities: " << nscclusters <<
' ' << nscpsclusters
805 NotCloserToOther<reco::PFBlockElement::SC, reco::PFBlockElement::ECAL> ecalClustersInSC(
_currentblock, thesc);
806 NotCloserToOther<reco::PFBlockElement::SC, reco::PFBlockElement::HGCAL> hgcalClustersInSC(
_currentblock, thesc);
807 auto ecalfirstnotinsc = std::partition(ecalbegin, ecalend, ecalClustersInSC);
808 auto hgcalfirstnotinsc = std::partition(hgcalbegin, hgcalend, hgcalClustersInSC);
818 std::vector<const ClusterElement*> safePFClusters =
819 is_pf_sc ? std::vector<const ClusterElement*>()
822 if (ecalfirstnotinsc == ecalbegin && hgcalfirstnotinsc == hgcalbegin) {
823 LOGERR(
"PFEGammaAlgo::unwrapSuperCluster()") <<
"No associated block elements to SuperCluster!"
824 <<
" This is a bug we should fix!" << std::endl;
830 if (is_pf_sc && nscclusters != npfclusters) {
831 std::stringstream sc_err;
832 thesc->
Dump(sc_err,
"\t");
834 <<
"The number of found ecal elements (" << nscclusters <<
") in block is not the same as"
835 <<
" the number of ecal PF clusters reported by the PFSuperCluster"
836 <<
" itself (" << npfclusters <<
")! This should not happen!" << std::endl
837 << sc_err.str() << std::endl;
839 for (
auto ecalitr = ecalbegin; ecalitr != ecalfirstnotinsc; ++ecalitr) {
844 if (!is_pf_sc &&
std::find(safePFClusters.begin(), safePFClusters.end(), elemascluster) == safePFClusters.end())
848 ecalclusters.emplace_back(elemascluster,
true);
850 ecalitr->setFlag(
false);
854 auto emplaceresult = ecal2ps.emplace(elemascluster, ClusterMap::mapped_type());
855 if (!emplaceresult.second) {
856 std::stringstream clus_err;
857 elemascluster->Dump(clus_err,
"\t");
859 <<
"List of pointers to ECAL block elements contains non-unique items!"
860 <<
" This is very bad!" << std::endl
861 <<
"cluster ptr = 0x" << std::hex << elemascluster <<
std::dec << std::endl
862 << clus_err.str() << std::endl;
864 ClusterMap::mapped_type& eslist = emplaceresult.first->second;
868 for (
auto hgcalitr = hgcalbegin; hgcalitr != hgcalfirstnotinsc; ++hgcalitr) {
873 if (!is_pf_sc &&
std::find(safePFClusters.begin(), safePFClusters.end(), elemascluster) == safePFClusters.end())
877 ecalclusters.emplace_back(elemascluster,
true);
879 hgcalitr->setFlag(
false);
896 LOGDRESSED(
"PFEGammaAlgo") <<
" Unwrapped SC has " << npfclusters <<
" ECAL sub-clusters"
897 <<
" and " << npfpsclusters <<
" PreShower layers 1 & 2 clusters!" << std::endl;
References _currentblock, _splayedblock, attachPSClusters(), TauDecayModes::dec, HLT_2018_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.
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_
trackRef_iterator tracks_end() const
last iterator over tracks
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
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
trackRef_iterator tracks_begin() const
first iterator over tracks
void initializeProtoCands(std::list< ProtoEGObject > &)
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 &)
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_