|
|
Go to the documentation of this file. 1 #ifndef RecoTauTag_RecoTau_RecoTauCommonUtilities_h
2 #define RecoTauTag_RecoTau_RecoTauCommonUtilities_h
24 #include <boost/iterator/transform_iterator.hpp>
25 #include <boost/iterator/indirect_iterator.hpp>
26 #include <boost/mem_fn.hpp>
28 #include <boost/type_traits/is_base_of.hpp>
40 template <
typename Iterator>
45 std::vector<CandidatePtr>
output;
58 std::vector<CandidatePtr>
pfCandidates(
const Jet&
jet,
int particleId,
bool sort =
true);
61 std::vector<CandidatePtr>
pfCandidates(
const Jet&
jet,
const std::vector<int>& particleIds,
bool sort =
true);
74 std::vector<CandidatePtr>
pfGammas(
const Jet&
jet,
bool sort =
true);
77 std::vector<CandidatePtr>
flattenPiZeros(
const std::vector<RecoTauPiZero>::const_iterator&,
78 const std::vector<RecoTauPiZero>::const_iterator&);
79 std::vector<CandidatePtr>
flattenPiZeros(
const std::vector<RecoTauPiZero>&);
82 template <
typename RefVectorType,
typename BaseView>
89 size_t nElements = view->size();
92 for (
size_t i = 0;
i < nElements; ++
i) {
93 output.push_back(view->refAt(
i).template castTo<OutputRef>());
103 template <
typename InputIterator>
110 template <
typename InputIterator,
typename FunctionPtr,
typename ReturnType>
120 template <
typename InputIterator>
126 template <
typename InputIterator>
132 template <
typename InputIterator>
137 template <
typename InputIterator>
140 InputIterator max_cand =
begin;
142 if ((*cand)->pt() > max_pt) {
143 max_pt = (*cand)->pt();
std::vector< CandidatePtr > pfChargedCands(const Jet &jet, bool sort=true)
Extract all non-neutral candidates from a PFJet.
bool operator()(const CandidatePtr &a, const CandidatePtr &b) const
math::XYZPointF atECALEntrance(const reco::Candidate *part, double bField)
InputIterator leadCand(InputIterator begin, InputIterator end)
virtual double pt() const =0
transverse momentum
std::vector< CandidatePtr > flattenPiZeros(const std::vector< RecoTauPiZero >::const_iterator &, const std::vector< RecoTauPiZero >::const_iterator &)
Flatten a list of pi zeros into a list of there constituent PFCandidates.
virtual int charge() const =0
electric charge
int sumPFCandCharge(InputIterator begin, InputIterator end)
Sum the charge of a collection of PFCandidates.
std::map< DetId, double > ReturnType
std::vector< CandidatePtr > pfGammas(const Jet &jet, bool sort=true)
Extract all pfGammas from a PFJet.
ReturnType sumPFVector(InputIterator begin, InputIterator end, FunctionPtr func, ReturnType init)
Sum the four vectors in a collection of PFCandidates.
std::vector< CandidatePtr > filterPFCandidates(const Iterator &begin, const Iterator &end, int pdgId, bool sort=true)
Container::value_type value_type
InputIterator takeNElements(const InputIterator &begin, const InputIterator &end, size_t N)
std::vector< CandidatePtr > pfCandidatesByPdgId(const Jet &jet, int pdgId, bool sort=true)
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
Abs< T >::type abs(const T &t)
reco::Candidate::LorentzVector sumPFCandP4(InputIterator begin, InputIterator end)
std::vector< CandidatePtr > pfCandidates(const Jet &jet, int particleId, bool sort=true)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
RefVectorType castView(const edm::Handle< BaseView > &view)
Convert a BaseView (View<T>) to a TRefVector.
double sumPFCandPt(InputIterator begin, InputIterator end)
Sum the pT of a collection of PFCandidates.