CMS 3D CMS Logo

RegionMapper.h
Go to the documentation of this file.
1 #ifndef L1Trigger_Phase2L1ParticleFlow_RegionMapper_h
2 #define L1Trigger_Phase2L1ParticleFlow_RegionMapper_h
3 
8 
11 
12 #include <unordered_map>
13 
14 namespace l1tpf_impl {
15  class RegionMapper {
16  // This does the input and filling of regions.
17  public:
19 
20  // add object, without tracking references
21  void addTrack(const l1t::PFTrack &t);
22  void addMuon(const l1t::Muon &t);
23  void addMuon(const l1t::TkMuon &t);
24  void addCalo(const l1t::PFCluster &t);
25  void addEmCalo(const l1t::PFCluster &t);
26 
27  // add object, tracking references
28  void addTrack(const l1t::PFTrack &t, l1t::PFTrackRef ref);
29  void addMuon(const l1t::Muon &t, l1t::PFCandidate::MuonRef ref);
30  void addCalo(const l1t::PFCluster &t, l1t::PFClusterRef ref);
31  void addEmCalo(const l1t::PFCluster &t, l1t::PFClusterRef ref);
32 
33  void clear();
34  std::vector<Region> &regions() { return regions_; }
35 
36  std::unique_ptr<l1t::PFCandidateCollection> fetch(bool puppi = true, float ptMin = 0.01) const;
37  std::unique_ptr<l1t::PFCandidateCollection> fetchCalo(float ptMin = 0.01, bool emcalo = false) const;
38  std::unique_ptr<l1t::PFCandidateCollection> fetchTracks(float ptMin = 0.01, bool fromPV = false) const;
39 
40  std::pair<unsigned, unsigned> totAndMaxInput(/*Region::InputType*/ int type) const;
41  std::pair<unsigned, unsigned> totAndMaxOutput(/*Region::OutputType*/ int type, bool puppi) const;
42  std::unique_ptr<std::vector<unsigned>> vecInput(int type) const;
43  std::unique_ptr<std::vector<unsigned>> vecOutput(int type, bool puppi) const;
44 
45  protected:
46  std::vector<Region> regions_;
47  bool useRelativeRegionalCoordinates_; // whether the eta,phi in each region are global or relative to the region center
49 
50  // these are used to link items back
51  std::unordered_map<const l1t::PFCluster *, l1t::PFClusterRef> clusterRefMap_;
52  std::unordered_map<const l1t::PFTrack *, l1t::PFTrackRef> trackRefMap_;
53  std::unordered_map<const l1t::Muon *, l1t::PFCandidate::MuonRef> muonRefMap_;
54  };
55 
56 } // namespace l1tpf_impl
57 #endif
std::unique_ptr< l1t::PFCandidateCollection > fetchCalo(float ptMin=0.01, bool emcalo=false) const
void addMuon(const l1t::Muon &t)
std::unordered_map< const l1t::PFTrack *, l1t::PFTrackRef > trackRefMap_
Definition: RegionMapper.h:52
std::unique_ptr< std::vector< unsigned > > vecOutput(int type, bool puppi) const
enum l1tpf_impl::RegionMapper::TrackAssoMode trackRegionMode_
RegionMapper(const edm::ParameterSet &)
Definition: RegionMapper.cc:5
std::unordered_map< const l1t::PFCluster *, l1t::PFClusterRef > clusterRefMap_
Definition: RegionMapper.h:51
constexpr float ptMin
std::unique_ptr< l1t::PFCandidateCollection > fetchTracks(float ptMin=0.01, bool fromPV=false) const
std::pair< unsigned, unsigned > totAndMaxOutput(int type, bool puppi) const
void addTrack(const l1t::PFTrack &t)
Definition: RegionMapper.cc:86
std::vector< Region > regions_
Definition: RegionMapper.h:46
void addCalo(const l1t::PFCluster &t)
std::pair< unsigned, unsigned > totAndMaxInput(int type) const
Definition: Muon.h:21
std::unordered_map< const l1t::Muon *, l1t::PFCandidate::MuonRef > muonRefMap_
Definition: RegionMapper.h:53
std::unique_ptr< std::vector< unsigned > > vecInput(int type) const
std::vector< Region > & regions()
Definition: RegionMapper.h:34
void addEmCalo(const l1t::PFCluster &t)
std::unique_ptr< l1t::PFCandidateCollection > fetch(bool puppi=true, float ptMin=0.01) const