File indexing completed on 2024-04-06 12:21:25
0001 #ifndef PFEGINPUT_REF_H
0002 #define PFEGINPUT_REF_H
0003
0004 #include "DataFormats/L1TParticleFlow/interface/layer1_emulator.h"
0005 #include "DataFormats/L1TParticleFlow/interface/egamma.h"
0006 #include "DataFormats/L1TParticleFlow/interface/pf.h"
0007
0008 namespace edm {
0009 class ParameterSet;
0010 class ParameterSetDescription;
0011 }
0012
0013 namespace l1ct {
0014
0015 struct EGInputSelectorEmuConfig {
0016 EGInputSelectorEmuConfig(const edm::ParameterSet &iConfig);
0017 EGInputSelectorEmuConfig(unsigned int emIdMask, unsigned int nHADCALO_IN, unsigned int nEMCALO_OUT, int debug)
0018 : idMask(emIdMask), nHADCALO_IN(nHADCALO_IN), nEMCALO_OUT(nEMCALO_OUT), debug(debug) {}
0019
0020 static edm::ParameterSetDescription getParameterSetDescription();
0021
0022 emid_t idMask;
0023 unsigned int nHADCALO_IN;
0024 unsigned int nEMCALO_OUT;
0025
0026 int debug;
0027 };
0028
0029 class EGInputSelectorEmulator {
0030 public:
0031 EGInputSelectorEmulator(const EGInputSelectorEmuConfig &config) : cfg(config), debug_(cfg.debug) {}
0032
0033 virtual ~EGInputSelectorEmulator() {}
0034
0035 void toFirmware(const PFInputRegion &in, HadCaloObj hadcalo[]) const;
0036 void toFirmware(const std::vector<l1ct::EmCaloObjEmu> &emcalo_sel, l1ct::EmCaloObj emcalo[]) const;
0037
0038 void select_eginput(const l1ct::HadCaloObjEmu &in, l1ct::EmCaloObjEmu &out, bool &valid_out) const;
0039 void select_eginputs(const std::vector<l1ct::HadCaloObjEmu> &hadcalo_in,
0040 std::vector<l1ct::EmCaloObjEmu> &emcalo_sel) const;
0041
0042
0043 void select_or_clear(const l1ct::HadCaloObjEmu &hadcalo_in, l1ct::EmCaloObjEmu &emcalo_out) const;
0044
0045
0046 void select_or_clear(const std::vector<l1ct::HadCaloObjEmu> &hadcalo_in,
0047 std::vector<l1ct::EmCaloObjEmu> &emcalo_out) const;
0048
0049
0050
0051 void setDebug(int debug) { debug_ = debug; }
0052
0053 private:
0054 EGInputSelectorEmuConfig cfg;
0055 int debug_;
0056 };
0057 }
0058
0059 #endif