Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-10 01:53:49

0001 #ifndef PFALGO3_REF_H
0002 #define PFALGO3_REF_H
0003 
0004 #include "pfalgo_common_ref.h"
0005 
0006 namespace edm {
0007   class ParameterSet;
0008 }
0009 
0010 namespace l1ct {
0011 
0012   class PFAlgo3Emulator : public PFAlgoEmulatorBase {
0013   public:
0014     PFAlgo3Emulator(unsigned int nTrack,
0015                     unsigned int nEmCalo,
0016                     unsigned int nCalo,
0017                     unsigned int nMu,
0018                     unsigned int nPhoton,
0019                     unsigned int nSelCalo,
0020                     unsigned int nAllNeutral,
0021                     unsigned int dR2Max_Tk_Mu,
0022                     unsigned int dR2Max_Tk_Em,
0023                     unsigned int dR2Max_Em_Calo,
0024                     unsigned int dR2Max_Tk_Calo,
0025                     pt_t tk_MaxInvPt_Loose,
0026                     pt_t tk_MaxInvPt_Tight)
0027         : PFAlgoEmulatorBase(
0028               nTrack, nCalo, nMu, nSelCalo, dR2Max_Tk_Mu, dR2Max_Tk_Calo, tk_MaxInvPt_Loose, tk_MaxInvPt_Tight),
0029           nEMCALO_(nEmCalo),
0030           nPHOTON_(nPhoton),
0031           nALLNEUTRAL_(nAllNeutral),
0032           dR2MAX_TK_EM_(dR2Max_Tk_Em),
0033           dR2MAX_EM_CALO_(dR2Max_Em_Calo) {}
0034 
0035     // note: this one will work only in CMSSW
0036     PFAlgo3Emulator(const edm::ParameterSet& iConfig);
0037 
0038     ~PFAlgo3Emulator() override {}
0039 
0040     void run(const PFInputRegion& in, OutputRegion& out) const override;
0041 
0042     void toFirmware(const PFInputRegion& in,
0043                     PFRegion& region,
0044                     HadCaloObj calo[/*nCALO*/],
0045                     EmCaloObj emcalo[/*nEMCALO*/],
0046                     TkObj track[/*nTRACK*/],
0047                     MuObj mu[/*nMU*/]) const;
0048     void toFirmware(const OutputRegion& out,
0049                     PFChargedObj outch[/*nTRACK*/],
0050                     PFNeutralObj outpho[/*nPHOTON*/],
0051                     PFNeutralObj outne[/*nSELCALO*/],
0052                     PFChargedObj outmu[/*nMU*/]) const;
0053 
0054     /// moves all objects from out.pfphoton to the beginning of out.pfneutral
0055     void mergeNeutrals(OutputRegion& out) const override;
0056 
0057   protected:
0058     unsigned int nEMCALO_, nPHOTON_, nALLNEUTRAL_;
0059     unsigned int dR2MAX_TK_EM_;
0060     unsigned int dR2MAX_EM_CALO_;
0061 
0062     int tk_best_match_ref(unsigned int dR2MAX,
0063                           const std::vector<l1ct::EmCaloObjEmu>& calo,
0064                           const l1ct::TkObjEmu& track) const;
0065     int em_best_match_ref(unsigned int dR2MAX,
0066                           const std::vector<l1ct::HadCaloObjEmu>& calo,
0067                           const l1ct::EmCaloObjEmu& em) const;
0068 
0069     void pfalgo3_em_ref(const PFInputRegion& in,
0070                         const std::vector<int>& iMu /*[nTRACK]*/,
0071                         std::vector<int>& iEle /*[nTRACK]*/,
0072                         OutputRegion& out,
0073                         std::vector<HadCaloObjEmu>& hadcalo_out /*[nCALO]*/) const;
0074   };
0075 
0076 }  // namespace l1ct
0077 
0078 #endif