47 std::vector<reco::PFCandidateRef> myVec;
53 reco::PFCandidate::ElementsInBlocks::const_iterator ieg = theElementsInpfEGcand.begin();
57 unsigned nObj = pfCandidateHandle->size();
58 for(
unsigned int lCand=0; lCand < nObj; lCand++) {
64 dR =
deltaR(candidateDirection.Eta(), candidateDirection.Phi(), pfCandRef->eta(), pfCandRef->phi());
70 bool elementFound=
false;
71 for (reco::PFCandidate::ElementsInBlocks::const_iterator ipf = theElementsInPFcand.begin(); ipf<theElementsInPFcand.end(); ++ipf) {
73 if ( ipf->first == egblock && !elementFound ) {
75 for (ieg = theElementsInpfEGcand.begin(); ieg<theElementsInpfEGcand.end(); ++ieg) {
76 if ( ipf->second == ieg->second && !elementFound ) {
78 myVec.push_back(pfCandRef);
127 bool passesCleaning=
false;
129 if(ecalClusWithMaxEt){
131 ecalClusWithMaxEt->
superClusterRef()->seed()->seed()==pfEGCand->superClusterRef()->seed()->seed()){
134 for(
auto cluster : pfEGCand->superClusterRef()->clusters()){
138 if(ecalClusWithMaxEt->
clusterRef()->seed()==cluster->seed()) {
144 return passesCleaning;
154 for(
auto& elemIndx : elementsInPFCand){
155 const reco::PFBlockElement*
elem = elemIndx.second<elemIndx.first->elements().size() ? &elemIndx.first->elements()[elemIndx.second] :
nullptr;
158 maxEtECALCluster =
elem;
T getParameter(std::string const &) const
Abstract base class for a PFBlock element (track, cluster...)
bool isNonnull() const
Checks for non-null.
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
virtual const PFClusterRef & clusterRef() const
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)
const PFClusterRef & clusterRef() const
std::vector< ElementInBlock > ElementsInBlocks
const SuperClusterRef & superClusterRef() const
bool passesCleaningNeutralHadron(const reco::PFCandidateRef &pfCand, const reco::PFCandidateRef &pfEGCand)
void setup(const edm::ParameterSet &conf)
bool passesCleaningPhoton(const reco::PFCandidateRef &pfCand, const reco::PFCandidateRef &pfEGCand)
double deltaR(double eta1, double eta2, double phi1, double phi2)
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)
const ElementsInBlocks & elementsInBlocks() const