15 : mDeltaR2Threshold (fDr*fDr)
20 const std::vector <reco::TrackRef>& fTracks,
24 std::vector <math::RhoEtaPhiVector> trackP3s;
25 std::map <int,double> trackvert;
29 trackP3s.reserve (fTracks.size());
30 for (
unsigned i = 0;
i < fTracks.size(); ++
i) {
39 int trackhasvert = -1;
40 for( reco::VertexCollection::const_iterator iv = vertices.begin(); iv != vertices.end(); iv++) {
41 std::vector<reco::TrackBaseRef>::const_iterator
rr =
42 find((*iv).tracks_begin(),
45 if( rr != (*iv).tracks_end() ) {
47 trackvert[
i] = (*iv).position().z();
52 if(trackhasvert < 0) {
55 trackvert[
i] = track->
dz(ppt);
62 for (
unsigned j = 0;
j < fJets.size(); ++
j) {
69 for (
unsigned t = 0;
t < fTracks.size(); ++
t) {
71 std::map<int, double>::iterator cur = trackvert.find(
t);
72 if(cur != trackvert.end()) {
73 neweta = jet->
physicsEta((*cur).second,jetEta);
81 double dR2 =
deltaR2 (neweta, jetPhi, trackP3s[
t].
eta(), trackP3s[
t].
phi());
double p() const
momentum vector magnitude
Base class for all types of Jets.
JetTracksAssociationDRVertexAssigned(double fDr)
double phi() const
azimuthal angle of momentum vector
std::vector< Vertex > VertexCollection
collection of Vertex objects
double mDeltaR2Threshold
fidutial dR between track in the vertex and jet's reference direction
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
RhoEtaPhiVectorD RhoEtaPhiVector
spatial vector with cylindrical internal representation using pseudorapidity
virtual double eta() const
momentum pseudorapidity
void produce(reco::JetTracksAssociation::Container *fAssociation, const std::vector< edm::RefToBase< reco::Jet > > &fJets, const std::vector< reco::TrackRef > &fTracks, const reco::VertexCollection &vertices) const
double eta() const
pseudorapidity of momentum vector
bool setValue(Container &, const reco::JetBaseRef &, reco::TrackRefVector)
associate jet with value. Returns false and associate nothing if jet is already associated ...
double deltaR2(const T1 &t1, const T2 &t2)
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...
XYZPointD XYZPoint
point in space with cartesian internal representation
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
virtual double phi() const
momentum azimuthal angle
static float physicsEta(float fZVertex, float fDetectorEta)
static function to convert detector eta to physics eta