53 return p.Z()-v.Z() - ((p.X()-v.X()) * c.
px() + (p.Y()-v.Y())*c.
py()) * c.
pz()/(c.
pt()*c.
pt());
63 PVOrigs_(consumes<
reco::
VertexCollection>(iConfig.getParameter<edm::InputTag>(
"originalVertices"))),
64 TKOrigs_(consumes<
reco::
TrackCollection>(iConfig.getParameter<edm::InputTag>(
"originalTracks"))),
65 minPtForTrackProperties_(iConfig.getParameter<double>(
"minPtForTrackProperties"))
67 produces< std::vector<pat::PackedCandidate> > ();
68 produces< edm::Association<pat::PackedCandidateCollection> > ();
69 produces< edm::Association<reco::PFCandidateCollection> > ();
87 std::vector<reco::Candidate>::const_iterator cand;
90 iEvent.
getByToken( CandsFromPVLoose_, candsFromPVLoose );
92 iEvent.
getByToken( CandsFromPVTight_, candsFromPVTight );
96 if (ptr.ptr().id() == cands.
id()) {
98 }
else if (ptr.backPtr().id() == cands.
id()) {
101 throw cms::Exception(
"Configuration",
"The elements from 'inputCollectionFromPVLoose' don't point to 'inputCollection'\n");
105 if (ptr.ptr().id() == cands.
id()) {
107 }
else if (ptr.backPtr().id() == cands.
id()) {
110 throw cms::Exception(
"Configuration",
"The elements from 'inputCollectionFromPVTight' don't point to 'inputCollection'\n");
123 PVpos = PV->position();
129 std::auto_ptr< std::vector<pat::PackedCandidate> > outPtrP(
new std::vector<pat::PackedCandidate> );
130 std::vector<int> mapping(cands->size());
131 std::vector<int> mappingTk(TKOrigs->size(), -1);
133 std::vector<int> jetOrder;
134 std::vector<int> jetOrderReverse;
135 for(
unsigned int i=0;
i<cands->size();
i++) jetOrderReverse.push_back(-1);
139 for(
unsigned int i=0;
i<dau.size();
i++)
141 if((*cands)[dau[
i].key()].trackRef().isNonnull() && (*cands)[dau[
i].key()].pt() > minPtForTrackProperties_){
142 jetOrder.push_back(dau[
i].
key());
143 jetOrderReverse[jetOrder.back()]=jetOrder.size()-1;
146 for(
unsigned int i=0;
i<dau.size();
i++)
148 if(!((*cands)[dau[
i].
key()].trackRef().isNonnull() && (*cands)[dau[
i].
key()].
pt() > minPtForTrackProperties_)){
149 jetOrder.push_back(dau[
i].
key());
150 jetOrderReverse[jetOrder.back()]=jetOrder.size()-1;
155 for(
unsigned int ic=0, nc = cands->size(); ic < nc; ++ic) {
156 if(jetOrderReverse[ic]==-1 && (*cands)[ic].trackRef().isNonnull() && (*cands)[ic].pt() > minPtForTrackProperties_)
158 jetOrder.push_back(ic);
159 jetOrderReverse[jetOrder.back()]=jetOrder.size()-1;
164 for(
unsigned int ic=0, nc = cands->size(); ic < nc; ++ic) {
165 if(jetOrderReverse[ic]==-1)
167 jetOrder.push_back(ic);
168 jetOrderReverse[jetOrder.back()]=jetOrder.size()-1;
175 for(
unsigned int ic=0, nc = cands->size(); ic < nc; ++ic) {
181 float phiAtVtx = cand.
phi();
196 phiAtVtx = ctrack->
phi();
210 outPtrP->back().setLostInnerHits( lostHits );
211 if(outPtrP->back().pt() > minPtForTrackProperties_) {
212 outPtrP->back().setTrackProperties(*ctrack);
220 outPtrP->back().setFromPV( fromPV[ic] );
224 outPtrP->back().setMuonID(cand.
muonRef()->isStandAloneMuon(), cand.
muonRef()->isGlobalMuon());
228 outPtrP->back().setFromPV( fromPV[ic] );
247 pf2pcFiller.
insert(cands, jetOrderReverse.begin(), jetOrderReverse.end());
248 pc2pfFiller.
insert(oh , jetOrder.begin(), jetOrder.end());
250 pf2pcFiller.
insert(cands, mapping.begin(), mapping.end());
251 pc2pfFiller.
insert(oh , mapping.begin(), mapping.end());
254 pf2pcFiller.
insert(TKOrigs, mappingTk.begin(), mappingTk.end());
virtual int pdgId() const
PDG identifier.
edm::EDGetTokenT< reco::PFCandidateFwdPtrVector > CandsFromPVLoose_
float calcDz(reco::Candidate::Point p, reco::Candidate::Point v, const reco::Candidate &c)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
virtual float phi() const
momentum azimuthal angle
int numberOfLostHits() const
Sin< T >::type sin(const T &t)
virtual double pz() const =0
z coordinate of momentum vector
void insert(const H &h, I begin, I end)
std::vector< Track > TrackCollection
collection of Tracks
double phi() const
azimuthal angle of momentum vector
std::vector< Vertex > VertexCollection
collection of Vertex objects
const Point & referencePoint() const
Reference point on the track.
edm::EDGetTokenT< reco::TrackCollection > TKOrigs_
reco::TrackRef trackRef() const
bool isNonnull() const
Checks for non-null.
virtual float pt() const =0
transverse momentum
PATPackedCandidateProducer(const edm::ParameterSet &)
edm::EDGetTokenT< reco::PFCandidateCollection > Cands_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
float trackWeight(const TrackBaseRef &r) const
returns the weight with which a Track has contributed to the vertex-fit.
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
virtual const Point & vertex() const
vertex position (overwritten by PF...)
const HitPattern & trackerExpectedHitsInner() const
Access the hit pattern counting (in the Tracker) the number of expected crossed layers before the fir...
virtual double py() const =0
y coordinate of momentum vector
edm::EDGetTokenT< reco::VertexCollection > PVs_
edm::EDGetTokenT< reco::PFCandidateFwdPtrVector > CandsFromPVTight_
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
edm::Ref< VertexCollection > VertexRef
persistent reference to a Vertex
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
reco::MuonRef muonRef() const
virtual double px() const =0
x coordinate of momentum vector
LostInnerHits
Enumerator specifying the.
std::vector< CandidatePtr > daughters
collection of references to daughters
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
std::vector< PFCandidateFwdPtr > PFCandidateFwdPtrVector
vector of "forward" reference
XYZPointD XYZPoint
point in space with cartesian internal representation
key_type key() const
Accessor for product key.
Analysis-level calorimeter jet class.
~PATPackedCandidateProducer()
float calcDxy(float dx, float dy, float phi)
Particle reconstructed by the particle flow algorithm.
virtual const PolarLorentzVector & polarP4() const
four-momentum Lorentz vector
virtual void produce(edm::Event &, const edm::EventSetup &)
reco::GsfTrackRef gsfTrackRef() const
const daughters & daughterPtrVector() const
references to daughtes
math::XYZPoint Point
point in the space
double minPtForTrackProperties_
ProductID id() const
Accessor for product ID.
bool hasValidHitInFirstPixelBarrel() const
edm::EDGetTokenT< reco::VertexCollection > PVOrigs_