4 #include <boost/foreach.hpp>
14 namespace reco {
namespace tau {
25 if (cand->trackRef().isNonnull())
27 else if (cand->gsfTrackRef().isNonnull()) {
35 class DZtoTrack :
public std::unary_function<double, reco::VertexRef> {
48 class TrackWeightInVertex :
public std::unary_function<double, reco::VertexRef>
56 return vtx->trackWeight(
trk_);
68 std::string
algorithm =
"highestPtInEvent";
71 if (!pset.
exists(
"primaryVertexSrc") || !pset.
exists(
"pvFindingAlgo")) {
73 <<
"The PSet passed to the RecoTauVertexAssociator was"
74 <<
" incorrectly configured. The vertex will be taken as the "
75 <<
"highest Pt vertex from the offlinePrimaryVertices collection."
79 algorithm = pset.
getParameter<std::string>(
"pvFindingAlgo");
82 if (algorithm ==
"highestPtInEvent") {
84 }
else if (algorithm ==
"closestInDeltaZ") {
86 }
else if (algorithm ==
"highestWeightForLeadTrack") {
90 <<
"The algorithm specified for tau-vertex association "
91 << algorithm <<
" is invalid. Options are: " << std::endl
92 <<
"highestPtInEvent,"
94 <<
"or highestWeightForLeadTrack." << std::endl;
103 for(
size_t i = 0;
i < verticesH_->size(); ++
i) {
126 DZtoTrack dzComputer(getLeadTrack(jet));
129 double dz = dzComputer(vtx);
130 if (dz < closestDistance) {
131 closestDistance = dz;
136 double largestWeight = 0.;
138 TrackWeightInVertex weightComputer(getLeadTrack(jet));
141 double weight = weightComputer(vtx);
142 if (weight > largestWeight) {
T getParameter(std::string const &) const
reco::VertexRef associatedVertex(const PFJet &tau) const
< trclass="colgroup">< tdclass="colgroup"colspan=5 > Ecal cluster collections</td ></tr >< tr >< td >< ahref="classreco_1_1BasicCluster.html"> reco::BasicCluster</a ></td >< td >< ahref="DataFormats_EgammaReco.html"> reco::BasicClusterCollection</a ></td >< td >< ahref="#"> hybridSuperClusters</a ></td >< tdclass="description"> Basic clusters reconstructed with hybrid algorithm(barrel only)</td >< td >S.Rahatlou</td ></tr >< tr >< td >< a href
const PFJetRef & jetRef() const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void setEvent(const edm::Event &evt)
Load the vertices from the event.
Jets made from PFObjects.
RecoTauVertexAssociator(const edm::ParameterSet &pset)
bool isNull() const
Checks for null.
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
edm::Ref< VertexCollection > VertexRef
persistent reference to a Vertex
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
const PFTauTagInfoRef & pfTauTagInfoRef() const
std::vector< reco::VertexRef > vertices_
std::vector< PFCandidatePtr > pfChargedCands(const PFJet &jet, bool sort=true)
Extract all non-neutral candidates from a PFJet.
const reco::TrackBaseRef trk_
edm::Ptr< PFCandidate > PFCandidatePtr
persistent Ptr to a PFCandidate