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 ntklinks,
23  unsigned int ncalolinks,
24  unsigned int ntk,
25  unsigned int ncalo,
26  unsigned int nem,
27  unsigned int nmu,
28  bool streaming,
29  unsigned int outii,
30  unsigned int pauseii,
31  bool useAlsoVtxCoords);
32 
35  unsigned int nHCalLinks,
36  unsigned int nECalLinks,
37  unsigned int nclocks,
38  unsigned int ntk,
39  unsigned int ncalo,
40  unsigned int nem,
41  unsigned int nmu,
42  bool streaming,
43  unsigned int outii,
44  unsigned int pauseii,
45  bool useAlsoVtxCoords);
46  // note: these ones will work only in CMSSW
48  MultififoRegionizerEmulator(const std::string& barrelSetup, const edm::ParameterSet& iConfig);
49 
51 
53 
54  void setEgInterceptMode(bool afterFifo, const l1ct::EGInputSelectorEmuConfig& interceptorConfig);
55  void initSectorsAndRegions(const RegionizerDecodedInputs& in, const std::vector<PFInputRegion>& out) override;
56 
57  void run(const RegionizerDecodedInputs& in, std::vector<PFInputRegion>& out) override;
58 
59  // clock-cycle emulation
60  bool step(bool newEvent,
61  const std::vector<l1ct::TkObjEmu>& links,
62  std::vector<l1ct::TkObjEmu>& out,
63  bool mux = true);
64  bool step(bool newEvent,
65  const std::vector<l1ct::EmCaloObjEmu>& links,
66  std::vector<l1ct::EmCaloObjEmu>& out,
67  bool mux = true);
68  bool step(bool newEvent,
69  const std::vector<l1ct::HadCaloObjEmu>& links,
70  std::vector<l1ct::HadCaloObjEmu>& out,
71  bool mux = true);
72  bool step(bool newEvent,
73  const std::vector<l1ct::MuObjEmu>& links,
74  std::vector<l1ct::MuObjEmu>& out,
75  bool mux = true);
76  bool step(bool newEvent,
77  const std::vector<l1ct::TkObjEmu>& links_tk,
78  const std::vector<l1ct::HadCaloObjEmu>& links_hadCalo,
79  const std::vector<l1ct::EmCaloObjEmu>& links_emCalo,
80  const std::vector<l1ct::MuObjEmu>& links_mu,
81  std::vector<l1ct::TkObjEmu>& out_tk,
82  std::vector<l1ct::HadCaloObjEmu>& out_hadCalo,
83  std::vector<l1ct::EmCaloObjEmu>& out_emCalo,
84  std::vector<l1ct::MuObjEmu>& out_mu,
85  bool mux = true);
86  void destream(int iclock,
87  const std::vector<l1ct::TkObjEmu>& tk_out,
88  const std::vector<l1ct::EmCaloObjEmu>& em_out,
89  const std::vector<l1ct::HadCaloObjEmu>& calo_out,
90  const std::vector<l1ct::MuObjEmu>& mu_out,
92 
93  // link emulation from decoded inputs (for simulation)
94  void fillLinks(unsigned int iclock,
96  std::vector<l1ct::TkObjEmu>& links,
97  std::vector<bool>& valid);
98  void fillLinks(unsigned int iclock,
100  std::vector<l1ct::HadCaloObjEmu>& links,
101  std::vector<bool>& valid);
102  void fillLinks(unsigned int iclock,
104  std::vector<l1ct::EmCaloObjEmu>& links,
105  std::vector<bool>& valid);
106  void fillLinks(unsigned int iclock,
108  std::vector<l1ct::MuObjEmu>& links,
109  std::vector<bool>& valid);
110  template <typename T>
111  void fillLinks(unsigned int iclock, const RegionizerDecodedInputs& in, std::vector<T>& links) {
112  std::vector<bool> unused;
113  fillLinks(iclock, in, links, unused);
114  }
115 
116  // convert links to firmware
117  void toFirmware(const std::vector<l1ct::TkObjEmu>& emu, TkObj fw[/*NTK_SECTORS*NTK_LINKS*/]);
118  void toFirmware(const std::vector<l1ct::HadCaloObjEmu>& emu, HadCaloObj fw[/*NCALO_SECTORS*NCALO_LINKS*/]);
119  void toFirmware(const std::vector<l1ct::EmCaloObjEmu>& emu, EmCaloObj fw[/*NCALO_SECTORS*NCALO_LINKS*/]);
120  void toFirmware(const std::vector<l1ct::MuObjEmu>& emu, MuObj fw[/*NMU_LINKS*/]);
121 
122  void reset();
123 
124  private:
125  const unsigned int NTK_SECTORS, NCALO_SECTORS; // max objects per sector per clock cycle
130  std::unique_ptr<EGInputSelectorEmulator> interceptor_;
131  bool init_;
132 
137  std::vector<l1ct::multififo_regionizer::Route> tkRoutes_, caloRoutes_, emCaloRoutes_, muRoutes_;
138 
139  template <typename T>
140  void fillCaloLinks(unsigned int iclock,
142  std::vector<T>& links,
143  std::vector<bool>& valid);
144  };
145 
146 } // namespace l1ct
147 
148 #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)
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_
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:17