CMS 3D CMS Logo

multififo_regionizer_ref.h
Go to the documentation of this file.
1 #ifndef multififo_regionizer_ref_h
2 #define multififo_regionizer_ref_h
3 
7 #include <memory>
8 
9 namespace edm {
10  class ParameterSet;
12 } // namespace edm
13 
14 namespace l1ct {
15  class EGInputSelectorEmulator;
16  struct EGInputSelectorEmuConfig;
17 } // namespace l1ct
18 
19 namespace l1ct {
21  public:
22  MultififoRegionizerEmulator(unsigned int nendcaps,
23  unsigned int nclocks,
24  unsigned int ntklinks,
25  unsigned int ncalolinks,
26  unsigned int ntk,
27  unsigned int ncalo,
28  unsigned int nem,
29  unsigned int nmu,
30  bool streaming,
31  unsigned int outii,
32  unsigned int pauseii,
33  bool useAlsoVtxCoords);
34 
37  unsigned int ntklinks,
38  unsigned int nHCalLinks,
39  unsigned int nECalLinks,
40  unsigned int nclocks,
41  unsigned int ntk,
42  unsigned int ncalo,
43  unsigned int nem,
44  unsigned int nmu,
45  bool streaming,
46  unsigned int outii,
47  unsigned int pauseii,
48  bool useAlsoVtxCoords);
49  // note: these ones will work only in CMSSW
51  MultififoRegionizerEmulator(const std::string& barrelSetup, const edm::ParameterSet& iConfig);
52 
54 
57 
59 
60  void setEgInterceptMode(bool afterFifo, const l1ct::EGInputSelectorEmuConfig& interceptorConfig);
61  void initSectorsAndRegions(const RegionizerDecodedInputs& in, const std::vector<PFInputRegion>& out) override;
62 
63  void run(const RegionizerDecodedInputs& in, std::vector<PFInputRegion>& out) override;
64 
65  // clock-cycle emulation
66  bool step(bool newEvent,
67  const std::vector<l1ct::TkObjEmu>& links,
68  std::vector<l1ct::TkObjEmu>& out,
69  bool mux = true);
70  bool step(bool newEvent,
71  const std::vector<l1ct::EmCaloObjEmu>& links,
72  std::vector<l1ct::EmCaloObjEmu>& out,
73  bool mux = true);
74  bool step(bool newEvent,
75  const std::vector<l1ct::HadCaloObjEmu>& links,
76  std::vector<l1ct::HadCaloObjEmu>& out,
77  bool mux = true);
78  bool step(bool newEvent,
79  const std::vector<l1ct::MuObjEmu>& links,
80  std::vector<l1ct::MuObjEmu>& out,
81  bool mux = true);
82  bool step(bool newEvent,
83  const std::vector<l1ct::TkObjEmu>& links_tk,
84  const std::vector<l1ct::HadCaloObjEmu>& links_hadCalo,
85  const std::vector<l1ct::EmCaloObjEmu>& links_emCalo,
86  const std::vector<l1ct::MuObjEmu>& links_mu,
87  std::vector<l1ct::TkObjEmu>& out_tk,
88  std::vector<l1ct::HadCaloObjEmu>& out_hadCalo,
89  std::vector<l1ct::EmCaloObjEmu>& out_emCalo,
90  std::vector<l1ct::MuObjEmu>& out_mu,
91  bool mux = true);
92  void destream(int iclock,
93  const std::vector<l1ct::TkObjEmu>& tk_out,
94  const std::vector<l1ct::EmCaloObjEmu>& em_out,
95  const std::vector<l1ct::HadCaloObjEmu>& calo_out,
96  const std::vector<l1ct::MuObjEmu>& mu_out,
98 
99  // link emulation from decoded inputs (for simulation)
100  void fillLinks(unsigned int iclock,
102  std::vector<l1ct::TkObjEmu>& links,
103  std::vector<bool>& valid);
104  void fillLinks(unsigned int iclock,
106  std::vector<l1ct::HadCaloObjEmu>& links,
107  std::vector<bool>& valid);
108  void fillLinks(unsigned int iclock,
110  std::vector<l1ct::EmCaloObjEmu>& links,
111  std::vector<bool>& valid);
112  void fillLinks(unsigned int iclock,
114  std::vector<l1ct::MuObjEmu>& links,
115  std::vector<bool>& valid);
116  template <typename T>
117  void fillLinks(unsigned int iclock, const RegionizerDecodedInputs& in, std::vector<T>& links) {
118  std::vector<bool> unused;
119  fillLinks(iclock, in, links, unused);
120  }
121 
122  // convert links to firmware
123  void toFirmware(const std::vector<l1ct::TkObjEmu>& emu, TkObj fw[/*NTK_SECTORS*NTK_LINKS*/]);
124  void toFirmware(const std::vector<l1ct::HadCaloObjEmu>& emu, HadCaloObj fw[/*NCALO_SECTORS*NCALO_LINKS*/]);
125  void toFirmware(const std::vector<l1ct::EmCaloObjEmu>& emu, EmCaloObj fw[/*NCALO_SECTORS*NCALO_LINKS*/]);
126  void toFirmware(const std::vector<l1ct::MuObjEmu>& emu, MuObj fw[/*NMU_LINKS*/]);
127 
128  void reset();
129 
130  private:
131  const unsigned int NTK_SECTORS, NCALO_SECTORS; // max objects per sector per clock cycle
136  std::unique_ptr<EGInputSelectorEmulator> interceptor_;
137  bool init_;
138 
143  std::vector<l1ct::multififo_regionizer::Route> tkRoutes_, caloRoutes_, emCaloRoutes_, muRoutes_;
144 
145  template <typename T>
146  void fillCaloLinks(unsigned int iclock,
148  std::vector<T>& links,
149  std::vector<bool>& valid);
150  };
151 
152 } // namespace l1ct
153 
154 #endif
std::vector< l1ct::multififo_regionizer::Route > emCaloRoutes_
void fillLinks(unsigned int iclock, const RegionizerDecodedInputs &in, std::vector< l1ct::TkObjEmu > &links, std::vector< bool > &valid)
std::unique_ptr< EGInputSelectorEmulator > interceptor_
enum l1ct::MultififoRegionizerEmulator::EmInterceptMode emInterceptMode_
void setEgInterceptMode(bool afterFifo, const l1ct::EGInputSelectorEmuConfig &interceptorConfig)
multififo_regionizer::Regionizer< l1ct::TkObjEmu > tkRegionizer_
MultififoRegionizerEmulator(unsigned int nendcaps, unsigned int nclocks, unsigned int ntklinks, unsigned int ncalolinks, unsigned int ntk, unsigned int ncalo, unsigned int nem, unsigned int nmu, bool streaming, unsigned int outii, unsigned int pauseii, bool useAlsoVtxCoords)
bool step(bool newEvent, const std::vector< l1ct::TkObjEmu > &links, std::vector< l1ct::TkObjEmu > &out, bool mux=true)
static edm::ParameterSetDescription getParameterSetDescriptionBarrel()
void run(const RegionizerDecodedInputs &in, std::vector< PFInputRegion > &out) override
void fillLinks(unsigned int iclock, const RegionizerDecodedInputs &in, std::vector< T > &links)
std::vector< l1ct::multififo_regionizer::Route > tkRoutes_
void toFirmware(const std::vector< l1ct::TkObjEmu > &emu, TkObj fw[])
static BarrelSetup parseBarrelSetup(const std::string &setup)
void destream(int iclock, const std::vector< l1ct::TkObjEmu > &tk_out, const std::vector< l1ct::EmCaloObjEmu > &em_out, const std::vector< l1ct::HadCaloObjEmu > &calo_out, const std::vector< l1ct::MuObjEmu > &mu_out, PFInputRegion &out)
std::vector< l1ct::multififo_regionizer::Route > muRoutes_
std::vector< l1ct::multififo_regionizer::Route > caloRoutes_
static edm::ParameterSetDescription getParameterSetDescription()
multififo_regionizer::Regionizer< l1ct::EmCaloObjEmu > emCaloRegionizer_
HLT enums.
void fillCaloLinks(unsigned int iclock, const std::vector< DetectorSector< T >> &in, std::vector< T > &links, std::vector< bool > &valid)
void initSectorsAndRegions(const RegionizerDecodedInputs &in, const std::vector< PFInputRegion > &out) override
multififo_regionizer::Regionizer< l1ct::MuObjEmu > muRegionizer_
multififo_regionizer::Regionizer< l1ct::HadCaloObjEmu > hadCaloRegionizer_
Definition: datatypes.h:8