Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "L1Trigger/Phase2L1ParticleFlow/interface/pf/pfalgo_dummy_ref.h"
0002 #include "L1Trigger/Phase2L1ParticleFlow/interface/dbgPrintf.h"
0003 
0004 #include <cmath>
0005 #include <cstdio>
0006 #include <algorithm>
0007 #include <memory>
0008 
0009 #ifdef CMSSW_GIT_HASH
0010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0011 
0012 l1ct::PFAlgoDummyEmulator::PFAlgoDummyEmulator(const edm::ParameterSet& iConfig)
0013     : PFAlgoEmulatorBase(
0014           0, iConfig.getParameter<uint32_t>("nCalo"), iConfig.getParameter<uint32_t>("nMu"), 0, 0, 0, 0, 0) {
0015   debug_ = iConfig.getUntrackedParameter<bool>("debug", false);
0016 }
0017 #endif
0018 
0019 void l1ct::PFAlgoDummyEmulator::run(const PFInputRegion& in, OutputRegion& out) const {
0020   unsigned int nCALO = std::min<unsigned>(nCALO_, in.hadcalo.size());
0021   unsigned int nMU = std::min<unsigned>(nMU_, in.muon.size());
0022 
0023   if (debug_) {
0024     for (unsigned int i = 0; i < nCALO; ++i) {
0025       if (in.hadcalo[i].hwPt == 0)
0026         continue;
0027       dbgPrintf(
0028           "FW  \t calo  %3d: pt %8.2f [ %8d ]  calo eta %+5.2f [ %+7d ]  calo phi %+5.2f [ %+7d ]  calo emPt %8.2f [ "
0029           "%6d ]   emID %2d \n",
0030           i,
0031           in.hadcalo[i].floatPt(),
0032           in.hadcalo[i].intPt(),
0033           in.hadcalo[i].floatEta(),
0034           in.hadcalo[i].intEta(),
0035           in.hadcalo[i].floatPhi(),
0036           in.hadcalo[i].intPhi(),
0037           in.hadcalo[i].floatEmPt(),
0038           in.hadcalo[i].intEmPt(),
0039           in.hadcalo[i].hwEmID.to_int());
0040     }
0041     for (unsigned int i = 0; i < nMU; ++i) {
0042       if (in.muon[i].hwPt == 0)
0043         continue;
0044       dbgPrintf("FW  \t muon  %3d: pt %8.2f [ %8d ]  calo eta %+5.2f [ %+7d ]  calo phi %+5.2f [ %+7d ]   \n",
0045                 i,
0046                 in.muon[i].floatPt(),
0047                 in.muon[i].intPt(),
0048                 in.muon[i].floatEta(),
0049                 in.muon[i].intEta(),
0050                 in.muon[i].floatPhi(),
0051                 in.muon[i].intPhi());
0052     }
0053   }
0054 
0055   out.pfneutral.resize(nCALO);
0056   for (unsigned int ic = 0; ic < nCALO; ++ic) {
0057     if (in.hadcalo[ic].hwPt > 0) {
0058       fillPFCand(in.hadcalo[ic], out.pfneutral[ic], in.hadcalo[ic].hwIsEM());
0059     } else {
0060       out.pfneutral[ic].clear();
0061     }
0062   }
0063 
0064   if (debug_) {
0065     for (unsigned int i = 0; i < nCALO; ++i) {
0066       if (out.pfneutral[i].hwPt == 0)
0067         continue;
0068       dbgPrintf("FW  \t outne %3d: pt %8.2f [ %8d ]  calo eta %+5.2f [ %+7d ]  calo phi %+5.2f [ %+7d ]  pid %d\n",
0069                 i,
0070                 out.pfneutral[i].floatPt(),
0071                 out.pfneutral[i].intPt(),
0072                 out.pfneutral[i].floatEta(),
0073                 out.pfneutral[i].intEta(),
0074                 out.pfneutral[i].floatPhi(),
0075                 out.pfneutral[i].intPhi(),
0076                 out.pfneutral[i].intId());
0077     }
0078   }
0079 }