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 
6 #include <memory>
7 
8 namespace edm {
9  class ParameterSet;
10 }
11 
12 namespace l1ct {
13  class EGInputSelectorEmulator;
14  struct EGInputSelectorEmuConfig;
15 } // namespace l1ct
16 
17 namespace l1ct {
19  public:
20  MultififoRegionizerEmulator(unsigned int nendcaps,
21  unsigned int nclocks,
22  unsigned int ntk,
23  unsigned int ncalo,
24  unsigned int nem,
25  unsigned int nmu,
26  bool streaming,
27  unsigned int outii,
28  bool useAlsoVtxCoords);
29 
32  unsigned int nHCalLinks,
33  unsigned int nECalLinks,
34  unsigned int nclocks,
35  unsigned int ntk,
36  unsigned int ncalo,
37  unsigned int nem,
38  unsigned int nmu,
39  bool streaming,
40  unsigned int outii,
41  unsigned int pauseii,
42  bool useAlsoVtxCoords);
43 
44  // note: this one will work only in CMSSW
46 
48 
49  void setEgInterceptMode(bool afterFifo, const l1ct::EGInputSelectorEmuConfig& interceptorConfig);
50  void initSectorsAndRegions(const RegionizerDecodedInputs& in, const std::vector<PFInputRegion>& out) override;
51 
52  void run(const RegionizerDecodedInputs& in, std::vector<PFInputRegion>& out) override;
53 
54  // clock-cycle emulation
55  bool step(bool newEvent,
56  const std::vector<l1ct::TkObjEmu>& links,
57  std::vector<l1ct::TkObjEmu>& out,
58  bool mux = true);
59  bool step(bool newEvent,
60  const std::vector<l1ct::EmCaloObjEmu>& links,
61  std::vector<l1ct::EmCaloObjEmu>& out,
62  bool mux = true);
63  bool step(bool newEvent,
64  const std::vector<l1ct::HadCaloObjEmu>& links,
65  std::vector<l1ct::HadCaloObjEmu>& out,
66  bool mux = true);
67  bool step(bool newEvent,
68  const std::vector<l1ct::MuObjEmu>& links,
69  std::vector<l1ct::MuObjEmu>& out,
70  bool mux = true);
71  bool step(bool newEvent,
72  const std::vector<l1ct::TkObjEmu>& links_tk,
73  const std::vector<l1ct::HadCaloObjEmu>& links_hadCalo,
74  const std::vector<l1ct::EmCaloObjEmu>& links_emCalo,
75  const std::vector<l1ct::MuObjEmu>& links_mu,
76  std::vector<l1ct::TkObjEmu>& out_tk,
77  std::vector<l1ct::HadCaloObjEmu>& out_hadCalo,
78  std::vector<l1ct::EmCaloObjEmu>& out_emCalo,
79  std::vector<l1ct::MuObjEmu>& out_mu,
80  bool mux = true);
81  void destream(int iclock,
82  const std::vector<l1ct::TkObjEmu>& tk_out,
83  const std::vector<l1ct::EmCaloObjEmu>& em_out,
84  const std::vector<l1ct::HadCaloObjEmu>& calo_out,
85  const std::vector<l1ct::MuObjEmu>& mu_out,
87 
88  // link emulation from decoded inputs (for simulation)
89  void fillLinks(unsigned int iclock, const RegionizerDecodedInputs& in, std::vector<l1ct::TkObjEmu>& links);
90  void fillLinks(unsigned int iclock, const RegionizerDecodedInputs& in, std::vector<l1ct::HadCaloObjEmu>& links);
91  void fillLinks(unsigned int iclock, const RegionizerDecodedInputs& in, std::vector<l1ct::EmCaloObjEmu>& links);
92  void fillLinks(unsigned int iclock, const RegionizerDecodedInputs& in, std::vector<l1ct::MuObjEmu>& links);
93 
94  // convert links to firmware
95  void toFirmware(const std::vector<l1ct::TkObjEmu>& emu, TkObj fw[/*NTK_SECTORS*NTK_LINKS*/]);
96  void toFirmware(const std::vector<l1ct::HadCaloObjEmu>& emu, HadCaloObj fw[/*NCALO_SECTORS*NCALO_LINKS*/]);
97  void toFirmware(const std::vector<l1ct::EmCaloObjEmu>& emu, EmCaloObj fw[/*NCALO_SECTORS*NCALO_LINKS*/]);
98  void toFirmware(const std::vector<l1ct::MuObjEmu>& emu, MuObj fw[/*NMU_LINKS*/]);
99 
100  private:
101  const unsigned int NTK_SECTORS, NCALO_SECTORS; // max objects per sector per clock cycle
106  std::unique_ptr<EGInputSelectorEmulator> interceptor_;
107  bool init_;
108 
113  std::vector<l1ct::multififo_regionizer::Route> tkRoutes_, caloRoutes_, emCaloRoutes_, muRoutes_;
114 
115  template <typename T>
116  void fillCaloLinks_(unsigned int iclock, const std::vector<DetectorSector<T>>& in, std::vector<T>& links);
117  };
118 
119 } // namespace l1ct
120 
121 #endif
std::vector< l1ct::multififo_regionizer::Route > emCaloRoutes_
void fillLinks(unsigned int iclock, const RegionizerDecodedInputs &in, std::vector< l1ct::TkObjEmu > &links)
std::unique_ptr< EGInputSelectorEmulator > interceptor_
void fillCaloLinks_(unsigned int iclock, const std::vector< DetectorSector< T >> &in, std::vector< T > &links)
enum l1ct::MultififoRegionizerEmulator::EmInterceptMode emInterceptMode_
void setEgInterceptMode(bool afterFifo, const l1ct::EGInputSelectorEmuConfig &interceptorConfig)
multififo_regionizer::Regionizer< l1ct::TkObjEmu > tkRegionizer_
bool step(bool newEvent, const std::vector< l1ct::TkObjEmu > &links, std::vector< l1ct::TkObjEmu > &out, bool mux=true)
void run(const RegionizerDecodedInputs &in, std::vector< PFInputRegion > &out) override
std::vector< l1ct::multififo_regionizer::Route > tkRoutes_
void toFirmware(const std::vector< l1ct::TkObjEmu > &emu, TkObj fw[])
MultififoRegionizerEmulator(unsigned int nendcaps, unsigned int nclocks, unsigned int ntk, unsigned int ncalo, unsigned int nem, unsigned int nmu, bool streaming, unsigned int outii, bool useAlsoVtxCoords)
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_
multififo_regionizer::Regionizer< l1ct::EmCaloObjEmu > emCaloRegionizer_
HLT enums.
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:19