25 std::vector<reco::PFCandidateRef> myVec;
31 reco::PFCandidate::ElementsInBlocks::const_iterator ieg = theElementsInpfEGcand.begin();
34 unsigned nObj = pfCandidateHandle->size();
35 for (
unsigned int lCand = 0; lCand < nObj; lCand++) {
40 dR =
deltaR(candidateDirection.Eta(), candidateDirection.Phi(), pfCandRef->eta(), pfCandRef->phi());
47 bool elementFound =
false;
48 for (reco::PFCandidate::ElementsInBlocks::const_iterator ipf = theElementsInPFcand.begin();
49 ipf < theElementsInPFcand.end();
51 if (ipf->first == egblock && !elementFound) {
52 for (ieg = theElementsInpfEGcand.begin(); ieg < theElementsInpfEGcand.end(); ++ieg) {
53 if (ipf->second == ieg->second && !elementFound) {
55 myVec.push_back(pfCandRef);
96 bool passesCleaning =
false;
98 if (ecalClusWithMaxEt) {
101 pfEGCand->superClusterRef()
104 passesCleaning =
true;
106 for (
auto cluster : pfEGCand->superClusterRef()->clusters()) {
110 if (ecalClusWithMaxEt->
clusterRef()->seed() == cluster->seed()) {
111 passesCleaning =
true;
116 return passesCleaning;
120 float maxECALEt = -1;
123 for (
auto& elemIndx : elementsInPFCand) {
125 elemIndx.second < elemIndx.first->elements().size() ? &elemIndx.first->elements()[elemIndx.second] :
nullptr;
128 maxEtECALCluster = elem;
Abstract base class for a PFBlock element (track, cluster...)
T getParameter(std::string const &) const
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool elementPassesCleaning(const reco::PFCandidateRef &pfCand, const reco::PFCandidateRef &pfEGCand)
std::vector< reco::PFCandidateRef > calculate(math::XYZTLorentzVectorD p4, const reco::PFCandidateRef pfEGCand, const edm::Handle< reco::PFCandidateCollection > pfCandidateHandle)
bool isNonnull() const
Checks for non-null.
const SuperClusterRef & superClusterRef() const
std::vector< ElementInBlock > ElementsInBlocks
const ElementsInBlocks & elementsInBlocks() const
bool passesCleaningNeutralHadron(const reco::PFCandidateRef &pfCand, const reco::PFCandidateRef &pfEGCand)
void setup(const edm::ParameterSet &conf)
virtual const PFClusterRef & clusterRef() const
bool passesCleaningPhoton(const reco::PFCandidateRef &pfCand, const reco::PFCandidateRef &pfEGCand)
const PFClusterRef & clusterRef() const override
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Particle reconstructed by the particle flow algorithm.
const reco::PFBlockElementCluster * getHighestEtECALCluster(const reco::PFCandidate &pfCand)
bool passesCleaningChargedHadron(const reco::PFCandidateRef &pfCand, const reco::PFCandidateRef &pfEGCand)