CMS 3D CMS Logo

PATPackedCandidateProducer.cc
Go to the documentation of this file.
1 #include <string>
2 
3 
23 /*#include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
24 #include "TrackingTools/GeomPropagators/interface/AnalyticalImpactPointExtrapolator.h"
25 #include "MagneticField/Engine/interface/MagneticField.h"
26 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
27 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
28 #include "RecoVertex/VertexPrimitives/interface/ConvertToFromReco.h"
29 */
30 //#define CRAZYSORT
31 
32 namespace pat {
34  const static int qualityMap[8] = {1,0,1,1,4,4,5,6};
35 
37  public:
39  ~PATPackedCandidateProducer() override;
40 
41  void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
42 
43  //sorting of cands to maximize the zlib compression
45  if (std::abs(i.charge()) == std::abs(j.charge())) {
46  if(i.charge()!=0){
47  if(i.hasTrackDetails() and ! j.hasTrackDetails() ) return true;
48  if(! i.hasTrackDetails() and j.hasTrackDetails() ) return false;
49  if(i.covarianceSchema() > j.covarianceSchema() ) return true;
50  if(i.covarianceSchema() < j.covarianceSchema() ) return false;
51 
52  }
53  if(i.vertexRef() == j.vertexRef())
54  return i.eta() > j.eta();
55  else
56  return i.vertexRef().key() < j.vertexRef().key();
57  }
58  return std::abs(i.charge()) > std::abs(j.charge());
59  }
60  template <typename T>
61  std::vector<size_t> sort_indexes(const std::vector<T> &v ) const {
62  std::vector<size_t> idx(v.size());
63  for (size_t i = 0; i != idx.size(); ++i) idx[i] = i;
64  std::sort(idx.begin(), idx.end(),[&v,this](size_t i1, size_t i2) { return candsOrdering(v[i1],v[i2]);});
65  return idx;
66  }
67 
68  private:
69  //if PuppiSrc && PuppiNoLepSrc are empty, usePuppi is false
70  //otherwise assumes that if they are set, you wanted to use puppi and will throw an exception
71  //if the puppis are not found
72  const bool usePuppi_;
73 
85  std::vector< edm::EDGetTokenT<edm::View<reco::Candidate> > > SVWhiteLists_;
88 
91  const int covarianceVersion_;
92  const std::vector<int> covariancePackingSchemas_;
93 
94  const bool storeTiming_;
95 
96  // for debugging
97  float calcDxy(float dx, float dy, float phi) const {
98  return - dx * std::sin(phi) + dy * std::cos(phi);
99  }
101  return p.Z()-v.Z() - ((p.X()-v.X()) * c.px() + (p.Y()-v.Y())*c.py()) * c.pz()/(c.pt()*c.pt());
102  }
103  };
104 }
105 
107  usePuppi_(!iConfig.getParameter<edm::InputTag>("PuppiSrc").encode().empty() ||
108  !iConfig.getParameter<edm::InputTag>("PuppiNoLepSrc").encode().empty()),
109  Cands_(consumes<reco::PFCandidateCollection>(iConfig.getParameter<edm::InputTag>("inputCollection"))),
110  PVs_(consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("inputVertices"))),
111  PVAsso_(consumes<edm::Association<reco::VertexCollection> >(iConfig.getParameter<edm::InputTag>("vertexAssociator"))),
112  PVAssoQuality_(consumes<edm::ValueMap<int> >(iConfig.getParameter<edm::InputTag>("vertexAssociator"))),
113  PVOrigs_(consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("originalVertices"))),
114  TKOrigs_(consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("originalTracks"))),
115  PuppiWeight_(usePuppi_ ? consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("PuppiSrc")) : edm::EDGetTokenT< edm::ValueMap<float> >()),
116  PuppiWeightNoLep_(usePuppi_ ? consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("PuppiNoLepSrc")) : edm::EDGetTokenT< edm::ValueMap<float> >()),
117  PuppiCandsMap_(usePuppi_ ? consumes<edm::ValueMap<reco::CandidatePtr> >(iConfig.getParameter<edm::InputTag>("PuppiSrc")) : edm::EDGetTokenT<edm::ValueMap<reco::CandidatePtr> >() ),
118  PuppiCands_(usePuppi_ ? consumes<std::vector< reco::PFCandidate > >(iConfig.getParameter<edm::InputTag>("PuppiSrc")) : edm::EDGetTokenT<std::vector< reco::PFCandidate > >() ),
119  PuppiCandsNoLep_(usePuppi_ ? consumes<std::vector< reco::PFCandidate > >(iConfig.getParameter<edm::InputTag>("PuppiNoLepSrc")) : edm::EDGetTokenT<std::vector< reco::PFCandidate > >()),
120  storeChargedHadronIsolation_(!iConfig.getParameter<edm::InputTag>("chargedHadronIsolation").encode().empty()),
121  ChargedHadronIsolation_(consumes<edm::ValueMap<bool> >(iConfig.getParameter<edm::InputTag>("chargedHadronIsolation"))),
122  minPtForChargedHadronProperties_(iConfig.getParameter<double>("minPtForChargedHadronProperties")),
123  minPtForTrackProperties_(iConfig.getParameter<double>("minPtForTrackProperties")),
124  covarianceVersion_(iConfig.getParameter<int >("covarianceVersion")),
125  covariancePackingSchemas_(iConfig.getParameter<std::vector<int> >("covariancePackingSchemas")),
126  storeTiming_(iConfig.getParameter<bool>("storeTiming"))
127 {
128  std::vector<edm::InputTag> sv_tags = iConfig.getParameter<std::vector<edm::InputTag> >("secondaryVerticesForWhiteList");
129  for(auto itag : sv_tags){
130  SVWhiteLists_.push_back(
132  );
133  }
134 
135  produces< std::vector<pat::PackedCandidate> > ();
136  produces< edm::Association<pat::PackedCandidateCollection> > ();
137  produces< edm::Association<reco::PFCandidateCollection> > ();
138 }
139 
141 
142 
143 
145 
147  iEvent.getByToken( Cands_, cands );
148 
149  edm::Handle<edm::ValueMap<float> > puppiWeight;
152  edm::Handle<edm::ValueMap<float> > puppiWeightNoLep;
154  std::vector<reco::CandidatePtr> puppiCandsNoLepPtrs;
155  if(usePuppi_){
156  iEvent.getByToken( PuppiWeight_, puppiWeight );
157  iEvent.getByToken( PuppiCandsMap_, puppiCandsMap );
158  iEvent.getByToken( PuppiCands_, puppiCands );
159  iEvent.getByToken( PuppiWeightNoLep_, puppiWeightNoLep );
160  iEvent.getByToken( PuppiCandsNoLep_, puppiCandsNoLep );
161  for (auto pup : *puppiCandsNoLep){
162  puppiCandsNoLepPtrs.push_back(pup.sourceCandidatePtr(0));
163  }
164  }
165  std::vector<int> mappingPuppi(usePuppi_ ? puppiCands->size() : 0);
166 
168  iEvent.getByToken( PVOrigs_, PVOrigs );
169 
171  iEvent.getByToken(PVAsso_,assoHandle);
172  edm::Handle<edm::ValueMap<int> > assoQualityHandle;
173  iEvent.getByToken(PVAssoQuality_,assoQualityHandle);
174  const edm::Association<reco::VertexCollection> & associatedPV=*(assoHandle.product());
175  const edm::ValueMap<int> & associationQuality=*(assoQualityHandle.product());
176 
177  edm::Handle<edm::ValueMap<bool> > chargedHadronIsolationHandle;
179  iEvent.getByToken(ChargedHadronIsolation_,chargedHadronIsolationHandle);
180 
181  std::set<unsigned int> whiteList;
182  std::set<reco::TrackRef> whiteListTk;
183  for(auto itoken : SVWhiteLists_) {
184  edm::Handle<edm::View<reco::Candidate > > svWhiteListHandle;
185  iEvent.getByToken(itoken, svWhiteListHandle);
186  const edm::View<reco::Candidate > & svWhiteList=*(svWhiteListHandle.product());
187  for(unsigned int i=0; i<svWhiteList.size();i++) {
188  //Whitelist via Ptrs
189  for(unsigned int j=0; j< svWhiteList[i].numberOfSourceCandidatePtrs(); j++) {
190  const edm::Ptr<reco::Candidate> & c = svWhiteList[i].sourceCandidatePtr(j);
191  if(c.id() == cands.id()) whiteList.insert(c.key());
192 
193  }
194  //Whitelist via RecoCharged
195  for(auto dau = svWhiteList[i].begin(); dau != svWhiteList[i].end() ; dau++){
196  const reco::RecoChargedCandidate * chCand=dynamic_cast<const reco::RecoChargedCandidate *>(&(*dau));
197  if(chCand!=nullptr) {
198  whiteListTk.insert(chCand->track());
199  }
200  }
201  }
202  }
203 
204 
206  iEvent.getByToken( PVs_, PVs );
207  reco::VertexRef PV(PVs.id());
208  reco::VertexRefProd PVRefProd(PVs);
209  math::XYZPoint PVpos;
210 
211 
213  iEvent.getByToken( TKOrigs_, TKOrigs );
214  auto outPtrP = std::make_unique<std::vector<pat::PackedCandidate>>();
215  std::vector<int> mapping(cands->size());
216  std::vector<int> mappingReverse(cands->size());
217  std::vector<int> mappingTk(TKOrigs->size(), -1);
218 
219  for(unsigned int ic=0, nc = cands->size(); ic < nc; ++ic) {
220  const reco::PFCandidate &cand=(*cands)[ic];
221  const reco::Track *ctrack = nullptr;
222  if ((abs(cand.pdgId()) == 11 || cand.pdgId() == 22) && cand.gsfTrackRef().isNonnull()) {
223  ctrack = &*cand.gsfTrackRef();
224  } else if (cand.trackRef().isNonnull()) {
225  ctrack = &*cand.trackRef();
226  }
227  if (ctrack) {
228  float dist=1e99;
229  int pvi=-1;
230  for(size_t ii=0;ii<PVs->size();ii++){
231  float dz=std::abs(ctrack->dz( ((*PVs)[ii]).position()));
232  if(dz<dist) {pvi=ii;dist=dz; }
233  }
234  PV = reco::VertexRef(PVs, pvi);
235  math::XYZPoint vtx = cand.vertex();
237  const reco::VertexRef & PVOrig = associatedPV[reco::CandidatePtr(cands,ic)];
238  if(PVOrig.isNonnull()) PV = reco::VertexRef(PVs, PVOrig.key()); // WARNING: assume the PV slimmer is keeping same order
239  int quality=associationQuality[reco::CandidatePtr(cands,ic)];
240 // if ((size_t)pvi!=PVOrig.key()) std::cout << "not closest in Z" << pvi << " " << PVOrig.key() << " " << cand.pt() << " " << quality << std::endl;
241  // TrajectoryStateOnSurface tsos = extrapolator.extrapolate(trajectoryStateTransform::initialFreeState(*ctrack,&*magneticField), RecoVertex::convertPos(PV->position()));
242  // vtx = tsos.globalPosition();
243  // phiAtVtx = tsos.globalDirection().phi();
244  vtx = ctrack->referencePoint();
245  float ptTrk = ctrack->pt();
246  float etaAtVtx = ctrack->eta();
247  float phiAtVtx = ctrack->phi();
248 
250  if (nlost == 0) {
253  }
254  } else {
256  }
257 
258 
259  outPtrP->push_back( pat::PackedCandidate(cand.polarP4(), vtx, ptTrk, etaAtVtx, phiAtVtx, cand.pdgId(), PVRefProd, PV.key()));
260  outPtrP->back().setAssociationQuality(pat::PackedCandidate::PVAssociationQuality(qualityMap[quality]));
261  outPtrP->back().setCovarianceVersion(covarianceVersion_);
262  if(cand.trackRef().isNonnull() && PVOrig.isNonnull() && PVOrig->trackWeight(cand.trackRef()) > 0.5 && quality == 7) {
263  outPtrP->back().setAssociationQuality(pat::PackedCandidate::UsedInFitTight);
264  }
265  // properties of the best track
266  outPtrP->back().setLostInnerHits( lostHits );
267  if(outPtrP->back().pt() > minPtForTrackProperties_ ||
268  outPtrP->back().ptTrk() > minPtForTrackProperties_ ||
269  whiteList.find(ic)!=whiteList.end() ||
270  (cand.trackRef().isNonnull() && whiteListTk.find(cand.trackRef())!=whiteListTk.end())
271  ) {
272  outPtrP->back().setFirstHit(ctrack->hitPattern().getHitPattern(reco::HitPattern::TRACK_HITS, 0));
273  if(abs(outPtrP->back().pdgId())==22) {
274  outPtrP->back().setTrackProperties(*ctrack,covariancePackingSchemas_[4],covarianceVersion_);
275  } else {
276  if( ctrack->hitPattern().numberOfValidPixelHits() >0) {
277  outPtrP->back().setTrackProperties(*ctrack,covariancePackingSchemas_[0],covarianceVersion_); //high quality
278  } else {
279  outPtrP->back().setTrackProperties(*ctrack,covariancePackingSchemas_[1],covarianceVersion_);
280  }
281  }
282  //outPtrP->back().setTrackProperties(*ctrack,tsos.curvilinearError());
283  } else {
284  if(outPtrP->back().pt() > 0.5 ){
285  if(ctrack->hitPattern().numberOfValidPixelHits() >0) outPtrP->back().setTrackProperties(*ctrack,covariancePackingSchemas_[2],covarianceVersion_); //low quality, with pixels
286  else outPtrP->back().setTrackProperties(*ctrack,covariancePackingSchemas_[3],covarianceVersion_); //low quality, without pixels
287  }
288  }
289 
290  // these things are always for the CKF track
291  outPtrP->back().setTrackHighPurity( cand.trackRef().isNonnull() && cand.trackRef()->quality(reco::Track::highPurity) );
292  if (cand.muonRef().isNonnull()) {
293  outPtrP->back().setMuonID(cand.muonRef()->isStandAloneMuon(), cand.muonRef()->isGlobalMuon());
294  }
295  } else {
296 
297  if (!PVs->empty()) {
298  PV = reco::VertexRef(PVs, 0);
299  PVpos = PV->position();
300  }
301 
302  outPtrP->push_back( pat::PackedCandidate(cand.polarP4(), PVpos, cand.pt(), cand.eta(), cand.phi(), cand.pdgId(), PVRefProd, PV.key()));
304  }
305 
306  // neutrals and isolated charged hadrons
307 
308  bool isIsolatedChargedHadron = false;
310  const edm::ValueMap<bool> & chargedHadronIsolation=*(chargedHadronIsolationHandle.product());
311  isIsolatedChargedHadron=((cand.pt()>minPtForChargedHadronProperties_)&&(chargedHadronIsolation[reco::PFCandidateRef(cands,ic)]));
312  outPtrP->back().setIsIsolatedChargedHadron(isIsolatedChargedHadron);
313  }
314 
315  if(abs(cand.pdgId()) == 1 || abs(cand.pdgId()) == 130) {
316  outPtrP->back().setHcalFraction(cand.hcalEnergy()/(cand.ecalEnergy()+cand.hcalEnergy()));
317  } else if(isIsolatedChargedHadron) {
318  outPtrP->back().setRawCaloFraction((cand.rawEcalEnergy()+cand.rawHcalEnergy())/cand.energy());
319  outPtrP->back().setHcalFraction(cand.rawHcalEnergy()/(cand.rawEcalEnergy()+cand.rawHcalEnergy()));
320  } else {
321  outPtrP->back().setHcalFraction(0);
322  }
323 
324  //specifically this is the PFLinker requirements to apply the e/gamma regression
325  if(cand.particleId() == reco::PFCandidate::e || (cand.particleId() == reco::PFCandidate::gamma && cand.mva_nothing_gamma()>0.)) {
326  outPtrP->back().setGoodEgamma();
327  }
328 
329  if (usePuppi_){
330  reco::PFCandidateRef pkref( cands, ic );
331  // outPtrP->back().setPuppiWeight( (*puppiWeight)[pkref]);
332 
333  float puppiWeightVal = (*puppiWeight)[pkref];
334  float puppiWeightNoLepVal = 0.0;
335  // Check the "no lepton" puppi weights.
336  // If present, then it is not a lepton, use stored weight
337  // If absent, it is a lepton, so set the weight to 1.0
338  if ( puppiWeightNoLep.isValid() ) {
339  // Look for the pointer inside the "no lepton" candidate collection.
340  auto pkrefPtr = pkref->sourceCandidatePtr(0);
341 
342  bool foundNoLep = false;
343  for ( size_t ipcnl = 0; ipcnl < puppiCandsNoLepPtrs.size(); ipcnl++){
344  if (puppiCandsNoLepPtrs[ipcnl] == pkrefPtr){
345  foundNoLep = true;
346  puppiWeightNoLepVal = puppiCandsNoLep->at(ipcnl).pt()/cand.pt(); // a hack for now, should use the value map
347  break;
348  }
349  }
350  if ( !foundNoLep || puppiWeightNoLepVal > 1 ) {
351  puppiWeightNoLepVal = 1.0;
352  }
353  }
354  outPtrP->back().setPuppiWeight( puppiWeightVal, puppiWeightNoLepVal );
355 
356  mappingPuppi[((*puppiCandsMap)[pkref]).key()]=ic;
357  }
358 
359  if (storeTiming_ && cand.isTimeValid()) {
360  outPtrP->back().setTime(cand.time(), cand.timeError());
361  }
362 
363  mapping[ic] = ic; // trivial at the moment!
364  if (cand.trackRef().isNonnull() && cand.trackRef().id() == TKOrigs.id()) {
365  mappingTk[cand.trackRef().key()] = ic;
366  }
367 
368  }
369 
370  auto outPtrPSorted = std::make_unique<std::vector<pat::PackedCandidate>>();
371  std::vector<size_t> order=sort_indexes(*outPtrP);
372  std::vector<size_t> reverseOrder(order.size());
373  for(size_t i=0,nc=cands->size();i<nc;i++) {
374  outPtrPSorted->push_back((*outPtrP)[order[i]]);
375  reverseOrder[order[i]] = i;
376  mappingReverse[order[i]]=i;
377  }
378 
379  // Fix track association for sorted candidates
380  for(size_t i=0,ntk=mappingTk.size();i<ntk;i++){
381  if(mappingTk[i] >= 0)
382  mappingTk[i]=reverseOrder[mappingTk[i]];
383  }
384 
385  for(size_t i=0,ntk=mappingPuppi.size();i<ntk;i++){
386  mappingPuppi[i]=reverseOrder[mappingPuppi[i]];
387  }
388 
390 
391  // now build the two maps
392  auto pf2pc = std::make_unique<edm::Association<pat::PackedCandidateCollection>>(oh);
393  auto pc2pf = std::make_unique<edm::Association<reco::PFCandidateCollection>>(cands);
396  pf2pcFiller.insert(cands, mappingReverse.begin(), mappingReverse.end());
397  pc2pfFiller.insert(oh , order.begin(), order.end());
398  // include also the mapping track -> packed PFCand
399  pf2pcFiller.insert(TKOrigs, mappingTk.begin(), mappingTk.end());
400  if(usePuppi_) pf2pcFiller.insert(puppiCands, mappingPuppi.begin(), mappingPuppi.end());
401 
402  pf2pcFiller.fill();
403  pc2pfFiller.fill();
404  iEvent.put(std::move(pf2pc));
405  iEvent.put(std::move(pc2pf));
406 
407 }
408 
409 
T getParameter(std::string const &) const
double ecalEnergy() const
return corrected Ecal energy
Definition: PFCandidate.h:222
int pdgId() const final
PDG identifier.
const Point & referencePoint() const
Reference point on the track.
Definition: TrackBase.h:714
const edm::EDGetTokenT< edm::ValueMap< float > > PuppiWeight_
virtual double pz() const =0
z coordinate of momentum vector
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:251
double eta() const final
momentum pseudorapidity
const PolarLorentzVector & polarP4() const final
four-momentum Lorentz vector
double rawEcalEnergy() const
return corrected Ecal energy
Definition: PFCandidate.h:225
int covarianceSchema() const
bool hasValidHitInPixelLayer(enum PixelSubdetector::SubDetector, uint16_t layer) const
Definition: HitPattern.cc:365
key_type key() const
Definition: Ptr.h:185
ProductID id() const
Definition: HandleBase.cc:15
float mva_nothing_gamma() const
mva for gamma detection
Definition: PFCandidate.h:333
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
void insert(const H &h, I begin, I end)
Definition: ValueMap.h:53
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
size_type size() const
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:678
double pt() const final
transverse momentum
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
float time() const
Definition: PFCandidate.h:421
static const int qualityMap[8]
conversion map from quality flags used in PV association and miniAOD one
const edm::EDGetTokenT< reco::PFCandidateCollection > Cands_
key_type key() const
Accessor for product key.
Definition: Ref.h:263
const reco::VertexRef vertexRef() const
ProductID id() const
Accessor for product ID.
Definition: Ref.h:257
const edm::EDGetTokenT< edm::ValueMap< int > > PVAssoQuality_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: HeavyIon.h:7
reco::TrackRef trackRef() const
Definition: PFCandidate.cc:442
const Point & vertex() const override
vertex position (overwritten by PF...)
Definition: PFCandidate.cc:656
bool isTimeValid() const
do we have a valid time information
Definition: PFCandidate.h:419
virtual double py() const =0
y coordinate of momentum vector
int charge() const override
electric charge
int iEvent
Definition: GenABIO.cc:230
PATPackedCandidateProducer(const edm::ParameterSet &)
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:684
double pt() const
track transverse momentum
Definition: TrackBase.h:654
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double energy() const final
energy
float calcDxy(float dx, float dy, float phi) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::TrackRef track() const override
reference to a track
const edm::EDGetTokenT< reco::TrackCollection > TKOrigs_
const edm::EDGetTokenT< std::vector< reco::PFCandidate > > PuppiCands_
std::vector< size_t > sort_indexes(const std::vector< T > &v) const
const edm::EDGetTokenT< edm::ValueMap< reco::CandidatePtr > > PuppiCandsMap_
bool isValid() const
Definition: HandleBase.h:74
const edm::EDGetTokenT< edm::ValueMap< float > > PuppiWeightNoLep_
edm::Ref< VertexCollection > VertexRef
persistent reference to a Vertex
Definition: VertexFwd.h:13
reco::MuonRef muonRef() const
Definition: PFCandidate.cc:459
ii
Definition: cuy.py:590
bool hasTrackDetails() const
Return true if a bestTrack can be extracted from this Candidate.
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...
Definition: TrackBase.h:642
LostInnerHits
Enumerator specifying the.
double eta() const override
momentum pseudorapidity
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
const edm::EDGetTokenT< edm::ValueMap< bool > > ChargedHadronIsolation_
float calcDz(reco::Candidate::Point p, reco::Candidate::Point v, const reco::Candidate &c) const
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
Definition: CandidateFwd.h:25
T const * product() const
Definition: Handle.h:81
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:479
const std::vector< int > covariancePackingSchemas_
virtual double pt() const =0
transverse momentum
const edm::EDGetTokenT< std::vector< reco::PFCandidate > > PuppiCandsNoLep_
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
def encode(args, files)
ProductID id() const
Accessor for product ID.
Definition: Ptr.h:180
const edm::EDGetTokenT< reco::VertexCollection > PVOrigs_
int numberOfLostHits(HitCategory category) const
Definition: HitPattern.h:982
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40
fixed size matrix
#define begin
Definition: vmac.h:32
HLT enums.
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:480
std::vector< edm::EDGetTokenT< edm::View< reco::Candidate > > > SVWhiteLists_
double hcalEnergy() const
return corrected Hcal energy
Definition: PFCandidate.h:232
int numberOfValidPixelHits() const
Definition: HitPattern.h:908
math::XYZPoint Point
point in the space
Definition: Candidate.h:41
const_iterator end() const
const edm::EDGetTokenT< edm::Association< reco::VertexCollection > > PVAsso_
const edm::EDGetTokenT< reco::VertexCollection > PVs_
virtual double px() const =0
x coordinate of momentum vector
virtual ParticleType particleId() const
Definition: PFCandidate.h:374
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:545
double phi() const final
momentum azimuthal angle
float timeError() const
Definition: PFCandidate.h:423
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
def move(src, dest)
Definition: eostools.py:511
double rawHcalEnergy() const
return raw Hcal energy
Definition: PFCandidate.h:235
bool candsOrdering(pat::PackedCandidate i, pat::PackedCandidate j) const