CMS 3D CMS Logo

Classes | Functions | Variables
p2eg Namespace Reference

Classes

class  card
 
class  Cluster
 
class  clusterInfo
 
class  crystal
 
class  crystalMax
 
class  ecalRegion_t
 
class  ecaltp_t
 
class  etaStrip_t
 
class  etaStripPeak_t
 
class  GCTcard_t
 
class  GCTcluster_t
 
class  GCTCorrfiber_t
 
class  GCTinternal_t
 
class  GCTintTowers_t
 
class  GCTtoCorr_t
 
class  GCTtower_t
 
class  linkECAL
 
class  RCTcard_t
 
class  RCTcluster_t
 
class  RCTtoGCTfiber_t
 
class  RCTtower_t
 
class  region3x4
 
class  SimpleCaloHit
 
class  tower_t
 
class  towerHCAL
 
class  towers3x4
 

Functions

void algo_top (const GCTcard_t &GCTcard, GCTtoCorr_t &GCTtoCorr, unsigned int nGCTCard, std::unique_ptr< l1tp2::CaloCrystalClusterCollection > const &gctClusters, std::unique_ptr< l1tp2::CaloTowerCollection > const &gctTowers, std::unique_ptr< l1tp2::CaloTowerCollection > const &gctFullTowers, std::unique_ptr< l1t::EGammaBxCollection > const &gctEGammas, std::unique_ptr< l1tp2::DigitizedClusterCorrelatorCollection > const &gctDigitizedClustersCorrelator, std::unique_ptr< l1tp2::DigitizedTowerCorrelatorCollection > const &gctDigitizedTowersCorrelator, std::unique_ptr< l1tp2::DigitizedClusterGTCollection > const &gctDigitizedClustersGT, l1tp2::ParametricCalibration calib_)
 
ecaltp_t bestOf2 (const ecaltp_t ecaltp0, const ecaltp_t ecaltp1)
 
bool compareClusterET (const Cluster &lhs, const Cluster &rhs)
 
ap_uint< 12 > convertHcalETtoEcalET (ap_uint< 12 > HCAL)
 
void doProximityAndBremsStitching (const RCTcard_t(&inputCards)[N_RCTCARDS_PHI], RCTcard_t(&outputCards)[N_RCTCARDS_PHI], int iStartingCard, bool isPositiveEta)
 
int getAbsID_iEta_fromFirmwareCardTowerLink (int nCard, int nTower, int nLink)
 
int getAbsID_iPhi_fromFirmwareCardTowerLink (int nCard, int nTower, int nLink)
 
clusterInfo getBremsValuesNeg (crystal tempX[CRYSTAL_IN_ETA][CRYSTAL_IN_PHI], ap_uint< 5 > seed_eta, ap_uint< 5 > seed_phi)
 
clusterInfo getBremsValuesPos (crystal tempX[CRYSTAL_IN_ETA][CRYSTAL_IN_PHI], ap_uint< 5 > seed_eta, ap_uint< 5 > seed_phi)
 
int getCard_iEtaMax (int cc)
 
int getCard_iEtaMin (int cc)
 
int getCard_iPhiMax (int cc)
 
int getCard_iPhiMin (int cc)
 
int getCard_refCrystal_iEta (int cc)
 
int getCard_refCrystal_iPhi (int cc)
 
Cluster getClusterFromRegion3x4 (crystal temp[CRYSTAL_IN_ETA][CRYSTAL_IN_PHI])
 
clusterInfo getClusterPosition (const ecalRegion_t ecalRegion)
 
GCTcard_t getClustersCombined (const GCTcard_t &GCTcard, unsigned int nGCTCard)
 
GCTinternal_t getClustersTowers (const GCTcard_t &GCTcard, unsigned int nGCTCard)
 
clusterInfo getClusterValues (crystal tempX[CRYSTAL_IN_ETA][CRYSTAL_IN_PHI], ap_uint< 5 > seed_eta, ap_uint< 5 > seed_phi)
 
void getECALTowersEt (crystal tempX[CRYSTAL_IN_ETA][CRYSTAL_IN_PHI], ap_uint< 12 > towerEt[12])
 
GCTintTowers_t getFullTowers (const GCTinternal_t &GCTinternal)
 
crystalMax getPeakBin15N (const etaStripPeak_t etaStrip)
 
ecaltp_t getPeakBin20N (const etaStrip_t etaStrip)
 
int getRegionNumber (const int local_iEta)
 
int getTower_absEtaID (float eta)
 
int getTower_absPhiID (float phi)
 
float getTowerEta_fromAbsID (int id)
 
float getTowerPhi_fromAbsID (int id)
 
ecalRegion_t initStructure (crystal temporary[CRYSTAL_IN_ETA][CRYSTAL_IN_PHI])
 
bool isValidCard (int cc)
 
Cluster packCluster (ap_uint< 15 > &clusterEt, ap_uint< 5 > &etaMax_t, ap_uint< 5 > &phiMax_t)
 
bool passes_iso (float pt, float iso)
 
bool passes_looseTkiso (float pt, float iso)
 
bool passes_looseTkss (float pt, float ss)
 
bool passes_ss (float pt, float ss)
 
void printl1tp2TowerInfo (l1tp2::CaloTower thisTower, std::string description="")
 
void removeClusterFromCrystal (crystal temp[CRYSTAL_IN_ETA][CRYSTAL_IN_PHI], ap_uint< 5 > seed_eta, ap_uint< 5 > seed_phi, ap_uint< 2 > brems)
 
void stitchClusterOverRegionBoundary (std::vector< Cluster > &cluster_list, int towerEtaUpper, int towerEtaLower, int cc)
 
void writeToCorrelatorAndGTOutputs (const GCTinternal_t &GCTinternal, GCTtoCorr_t &GCTtoCorrOutput, std::unique_ptr< l1tp2::CaloCrystalClusterCollection > const &gctClustersOutput, std::unique_ptr< l1tp2::CaloTowerCollection > const &gctTowersOutput, std::unique_ptr< l1t::EGammaBxCollection > const &gctEGammas, std::unique_ptr< l1tp2::DigitizedClusterCorrelatorCollection > const &gctDigitizedClustersCorrelator, std::unique_ptr< l1tp2::DigitizedTowerCorrelatorCollection > const &gctDigitizedTowersCorrelator, std::unique_ptr< l1tp2::DigitizedClusterGTCollection > const &gctDigitizedClustersGT, int nGCTCard, int fiberStart, int fiberEnd, int corrFiberIndexOffset, int corrTowPhiOffset)
 

Variables

static constexpr float a0 = 0.21
 
static constexpr float a0_80 = 0.85
 
static constexpr float a1_80 = 0.0080
 
static constexpr float b0 = 0.38
 
static constexpr float b1 = 1.9
 
static constexpr float b2 = 0.05
 
static constexpr float c0_ss = 0.94
 
static constexpr float c1_ss = 0.052
 
static constexpr float c2_ss = 0.044
 
static constexpr int CRYSTAL_IN_ETA = 15
 
static constexpr int CRYSTAL_IN_PHI = 20
 
static constexpr int CRYSTALS_IN_TOWER_ETA = 5
 
static constexpr int CRYSTALS_IN_TOWER_PHI = 5
 
static constexpr float cut_500_MeV = 0.5
 
static constexpr float d0 = 0.96
 
static constexpr float d1 = 0.0003
 
static constexpr float e0_looseTkss = 0.944
 
static constexpr float e1_looseTkss = 0.65
 
static constexpr float e2_looseTkss = 0.4
 
static constexpr float ECAL_eta_range = 1.4841
 
static constexpr float ECAL_LSB = 0.125
 
static constexpr int GCTCARD_0_TOWER_IPHI_OFFSET = 20
 
static constexpr int GCTCARD_1_TOWER_IPHI_OFFSET = 44
 
static constexpr int GCTCARD_2_TOWER_IPHI_OFFSET = 68
 
static const unsigned int GCTcardtoRCTcardnumber [N_GCTCARDS][N_RCTCARDS_PHI *2]
 
static constexpr float half_crystal_size = 0.00873
 
static constexpr float HCAL_LSB = 0.5
 
static constexpr int n_clusters_4link = 8
 
static constexpr int n_clusters_link = 2
 
static constexpr int N_CLUSTERS_PER_REGION = 4
 
static constexpr int n_crystals_cardEta = (n_towers_Eta * n_towers_cardEta)
 
static constexpr int n_crystals_cardPhi = (n_towers_Phi * n_towers_cardPhi)
 
static constexpr int N_GCTCARDS = 3
 
static constexpr int N_GCTCLUSTERS_FIBER = 2
 
static constexpr int N_GCTCORR_FIBERS = 48
 
static constexpr int N_GCTETA = 34
 
static constexpr int N_GCTINTERNAL_FIBERS = 64
 
static constexpr int N_GCTPHI = 32
 
static constexpr int N_GCTPOSITIVE_FIBERS = 32
 
static constexpr int N_GCTTOWERS_CLUSTER_ISO_ONESIDE = 5
 
static constexpr int N_GCTTOWERS_FIBER = 17
 
static constexpr int n_links_card = 4
 
static constexpr int N_RCTCARDS_PHI = 8
 
static constexpr int N_RCTCLUSTERS_FIBER = 2
 
static constexpr int N_RCTGCT_FIBERS = 4
 
static constexpr int N_RCTTOWERS_FIBER = 17
 
static constexpr int N_REGIONS_PER_CARD = 6
 
static constexpr int n_towers_cardEta = 17
 
static constexpr int n_towers_cardPhi = 4
 
static constexpr int n_towers_Eta = 34
 
static constexpr int n_towers_halfPhi = 36
 
static constexpr int n_towers_per_link = 17
 
static constexpr int n_towers_Phi = 72
 
static constexpr float slideIsoPtThreshold = 80
 
static constexpr int TOWER_IN_ETA = 3
 
static constexpr int TOWER_IN_PHI = 4
 

Function Documentation

◆ algo_top()

void p2eg::algo_top ( const GCTcard_t GCTcard,
p2eg::GCTtoCorr_t GCTtoCorr,
unsigned int  nGCTCard,
std::unique_ptr< l1tp2::CaloCrystalClusterCollection > const &  gctClusters,
std::unique_ptr< l1tp2::CaloTowerCollection > const &  gctTowers,
std::unique_ptr< l1tp2::CaloTowerCollection > const &  gctFullTowers,
std::unique_ptr< l1t::EGammaBxCollection > const &  gctEGammas,
std::unique_ptr< l1tp2::DigitizedClusterCorrelatorCollection > const &  gctDigitizedClustersCorrelator,
std::unique_ptr< l1tp2::DigitizedTowerCorrelatorCollection > const &  gctDigitizedTowersCorrelator,
std::unique_ptr< l1tp2::DigitizedClusterGTCollection > const &  gctDigitizedClustersGT,
l1tp2::ParametricCalibration  calib_ 
)
inline

Definition at line 367 of file Phase2L1GCT.h.

References p2eg::GCTinternal_t::computeClusterIsolationInPlace(), l1tPhase2CaloPFClusterEmulator_cfi::gctFullTowers, getClustersTowers(), getFullTowers(), N_GCTINTERNAL_FIBERS, N_GCTPOSITIVE_FIBERS, N_RCTGCT_FIBERS, p2eg::GCTinternal_t::setIsolationInfo(), writeToCorrelatorAndGTOutputs(), and p2eg::GCTintTowers_t::writeToPFOutput().

Referenced by Phase2L1CaloEGammaEmulator::produce().

378  {
379  //-------------------------//
380  // Initialize the GCT area
381  //-------------------------//
382  p2eg::GCTinternal_t GCTinternal = p2eg::getClustersTowers(GCTcard, nGCTCard);
383 
384  //------------------------------------------------//
385  // Combine towers and clusters to get full towers
386  //------------------------------------------------//
387  p2eg::GCTintTowers_t GCTintTowers = p2eg::getFullTowers(GCTinternal);
388 
389  //---------------------------//
390  // Compute cluster isolation
391  //--------------------------//
392  GCTinternal.computeClusterIsolationInPlace(nGCTCard);
393  GCTinternal.setIsolationInfo();
394 
395  //-----------------------------------------------------------------------------------------------------------------------//
396  // Output to correlator and CMSSW collections.
397  // For positive eta, skip overlap region, i.e. fibers i = 0, 1, 2, 3, and i = 28, 29, 30, 31.
398  // For negative eta, skip overlap region, i.e. fibers 32, 33, 34, 35, and 61, 62, 63, 64.
399  //-----------------------------------------------------------------------------------------------------------------------//
400  int posEtaFiberStart = p2eg::N_RCTGCT_FIBERS; // 4, since there are 4 fibers in one RCT card
401  int posEtaFiberEnd = (p2eg::N_GCTPOSITIVE_FIBERS - p2eg::N_RCTGCT_FIBERS);
402  int negEtaFiberStart = (p2eg::N_GCTPOSITIVE_FIBERS + p2eg::N_RCTGCT_FIBERS);
403  int negEtaFiberEnd =
404  (p2eg::N_GCTINTERNAL_FIBERS - p2eg::N_RCTGCT_FIBERS); // first term is number of gct internal fibers
405 
406  // When indexing into the correlator output, note that the output to correlator does NOT include the overlap region,
407  // so fiber number "i" in GCT is not fiber "i" in the correlator output, it's reduced by 4 in positive eta, and 12 in negative eta.
408  // (4 because we are skipping one RCT card in positive eta, and 12 because we are skipping three RCT cards in negative eta)
409  int posEtaCorrelatorFiberIndexOffset = 4;
410  int negEtaCorrelatorFiberIndexOffset = 12;
411 
412  // The offset in the actual towPhi value is going to be the same in pos/neg eta; shifted down by 4 due to no overlap region
413  int correlatorTowPhiOffset = 4;
414 
415  // Positive eta
417  GCTtoCorr,
418  gctClusters,
419  gctTowers,
420  gctEGammas,
421  gctDigitizedClustersCorrelator,
422  gctDigitizedTowersCorrelator,
423  gctDigitizedClustersGT,
424  nGCTCard,
425  posEtaFiberStart,
426  posEtaFiberEnd,
427  posEtaCorrelatorFiberIndexOffset,
428  correlatorTowPhiOffset);
429  // Negative eta
431  GCTtoCorr,
432  gctClusters,
433  gctTowers,
434  gctEGammas,
435  gctDigitizedClustersCorrelator,
436  gctDigitizedTowersCorrelator,
437  gctDigitizedClustersGT,
438  nGCTCard,
439  negEtaFiberStart,
440  negEtaFiberEnd,
441  negEtaCorrelatorFiberIndexOffset,
442  correlatorTowPhiOffset);
443 
444  //-----------------------------------------------------------------------------------------------------------------------//
445  // CMSSW outputs for GCT Full Towers (clusters + towers) output for PFClusters.
446  //-----------------------------------------------------------------------------------------------------------------------//
447  GCTintTowers.writeToPFOutput(nGCTCard, gctFullTowers);
448 }
static constexpr int N_GCTPOSITIVE_FIBERS
void computeClusterIsolationInPlace(int nGCTCard)
static constexpr int N_RCTGCT_FIBERS
static constexpr int N_GCTINTERNAL_FIBERS
GCTintTowers_t getFullTowers(const GCTinternal_t &GCTinternal)
Definition: Phase2L1GCT.h:241
void writeToCorrelatorAndGTOutputs(const GCTinternal_t &GCTinternal, GCTtoCorr_t &GCTtoCorrOutput, std::unique_ptr< l1tp2::CaloCrystalClusterCollection > const &gctClustersOutput, std::unique_ptr< l1tp2::CaloTowerCollection > const &gctTowersOutput, std::unique_ptr< l1t::EGammaBxCollection > const &gctEGammas, std::unique_ptr< l1tp2::DigitizedClusterCorrelatorCollection > const &gctDigitizedClustersCorrelator, std::unique_ptr< l1tp2::DigitizedTowerCorrelatorCollection > const &gctDigitizedTowersCorrelator, std::unique_ptr< l1tp2::DigitizedClusterGTCollection > const &gctDigitizedClustersGT, int nGCTCard, int fiberStart, int fiberEnd, int corrFiberIndexOffset, int corrTowPhiOffset)
Definition: Phase2L1GCT.h:294
GCTinternal_t getClustersTowers(const GCTcard_t &GCTcard, unsigned int nGCTCard)
Definition: Phase2L1GCT.h:196
void writeToPFOutput(int nGCTCard, std::unique_ptr< l1tp2::CaloTowerCollection > const &gctFullTowers)

◆ bestOf2()

p2eg::ecaltp_t p2eg::bestOf2 ( const ecaltp_t  ecaltp0,
const ecaltp_t  ecaltp1 
)
inline

Definition at line 940 of file Phase2L1RCT.h.

References p2eg::ecaltp_t::energy, and x.

Referenced by getPeakBin15N(), and getPeakBin20N().

940  {
942  x = (ecaltp0.energy > ecaltp1.energy) ? ecaltp0 : ecaltp1;
943 
944  return x;
945 }
float x

◆ compareClusterET()

bool p2eg::compareClusterET ( const Cluster lhs,
const Cluster rhs 
)
inline

Definition at line 961 of file Phase2L1CaloEGammaUtils.h.

References p2eg::Cluster::clusterEnergy().

Referenced by Phase2L1CaloEGammaEmulator::produce().

961  {
962  return (lhs.clusterEnergy() > rhs.clusterEnergy());
963  }

◆ convertHcalETtoEcalET()

ap_uint<12> p2eg::convertHcalETtoEcalET ( ap_uint< 12 >  HCAL)
inline

Definition at line 96 of file Phase2L1CaloEGammaUtils.h.

References ECAL_LSB, and HCAL_LSB.

Referenced by p2eg::tower_t::getHoverE(), and Phase2L1CaloEGammaEmulator::produce().

96  {
97  float hcalEtAsFloat = HCAL * HCAL_LSB;
98  return (ap_uint<12>(hcalEtAsFloat / ECAL_LSB));
99  }
static constexpr float HCAL_LSB
static constexpr float ECAL_LSB
Definition: HCAL.py:1

◆ doProximityAndBremsStitching()

void p2eg::doProximityAndBremsStitching ( const RCTcard_t(&)  inputCards[N_RCTCARDS_PHI],
RCTcard_t(&)  outputCards[N_RCTCARDS_PHI],
int  iStartingCard,
bool  isPositiveEta 
)

Referenced by getClustersCombined().

◆ getAbsID_iEta_fromFirmwareCardTowerLink()

int p2eg::getAbsID_iEta_fromFirmwareCardTowerLink ( int  nCard,
int  nTower,
int  nLink 
)
inline

Definition at line 195 of file Phase2L1CaloEGammaUtils.h.

References n_towers_per_link, and funct::void.

Referenced by Phase2L1CaloEGammaEmulator::produce().

195  {
196  // iEta only depends on the tower position in the link
197  (void)nCard;
198  (void)nLink;
199  if ((nCard % 2) == 1) { // if cc is odd (positive eta), e.g. nTower = 0 will correspond to absolute iEta ID 17.
200  return n_towers_per_link + nTower;
201  } else { // if cc is even (negative eta): e.g. nTower = 0 will correspond to absolute iEta ID 16.
202  return (16 - nTower);
203  }
204  }
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
static constexpr int n_towers_per_link

◆ getAbsID_iPhi_fromFirmwareCardTowerLink()

int p2eg::getAbsID_iPhi_fromFirmwareCardTowerLink ( int  nCard,
int  nTower,
int  nLink 
)
inline

Definition at line 209 of file Phase2L1CaloEGammaUtils.h.

References TOWER_IN_PHI, and funct::void.

Referenced by Phase2L1CaloEGammaEmulator::produce().

209  {
210  // iPhi only depends on the card and link number
211  (void)nTower;
212  if ((nCard % 2) == 1) { // if cc is odd (positive eta),
213  // e.g. cc=3, link #2, global iPhi = int(3/2) * 4 + 2 = 6
214  return (int(nCard / 2) * TOWER_IN_PHI) + nLink;
215  } else { // if cc is even (negative eta)
216  // e.g. cc=4, link #2, global iPhi = int(4/2) * 4 + (4 - 2 - 1)
217  // = 2*4 + 1
218  // = 9
219  // minus one is because TOWER_IN_PHI is 4
220  return (int(nCard / 2) * TOWER_IN_PHI) + (TOWER_IN_PHI - nLink - 1);
221  }
222  }
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
static constexpr int TOWER_IN_PHI

◆ getBremsValuesNeg()

clusterInfo p2eg::getBremsValuesNeg ( crystal  tempX[CRYSTAL_IN_ETA][CRYSTAL_IN_PHI],
ap_uint< 5 >  seed_eta,
ap_uint< 5 >  seed_phi 
)

◆ getBremsValuesPos()

clusterInfo p2eg::getBremsValuesPos ( crystal  tempX[CRYSTAL_IN_ETA][CRYSTAL_IN_PHI],
ap_uint< 5 >  seed_eta,
ap_uint< 5 >  seed_phi 
)

◆ getCard_iEtaMax()

int p2eg::getCard_iEtaMax ( int  cc)
inline

Definition at line 112 of file Phase2L1CaloEGammaUtils.h.

References cms::cuda::assert(), gpuPixelDoublets::cc, CRYSTALS_IN_TOWER_ETA, TrackingDataMCValidation_Standalone_cff::etamax, isValidCard(), n_towers_cardEta, and n_towers_Eta.

Referenced by p2eg::SimpleCaloHit::isInCard().

112  {
114 
115  int etamax = 0;
116  if (cc % 2 == 0) // Even card: negative eta
117  etamax = (n_towers_cardEta * CRYSTALS_IN_TOWER_ETA - 1); // First eta half. 5 crystals in eta in 1 tower.
118  else // Odd card: positive eta
120  return etamax;
121  }
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
assert(be >=bs)
bool isValidCard(int cc)
static constexpr int CRYSTALS_IN_TOWER_ETA
static constexpr int n_towers_Eta
static constexpr int n_towers_cardEta

◆ getCard_iEtaMin()

int p2eg::getCard_iEtaMin ( int  cc)
inline

Definition at line 124 of file Phase2L1CaloEGammaUtils.h.

References gpuPixelDoublets::cc, CRYSTALS_IN_TOWER_ETA, TrackingDataMCValidation_Standalone_cff::etamin, and n_towers_cardEta.

Referenced by p2eg::SimpleCaloHit::isInCard().

124  {
125  int etamin = 0;
126  if (cc % 2 == 0) // Even card: negative eta
127  etamin = (0);
128  else // Odd card: positive eta
130  return etamin;
131  }
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
static constexpr int CRYSTALS_IN_TOWER_ETA
static constexpr int n_towers_cardEta

◆ getCard_iPhiMax()

int p2eg::getCard_iPhiMax ( int  cc)
inline

Definition at line 134 of file Phase2L1CaloEGammaUtils.h.

References gpuPixelDoublets::cc, CRYSTALS_IN_TOWER_PHI, and phimax.

Referenced by p2eg::SimpleCaloHit::isInCard().

134  {
135  int phimax = ((cc / 2) + 1) * 4 * CRYSTALS_IN_TOWER_PHI - 1;
136  return phimax;
137  }
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
static constexpr int CRYSTALS_IN_TOWER_PHI

◆ getCard_iPhiMin()

int p2eg::getCard_iPhiMin ( int  cc)
inline

Definition at line 140 of file Phase2L1CaloEGammaUtils.h.

References gpuPixelDoublets::cc, CRYSTALS_IN_TOWER_PHI, and phimin.

Referenced by p2eg::SimpleCaloHit::isInCard().

140  {
141  int phimin = (cc / 2) * 4 * CRYSTALS_IN_TOWER_PHI;
142  return phimin;
143  }
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
static constexpr int CRYSTALS_IN_TOWER_PHI

◆ getCard_refCrystal_iEta()

int p2eg::getCard_refCrystal_iEta ( int  cc)
inline

Definition at line 146 of file Phase2L1CaloEGammaUtils.h.

References gpuPixelDoublets::cc, and CRYSTALS_IN_TOWER_ETA.

Referenced by p2eg::Cluster::crystaliEtaFromCardRegionInfo(), and p2eg::SimpleCaloHit::crystalLocaliEta().

146  {
147  if ((cc % 2) == 1) { // if cc is odd (positive eta)
148  return (17 * CRYSTALS_IN_TOWER_ETA);
149  } else { // if cc is even (negative eta) the bottom left corner is further in eta, hence +4
150  return ((16 * CRYSTALS_IN_TOWER_ETA) + 4);
151  }
152  }
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
static constexpr int CRYSTALS_IN_TOWER_ETA

◆ getCard_refCrystal_iPhi()

int p2eg::getCard_refCrystal_iPhi ( int  cc)
inline

Definition at line 155 of file Phase2L1CaloEGammaUtils.h.

References gpuPixelDoublets::cc, CRYSTALS_IN_TOWER_PHI, createfilelist::int, and TOWER_IN_PHI.

Referenced by p2eg::Cluster::crystaliPhiFromCardRegionInfo(), and p2eg::SimpleCaloHit::crystalLocaliPhi().

155  {
156  if ((cc % 2) == 1) {
157  // if cc is odd: positive eta
158  return int(cc / 2) * TOWER_IN_PHI * CRYSTALS_IN_TOWER_PHI;
159  } else {
160  // if cc is even, the bottom left corner is further in phi, hence the +4 and -1
161  return (((int(cc / 2) * TOWER_IN_PHI) + 4) * CRYSTALS_IN_TOWER_PHI) - 1;
162  }
163  }
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
static constexpr int TOWER_IN_PHI
static constexpr int CRYSTALS_IN_TOWER_PHI

◆ getClusterFromRegion3x4()

Cluster p2eg::getClusterFromRegion3x4 ( crystal  temp[CRYSTAL_IN_ETA][CRYSTAL_IN_PHI])

◆ getClusterPosition()

p2eg::clusterInfo p2eg::getClusterPosition ( const ecalRegion_t  ecalRegion)
inline

Definition at line 1060 of file Phase2L1RCT.h.

References p2eg::clusterInfo::brems, p2eg::crystalMax::energy, p2eg::clusterInfo::energy, p2eg::clusterInfo::et2x5, p2eg::clusterInfo::et5x5, p2eg::crystalMax::etaMax, p2eg::clusterInfo::etaMax, p2eg::ecalRegion_t::etaStrip0, p2eg::ecalRegion_t::etaStrip1, p2eg::ecalRegion_t::etaStrip10, p2eg::ecalRegion_t::etaStrip11, p2eg::ecalRegion_t::etaStrip12, p2eg::ecalRegion_t::etaStrip13, p2eg::ecalRegion_t::etaStrip14, p2eg::ecalRegion_t::etaStrip2, p2eg::ecalRegion_t::etaStrip3, p2eg::ecalRegion_t::etaStrip4, p2eg::ecalRegion_t::etaStrip5, p2eg::ecalRegion_t::etaStrip6, p2eg::ecalRegion_t::etaStrip7, p2eg::ecalRegion_t::etaStrip8, p2eg::ecalRegion_t::etaStrip9, getPeakBin15N(), getPeakBin20N(), p2eg::crystalMax::phiMax, p2eg::clusterInfo::phiMax, p2eg::etaStripPeak_t::pk0, p2eg::etaStripPeak_t::pk1, p2eg::etaStripPeak_t::pk10, p2eg::etaStripPeak_t::pk11, p2eg::etaStripPeak_t::pk12, p2eg::etaStripPeak_t::pk13, p2eg::etaStripPeak_t::pk14, p2eg::etaStripPeak_t::pk2, p2eg::etaStripPeak_t::pk3, p2eg::etaStripPeak_t::pk4, p2eg::etaStripPeak_t::pk5, p2eg::etaStripPeak_t::pk6, p2eg::etaStripPeak_t::pk7, p2eg::etaStripPeak_t::pk8, p2eg::etaStripPeak_t::pk9, and p2eg::clusterInfo::seedEnergy.

1060  {
1061  p2eg::etaStripPeak_t etaStripPeak;
1062  p2eg::clusterInfo cluster;
1063 
1064  etaStripPeak.pk0 = p2eg::getPeakBin20N(ecalRegion.etaStrip0);
1065  etaStripPeak.pk1 = p2eg::getPeakBin20N(ecalRegion.etaStrip1);
1066  etaStripPeak.pk2 = p2eg::getPeakBin20N(ecalRegion.etaStrip2);
1067  etaStripPeak.pk3 = p2eg::getPeakBin20N(ecalRegion.etaStrip3);
1068  etaStripPeak.pk4 = p2eg::getPeakBin20N(ecalRegion.etaStrip4);
1069  etaStripPeak.pk5 = p2eg::getPeakBin20N(ecalRegion.etaStrip5);
1070  etaStripPeak.pk6 = p2eg::getPeakBin20N(ecalRegion.etaStrip6);
1071  etaStripPeak.pk7 = p2eg::getPeakBin20N(ecalRegion.etaStrip7);
1072  etaStripPeak.pk8 = p2eg::getPeakBin20N(ecalRegion.etaStrip8);
1073  etaStripPeak.pk9 = p2eg::getPeakBin20N(ecalRegion.etaStrip9);
1074  etaStripPeak.pk10 = p2eg::getPeakBin20N(ecalRegion.etaStrip10);
1075  etaStripPeak.pk11 = p2eg::getPeakBin20N(ecalRegion.etaStrip11);
1076  etaStripPeak.pk12 = p2eg::getPeakBin20N(ecalRegion.etaStrip12);
1077  etaStripPeak.pk13 = p2eg::getPeakBin20N(ecalRegion.etaStrip13);
1078  etaStripPeak.pk14 = p2eg::getPeakBin20N(ecalRegion.etaStrip14);
1079 
1080  p2eg::crystalMax peakIn15;
1081  peakIn15 = p2eg::getPeakBin15N(etaStripPeak);
1082 
1083  cluster.seedEnergy = peakIn15.energy;
1084  cluster.energy = 0;
1085  cluster.etaMax = peakIn15.etaMax;
1086  cluster.phiMax = peakIn15.phiMax;
1087  cluster.brems = 0;
1088  cluster.et5x5 = 0;
1089  cluster.et2x5 = 0;
1090 
1091  return cluster;
1092 }
ecaltp_t getPeakBin20N(const etaStrip_t etaStrip)
Definition: Phase2L1RCT.h:950
crystalMax getPeakBin15N(const etaStripPeak_t etaStrip)
Definition: Phase2L1RCT.h:982

◆ getClustersCombined()

p2eg::GCTcard_t p2eg::getClustersCombined ( const GCTcard_t GCTcard,
unsigned int  nGCTCard 
)
inline

Definition at line 98 of file Phase2L1GCT.h.

References p2eg::RCTcluster_t::crEta, p2eg::RCTcluster_t::crPhi, doProximityAndBremsStitching(), HLT_2023v12_cff::dPhi, p2eg::RCTcluster_t::et, HLT_2023v12_cff::eta1, HLT_2023v12_cff::eta2, mps_fire::i, caHitNtupletGeneratorKernels::if(), dqmiolumiharvest::j, dqmdumpme::k, N_RCTCARDS_PHI, N_RCTCLUSTERS_FIBER, N_RCTGCT_FIBERS, p2eg::GCTcard_t::RCTcardEtaNeg, p2eg::GCTcard_t::RCTcardEtaPos, p2eg::RCTtoGCTfiber_t::RCTclusters, p2eg::RCTcard_t::RCTtoGCTfiber, p2eg::RCTcluster_t::towEta, p2eg::RCTcluster_t::towPhi, and SiPixelPI::two.

Referenced by getClustersTowers().

98  {
99  p2eg::GCTcard_t GCTcombinedClusters;
100 
101  // Initialize the output
102  for (int i = 0; i < p2eg::N_RCTCARDS_PHI; i++) {
103  for (int j = 0; j < p2eg::N_RCTGCT_FIBERS; j++) {
104  for (int k = 0; k < p2eg::N_RCTCLUSTERS_FIBER; k++) {
105  GCTcombinedClusters.RCTcardEtaPos[i].RCTtoGCTfiber[j].RCTclusters[k] =
106  GCTcard.RCTcardEtaPos[i].RCTtoGCTfiber[j].RCTclusters[k];
107  GCTcombinedClusters.RCTcardEtaNeg[i].RCTtoGCTfiber[j].RCTclusters[k] =
108  GCTcard.RCTcardEtaNeg[i].RCTtoGCTfiber[j].RCTclusters[k];
109  }
110  }
111  }
112  bool isPositiveEta;
113  int iStartingCard;
114 
115  // we will store new et in the GCTcombinedClusters, 0'ing lower clusters after stitching, dont need to care about other variables they stay the
116  // same as input for now at least
117  // we combine even phi boundaries positive eta. Start at card 0 (third argument), and tell the function this is positive eta (fourth argument)
118  isPositiveEta = true;
119  iStartingCard = 0;
121  GCTcard.RCTcardEtaPos, GCTcombinedClusters.RCTcardEtaPos, iStartingCard, isPositiveEta);
122 
123  // now we combine odd phi boundaries positive eta
124  isPositiveEta = true;
125  iStartingCard = 1;
127  GCTcard.RCTcardEtaPos, GCTcombinedClusters.RCTcardEtaPos, iStartingCard, isPositiveEta);
128 
129  // repeat above steps for NEGATIVE eta, even phi boundaries
130  isPositiveEta = false;
131  iStartingCard = 0;
133  GCTcard.RCTcardEtaNeg, GCTcombinedClusters.RCTcardEtaNeg, iStartingCard, isPositiveEta);
134 
135  // lastly, NEGATIVE eta, odd phi boundaries
136  isPositiveEta = false;
137  iStartingCard = 1;
139  GCTcard.RCTcardEtaNeg, GCTcombinedClusters.RCTcardEtaNeg, iStartingCard, isPositiveEta);
140 
141  // we need to store what we did before we start phi stitching
142  p2eg::GCTcard_t GCTout;
143  for (int i = 0; i < p2eg::N_RCTCARDS_PHI; i++) {
144  for (int j = 0; j < p2eg::N_RCTGCT_FIBERS; j++) {
145  for (int k = 0; k < p2eg::N_RCTCLUSTERS_FIBER; k++) {
147  GCTcombinedClusters.RCTcardEtaPos[i].RCTtoGCTfiber[j].RCTclusters[k];
149  GCTcombinedClusters.RCTcardEtaNeg[i].RCTtoGCTfiber[j].RCTclusters[k];
150  }
151  }
152  }
153 
154  // now we combine eta boundaries, just positive and negative eta
155  // Uses RCTcardEtaPos and RCTcardEtaNeg
156  for (int i = 0; i < p2eg::N_RCTCARDS_PHI; i++) {
157  for (int j = 0; j < p2eg::N_RCTGCT_FIBERS; j++) {
158  for (int k = 0; k < p2eg::N_RCTCLUSTERS_FIBER; k++) {
159  ap_uint<15> phi1 = (i * 4 + GCTcard.RCTcardEtaPos[i].RCTtoGCTfiber[j].RCTclusters[k].towPhi) * 5 +
160  GCTcard.RCTcardEtaPos[i].RCTtoGCTfiber[j].RCTclusters[k].crPhi;
161  ap_uint<15> eta1 = GCTcard.RCTcardEtaPos[i].RCTtoGCTfiber[j].RCTclusters[k].crEta;
162  if (GCTcard.RCTcardEtaPos[i].RCTtoGCTfiber[j].RCTclusters[k].towEta == 0 && eta1 == 0) {
163  for (int j1 = 0; j1 < p2eg::N_RCTGCT_FIBERS; j1++) {
164  for (int k1 = 0; k1 < p2eg::N_RCTCLUSTERS_FIBER; k1++) {
165  ap_uint<15> phi2 = (i * 4 + (3 - GCTcard.RCTcardEtaNeg[i].RCTtoGCTfiber[j1].RCTclusters[k1].towPhi)) * 5 +
166  (4 - GCTcard.RCTcardEtaNeg[i].RCTtoGCTfiber[j1].RCTclusters[k1].crPhi);
167  ap_uint<15> eta2 = GCTcard.RCTcardEtaNeg[i].RCTtoGCTfiber[j1].RCTclusters[k1].crEta;
168  if (GCTcard.RCTcardEtaNeg[i].RCTtoGCTfiber[j1].RCTclusters[k1].towEta == 0 && eta2 == 0) {
169  ap_uint<15> dPhi;
170  dPhi = (phi1 > phi2) ? (phi1 - phi2) : (phi2 - phi1);
171  if (dPhi < 2) {
172  ap_uint<12> one = GCTcombinedClusters.RCTcardEtaPos[i].RCTtoGCTfiber[j].RCTclusters[k].et;
173  ap_uint<12> two = GCTcombinedClusters.RCTcardEtaNeg[i].RCTtoGCTfiber[j1].RCTclusters[k1].et;
174  if (one > two) {
176  GCTout.RCTcardEtaNeg[i].RCTtoGCTfiber[j1].RCTclusters[k1].et = 0;
177  } else {
178  GCTout.RCTcardEtaPos[i].RCTtoGCTfiber[j].RCTclusters[k].et = 0;
179  GCTout.RCTcardEtaNeg[i].RCTtoGCTfiber[j1].RCTclusters[k1].et = one + two;
180  }
181  }
182  }
183  }
184  }
185  }
186  }
187  }
188  }
189  return GCTout;
190 }
RCTcluster_t RCTclusters[N_RCTCLUSTERS_FIBER]
RCTcard_t RCTcardEtaNeg[N_RCTCARDS_PHI]
static constexpr int N_RCTCARDS_PHI
static constexpr int N_RCTGCT_FIBERS
static constexpr int N_RCTCLUSTERS_FIBER
void doProximityAndBremsStitching(const RCTcard_t(&inputCards)[N_RCTCARDS_PHI], RCTcard_t(&outputCards)[N_RCTCARDS_PHI], int iStartingCard, bool isPositiveEta)
RCTtoGCTfiber_t RCTtoGCTfiber[N_RCTGCT_FIBERS]
RCTcard_t RCTcardEtaPos[N_RCTCARDS_PHI]

◆ getClustersTowers()

p2eg::GCTinternal_t p2eg::getClustersTowers ( const GCTcard_t GCTcard,
unsigned int  nGCTCard 
)
inline

Definition at line 196 of file Phase2L1GCT.h.

References p2eg::GCTCorrfiber_t::GCTclusters, p2eg::GCTinternal_t::GCTCorrfiber, p2eg::GCTCorrfiber_t::GCTtowers, getClustersCombined(), mps_fire::i, p2eg::GCTcluster_t::initFromRCTCluster(), p2eg::GCTtower_t::initFromRCTTower(), dqmiolumiharvest::j, dqmdumpme::k, N_GCTPOSITIVE_FIBERS, N_RCTCARDS_PHI, N_RCTCLUSTERS_FIBER, N_RCTGCT_FIBERS, N_RCTTOWERS_FIBER, p2eg::GCTcard_t::RCTcardEtaNeg, p2eg::GCTcard_t::RCTcardEtaPos, p2eg::RCTtoGCTfiber_t::RCTclusters, p2eg::RCTcard_t::RCTtoGCTfiber, and p2eg::RCTtoGCTfiber_t::RCTtowers.

Referenced by algo_top().

196  {
197  p2eg::GCTcard_t GCTcombinedClusters;
198  p2eg::GCTinternal_t GCTout;
199 
200  // here we will stitch the clusters in phi and eta
201  GCTcombinedClusters = p2eg::getClustersCombined(GCTcard, nGCTCard);
202 
203  // create internal structure of GCT card
204  // we start from RCT card 0 - it is overlap with other GCT card and fill structure that we will use to send data to Correlator
205  // we only need to care about clusters et in combinrdClusters, since the rest remains unchanged wrt input, the cluster that we set to 0
206  // remain in the data at the same place , it will just get 0 et now
207  // we need to code Positive and Negative Eta differently ! For negative Eta link 0 for each RCT
208  // region becomes 3 in GCT output, the RCT card is rotated around 0:0 point of the card
209  // First 16 fibers - positive Eta , second 16 - negative. Eta coded 0...16 and towEtaNeg = 0 or 1 for clusters ;
210  // Phi is coded 0...15 , in case if whole card 0...33 and subdevision 1/5 in crPhi and crEta 0...4 for
211  // position in tower
212  //
213  // towers are put in link starting from eta=0, the link number defines Eta negative or positive and Phi position of tower.
214  for (int i = 0; i < p2eg::N_RCTCARDS_PHI; i++) {
215  for (int j = 0; j < p2eg::N_RCTGCT_FIBERS; j++) {
216  for (int k = 0; k < p2eg::N_RCTCLUSTERS_FIBER; k++) {
217  bool isPositiveEta;
218  // positive eta: initialize from RCT clusters in pos object
219  isPositiveEta = true;
221  i, isPositiveEta, GCTcombinedClusters.RCTcardEtaPos[i].RCTtoGCTfiber[j].RCTclusters[k]);
222  // negative eta: initialize from RCT clusters in neg object
223  isPositiveEta = false;
224  GCTout.GCTCorrfiber[i * 4 + (3 - j) + p2eg::N_GCTPOSITIVE_FIBERS].GCTclusters[k].initFromRCTCluster(
225  i, isPositiveEta, GCTcombinedClusters.RCTcardEtaNeg[i].RCTtoGCTfiber[j].RCTclusters[k]);
226  }
227  for (int k = 0; k < N_RCTTOWERS_FIBER; k++) {
228  GCTout.GCTCorrfiber[i * 4 + j].GCTtowers[k].initFromRCTTower(
229  GCTcard.RCTcardEtaPos[i].RCTtoGCTfiber[j].RCTtowers[k]); // pos eta
230  GCTout.GCTCorrfiber[i * 4 + (3 - j) + p2eg::N_GCTPOSITIVE_FIBERS].GCTtowers[k].initFromRCTTower(
231  GCTcard.RCTcardEtaNeg[i].RCTtoGCTfiber[j].RCTtowers[k]); // neg eta
232  }
233  }
234  }
235  return GCTout;
236 }
RCTcluster_t RCTclusters[N_RCTCLUSTERS_FIBER]
GCTCorrfiber_t GCTCorrfiber[N_GCTINTERNAL_FIBERS]
static constexpr int N_GCTPOSITIVE_FIBERS
GCTcluster_t GCTclusters[N_GCTCLUSTERS_FIBER]
RCTcard_t RCTcardEtaNeg[N_RCTCARDS_PHI]
static constexpr int N_RCTCARDS_PHI
static constexpr int N_RCTTOWERS_FIBER
GCTcard_t getClustersCombined(const GCTcard_t &GCTcard, unsigned int nGCTCard)
Definition: Phase2L1GCT.h:98
static constexpr int N_RCTGCT_FIBERS
static constexpr int N_RCTCLUSTERS_FIBER
void initFromRCTCluster(int iRCTcardIndex, bool isPosEta, const RCTcluster_t &rctCluster)
RCTtoGCTfiber_t RCTtoGCTfiber[N_RCTGCT_FIBERS]
RCTcard_t RCTcardEtaPos[N_RCTCARDS_PHI]
GCTtower_t GCTtowers[N_GCTTOWERS_FIBER]
void initFromRCTTower(const RCTtower_t &rctTower)

◆ getClusterValues()

clusterInfo p2eg::getClusterValues ( crystal  tempX[CRYSTAL_IN_ETA][CRYSTAL_IN_PHI],
ap_uint< 5 >  seed_eta,
ap_uint< 5 >  seed_phi 
)

◆ getECALTowersEt()

void p2eg::getECALTowersEt ( crystal  tempX[CRYSTAL_IN_ETA][CRYSTAL_IN_PHI],
ap_uint< 12 >  towerEt[12] 
)

◆ getFullTowers()

p2eg::GCTintTowers_t p2eg::getFullTowers ( const GCTinternal_t GCTinternal)
inline

Definition at line 241 of file Phase2L1GCT.h.

References p2eg::GCTcluster_t::et, p2eg::GCTtower_t::et, PVValHelper::eta, HLT_2023v12_cff::eta1, p2eg::GCTCorrfiber_t::GCTclusters, p2eg::GCTinternal_t::GCTCorrfiber, p2eg::GCTintTowers_t::GCTtower, p2eg::GCTCorrfiber_t::GCTtowers, p2eg::GCTtower_t::hoe, mps_fire::i, testProducerWithPsetDescEmpty_cfi::i1, dqmdumpme::k, N_GCTCLUSTERS_FIBER, N_GCTETA, N_GCTINTERNAL_FIBERS, N_GCTPOSITIVE_FIBERS, N_GCTTOWERS_FIBER, PVValHelper::phi, p2eg::GCTcluster_t::towEta, and p2eg::GCTcluster_t::towPhi.

Referenced by algo_top().

241  {
242  p2eg::GCTintTowers_t GCTintTowers;
243 
244  // Positive eta
245  for (int i = 0; i < p2eg::N_GCTPOSITIVE_FIBERS; i = i + 4) {
246  for (int i1 = 0; i1 < 4; i1++) {
247  for (int k = 0; k < p2eg::N_GCTTOWERS_FIBER; k++) {
248  ap_uint<15> phi = i + i1;
249  ap_uint<15> eta = p2eg::N_GCTETA / 2 + k;
250  GCTintTowers.GCTtower[eta][phi].et = GCTinternal.GCTCorrfiber[phi].GCTtowers[k].et;
251  GCTintTowers.GCTtower[eta][phi].hoe = GCTinternal.GCTCorrfiber[phi].GCTtowers[k].hoe;
252  for (int ic1 = 0; ic1 < 4; ic1++) {
253  for (int jc = 0; jc < p2eg::N_GCTCLUSTERS_FIBER; jc++) {
254  ap_uint<15> eta1 = p2eg::N_GCTETA / 2 + GCTinternal.GCTCorrfiber[i + ic1].GCTclusters[jc].towEta;
255  ap_uint<15> phi1 = GCTinternal.GCTCorrfiber[i + ic1].GCTclusters[jc].towPhi;
256  if (eta == eta1 && phi == phi1) {
257  GCTintTowers.GCTtower[eta][phi].et =
258  (GCTintTowers.GCTtower[eta][phi].et + GCTinternal.GCTCorrfiber[i + ic1].GCTclusters[jc].et);
259  }
260  }
261  }
262  }
263  }
264  }
265 
266  // Negative eta
268  for (int i1 = 0; i1 < 4; i1++) {
269  for (int k = 0; k < p2eg::N_GCTTOWERS_FIBER; k++) {
270  ap_uint<15> eta = p2eg::N_GCTETA / 2 - k - 1;
271  ap_uint<15> phi = i + i1 - p2eg::N_GCTPOSITIVE_FIBERS;
272  GCTintTowers.GCTtower[eta][phi].et = GCTinternal.GCTCorrfiber[i + i1].GCTtowers[k].et;
273  GCTintTowers.GCTtower[eta][phi].hoe = GCTinternal.GCTCorrfiber[i + i1].GCTtowers[k].hoe;
274  for (int ic1 = 0; ic1 < 4; ic1++) {
275  for (int jc = 0; jc < p2eg::N_GCTCLUSTERS_FIBER; jc++) {
276  ap_uint<15> eta1 = p2eg::N_GCTETA / 2 - 1 - GCTinternal.GCTCorrfiber[i + ic1].GCTclusters[jc].towEta;
277  ap_uint<15> phi1 = GCTinternal.GCTCorrfiber[i + ic1].GCTclusters[jc].towPhi;
278  if (eta == eta1 && phi == phi1) {
279  GCTintTowers.GCTtower[eta][phi].et =
280  (GCTintTowers.GCTtower[eta][phi].et + GCTinternal.GCTCorrfiber[i + ic1].GCTclusters[jc].et);
281  }
282  }
283  }
284  }
285  }
286  }
287 
288  return GCTintTowers;
289 }
static constexpr int N_GCTCLUSTERS_FIBER
GCTtower_t GCTtower[N_GCTETA][N_GCTPHI]
static constexpr int N_GCTPOSITIVE_FIBERS
static constexpr int N_GCTTOWERS_FIBER
static constexpr int N_GCTINTERNAL_FIBERS
static constexpr int N_GCTETA

◆ getPeakBin15N()

p2eg::crystalMax p2eg::getPeakBin15N ( const etaStripPeak_t  etaStrip)
inline

Definition at line 982 of file Phase2L1RCT.h.

References bestOf2(), p2eg::ecaltp_t::energy, p2eg::ecaltp_t::eta, p2eg::ecaltp_t::phi, p2eg::etaStripPeak_t::pk0, p2eg::etaStripPeak_t::pk1, p2eg::etaStripPeak_t::pk10, p2eg::etaStripPeak_t::pk11, p2eg::etaStripPeak_t::pk12, p2eg::etaStripPeak_t::pk13, p2eg::etaStripPeak_t::pk14, p2eg::etaStripPeak_t::pk2, p2eg::etaStripPeak_t::pk3, p2eg::etaStripPeak_t::pk4, p2eg::etaStripPeak_t::pk5, p2eg::etaStripPeak_t::pk6, p2eg::etaStripPeak_t::pk7, p2eg::etaStripPeak_t::pk8, p2eg::etaStripPeak_t::pk9, and x.

Referenced by getClusterPosition().

982  {
984 
985  p2eg::ecaltp_t best01 = p2eg::bestOf2(etaStrip.pk0, etaStrip.pk1);
986  p2eg::ecaltp_t best23 = p2eg::bestOf2(etaStrip.pk2, etaStrip.pk3);
987  p2eg::ecaltp_t best45 = p2eg::bestOf2(etaStrip.pk4, etaStrip.pk5);
988  p2eg::ecaltp_t best67 = p2eg::bestOf2(etaStrip.pk6, etaStrip.pk7);
989  p2eg::ecaltp_t best89 = p2eg::bestOf2(etaStrip.pk8, etaStrip.pk9);
990  p2eg::ecaltp_t best1011 = p2eg::bestOf2(etaStrip.pk10, etaStrip.pk11);
991  p2eg::ecaltp_t best1213 = p2eg::bestOf2(etaStrip.pk12, etaStrip.pk13);
992 
993  p2eg::ecaltp_t best0123 = p2eg::bestOf2(best01, best23);
994  p2eg::ecaltp_t best4567 = p2eg::bestOf2(best45, best67);
995  p2eg::ecaltp_t best891011 = p2eg::bestOf2(best89, best1011);
996  p2eg::ecaltp_t best121314 = p2eg::bestOf2(best1213, etaStrip.pk14);
997 
998  p2eg::ecaltp_t best01234567 = p2eg::bestOf2(best0123, best4567);
999  p2eg::ecaltp_t best891011121314 = p2eg::bestOf2(best891011, best121314);
1000 
1001  p2eg::ecaltp_t bestOf15 = p2eg::bestOf2(best01234567, best891011121314);
1002 
1003  x.energy = bestOf15.energy;
1004  x.etaMax = bestOf15.eta;
1005  x.phiMax = bestOf15.phi;
1006 
1007  return x;
1008 }
float x
ecaltp_t bestOf2(const ecaltp_t ecaltp0, const ecaltp_t ecaltp1)
Definition: Phase2L1RCT.h:940

◆ getPeakBin20N()

p2eg::ecaltp_t p2eg::getPeakBin20N ( const etaStrip_t  etaStrip)
inline

Definition at line 950 of file Phase2L1RCT.h.

References bestOf2(), p2eg::etaStrip_t::cr0, p2eg::etaStrip_t::cr1, p2eg::etaStrip_t::cr10, p2eg::etaStrip_t::cr11, p2eg::etaStrip_t::cr12, p2eg::etaStrip_t::cr13, p2eg::etaStrip_t::cr14, p2eg::etaStrip_t::cr15, p2eg::etaStrip_t::cr16, p2eg::etaStrip_t::cr17, p2eg::etaStrip_t::cr18, p2eg::etaStrip_t::cr19, p2eg::etaStrip_t::cr2, p2eg::etaStrip_t::cr3, p2eg::etaStrip_t::cr4, p2eg::etaStrip_t::cr5, p2eg::etaStrip_t::cr6, p2eg::etaStrip_t::cr7, p2eg::etaStrip_t::cr8, and p2eg::etaStrip_t::cr9.

Referenced by getClusterPosition().

950  {
951  p2eg::ecaltp_t best01 = p2eg::bestOf2(etaStrip.cr0, etaStrip.cr1);
952  p2eg::ecaltp_t best23 = p2eg::bestOf2(etaStrip.cr2, etaStrip.cr3);
953  p2eg::ecaltp_t best45 = p2eg::bestOf2(etaStrip.cr4, etaStrip.cr5);
954  p2eg::ecaltp_t best67 = p2eg::bestOf2(etaStrip.cr6, etaStrip.cr7);
955  p2eg::ecaltp_t best89 = p2eg::bestOf2(etaStrip.cr8, etaStrip.cr9);
956  p2eg::ecaltp_t best1011 = p2eg::bestOf2(etaStrip.cr10, etaStrip.cr11);
957  p2eg::ecaltp_t best1213 = p2eg::bestOf2(etaStrip.cr12, etaStrip.cr13);
958  p2eg::ecaltp_t best1415 = p2eg::bestOf2(etaStrip.cr14, etaStrip.cr15);
959  p2eg::ecaltp_t best1617 = p2eg::bestOf2(etaStrip.cr16, etaStrip.cr17);
960  p2eg::ecaltp_t best1819 = p2eg::bestOf2(etaStrip.cr18, etaStrip.cr19);
961 
962  p2eg::ecaltp_t best0123 = p2eg::bestOf2(best01, best23);
963  p2eg::ecaltp_t best4567 = p2eg::bestOf2(best45, best67);
964  p2eg::ecaltp_t best891011 = p2eg::bestOf2(best89, best1011);
965  p2eg::ecaltp_t best12131415 = p2eg::bestOf2(best1213, best1415);
966  p2eg::ecaltp_t best16171819 = p2eg::bestOf2(best1617, best1819);
967 
968  p2eg::ecaltp_t best01234567 = p2eg::bestOf2(best0123, best4567);
969  p2eg::ecaltp_t best89101112131415 = p2eg::bestOf2(best891011, best12131415);
970 
971  p2eg::ecaltp_t best0to15 = p2eg::bestOf2(best01234567, best89101112131415);
972  p2eg::ecaltp_t bestOf20 = p2eg::bestOf2(best0to15, best16171819);
973 
974  return bestOf20;
975 }
ecaltp_t bestOf2(const ecaltp_t ecaltp0, const ecaltp_t ecaltp1)
Definition: Phase2L1RCT.h:940

◆ getRegionNumber()

int p2eg::getRegionNumber ( const int  local_iEta)
inline

Definition at line 250 of file Phase2L1CaloEGammaUtils.h.

References cms::cuda::assert(), CRYSTALS_IN_TOWER_ETA, createfilelist::int, and TOWER_IN_ETA.

Referenced by Phase2L1CaloEGammaEmulator::produce().

250  {
251  int no = int(local_iEta / (TOWER_IN_ETA * CRYSTALS_IN_TOWER_ETA));
252  assert(no < 6);
253  return no;
254  }
assert(be >=bs)
static constexpr int TOWER_IN_ETA
static constexpr int CRYSTALS_IN_TOWER_ETA

◆ getTower_absEtaID()

int p2eg::getTower_absEtaID ( float  eta)
inline

Definition at line 171 of file Phase2L1CaloEGammaUtils.h.

References ECAL_eta_range, PVValHelper::eta, createfilelist::int, and n_towers_Eta.

171  {
172  float size_cell = 2 * ECAL_eta_range / n_towers_Eta;
173  int etaID = int((eta + ECAL_eta_range) / size_cell);
174  return etaID;
175  }
static constexpr float ECAL_eta_range
static constexpr int n_towers_Eta

◆ getTower_absPhiID()

int p2eg::getTower_absPhiID ( float  phi)
inline

Definition at line 181 of file Phase2L1CaloEGammaUtils.h.

References createfilelist::int, M_PI, and n_towers_Phi.

181  {
182  float size_cell = 2 * M_PI / n_towers_Phi;
183  int phiID = int((phi + M_PI) / size_cell);
184  return phiID;
185  }
#define M_PI
static constexpr int n_towers_Phi

◆ getTowerEta_fromAbsID()

float p2eg::getTowerEta_fromAbsID ( int  id)
inline

Definition at line 230 of file Phase2L1CaloEGammaUtils.h.

References ECAL_eta_range, PVValHelper::eta, and n_towers_Eta.

Referenced by p2eg::GCTtower_t::createCaloTowerFromFiberIdx(), p2eg::GCTtower_t::createFullTowerFromCardIdx(), p2eg::GCTtower_t::printGCTTowerInfoFromGlobalIdx(), and Phase2L1CaloEGammaEmulator::produce().

230  {
231  float size_cell = 2 * ECAL_eta_range / n_towers_Eta;
232  float eta = (id * size_cell) - ECAL_eta_range + 0.5 * size_cell;
233  return eta;
234  }
static constexpr float ECAL_eta_range
static constexpr int n_towers_Eta

◆ getTowerPhi_fromAbsID()

float p2eg::getTowerPhi_fromAbsID ( int  id)
inline

Definition at line 240 of file Phase2L1CaloEGammaUtils.h.

References M_PI, and n_towers_Phi.

Referenced by p2eg::GCTtower_t::createCaloTowerFromFiberIdx(), p2eg::GCTtower_t::createFullTowerFromCardIdx(), p2eg::GCTtower_t::printGCTTowerInfoFromGlobalIdx(), and Phase2L1CaloEGammaEmulator::produce().

240  {
241  float size_cell = 2 * M_PI / n_towers_Phi;
242  float phi = (id * size_cell) - M_PI + 0.5 * size_cell;
243  return phi;
244  }
#define M_PI
static constexpr int n_towers_Phi

◆ initStructure()

ecalRegion_t p2eg::initStructure ( crystal  temporary[CRYSTAL_IN_ETA][CRYSTAL_IN_PHI])

◆ isValidCard()

bool p2eg::isValidCard ( int  cc)
inline

Definition at line 106 of file Phase2L1CaloEGammaUtils.h.

References gpuPixelDoublets::cc.

Referenced by getCard_iEtaMax().

106 { return ((cc > -1) && (cc < 36)); }
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49

◆ packCluster()

p2eg::Cluster p2eg::packCluster ( ap_uint< 15 > &  clusterEt,
ap_uint< 5 > &  etaMax_t,
ap_uint< 5 > &  phiMax_t 
)
inline

Definition at line 1099 of file Phase2L1RCT.h.

References timeUnitHelper::pack().

1099  {
1100  ap_uint<12> peggedEt;
1102 
1103  ap_uint<5> towerEta = (etaMax_t) / 5;
1104  ap_uint<2> towerPhi = (phiMax_t) / 5;
1105  ap_uint<3> clusterEta = etaMax_t - 5 * towerEta;
1106  ap_uint<3> clusterPhi = phiMax_t - 5 * towerPhi;
1107 
1108  peggedEt = (clusterEt > 0xFFF) ? (ap_uint<12>)0xFFF : (ap_uint<12>)clusterEt;
1109 
1110  pack = p2eg::Cluster(peggedEt, towerEta, towerPhi, clusterEta, clusterPhi, 0);
1111 
1112  return pack;
1113 }
def pack(high, low)

◆ passes_iso()

bool p2eg::passes_iso ( float  pt,
float  iso 
)
inline

Definition at line 992 of file Phase2L1CaloEGammaUtils.h.

References a0, a0_80, a1_80, DiDispStaMuonMonitor_cfi::pt, and slideIsoPtThreshold.

Referenced by p2eg::GCTcluster_t::setRelIsoAndFlags().

992  {
993  bool is_iso = true;
994  if (pt > 130)
995  is_iso = true;
996  else if (pt < slideIsoPtThreshold) {
997  if (!((a0_80 - a1_80 * pt) > iso))
998  is_iso = false;
999  } else {
1000  if (iso > a0)
1001  is_iso = false;
1002  }
1003  return is_iso;
1004  }
static constexpr float a1_80
static constexpr float a0_80
static constexpr float slideIsoPtThreshold
static constexpr float a0

◆ passes_looseTkiso()

bool p2eg::passes_looseTkiso ( float  pt,
float  iso 
)
inline

Definition at line 1006 of file Phase2L1CaloEGammaUtils.h.

References b0, b1, b2, JetChargeProducer_cfi::exp, and DiDispStaMuonMonitor_cfi::pt.

Referenced by p2eg::GCTcluster_t::setRelIsoAndFlags().

1006  {
1007  bool is_iso;
1008  if (pt > 130)
1009  is_iso = true;
1010  else
1011  is_iso = (b0 + b1 * std::exp(-b2 * pt) > iso);
1012  return is_iso;
1013  }
weight_default_t b1[25]
Definition: b1.h:9
weight_default_t b2[10]
Definition: b2.h:9
static constexpr float b0

◆ passes_looseTkss()

bool p2eg::passes_looseTkss ( float  pt,
float  ss 
)
inline

Definition at line 1024 of file Phase2L1CaloEGammaUtils.h.

References e0_looseTkss, e1_looseTkss, e2_looseTkss, JetChargeProducer_cfi::exp, DiDispStaMuonMonitor_cfi::pt, and contentValuesCheck::ss.

Referenced by Phase2L1CaloEGammaEmulator::produce().

1024  {
1025  bool is_ss;
1026  if (pt > 130)
1027  is_ss = true;
1028  else
1029  is_ss = ((e0_looseTkss - e1_looseTkss * std::exp(-e2_looseTkss * pt)) <= ss);
1030  return is_ss;
1031  }
static constexpr float e2_looseTkss
static constexpr float e0_looseTkss
static constexpr float e1_looseTkss

◆ passes_ss()

bool p2eg::passes_ss ( float  pt,
float  ss 
)
inline

Definition at line 1015 of file Phase2L1CaloEGammaUtils.h.

References c0_ss, c1_ss, c2_ss, JetChargeProducer_cfi::exp, DiDispStaMuonMonitor_cfi::pt, and contentValuesCheck::ss.

Referenced by Phase2L1CaloEGammaEmulator::produce().

1015  {
1016  bool is_ss;
1017  if (pt > 130)
1018  is_ss = true;
1019  else
1020  is_ss = ((c0_ss + c1_ss * std::exp(-c2_ss * pt)) <= ss);
1021  return is_ss;
1022  }
static constexpr float c2_ss
static constexpr float c1_ss
static constexpr float c0_ss

◆ printl1tp2TowerInfo()

void p2eg::printl1tp2TowerInfo ( l1tp2::CaloTower  thisTower,
std::string  description = "" 
)
inline

Definition at line 1694 of file Phase2L1CaloEGammaUtils.h.

References gather_cfg::cout, makeListRunsInFiles::description, l1tp2::CaloTower::ecalTowerEt(), l1tp2::CaloTower::hcalTowerEt(), l1tp2::CaloTower::towerEta(), l1tp2::CaloTower::towerIEta(), l1tp2::CaloTower::towerIPhi(), and l1tp2::CaloTower::towerPhi().

1694  {
1695  std::cout << "[Print l1tp2::CaloTower info:] [" << description << "]: "
1696  << ".ecalTowerEta() (float): " << thisTower.ecalTowerEt() << ", "
1697  << ".hcalTowerEta() (float): " << thisTower.hcalTowerEt() << ", "
1698  << ".towerIEta(): " << thisTower.towerIEta() << ", "
1699  << ".towerIPhi(): " << thisTower.towerIPhi() << ", "
1700  << ".towerEta() " << thisTower.towerEta() << ", "
1701  << ".towerPhi() " << thisTower.towerPhi() << std::endl;
1702  }
float ecalTowerEt() const
Definition: CaloTower.h:35
int towerIPhi() const
Definition: CaloTower.h:37
int towerIEta() const
Definition: CaloTower.h:38
float towerPhi() const
Definition: CaloTower.h:39
float hcalTowerEt() const
Definition: CaloTower.h:36
float towerEta() const
Definition: CaloTower.h:40

◆ removeClusterFromCrystal()

void p2eg::removeClusterFromCrystal ( crystal  temp[CRYSTAL_IN_ETA][CRYSTAL_IN_PHI],
ap_uint< 5 >  seed_eta,
ap_uint< 5 >  seed_phi,
ap_uint< 2 >  brems 
)

◆ stitchClusterOverRegionBoundary()

void p2eg::stitchClusterOverRegionBoundary ( std::vector< Cluster > &  cluster_list,
int  towerEtaUpper,
int  towerEtaLower,
int  cc 
)
inline

Definition at line 1478 of file Phase2L1RCT.h.

References alignmentValidation::c1, gpuPixelDoublets::cc, p2eg::Cluster::clusterEnergy(), p2eg::Cluster::clusterEta(), p2eg::Cluster::clusterPhi(), HLT_2023v12_cff::dPhi, p2eg::Cluster::getBrems(), p2eg::Cluster::getIsLooseTkss(), p2eg::Cluster::getIsSS(), mps_fire::i, dqmiolumiharvest::j, p2eg::Cluster::region(), p2eg::Cluster::satur(), p2eg::Cluster::towerEta(), p2eg::Cluster::towerEtaInCard(), p2eg::Cluster::towerPhi(), p2eg::Cluster::uint_et2x5(), p2eg::Cluster::uint_et5x5(), and funct::void.

Referenced by Phase2L1CaloEGammaEmulator::produce().

1481  {
1482  (void)cc; // for printout statements
1483 
1484  int crystalEtaUpper = 0;
1485  int crystalEtaLower = 4;
1486 
1487  for (size_t i = 0; i < cluster_list.size(); i++) {
1488  for (size_t j = 0; j < cluster_list.size(); j++) {
1489  // Do not double-count
1490  if (i == j)
1491  continue;
1492 
1493  p2eg::Cluster c1 = cluster_list[i];
1494  p2eg::Cluster c2 = cluster_list[j];
1495 
1496  p2eg::Cluster newc1;
1497  p2eg::Cluster newc2;
1498 
1499  // Use the .towerEtaInCard() method to get the tower eta in the entire RCT card
1500  if ((c1.clusterEnergy() > 0) && (c1.towerEtaInCard() == towerEtaUpper) && (c1.clusterEta() == crystalEtaUpper)) {
1501  if ((c2.clusterEnergy() > 0) && (c2.towerEtaInCard() == towerEtaLower) &&
1502  (c2.clusterEta() == crystalEtaLower)) {
1503  ap_uint<5> phi1 = c1.towerPhi() * 5 + c1.clusterPhi();
1504  ap_uint<5> phi2 = c2.towerPhi() * 5 + c2.clusterPhi();
1505  ap_uint<5> dPhi;
1506  dPhi = (phi1 > phi2) ? (phi1 - phi2) : (phi2 - phi1);
1507 
1508  if (dPhi < 2) {
1509  ap_uint<15> totalEnergy = c1.clusterEnergy() + c2.clusterEnergy();
1510  ap_uint<15> totalEt2x5 = c1.uint_et2x5() + c2.uint_et2x5();
1511  ap_uint<15> totalEt5x5 = c1.uint_et5x5() + c2.uint_et5x5();
1512 
1513  bool rct_is_iso = false; // RCT has no isolation information
1514  bool rct_is_looseTkiso = false; // RCT has no isolation information
1515 
1516  // Initialize a cluster with the larger cluster's position and total energy
1517  if (c1.clusterEnergy() > c2.clusterEnergy()) {
1518  newc1 = p2eg::Cluster(totalEnergy,
1519  c1.towerEta(),
1520  c1.towerPhi(),
1521  c1.clusterEta(),
1522  c1.clusterPhi(),
1523  c1.satur(),
1524  totalEt5x5,
1525  totalEt2x5,
1526  c1.getBrems(),
1527  c1.getIsSS(),
1528  c1.getIsLooseTkss(),
1529  rct_is_iso,
1530  rct_is_looseTkiso,
1531  c1.region());
1532  newc2 = p2eg::Cluster(0,
1533  c2.towerEta(),
1534  c2.towerPhi(),
1535  c2.clusterEta(),
1536  c2.clusterPhi(),
1537  c2.satur(),
1538  0,
1539  0,
1540  0,
1541  false,
1542  false,
1543  rct_is_iso,
1544  rct_is_looseTkiso,
1545  c2.region());
1546  cluster_list[i] = newc1;
1547  cluster_list[j] = newc2;
1548  } else {
1549  // Analogous to above portion
1550  newc1 = p2eg::Cluster(0,
1551  c1.towerEta(),
1552  c1.towerPhi(),
1553  c1.clusterEta(),
1554  c1.clusterPhi(),
1555  c1.satur(),
1556  0,
1557  0,
1558  0,
1559  false,
1560  false,
1561  rct_is_iso,
1562  rct_is_looseTkiso,
1563  c1.region());
1564  newc2 = p2eg::Cluster(totalEnergy,
1565  c2.towerEta(),
1566  c2.towerPhi(),
1567  c2.clusterEta(),
1568  c2.clusterPhi(),
1569  c2.satur(),
1570  totalEt5x5,
1571  totalEt2x5,
1572  c2.getBrems(),
1573  c2.getIsSS(),
1574  c2.getIsLooseTkss(),
1575  rct_is_iso,
1576  rct_is_looseTkiso,
1577  c2.region());
1578  cluster_list[i] = newc1;
1579  cluster_list[j] = newc2;
1580  }
1581  }
1582  }
1583  }
1584  }
1585  }
1586 }
ap_uint< 3 > clusterEta() const
ap_uint< 15 > uint_et2x5() const
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
ap_uint< 15 > uint_et5x5() const
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
ap_uint< 5 > towerEta() const
ap_uint< 3 > satur() const
ap_uint< 3 > clusterPhi() const
ap_uint< 2 > towerPhi() const
ap_uint< 12 > clusterEnergy() const

◆ writeToCorrelatorAndGTOutputs()

void p2eg::writeToCorrelatorAndGTOutputs ( const GCTinternal_t GCTinternal,
p2eg::GCTtoCorr_t GCTtoCorrOutput,
std::unique_ptr< l1tp2::CaloCrystalClusterCollection > const &  gctClustersOutput,
std::unique_ptr< l1tp2::CaloTowerCollection > const &  gctTowersOutput,
std::unique_ptr< l1t::EGammaBxCollection > const &  gctEGammas,
std::unique_ptr< l1tp2::DigitizedClusterCorrelatorCollection > const &  gctDigitizedClustersCorrelator,
std::unique_ptr< l1tp2::DigitizedTowerCorrelatorCollection > const &  gctDigitizedTowersCorrelator,
std::unique_ptr< l1tp2::DigitizedClusterGTCollection > const &  gctDigitizedClustersGT,
int  nGCTCard,
int  fiberStart,
int  fiberEnd,
int  corrFiberIndexOffset,
int  corrTowPhiOffset = 4 
)
inline

Definition at line 294 of file Phase2L1GCT.h.

References nano_mu_digi_cff::bx, p2eg::GCTcluster_t::createCaloCrystalCluster(), p2eg::GCTtower_t::createCaloTowerFromFiberIdx(), p2eg::GCTcluster_t::createDigitizedClusterCorrelator(), p2eg::GCTcluster_t::createDigitizedClusterGT(), p2eg::GCTtower_t::createDigitizedTowerCorrelator(), p2eg::GCTcluster_t::createL1TEGamma(), p2eg::GCTcluster_t::etFloat(), p2eg::GCTCorrfiber_t::GCTclusters, p2eg::GCTtoCorr_t::GCTCorrfiber, p2eg::GCTinternal_t::GCTCorrfiber, p2eg::GCTCorrfiber_t::GCTtowers, mps_fire::i, sistrip::SpyUtilities::isValid(), dqmdumpme::k, N_GCTCLUSTERS_FIBER, N_GCTTOWERS_FIBER, and p2eg::GCTcluster_t::towPhi.

Referenced by algo_top().

307  {
308  for (int i = fiberStart; i < fiberEnd; i++) {
309  // In each fiber, first do clusters
310  for (int k = 0; k < p2eg::N_GCTCLUSTERS_FIBER; k++) {
311  // First do CMSSW cluster outputs
312  p2eg::GCTcluster_t thisCluster = GCTinternal.GCTCorrfiber[i].GCTclusters[k];
313  if (thisCluster.etFloat() > 0.0) {
314  // Make l1tp2::CaloCrystalCluster
315  gctClustersOutput->push_back(thisCluster.createCaloCrystalCluster());
316 
317  // Make l1t::EGamma
318  int bx = 0;
319  l1t::EGamma thisEGamma = thisCluster.createL1TEGamma();
320  gctEGammas->push_back(bx, thisEGamma);
321  }
322 
323  // Then the clusters to the correlator: all fields are the same with the exception of towPhi, which
324  // needs to be subtracted by 4 because the output to correlator does NOT include the overlap region.
325  GCTtoCorrOutput.GCTCorrfiber[i - corrFiberIndexOffset].GCTclusters[k] = thisCluster;
326  GCTtoCorrOutput.GCTCorrfiber[i - corrFiberIndexOffset].GCTclusters[k].towPhi =
327  (thisCluster.towPhi - corrTowPhiOffset);
328 
329  // Make l1tp2::DigitizedClusterCorrelator. The function needs corrTowPhiOffset to know the towPhi in the card excluding the overlap region.
330  // The correlator clusters don't need to know the fiber offset.
331  if (thisCluster.etFloat() > 0.0) {
332  gctDigitizedClustersCorrelator->push_back(thisCluster.createDigitizedClusterCorrelator(corrTowPhiOffset));
333  }
334 
335  // Make l1tp2::DigitizedClusterGT.
336  if (thisCluster.etFloat() > 0.0) {
337  bool isValid = true;
338  gctDigitizedClustersGT->push_back(thisCluster.createDigitizedClusterGT(isValid));
339  }
340  }
341 
342  // Next do tower outputs
343  for (int k = 0; k < p2eg::N_GCTTOWERS_FIBER; k++) {
344  // First do CMSSW tower outputs
345  p2eg::GCTtower_t thisTower = GCTinternal.GCTCorrfiber[i].GCTtowers[k];
346  l1tp2::CaloTower thisL1CaloTower = thisTower.createCaloTowerFromFiberIdx(nGCTCard, i, k);
347  gctTowersOutput->push_back(thisL1CaloTower);
348 
349  // Then the towers to the correlator. Note the same corrFiberIndexOffset as was done for the clusters
350  GCTtoCorrOutput.GCTCorrfiber[i - corrFiberIndexOffset].GCTtowers[k] = thisTower;
351 
352  // For the collection, the three arguments are (1) the GCT card, (2) the fiber index in the GCT card (excluding the overlap region), and (3) the tower index in the fiber
353  l1tp2::DigitizedTowerCorrelator thisDigitizedTowerCorrelator =
354  thisTower.createDigitizedTowerCorrelator(nGCTCard, i - corrFiberIndexOffset, k);
355  gctDigitizedTowersCorrelator->push_back(thisDigitizedTowerCorrelator);
356  }
357  }
358 }
GCTCorrfiber_t GCTCorrfiber[N_GCTCORR_FIBERS]
static constexpr int N_GCTCLUSTERS_FIBER
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
l1tp2::CaloCrystalCluster createCaloCrystalCluster(void) const
static constexpr int N_GCTTOWERS_FIBER
GCTcluster_t GCTclusters[N_GCTCLUSTERS_FIBER]
l1t::EGamma createL1TEGamma(void) const
l1tp2::DigitizedClusterGT createDigitizedClusterGT(bool isValid) const
l1tp2::DigitizedClusterCorrelator createDigitizedClusterCorrelator(const int corrTowPhiOffset) const
l1tp2::CaloTower createCaloTowerFromFiberIdx(int nGCTCard, int iFiber, int iTowerInFiber)
l1tp2::DigitizedTowerCorrelator createDigitizedTowerCorrelator(unsigned int indexCard, unsigned int indexFiber, unsigned int indexTower)
GCTtower_t GCTtowers[N_GCTTOWERS_FIBER]

Variable Documentation

◆ a0

constexpr float p2eg::a0 = 0.21
static

Definition at line 56 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_iso().

◆ a0_80

constexpr float p2eg::a0_80 = 0.85
static

Definition at line 56 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_iso().

◆ a1_80

constexpr float p2eg::a1_80 = 0.0080
static

Definition at line 56 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_iso().

◆ b0

constexpr float p2eg::b0 = 0.38
static

Definition at line 57 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_looseTkiso().

◆ b1

constexpr float p2eg::b1 = 1.9
static

Definition at line 57 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_looseTkiso().

◆ b2

constexpr float p2eg::b2 = 0.05
static

Definition at line 57 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_looseTkiso().

◆ c0_ss

constexpr float p2eg::c0_ss = 0.94
static

Definition at line 58 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_ss().

◆ c1_ss

constexpr float p2eg::c1_ss = 0.052
static

Definition at line 58 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_ss().

◆ c2_ss

constexpr float p2eg::c2_ss = 0.044
static

Definition at line 58 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_ss().

◆ CRYSTAL_IN_ETA

constexpr int p2eg::CRYSTAL_IN_ETA = 15
static

Definition at line 49 of file Phase2L1CaloEGammaUtils.h.

Referenced by Phase2L1CaloEGammaEmulator::produce().

◆ CRYSTAL_IN_PHI

constexpr int p2eg::CRYSTAL_IN_PHI = 20
static

Definition at line 50 of file Phase2L1CaloEGammaUtils.h.

Referenced by Phase2L1CaloEGammaEmulator::produce().

◆ CRYSTALS_IN_TOWER_ETA

constexpr int p2eg::CRYSTALS_IN_TOWER_ETA = 5
static

◆ CRYSTALS_IN_TOWER_PHI

constexpr int p2eg::CRYSTALS_IN_TOWER_PHI = 5
static

◆ cut_500_MeV

constexpr float p2eg::cut_500_MeV = 0.5
static

Definition at line 61 of file Phase2L1CaloEGammaUtils.h.

Referenced by Phase2L1CaloEGammaEmulator::produce().

◆ d0

constexpr float p2eg::d0 = 0.96
static

Definition at line 59 of file Phase2L1CaloEGammaUtils.h.

◆ d1

constexpr float p2eg::d1 = 0.0003
static

Definition at line 59 of file Phase2L1CaloEGammaUtils.h.

◆ e0_looseTkss

constexpr float p2eg::e0_looseTkss = 0.944
static

Definition at line 60 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_looseTkss().

◆ e1_looseTkss

constexpr float p2eg::e1_looseTkss = 0.65
static

Definition at line 60 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_looseTkss().

◆ e2_looseTkss

constexpr float p2eg::e2_looseTkss = 0.4
static

Definition at line 60 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_looseTkss().

◆ ECAL_eta_range

constexpr float p2eg::ECAL_eta_range = 1.4841
static

◆ ECAL_LSB

constexpr float p2eg::ECAL_LSB = 0.125
static

◆ GCTCARD_0_TOWER_IPHI_OFFSET

constexpr int p2eg::GCTCARD_0_TOWER_IPHI_OFFSET = 20
static

◆ GCTCARD_1_TOWER_IPHI_OFFSET

constexpr int p2eg::GCTCARD_1_TOWER_IPHI_OFFSET = 44
static

◆ GCTCARD_2_TOWER_IPHI_OFFSET

constexpr int p2eg::GCTCARD_2_TOWER_IPHI_OFFSET = 68
static

◆ GCTcardtoRCTcardnumber

const unsigned int p2eg::GCTcardtoRCTcardnumber[N_GCTCARDS][N_RCTCARDS_PHI *2]
static
Initial value:
= {
{11, 13, 15, 17, 19, 21, 23, 25, 10, 12, 14, 16, 18, 20, 22, 24},
{23, 25, 27, 29, 31, 33, 35, 1, 22, 24, 26, 28, 30, 32, 34, 0},
{35, 1, 3, 5, 7, 9, 11, 13, 34, 0, 2, 4, 6, 8, 10, 12}}

Definition at line 1681 of file Phase2L1CaloEGammaUtils.h.

Referenced by Phase2L1CaloEGammaEmulator::produce().

◆ half_crystal_size

constexpr float p2eg::half_crystal_size = 0.00873
static

◆ HCAL_LSB

constexpr float p2eg::HCAL_LSB = 0.5
static

◆ n_clusters_4link

constexpr int p2eg::n_clusters_4link = 8
static

Definition at line 40 of file Phase2L1CaloEGammaUtils.h.

Referenced by Phase2L1CaloEGammaEmulator::produce().

◆ n_clusters_link

constexpr int p2eg::n_clusters_link = 2
static

Definition at line 39 of file Phase2L1CaloEGammaUtils.h.

◆ N_CLUSTERS_PER_REGION

constexpr int p2eg::N_CLUSTERS_PER_REGION = 4
static

Definition at line 66 of file Phase2L1CaloEGammaUtils.h.

Referenced by Phase2L1CaloEGammaEmulator::produce().

◆ n_crystals_cardEta

constexpr int p2eg::n_crystals_cardEta = (n_towers_Eta * n_towers_cardEta)
static

Definition at line 34 of file Phase2L1CaloEGammaUtils.h.

◆ n_crystals_cardPhi

constexpr int p2eg::n_crystals_cardPhi = (n_towers_Phi * n_towers_cardPhi)
static

Definition at line 35 of file Phase2L1CaloEGammaUtils.h.

◆ N_GCTCARDS

constexpr int p2eg::N_GCTCARDS = 3
static

Definition at line 75 of file Phase2L1CaloEGammaUtils.h.

Referenced by Phase2L1CaloEGammaEmulator::produce().

◆ N_GCTCLUSTERS_FIBER

constexpr int p2eg::N_GCTCLUSTERS_FIBER = 2
static

◆ N_GCTCORR_FIBERS

constexpr int p2eg::N_GCTCORR_FIBERS = 48
static

Definition at line 76 of file Phase2L1CaloEGammaUtils.h.

◆ N_GCTETA

constexpr int p2eg::N_GCTETA = 34
static

◆ N_GCTINTERNAL_FIBERS

constexpr int p2eg::N_GCTINTERNAL_FIBERS = 64
static

◆ N_GCTPHI

constexpr int p2eg::N_GCTPHI = 32
static

◆ N_GCTPOSITIVE_FIBERS

constexpr int p2eg::N_GCTPOSITIVE_FIBERS = 32
static

◆ N_GCTTOWERS_CLUSTER_ISO_ONESIDE

constexpr int p2eg::N_GCTTOWERS_CLUSTER_ISO_ONESIDE = 5
static

◆ N_GCTTOWERS_FIBER

constexpr int p2eg::N_GCTTOWERS_FIBER = 17
static

◆ n_links_card

constexpr int p2eg::n_links_card = 4
static

Definition at line 38 of file Phase2L1CaloEGammaUtils.h.

Referenced by Phase2L1CaloEGammaEmulator::produce().

◆ N_RCTCARDS_PHI

constexpr int p2eg::N_RCTCARDS_PHI = 8
static

◆ N_RCTCLUSTERS_FIBER

constexpr int p2eg::N_RCTCLUSTERS_FIBER = 2
static

◆ N_RCTGCT_FIBERS

constexpr int p2eg::N_RCTGCT_FIBERS = 4
static

◆ N_RCTTOWERS_FIBER

constexpr int p2eg::N_RCTTOWERS_FIBER = 17
static

Definition at line 72 of file Phase2L1CaloEGammaUtils.h.

Referenced by getClustersTowers().

◆ N_REGIONS_PER_CARD

constexpr int p2eg::N_REGIONS_PER_CARD = 6
static

◆ n_towers_cardEta

constexpr int p2eg::n_towers_cardEta = 17
static

◆ n_towers_cardPhi

constexpr int p2eg::n_towers_cardPhi = 4
static

Definition at line 33 of file Phase2L1CaloEGammaUtils.h.

Referenced by Phase2L1CaloEGammaEmulator::produce().

◆ n_towers_Eta

constexpr int p2eg::n_towers_Eta = 34
static

◆ n_towers_halfPhi

constexpr int p2eg::n_towers_halfPhi = 36
static

Definition at line 31 of file Phase2L1CaloEGammaUtils.h.

Referenced by Phase2L1CaloEGammaEmulator::produce().

◆ n_towers_per_link

constexpr int p2eg::n_towers_per_link = 17
static

Definition at line 41 of file Phase2L1CaloEGammaUtils.h.

Referenced by getAbsID_iEta_fromFirmwareCardTowerLink().

◆ n_towers_Phi

constexpr int p2eg::n_towers_Phi = 72
static

◆ slideIsoPtThreshold

constexpr float p2eg::slideIsoPtThreshold = 80
static

Definition at line 55 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_iso().

◆ TOWER_IN_ETA

constexpr int p2eg::TOWER_IN_ETA = 3
static

◆ TOWER_IN_PHI

constexpr int p2eg::TOWER_IN_PHI = 4
static