CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
l1tpf_impl::Region Struct Reference

#include <Region.h>

Inheritance diagram for l1tpf_impl::Region:
l1tpf_impl::InputRegion

Public Types

enum  InputType {
  calo_type = 0, emcalo_type = 1, track_type = 2, l1mu_type = 3,
  n_input_types = 4
}
 
enum  OutputType {
  any_type = 0, charged_type = 1, neutral_type = 2, electron_type = 3,
  pfmuon_type = 4, charged_hadron_type = 5, neutral_hadron_type = 6, photon_type = 7,
  n_output_types = 8
}
 

Public Member Functions

bool contains (float eta, float phi) const
 
bool fiducial (float eta, float phi) const
 
bool fiducialLocal (float localEta, float localPhi) const
 
float globalAbsEta (float localEta) const
 
float globalEta (float localEta) const
 
float globalPhi (float localPhi) const
 
void inputSort ()
 
float localEta (float globalEta) const
 
float localPhi (float globalPhi) const
 
unsigned int nInput (InputType type) const
 
unsigned int nOutput (OutputType type, bool puppi, bool fiducial=true) const
 
 Region (float etamin, float etamax, float phicenter, float phiwidth, float etaextra, float phiextra, bool useRelativeCoordinates, unsigned int ncalomax, unsigned int nemcalomax, unsigned int ntrackmax, unsigned int nmuonmax, unsigned int npfmax, unsigned int npuppimax)
 
float regionAbsEta () const
 
void zero ()
 
- Public Member Functions inherited from l1tpf_impl::InputRegion
 InputRegion ()
 
 InputRegion (float etacenter, float etamin, float etamax, float phicenter, float phihalfwidth, float etaextra, float phiextra)
 

Static Public Member Functions

static const char * inputTypeName (int inputType)
 
static const char * outputTypeName (int outputType)
 

Public Attributes

unsigned int caloOverflow
 
unsigned int emcaloOverflow
 
unsigned int muonOverflow
 
const unsigned int ncaloMax
 
const unsigned int nemcaloMax
 
const unsigned int nmuonMax
 
const unsigned int npfMax
 
const unsigned int npuppiMax
 
const unsigned int ntrackMax
 
std::vector< PFParticlepf
 
unsigned int pfOverflow
 
std::vector< PFParticlepuppi
 
unsigned int puppiOverflow
 
const bool relativeCoordinates
 
unsigned int trackOverflow
 
- Public Attributes inherited from l1tpf_impl::InputRegion
std::vector< CaloClustercalo
 
std::vector< CaloClusteremcalo
 
float etaCenter
 
float etaExtra
 
float etaMax
 
float etaMin
 
std::vector< Muonmuon
 
float phiCenter
 
float phiExtra
 
float phiHalfWidth
 
std::vector< PropagatedTracktrack
 

Detailed Description

Definition at line 8 of file Region.h.

Member Enumeration Documentation

◆ InputType

Enumerator
calo_type 
emcalo_type 
track_type 
l1mu_type 
n_input_types 

Definition at line 45 of file Region.h.

45 { calo_type = 0, emcalo_type = 1, track_type = 2, l1mu_type = 3, n_input_types = 4 };

◆ OutputType

Enumerator
any_type 
charged_type 
neutral_type 
electron_type 
pfmuon_type 
charged_hadron_type 
neutral_hadron_type 
photon_type 
n_output_types 

Definition at line 48 of file Region.h.

48  {
49  any_type = 0,
50  charged_type = 1,
51  neutral_type = 2,
52  electron_type = 3,
53  pfmuon_type = 4,
56  photon_type = 7,
57  n_output_types = 8
58  };

Constructor & Destructor Documentation

◆ Region()

l1tpf_impl::Region::Region ( float  etamin,
float  etamax,
float  phicenter,
float  phiwidth,
float  etaextra,
float  phiextra,
bool  useRelativeCoordinates,
unsigned int  ncalomax,
unsigned int  nemcalomax,
unsigned int  ntrackmax,
unsigned int  nmuonmax,
unsigned int  npfmax,
unsigned int  npuppimax 
)
inline

Definition at line 15 of file Region.h.

28  : InputRegion(0.5 * (etamin + etamax), etamin, etamax, phicenter, 0.5 * phiwidth, etaextra, phiextra),
29  pf(),
30  puppi(),
31  caloOverflow(),
33  trackOverflow(),
34  muonOverflow(),
35  pfOverflow(),
36  puppiOverflow(),
37  relativeCoordinates(useRelativeCoordinates),
38  ncaloMax(ncalomax),
39  nemcaloMax(nemcalomax),
40  ntrackMax(ntrackmax),
41  nmuonMax(nmuonmax),
42  npfMax(npfmax),
43  npuppiMax(npuppimax) {}

Member Function Documentation

◆ contains()

bool l1tpf_impl::Region::contains ( float  eta,
float  phi 
) const
inline

◆ fiducial()

bool l1tpf_impl::Region::fiducial ( float  eta,
float  phi 
) const
inline

◆ fiducialLocal()

bool l1tpf_impl::Region::fiducialLocal ( float  localEta,
float  localPhi 
) const
inline

◆ globalAbsEta()

float l1tpf_impl::Region::globalAbsEta ( float  localEta) const
inline

◆ globalEta()

float l1tpf_impl::Region::globalEta ( float  localEta) const
inline

Definition at line 87 of file Region.h.

References l1tpf_impl::InputRegion::etaCenter, localEta(), and relativeCoordinates.

Referenced by localEta().

◆ globalPhi()

float l1tpf_impl::Region::globalPhi ( float  localPhi) const
inline

Definition at line 88 of file Region.h.

References localPhi(), l1tpf_impl::InputRegion::phiCenter, and relativeCoordinates.

Referenced by localPhi().

◆ inputSort()

void l1tpf_impl::Region::inputSort ( )

Definition at line 113 of file Region.cc.

113  {
114  std::sort(calo.begin(), calo.end());
115  std::sort(emcalo.begin(), emcalo.end());
116  std::sort(track.begin(), track.end());
117  std::sort(muon.begin(), muon.end());
118  if (ncaloMax > 0 && calo.size() > ncaloMax) {
119  caloOverflow = calo.size() - ncaloMax;
120  calo.resize(ncaloMax);
121  }
122  if (nemcaloMax > 0 && emcalo.size() > nemcaloMax) {
123  emcaloOverflow = emcalo.size() - nemcaloMax;
124  emcalo.resize(nemcaloMax);
125  }
126  if (ntrackMax > 0 && track.size() > ntrackMax) {
127  trackOverflow = track.size() - ntrackMax;
128  track.resize(ntrackMax);
129  }
130 }

References jetUpdater_cfi::sort, and HLT_FULL_cff::track.

◆ inputTypeName()

const char * l1tpf_impl::Region::inputTypeName ( int  inputType)
static

Definition at line 6 of file Region.cc.

6  {
7  switch (InputType(type)) {
8  case calo_type:
9  return "Calo";
10  case emcalo_type:
11  return "EmCalo";
12  case track_type:
13  return "TK";
14  case l1mu_type:
15  return "Mu";
16  case n_input_types:
17  throw cms::Exception(
18  "LogicError", "n_input_types is not a type to be used, but only a compile-time const for iterating on types");
19  }
20  return "NO_SUCH_INPUT_TYPE";
21 }

References calo_type, emcalo_type, Exception, l1mu_type, n_input_types, and track_type.

Referenced by L1TPFProducer::L1TPFProducer(), and L1TPFProducer::produce().

◆ localEta()

float l1tpf_impl::Region::localEta ( float  globalEta) const
inline

◆ localPhi()

float l1tpf_impl::Region::localPhi ( float  globalPhi) const
inline

◆ nInput()

unsigned int l1tpf_impl::Region::nInput ( InputType  type) const

Definition at line 48 of file Region.cc.

48  {
49  switch (type) {
50  case calo_type:
51  return calo.size();
52  case emcalo_type:
53  return emcalo.size();
54  case track_type:
55  return track.size();
56  case l1mu_type:
57  return muon.size();
58  case n_input_types:
59  throw cms::Exception(
60  "LogicError", "n_input_types is not a type to be used, but only a compile-time const for iterating on types");
61  }
62  return 9999;
63 }

References Exception, and HLT_FULL_cff::track.

◆ nOutput()

unsigned int l1tpf_impl::Region::nOutput ( OutputType  type,
bool  puppi,
bool  fiducial = true 
) const

Definition at line 65 of file Region.cc.

65  {
66  unsigned int ret = 0;
67  for (const auto &p : (usePuppi ? puppi : pf)) {
68  if (p.hwPt <= 0)
69  continue;
70  if (fiducial && !fiducialLocal(p.floatEta(), p.floatPhi()))
71  continue;
72  switch (type) {
73  case any_type:
74  ret++;
75  break;
76  case charged_type:
77  if (p.intCharge() != 0)
78  ret++;
79  break;
80  case neutral_type:
81  if (p.intCharge() == 0)
82  ret++;
83  break;
84  case electron_type:
85  if (p.hwId == l1t::PFCandidate::Electron)
86  ret++;
87  break;
88  case pfmuon_type:
89  if (p.hwId == l1t::PFCandidate::Muon)
90  ret++;
91  break;
94  ret++;
95  break;
98  ret++;
99  break;
100  case photon_type:
101  if (p.hwId == l1t::PFCandidate::Photon)
102  ret++;
103  break;
104  case n_output_types:
105  throw cms::Exception(
106  "LogicError",
107  "n_output_types is not a type to be used, but only a compile-time const for iterating on types");
108  }
109  }
110  return ret;
111 }

References l1t::PFCandidate::ChargedHadron, l1t::PFCandidate::Electron, Exception, alignBH_cfg::fiducial, l1t::PFCandidate::Muon, l1t::PFCandidate::NeutralHadron, AlCaHLTBitMon_ParallelJobs::p, packedPFCandidateRefMixer_cfi::pf, l1t::PFCandidate::Photon, runTheMatrix::ret, and PileupJetID_cfi::usePuppi.

◆ outputTypeName()

const char * l1tpf_impl::Region::outputTypeName ( int  outputType)
static

Definition at line 22 of file Region.cc.

22  {
23  switch (OutputType(type)) {
24  case any_type:
25  return "";
26  case charged_type:
27  return "Charged";
28  case neutral_type:
29  return "Neutral";
30  case electron_type:
31  return "Electron";
32  case pfmuon_type:
33  return "Muon";
35  return "ChargedHadron";
37  return "NeutralHadron";
38  case photon_type:
39  return "Photon";
40  case n_output_types:
41  throw cms::Exception(
42  "LogicError",
43  "n_output_types is not a type to be used, but only a compile-time const for iterating on types");
44  }
45  return "NO_SUCH_OUTPUT_TYPE";
46 }

References Exception.

Referenced by L1TPFProducer::L1TPFProducer(), and L1TPFProducer::produce().

◆ regionAbsEta()

float l1tpf_impl::Region::regionAbsEta ( ) const
inline

Definition at line 85 of file Region.h.

85 { return std::abs(etaCenter); }

References funct::abs(), and l1tpf_impl::InputRegion::etaCenter.

◆ zero()

void l1tpf_impl::Region::zero ( )
inline

Definition at line 92 of file Region.h.

92  {
93  calo.clear();
94  emcalo.clear();
95  track.clear();
96  muon.clear();
97  pf.clear();
98  puppi.clear();
99  caloOverflow = 0;
100  emcaloOverflow = 0;
101  trackOverflow = 0;
102  muonOverflow = 0;
103  pfOverflow = 0;
104  puppiOverflow = 0;
105  }

References caloOverflow, l1tpf_impl::InputRegion::emcalo, emcaloOverflow, muonOverflow, pf, pfOverflow, puppi, puppiOverflow, l1tpf_impl::InputRegion::track, and trackOverflow.

Member Data Documentation

◆ caloOverflow

unsigned int l1tpf_impl::Region::caloOverflow

Definition at line 11 of file Region.h.

Referenced by zero().

◆ emcaloOverflow

unsigned int l1tpf_impl::Region::emcaloOverflow

Definition at line 11 of file Region.h.

Referenced by zero().

◆ muonOverflow

unsigned int l1tpf_impl::Region::muonOverflow

Definition at line 11 of file Region.h.

Referenced by zero().

◆ ncaloMax

const unsigned int l1tpf_impl::Region::ncaloMax

Definition at line 14 of file Region.h.

◆ nemcaloMax

const unsigned int l1tpf_impl::Region::nemcaloMax

Definition at line 14 of file Region.h.

◆ nmuonMax

const unsigned int l1tpf_impl::Region::nmuonMax

Definition at line 14 of file Region.h.

◆ npfMax

const unsigned int l1tpf_impl::Region::npfMax

Definition at line 14 of file Region.h.

◆ npuppiMax

const unsigned int l1tpf_impl::Region::npuppiMax

Definition at line 14 of file Region.h.

◆ ntrackMax

const unsigned int l1tpf_impl::Region::ntrackMax

Definition at line 14 of file Region.h.

◆ pf

std::vector<PFParticle> l1tpf_impl::Region::pf

Definition at line 9 of file Region.h.

Referenced by zero().

◆ pfOverflow

unsigned int l1tpf_impl::Region::pfOverflow

Definition at line 11 of file Region.h.

Referenced by zero().

◆ puppi

std::vector<PFParticle> l1tpf_impl::Region::puppi

Definition at line 10 of file Region.h.

Referenced by zero().

◆ puppiOverflow

unsigned int l1tpf_impl::Region::puppiOverflow

Definition at line 11 of file Region.h.

Referenced by zero().

◆ relativeCoordinates

const bool l1tpf_impl::Region::relativeCoordinates

Definition at line 13 of file Region.h.

Referenced by fiducialLocal(), globalAbsEta(), globalEta(), globalPhi(), localEta(), and localPhi().

◆ trackOverflow

unsigned int l1tpf_impl::Region::trackOverflow

Definition at line 11 of file Region.h.

Referenced by zero().

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:542
l1t::PFCandidate::Photon
Definition: PFCandidate.h:15
l1tpf_impl::Region::charged_hadron_type
Definition: Region.h:54
l1tpf_impl::InputRegion::emcalo
std::vector< CaloCluster > emcalo
Definition: DiscretePFInputs.h:227
l1tpf_impl::Region::pfmuon_type
Definition: Region.h:53
l1tpf_impl::Region::globalEta
float globalEta(float localEta) const
Definition: Region.h:87
l1tpf_impl::Region::puppi
std::vector< PFParticle > puppi
Definition: Region.h:10
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
muon
Definition: MuonCocktails.h:17
l1tpf_impl::InputRegion::etaExtra
float etaExtra
Definition: DiscretePFInputs.h:225
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
l1tpf_impl::Region::pf
std::vector< PFParticle > pf
Definition: Region.h:9
l1tpf_impl::Region::npuppiMax
const unsigned int npuppiMax
Definition: Region.h:14
l1tpf_impl::Region::emcaloOverflow
unsigned int emcaloOverflow
Definition: Region.h:11
l1tpf_impl::Region::n_output_types
Definition: Region.h:57
l1tpf_impl::InputRegion::track
std::vector< PropagatedTrack > track
Definition: DiscretePFInputs.h:228
l1tpf_impl::Region::photon_type
Definition: Region.h:56
l1t::PFCandidate::Electron
Definition: PFCandidate.h:15
muonTiming_cfi.etamin
etamin
Definition: muonTiming_cfi.py:30
l1tpf_impl::Region::globalPhi
float globalPhi(float localPhi) const
Definition: Region.h:88
l1tpf_impl::Region::npfMax
const unsigned int npfMax
Definition: Region.h:14
l1tpf_impl::Region::any_type
Definition: Region.h:49
l1tpf_impl::Region::emcalo_type
Definition: Region.h:45
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
l1tpf_impl::InputRegion::etaMax
float etaMax
Definition: DiscretePFInputs.h:224
PVValHelper::eta
Definition: PVValidationHelpers.h:70
l1tpf_impl::Region::fiducial
bool fiducial(float eta, float phi) const
Definition: Region.h:71
l1tpf_impl::Region::relativeCoordinates
const bool relativeCoordinates
Definition: Region.h:13
l1tpf_impl::Region::n_input_types
Definition: Region.h:45
l1tpf_impl::Region::neutral_type
Definition: Region.h:51
l1tpf_impl::Region::ncaloMax
const unsigned int ncaloMax
Definition: Region.h:14
l1tpf_impl::Region::OutputType
OutputType
Definition: Region.h:48
l1tpf_impl::Region::neutral_hadron_type
Definition: Region.h:55
l1tpf_impl::Region::caloOverflow
unsigned int caloOverflow
Definition: Region.h:11
l1tpf_impl::Region::trackOverflow
unsigned int trackOverflow
Definition: Region.h:11
l1tpf_impl::InputRegion::InputRegion
InputRegion()
Definition: DiscretePFInputs.h:231
l1tpf_impl::Region::track_type
Definition: Region.h:45
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
l1tpf_impl::Region::fiducialLocal
bool fiducialLocal(float localEta, float localPhi) const
Definition: Region.h:76
l1t::PFCandidate::ChargedHadron
Definition: PFCandidate.h:15
l1tpf_impl::Region::nmuonMax
const unsigned int nmuonMax
Definition: Region.h:14
l1tpf_impl::Region::ntrackMax
const unsigned int ntrackMax
Definition: Region.h:14
l1tpf_impl::Region::localPhi
float localPhi(float globalPhi) const
Definition: Region.h:90
l1tpf_impl::Region::charged_type
Definition: Region.h:50
l1tpf_impl::Region::localEta
float localEta(float globalEta) const
Definition: Region.h:89
l1tpf_impl::Region::l1mu_type
Definition: Region.h:45
l1tpf_impl::Region::nemcaloMax
const unsigned int nemcaloMax
Definition: Region.h:14
l1tpf_impl::Region::pfOverflow
unsigned int pfOverflow
Definition: Region.h:11
DDAxes::phi
l1t::PFCandidate::Muon
Definition: PFCandidate.h:15
l1tpf_impl::InputRegion::etaCenter
float etaCenter
Definition: DiscretePFInputs.h:224
l1tpf_impl::InputRegion::phiExtra
float phiExtra
Definition: DiscretePFInputs.h:225
l1tpf_impl::Region::calo_type
Definition: Region.h:45
Exception
Definition: hltDiff.cc:245
muonTiming_cfi.etamax
etamax
Definition: muonTiming_cfi.py:23
l1tpf_impl::Region::InputType
InputType
Definition: Region.h:45
l1tpf_impl::Region::muonOverflow
unsigned int muonOverflow
Definition: Region.h:11
l1tpf_impl::InputRegion::phiHalfWidth
float phiHalfWidth
Definition: DiscretePFInputs.h:224
l1tpf_impl::InputRegion::etaMin
float etaMin
Definition: DiscretePFInputs.h:224
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
calo
Definition: Common.h:9
l1t::PFCandidate::NeutralHadron
Definition: PFCandidate.h:15
l1tpf_impl::InputRegion::phiCenter
float phiCenter
Definition: DiscretePFInputs.h:224
l1tpf_impl::Region::puppiOverflow
unsigned int puppiOverflow
Definition: Region.h:11
l1tpf_impl::Region::electron_type
Definition: Region.h:52
PileupJetID_cfi.usePuppi
usePuppi
Definition: PileupJetID_cfi.py:32