|
|
Go to the documentation of this file.
53 typedef std::vector<reco::CandidatePtr>
CandPtrs;
89 edm::ParameterSet qcuts_pset =
pset.getParameterSet(
"qualityCuts").getParameterSet(
"signalQualityCuts");
127 int maxUnmatchedBlockElements1plus2) {
129 int numBlocks1 = blockElements1.size();
131 int numBlocks2 = blockElements2.size();
132 int numBlocks_matched = 0;
133 for (reco::PFCandidate::ElementsInBlocks::const_iterator blockElement1 = blockElements1.begin();
134 blockElement1 != blockElements1.end();
137 for (reco::PFCandidate::ElementsInBlocks::const_iterator blockElement2 = blockElements2.begin();
138 blockElement2 != blockElements2.end();
140 if (blockElement1->first.id() == blockElement2->first.id() &&
141 blockElement1->first.key() == blockElement2->first.key() &&
142 blockElement1->second == blockElement2->second) {
149 assert(numBlocks_matched <= numBlocks1);
150 assert(numBlocks_matched <= numBlocks2);
151 if (numBlocks_matched >= minMatches1 && numBlocks_matched >= minMatches2 &&
152 ((numBlocks1 - numBlocks_matched) + (numBlocks2 - numBlocks_matched)) <= maxUnmatchedBlockElements1plus2) {
163 edm::LogPrint(
"TauChHadronFromPF") <<
"<PFRecoTauChargedHadronFromPFCandidatePlugin::operator()>:";
173 for (CandPtrs::iterator
cand = candsVector.begin();
cand != candsVector.end(); ++
cand) {
176 <<
"processing PFCandidate: Pt = " << (*cand)->pt() <<
", eta = " << (*cand)->eta()
177 <<
", phi = " << (*cand)->phi() <<
" (pdgId = " << (*cand)->pdgId() <<
", charge = " << (*cand)->charge()
182 if (
std::abs((*cand)->charge()) > 0.5)
209 for (
const auto& jetConstituent :
jet.daughterPtrVector()) {
214 int jetConstituentPdgId =
std::abs(jetConstituent->pdgId());
215 if (!(jetConstituentPdgId == 130 || jetConstituentPdgId == 22))
220 double dRmerge = -1.;
221 int minBlockElementMatches = 1000;
222 int maxUnmatchedBlockElements = 0;
223 double minMergeEt = 1.e+6;
224 if (jetConstituentPdgId == 130) {
227 else if (
pdgId == 130)
229 else if (
pdgId == 11)
236 }
else if (jetConstituentPdgId == 22) {
239 else if (
pdgId == 130)
241 else if (
pdgId == 11)
250 if (jetConstituent->et() > minMergeEt) {
252 chargedHadron->neutralPFCandidates_.push_back(jetConstituent);
257 dynamic_cast<const reco::PFCandidate*>(jetConstituent.get());
258 if (pfCand !=
nullptr && pfJetConstituent !=
nullptr) {
259 if (isMatchedByBlockElement(*pfJetConstituent,
261 minBlockElementMatches,
262 minBlockElementMatches,
263 maxUnmatchedBlockElements)) {
264 chargedHadron->neutralPFCandidates_.push_back(jetConstituent);
294 "PFRecoTauChargedHadronFromPFCandidatePlugin");
reco::TrackRef trackRef() const
double minMergeChargedHadronPt_
double dRmergeNeutralHadronWrtNeutralHadron_
const edm::Event * evt() const
Base class for all types of Jets.
double dRmergePhotonWrtChargedHadron_
const std::string & name() const
Log< level::Warning, true > LogPrint
math::XYZPointF atECALEntrance(const reco::Candidate *part, double bField)
const ElementsInBlocks & elementsInBlocks() const
double minMergeNeutralHadronEt_
std::vector< reco::CandidatePtr > CandPtrs
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
reco::MuonRef muonRef() const
void setChargedHadronP4(reco::PFRecoTauChargedHadron &chargedHadron, double scaleFactor_neutralPFCands=1.0)
void setPV(const reco::VertexRef &vtx)
Update the primary vertex.
RecoTauQualityCuts * qcuts_
PFRecoTauChargedHadronFromPFCandidatePlugin(const edm::ParameterSet &, edm::ConsumesCollector &&iC)
Global3DPoint GlobalPoint
#define DEFINE_EDM_PLUGIN(factory, type, name)
boost::ptr_vector< PFRecoTauChargedHadron > ChargedHadronVector
std::unique_ptr< ChargedHadronVector > return_type
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bFieldToken_
std::vector< ElementInBlock > ElementsInBlocks
double dRmergeNeutralHadronWrtOther_
double dRmergeNeutralHadronWrtElectron_
bool isMatched(TrackingRecHit const &hit)
Coll filterCandRefs(const Coll &refcoll, bool invert=false) const
Filter a ref vector of Candidates.
reco::VertexRef associatedVertex(const Jet &jet) const
PFRecoTauChargedHadronAlgorithm
reco::GsfTrackRef gsfTrackRef() const
double dRmergePhotonWrtOther_
bool isNonnull() const
Checks for non-null.
void beginEvent() override
Hook called at the beginning of the event.
double dRmergePhotonWrtNeutralHadron_
int minBlockElementMatchesNeutralHadron_
int maxUnmatchedBlockElementsNeutralHadron_
void setEvent(const edm::Event &evt)
Load the vertices from the event.
RecoTauVertexAssociator vertexAssociator_
bool getData(T &iHolder) const
return_type operator()(const reco::Jet &) const override
Build a collection of chargedHadrons from objects in the input jet.
int minBlockElementMatchesPhoton_
double dRmergePhotonWrtElectron_
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
std::vector< int > inputParticleIds_
Particle reconstructed by the particle flow algorithm.
Abs< T >::type abs(const T &t)
std::vector< CandidatePtr > pfCandidates(const Jet &jet, int particleId, bool sort=true)
const edm::EventSetup * evtSetup() const
double dRmergeNeutralHadronWrtChargedHadron_
~PFRecoTauChargedHadronFromPFCandidatePlugin() override
int maxUnmatchedBlockElementsPhoton_