CMS 3D CMS Logo

Region.h
Go to the documentation of this file.
1 #ifndef L1Trigger_Phase2L1ParticleFlow_Region_h
2 #define L1Trigger_Phase2L1ParticleFlow_Region_h
3 
6 
7 namespace l1tpf_impl {
8  struct Region : public InputRegion {
9  std::vector<PFParticle> pf;
10  std::vector<PFParticle> puppi;
12 
13  const bool relativeCoordinates; // whether the eta,phi in each region are global or relative to the region center
15  Region(float etamin,
16  float etamax,
17  float phicenter,
18  float phiwidth,
19  float etaextra,
20  float phiextra,
21  bool useRelativeCoordinates,
22  unsigned int ncalomax,
23  unsigned int nemcalomax,
24  unsigned int ntrackmax,
25  unsigned int nmuonmax,
26  unsigned int npfmax,
27  unsigned int npuppimax)
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) {}
44 
46  static const char* inputTypeName(int inputType);
47 
48  enum OutputType {
49  any_type = 0,
58  };
59  static const char* outputTypeName(int outputType);
60 
61  unsigned int nInput(InputType type) const;
62  unsigned int nOutput(OutputType type, bool puppi, bool fiducial = true) const;
63 
64  // global coordinates
65  bool contains(float eta, float phi) const {
66  float dphi = deltaPhi(phiCenter, phi);
67  return (etaMin - etaExtra < eta && eta <= etaMax + etaExtra && -phiHalfWidth - phiExtra < dphi &&
68  dphi <= phiHalfWidth + phiExtra);
69  }
70  // global coordinates
71  bool fiducial(float eta, float phi) const {
72  float dphi = deltaPhi(phiCenter, phi);
73  return (etaMin < eta && eta <= etaMax && -phiHalfWidth < dphi && dphi <= phiHalfWidth);
74  }
75  // possibly local coordinates
76  bool fiducialLocal(float localEta, float localPhi) const {
77  if (relativeCoordinates) {
78  float dphi = deltaPhi(0.f, localPhi);
79  return (etaMin < localEta + etaCenter && localEta + etaCenter <= etaMax && -phiHalfWidth < dphi &&
80  dphi <= phiHalfWidth);
81  }
82  float dphi = deltaPhi(phiCenter, localPhi);
83  return (etaMin < localEta && localEta <= etaMax && -phiHalfWidth < dphi && dphi <= phiHalfWidth);
84  }
85  float regionAbsEta() const { return std::abs(etaCenter); }
87  float globalEta(float localEta) const { return relativeCoordinates ? localEta + etaCenter : localEta; }
88  float globalPhi(float localPhi) const { return relativeCoordinates ? localPhi + phiCenter : localPhi; }
89  float localEta(float globalEta) const { return relativeCoordinates ? globalEta - etaCenter : globalEta; }
91 
92  void zero() {
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  }
106 
107  void inputSort();
108  };
109 
110 } // namespace l1tpf_impl
111 
112 #endif
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
Definition: BitwisePFAlgo.h:8
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
deltaPhi.h
l1tpf_impl::InputRegion::etaExtra
float etaExtra
Definition: DiscretePFInputs.h:225
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
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::globalAbsEta
float globalAbsEta(float localEta) const
Definition: Region.h:86
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::Region::track_type
Definition: Region.h:45
l1tpf_impl::Region
Definition: Region.h:8
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
l1tpf_impl::Region::fiducialLocal
bool fiducialLocal(float localEta, float localPhi) const
Definition: Region.h:76
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
l1tpf_impl::Region::inputTypeName
static const char * inputTypeName(int inputType)
Definition: Region.cc:6
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
l1tpf_impl::Region::regionAbsEta
float regionAbsEta() const
Definition: Region.h:85
muonTiming_cfi.etamax
etamax
Definition: muonTiming_cfi.py:23
l1tpf_impl::Region::InputType
InputType
Definition: Region.h:45
l1tpf_impl::Region::zero
void zero()
Definition: Region.h:92
l1tpf_impl::Region::muonOverflow
unsigned int muonOverflow
Definition: Region.h:11
l1tpf_impl::InputRegion
Definition: DiscretePFInputs.h:223
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
l1tpf_impl::InputRegion::phiCenter
float phiCenter
Definition: DiscretePFInputs.h:224
l1tpf_impl::Region::puppiOverflow
unsigned int puppiOverflow
Definition: Region.h:11
l1tpf_impl::Region::inputSort
void inputSort()
Definition: Region.cc:113
l1tpf_impl::Region::electron_type
Definition: Region.h:52
l1tpf_impl::Region::outputTypeName
static const char * outputTypeName(int outputType)
Definition: Region.cc:22
DiscretePFInputs.h
l1tpf_impl::Region::nOutput
unsigned int nOutput(OutputType type, bool puppi, bool fiducial=true) const
Definition: Region.cc:65
l1tpf_impl::Region::nInput
unsigned int nInput(InputType type) const
Definition: Region.cc:48
l1tpf_impl::Region::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)
Definition: Region.h:15
l1tpf_impl::Region::contains
bool contains(float eta, float phi) const
Definition: Region.h:65