CMS 3D CMS Logo

PFAlgoBase.cc
Go to the documentation of this file.
2 
4 
5 using namespace l1tpf_impl;
6 
7 PFAlgoBase::PFAlgoBase(const edm::ParameterSet &iConfig) : debug_(iConfig.getUntrackedParameter<int>("debug", 0)) {}
8 
10 
12  r.inputSort();
13  r.pf.clear();
14  r.puppi.clear();
15  for (auto &c : r.calo)
16  c.used = false;
17  for (auto &c : r.emcalo)
18  c.used = false;
19  for (auto &t : r.track) {
20  t.used = false;
21  t.muonLink = false;
22  }
23 }
24 
25 PFParticle &PFAlgoBase::addTrackToPF(std::vector<PFParticle> &pfs, const PropagatedTrack &tk) const {
26  PFParticle pf;
27  pf.hwPt = tk.hwPt;
28  pf.hwEta = tk.hwEta;
29  pf.hwPhi = tk.hwPhi;
30  pf.hwVtxEta = tk.hwEta; // FIXME: get from the track
31  pf.hwVtxPhi = tk.hwPhi; // before propagation
32  pf.track = tk;
33  pf.cluster.hwPt = 0;
34  pf.cluster.src = nullptr;
35  pf.muonsrc = nullptr;
37  pf.hwStatus = 0;
38  pfs.push_back(pf);
39  return pfs.back();
40 }
41 
42 PFParticle &PFAlgoBase::addCaloToPF(std::vector<PFParticle> &pfs, const CaloCluster &calo) const {
43  PFParticle pf;
44  pf.hwPt = calo.hwPt;
45  pf.hwEta = calo.hwEta;
46  pf.hwPhi = calo.hwPhi;
47  pf.hwVtxEta = calo.hwEta;
48  pf.hwVtxPhi = calo.hwPhi;
49  pf.track.hwPt = 0;
50  pf.track.src = nullptr;
51  pf.cluster = calo;
52  pf.muonsrc = nullptr;
54  pf.hwStatus = 0;
55  pfs.push_back(pf);
56  return pfs.back();
57 }
void initRegion(Region &r) const
Definition: PFAlgoBase.cc:11
PFParticle & addTrackToPF(Region &r, const PropagatedTrack &tk) const
Definition: PFAlgoBase.h:20
PFAlgoBase(const edm::ParameterSet &)
Definition: PFAlgoBase.cc:7
PFParticle & addCaloToPF(Region &r, const CaloCluster &calo) const
Definition: PFAlgoBase.h:21
Definition: Common.h:9