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
PFCandidate.h
l1tpf_impl
Definition: BitwisePFAlgo.h:8
l1t::PFTrack
Definition: PFTrack.h:12
ptMin
constexpr float ptMin
Definition: PhotonIDValueMapProducer.cc:153
l1tpf_impl::RegionMapper::fetch
std::unique_ptr< l1t::PFCandidateCollection > fetch(bool puppi=true, float ptMin=0.01) const
Definition: RegionMapper.cc:185
l1tpf_impl::RegionMapper::regions
std::vector< Region > & regions()
Definition: RegionMapper.h:34
l1tpf_impl::RegionMapper::TrackAssoMode
TrackAssoMode
Definition: RegionMapper.h:48
edm::Ref< l1t::PFTrackCollection >
TkMuon.h
l1tpf_impl::RegionMapper::TrackAssoMode::atVertex
l1tpf_impl::RegionMapper::muonRefMap_
std::unordered_map< const l1t::Muon *, l1t::PFCandidate::MuonRef > muonRefMap_
Definition: RegionMapper.h:53
l1tpf_impl::RegionMapper::addMuon
void addMuon(const l1t::Muon &t)
Definition: RegionMapper.cc:124
isotracks_cff.fromPV
fromPV
Definition: isotracks_cff.py:39
l1tpf_impl::RegionMapper::TrackAssoMode::any
l1tpf_impl::RegionMapper::addEmCalo
void addEmCalo(const l1t::PFCluster &t)
Definition: RegionMapper.cc:169
l1tpf_impl::RegionMapper::useRelativeRegionalCoordinates_
bool useRelativeRegionalCoordinates_
Definition: RegionMapper.h:47
OrderedSet.t
t
Definition: OrderedSet.py:90
Region.h
l1tpf_impl::RegionMapper::fetchTracks
std::unique_ptr< l1t::PFCandidateCollection > fetchTracks(float ptMin=0.01, bool fromPV=false) const
Definition: RegionMapper.cc:264
l1tpf_impl::RegionMapper::fetchCalo
std::unique_ptr< l1t::PFCandidateCollection > fetchCalo(float ptMin=0.01, bool emcalo=false) const
Definition: RegionMapper.cc:239
edm::ParameterSet
Definition: ParameterSet.h:36
l1tpf_impl::RegionMapper::trackRegionMode_
enum l1tpf_impl::RegionMapper::TrackAssoMode trackRegionMode_
l1tpf_impl::RegionMapper::addTrack
void addTrack(const l1t::PFTrack &t)
Definition: RegionMapper.cc:86
l1tpf_impl::RegionMapper::clusterRefMap_
std::unordered_map< const l1t::PFCluster *, l1t::PFClusterRef > clusterRefMap_
Definition: RegionMapper.h:51
l1t::TkMuon
Definition: TkMuon.h:12
l1tpf_impl::RegionMapper::totAndMaxInput
std::pair< unsigned, unsigned > totAndMaxInput(int type) const
Definition: RegionMapper.cc:304
l1tpf_impl::RegionMapper::vecOutput
std::unique_ptr< std::vector< unsigned > > vecOutput(int type, bool puppi) const
Definition: RegionMapper.cc:333
edm::Ptr< l1t::Muon >
l1tpf_impl::RegionMapper::RegionMapper
RegionMapper(const edm::ParameterSet &)
Definition: RegionMapper.cc:5
type
type
Definition: HCALResponse.h:21
l1tpf_impl::RegionMapper
Definition: RegionMapper.h:15
l1t::PFCluster
Definition: PFCluster.h:10
l1tpf_impl::RegionMapper::TrackAssoMode::atCalo
l1tpf_impl::RegionMapper::regions_
std::vector< Region > regions_
Definition: RegionMapper.h:46
ParameterSet.h
l1t::Muon
Definition: Muon.h:21
l1tpf_impl::RegionMapper::vecInput
std::unique_ptr< std::vector< unsigned > > vecInput(int type) const
Definition: RegionMapper.cc:314
l1tpf_impl::RegionMapper::totAndMaxOutput
std::pair< unsigned, unsigned > totAndMaxOutput(int type, bool puppi) const
Definition: RegionMapper.cc:323
TkMuonFwd.h
deltaPhi.h
l1tpf_impl::RegionMapper::clear
void clear()
Definition: RegionMapper.cc:78
l1tpf_impl::RegionMapper::trackRefMap_
std::unordered_map< const l1t::PFTrack *, l1t::PFTrackRef > trackRefMap_
Definition: RegionMapper.h:52
l1tpf_impl::RegionMapper::addCalo
void addCalo(const l1t::PFCluster &t)
Definition: RegionMapper.cc:153