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.5
 
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 370 of file Phase2L1GCT.h.

References p2eg::GCTinternal_t::computeClusterIsolationInPlace(), l1tPhase2CaloJetEmulator_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().

381  {
382  //-------------------------//
383  // Initialize the GCT area
384  //-------------------------//
385  p2eg::GCTinternal_t GCTinternal = p2eg::getClustersTowers(GCTcard, nGCTCard);
386 
387  //------------------------------------------------//
388  // Combine towers and clusters to get full towers
389  //------------------------------------------------//
390  p2eg::GCTintTowers_t GCTintTowers = p2eg::getFullTowers(GCTinternal);
391 
392  //---------------------------//
393  // Compute cluster isolation
394  //--------------------------//
395  GCTinternal.computeClusterIsolationInPlace(nGCTCard);
396  GCTinternal.setIsolationInfo();
397 
398  //-----------------------------------------------------------------------------------------------------------------------//
399  // Output to correlator and CMSSW collections.
400  // For positive eta, skip overlap region, i.e. fibers i = 0, 1, 2, 3, and i = 28, 29, 30, 31.
401  // For negative eta, skip overlap region, i.e. fibers 32, 33, 34, 35, and 61, 62, 63, 64.
402  //-----------------------------------------------------------------------------------------------------------------------//
403  int posEtaFiberStart = p2eg::N_RCTGCT_FIBERS; // 4, since there are 4 fibers in one RCT card
404  int posEtaFiberEnd = (p2eg::N_GCTPOSITIVE_FIBERS - p2eg::N_RCTGCT_FIBERS);
405  int negEtaFiberStart = (p2eg::N_GCTPOSITIVE_FIBERS + p2eg::N_RCTGCT_FIBERS);
406  int negEtaFiberEnd =
407  (p2eg::N_GCTINTERNAL_FIBERS - p2eg::N_RCTGCT_FIBERS); // first term is number of gct internal fibers
408 
409  // When indexing into the correlator output, note that the output to correlator does NOT include the overlap region,
410  // 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.
411  // (4 because we are skipping one RCT card in positive eta, and 12 because we are skipping three RCT cards in negative eta)
412  int posEtaCorrelatorFiberIndexOffset = 4;
413  int negEtaCorrelatorFiberIndexOffset = 12;
414 
415  // 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
416  int correlatorTowPhiOffset = 4;
417 
418  // Positive eta
420  GCTtoCorr,
421  gctClusters,
422  gctTowers,
423  gctEGammas,
424  gctDigitizedClustersCorrelator,
425  gctDigitizedTowersCorrelator,
426  gctDigitizedClustersGT,
427  nGCTCard,
428  posEtaFiberStart,
429  posEtaFiberEnd,
430  posEtaCorrelatorFiberIndexOffset,
431  correlatorTowPhiOffset);
432  // Negative eta
434  GCTtoCorr,
435  gctClusters,
436  gctTowers,
437  gctEGammas,
438  gctDigitizedClustersCorrelator,
439  gctDigitizedTowersCorrelator,
440  gctDigitizedClustersGT,
441  nGCTCard,
442  negEtaFiberStart,
443  negEtaFiberEnd,
444  negEtaCorrelatorFiberIndexOffset,
445  correlatorTowPhiOffset);
446 
447  //-----------------------------------------------------------------------------------------------------------------------//
448  // CMSSW outputs for GCT Full Towers (clusters + towers) output for PFClusters.
449  //-----------------------------------------------------------------------------------------------------------------------//
450  GCTintTowers.writeToPFOutput(nGCTCard, gctFullTowers);
451 }
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:297
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 877 of file Phase2L1CaloEGammaUtils.h.

References p2eg::Cluster::clusterEnergy().

Referenced by Phase2L1CaloEGammaEmulator::produce().

877  {
878  return (lhs.clusterEnergy() > rhs.clusterEnergy());
879  }

◆ convertHcalETtoEcalET()

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

Definition at line 97 of file Phase2L1CaloEGammaUtils.h.

References ECAL_LSB, and HCAL_LSB.

Referenced by Phase2L1CaloEGammaEmulator::produce().

97  {
98  float hcalEtAsFloat = HCAL * HCAL_LSB;
99  return (ap_uint<12>(hcalEtAsFloat / ECAL_LSB));
100  }
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 196 of file Phase2L1CaloEGammaUtils.h.

References n_towers_per_link, and funct::void.

Referenced by Phase2L1CaloEGammaEmulator::produce().

196  {
197  // iEta only depends on the tower position in the link
198  (void)nCard;
199  (void)nLink;
200  if ((nCard % 2) == 1) { // if cc is odd (positive eta), e.g. nTower = 0 will correspond to absolute iEta ID 17.
201  return n_towers_per_link + nTower;
202  } else { // if cc is even (negative eta): e.g. nTower = 0 will correspond to absolute iEta ID 16.
203  return (16 - nTower);
204  }
205  }
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 210 of file Phase2L1CaloEGammaUtils.h.

References TOWER_IN_PHI, and funct::void.

Referenced by Phase2L1CaloEGammaEmulator::produce().

210  {
211  // iPhi only depends on the card and link number
212  (void)nTower;
213  if ((nCard % 2) == 1) { // if cc is odd (positive eta),
214  // e.g. cc=3, link #2, global iPhi = int(3/2) * 4 + 2 = 6
215  return (int(nCard / 2) * TOWER_IN_PHI) + nLink;
216  } else { // if cc is even (negative eta)
217  // e.g. cc=4, link #2, global iPhi = int(4/2) * 4 + (4 - 2 - 1)
218  // = 2*4 + 1
219  // = 9
220  // minus one is because TOWER_IN_PHI is 4
221  return (int(nCard / 2) * TOWER_IN_PHI) + (TOWER_IN_PHI - nLink - 1);
222  }
223  }
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 113 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().

113  {
115 
116  int etamax = 0;
117  if (cc % 2 == 0) // Even card: negative eta
118  etamax = (n_towers_cardEta * CRYSTALS_IN_TOWER_ETA - 1); // First eta half. 5 crystals in eta in 1 tower.
119  else // Odd card: positive eta
121  return etamax;
122  }
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 125 of file Phase2L1CaloEGammaUtils.h.

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

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

125  {
126  int etamin = 0;
127  if (cc % 2 == 0) // Even card: negative eta
128  etamin = (0);
129  else // Odd card: positive eta
131  return etamin;
132  }
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 135 of file Phase2L1CaloEGammaUtils.h.

References gpuPixelDoublets::cc, CRYSTALS_IN_TOWER_PHI, and phimax.

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

135  {
136  int phimax = ((cc / 2) + 1) * 4 * CRYSTALS_IN_TOWER_PHI - 1;
137  return phimax;
138  }
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 141 of file Phase2L1CaloEGammaUtils.h.

References gpuPixelDoublets::cc, CRYSTALS_IN_TOWER_PHI, and phimin.

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

141  {
142  int phimin = (cc / 2) * 4 * CRYSTALS_IN_TOWER_PHI;
143  return phimin;
144  }
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 147 of file Phase2L1CaloEGammaUtils.h.

References gpuPixelDoublets::cc, and CRYSTALS_IN_TOWER_ETA.

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

147  {
148  if ((cc % 2) == 1) { // if cc is odd (positive eta)
149  return (17 * CRYSTALS_IN_TOWER_ETA);
150  } else { // if cc is even (negative eta) the bottom left corner is further in eta, hence +4
151  return ((16 * CRYSTALS_IN_TOWER_ETA) + 4);
152  }
153  }
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 156 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().

156  {
157  if ((cc % 2) == 1) {
158  // if cc is odd: positive eta
159  return int(cc / 2) * TOWER_IN_PHI * CRYSTALS_IN_TOWER_PHI;
160  } else {
161  // if cc is even, the bottom left corner is further in phi, hence the +4 and -1
162  return (((int(cc / 2) * TOWER_IN_PHI) + 4) * CRYSTALS_IN_TOWER_PHI) - 1;
163  }
164  }
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 1057 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.

1057  {
1058  p2eg::etaStripPeak_t etaStripPeak;
1059  p2eg::clusterInfo cluster;
1060 
1061  etaStripPeak.pk0 = p2eg::getPeakBin20N(ecalRegion.etaStrip0);
1062  etaStripPeak.pk1 = p2eg::getPeakBin20N(ecalRegion.etaStrip1);
1063  etaStripPeak.pk2 = p2eg::getPeakBin20N(ecalRegion.etaStrip2);
1064  etaStripPeak.pk3 = p2eg::getPeakBin20N(ecalRegion.etaStrip3);
1065  etaStripPeak.pk4 = p2eg::getPeakBin20N(ecalRegion.etaStrip4);
1066  etaStripPeak.pk5 = p2eg::getPeakBin20N(ecalRegion.etaStrip5);
1067  etaStripPeak.pk6 = p2eg::getPeakBin20N(ecalRegion.etaStrip6);
1068  etaStripPeak.pk7 = p2eg::getPeakBin20N(ecalRegion.etaStrip7);
1069  etaStripPeak.pk8 = p2eg::getPeakBin20N(ecalRegion.etaStrip8);
1070  etaStripPeak.pk9 = p2eg::getPeakBin20N(ecalRegion.etaStrip9);
1071  etaStripPeak.pk10 = p2eg::getPeakBin20N(ecalRegion.etaStrip10);
1072  etaStripPeak.pk11 = p2eg::getPeakBin20N(ecalRegion.etaStrip11);
1073  etaStripPeak.pk12 = p2eg::getPeakBin20N(ecalRegion.etaStrip12);
1074  etaStripPeak.pk13 = p2eg::getPeakBin20N(ecalRegion.etaStrip13);
1075  etaStripPeak.pk14 = p2eg::getPeakBin20N(ecalRegion.etaStrip14);
1076 
1077  p2eg::crystalMax peakIn15;
1078  peakIn15 = p2eg::getPeakBin15N(etaStripPeak);
1079 
1080  cluster.seedEnergy = peakIn15.energy;
1081  cluster.energy = 0;
1082  cluster.etaMax = peakIn15.etaMax;
1083  cluster.phiMax = peakIn15.phiMax;
1084  cluster.brems = 0;
1085  cluster.et5x5 = 0;
1086  cluster.et2x5 = 0;
1087 
1088  return cluster;
1089 }
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, ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets::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]
if(threadIdxLocalY==0 &&threadIdxLocalX==0)

◆ 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::GCTtower_t::ecalEt, 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::hcalEt, 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  // Positive eta
244  for (int i = 0; i < p2eg::N_GCTPOSITIVE_FIBERS; i = i + 4) {
245  for (int i1 = 0; i1 < 4; i1++) {
246  for (int k = 0; k < p2eg::N_GCTTOWERS_FIBER; k++) {
247  ap_uint<15> phi = i + i1;
248  ap_uint<15> eta = p2eg::N_GCTETA / 2 + k;
249  GCTintTowers.GCTtower[eta][phi].et = GCTinternal.GCTCorrfiber[phi].GCTtowers[k].et;
250  GCTintTowers.GCTtower[eta][phi].hoe = GCTinternal.GCTCorrfiber[phi].GCTtowers[k].hoe;
251  GCTintTowers.GCTtower[eta][phi].ecalEt = GCTinternal.GCTCorrfiber[phi].GCTtowers[k].ecalEt;
252  GCTintTowers.GCTtower[eta][phi].hcalEt = GCTinternal.GCTCorrfiber[phi].GCTtowers[k].hcalEt;
253  for (int ic1 = 0; ic1 < 4; ic1++) {
254  for (int jc = 0; jc < p2eg::N_GCTCLUSTERS_FIBER; jc++) {
255  ap_uint<15> eta1 = p2eg::N_GCTETA / 2 + GCTinternal.GCTCorrfiber[i + ic1].GCTclusters[jc].towEta;
256  ap_uint<15> phi1 = GCTinternal.GCTCorrfiber[i + ic1].GCTclusters[jc].towPhi;
257  if (eta == eta1 && phi == phi1) {
258  GCTintTowers.GCTtower[eta][phi].et =
259  (GCTintTowers.GCTtower[eta][phi].et + GCTinternal.GCTCorrfiber[i + ic1].GCTclusters[jc].et);
260  }
261  }
262  }
263  }
264  }
265  }
266 
267  // Negative eta
269  for (int i1 = 0; i1 < 4; i1++) {
270  for (int k = 0; k < p2eg::N_GCTTOWERS_FIBER; k++) {
271  ap_uint<15> eta = p2eg::N_GCTETA / 2 - k - 1;
272  ap_uint<15> phi = i + i1 - p2eg::N_GCTPOSITIVE_FIBERS;
273  GCTintTowers.GCTtower[eta][phi].et = GCTinternal.GCTCorrfiber[i + i1].GCTtowers[k].et;
274  GCTintTowers.GCTtower[eta][phi].hoe = GCTinternal.GCTCorrfiber[i + i1].GCTtowers[k].hoe;
275  GCTintTowers.GCTtower[eta][phi].ecalEt = GCTinternal.GCTCorrfiber[i + i1].GCTtowers[k].ecalEt;
276  GCTintTowers.GCTtower[eta][phi].hcalEt = GCTinternal.GCTCorrfiber[i + i1].GCTtowers[k].hcalEt;
277  for (int ic1 = 0; ic1 < 4; ic1++) {
278  for (int jc = 0; jc < p2eg::N_GCTCLUSTERS_FIBER; jc++) {
279  ap_uint<15> eta1 = p2eg::N_GCTETA / 2 - 1 - GCTinternal.GCTCorrfiber[i + ic1].GCTclusters[jc].towEta;
280  ap_uint<15> phi1 = GCTinternal.GCTCorrfiber[i + ic1].GCTclusters[jc].towPhi;
281  if (eta == eta1 && phi == phi1) {
282  GCTintTowers.GCTtower[eta][phi].et =
283  (GCTintTowers.GCTtower[eta][phi].et + GCTinternal.GCTCorrfiber[i + ic1].GCTclusters[jc].et);
284  }
285  }
286  }
287  }
288  }
289  }
290 
291  return GCTintTowers;
292 }
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 251 of file Phase2L1CaloEGammaUtils.h.

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

Referenced by Phase2L1CaloEGammaEmulator::produce().

251  {
252  int no = int(local_iEta / (TOWER_IN_ETA * CRYSTALS_IN_TOWER_ETA));
253  assert(no < 6);
254  return no;
255  }
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 172 of file Phase2L1CaloEGammaUtils.h.

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

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

◆ getTower_absPhiID()

int p2eg::getTower_absPhiID ( float  phi)
inline

Definition at line 182 of file Phase2L1CaloEGammaUtils.h.

References createfilelist::int, M_PI, and n_towers_Phi.

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

◆ getTowerEta_fromAbsID()

float p2eg::getTowerEta_fromAbsID ( int  id)
inline

Definition at line 231 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().

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

◆ getTowerPhi_fromAbsID()

float p2eg::getTowerPhi_fromAbsID ( int  id)
inline

Definition at line 241 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().

241  {
242  float size_cell = 2 * M_PI / n_towers_Phi;
243  float phi = (id * size_cell) - M_PI + 0.5 * size_cell;
244  return phi;
245  }
#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 107 of file Phase2L1CaloEGammaUtils.h.

References gpuPixelDoublets::cc.

Referenced by getCard_iEtaMax().

107 { 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 1096 of file Phase2L1RCT.h.

References timeUnitHelper::pack().

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

◆ passes_iso()

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

Definition at line 908 of file Phase2L1CaloEGammaUtils.h.

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

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

908  {
909  bool is_iso = true;
910  if (pt > 130)
911  is_iso = true;
912  else if (pt < slideIsoPtThreshold) {
913  if (!((a0_80 - a1_80 * pt) > iso))
914  is_iso = false;
915  } else {
916  if (iso > a0)
917  is_iso = false;
918  }
919  return is_iso;
920  }
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 922 of file Phase2L1CaloEGammaUtils.h.

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

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

922  {
923  bool is_iso;
924  if (pt > 130)
925  is_iso = true;
926  else
927  is_iso = (b0 + b1 * std::exp(-b2 * pt) > iso);
928  return is_iso;
929  }
bias2_t b2[25]
Definition: b2.h:9
static constexpr float b0
static constexpr float b1

◆ passes_looseTkss()

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

Definition at line 940 of file Phase2L1CaloEGammaUtils.h.

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

Referenced by Phase2L1CaloEGammaEmulator::produce().

940  {
941  bool is_ss;
942  if (pt > 130)
943  is_ss = true;
944  else
945  is_ss = ((e0_looseTkss - e1_looseTkss * std::exp(-e2_looseTkss * pt)) <= ss);
946  return is_ss;
947  }
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 931 of file Phase2L1CaloEGammaUtils.h.

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

Referenced by Phase2L1CaloEGammaEmulator::produce().

931  {
932  bool is_ss;
933  if (pt > 130)
934  is_ss = true;
935  else
936  is_ss = ((c0_ss + c1_ss * std::exp(-c2_ss * pt)) <= ss);
937  return is_ss;
938  }
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 1611 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().

1611  {
1612  std::cout << "[Print l1tp2::CaloTower info:] [" << description << "]: "
1613  << ".ecalTowerEta() (float): " << thisTower.ecalTowerEt() << ", "
1614  << ".hcalTowerEta() (float): " << thisTower.hcalTowerEt() << ", "
1615  << ".towerIEta(): " << thisTower.towerIEta() << ", "
1616  << ".towerIPhi(): " << thisTower.towerIPhi() << ", "
1617  << ".towerEta() " << thisTower.towerEta() << ", "
1618  << ".towerPhi() " << thisTower.towerPhi() << std::endl;
1619  }
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 1475 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().

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

310  {
311  for (int i = fiberStart; i < fiberEnd; i++) {
312  // In each fiber, first do clusters
313  for (int k = 0; k < p2eg::N_GCTCLUSTERS_FIBER; k++) {
314  // First do CMSSW cluster outputs
315  p2eg::GCTcluster_t thisCluster = GCTinternal.GCTCorrfiber[i].GCTclusters[k];
316  if (thisCluster.etFloat() > 0.0) {
317  // Make l1tp2::CaloCrystalCluster
318  gctClustersOutput->push_back(thisCluster.createCaloCrystalCluster());
319 
320  // Make l1t::EGamma
321  int bx = 0;
322  l1t::EGamma thisEGamma = thisCluster.createL1TEGamma();
323  gctEGammas->push_back(bx, thisEGamma);
324  }
325 
326  // Then the clusters to the correlator: all fields are the same with the exception of towPhi, which
327  // needs to be subtracted by 4 because the output to correlator does NOT include the overlap region.
328  GCTtoCorrOutput.GCTCorrfiber[i - corrFiberIndexOffset].GCTclusters[k] = thisCluster;
329  GCTtoCorrOutput.GCTCorrfiber[i - corrFiberIndexOffset].GCTclusters[k].towPhi =
330  (thisCluster.towPhi - corrTowPhiOffset);
331 
332  // Make l1tp2::DigitizedClusterCorrelator. The function needs corrTowPhiOffset to know the towPhi in the card excluding the overlap region.
333  // The correlator clusters don't need to know the fiber offset.
334  if (thisCluster.etFloat() > 0.0) {
335  gctDigitizedClustersCorrelator->push_back(thisCluster.createDigitizedClusterCorrelator(corrTowPhiOffset));
336  }
337 
338  // Make l1tp2::DigitizedClusterGT.
339  if (thisCluster.etFloat() > 0.0) {
340  bool isValid = true;
341  gctDigitizedClustersGT->push_back(thisCluster.createDigitizedClusterGT(isValid));
342  }
343  }
344 
345  // Next do tower outputs
346  for (int k = 0; k < p2eg::N_GCTTOWERS_FIBER; k++) {
347  // First do CMSSW tower outputs
348  p2eg::GCTtower_t thisTower = GCTinternal.GCTCorrfiber[i].GCTtowers[k];
349  l1tp2::CaloTower thisL1CaloTower = thisTower.createCaloTowerFromFiberIdx(nGCTCard, i, k);
350  gctTowersOutput->push_back(thisL1CaloTower);
351 
352  // Then the towers to the correlator. Note the same corrFiberIndexOffset as was done for the clusters
353  GCTtoCorrOutput.GCTCorrfiber[i - corrFiberIndexOffset].GCTtowers[k] = thisTower;
354 
355  // 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
356  l1tp2::DigitizedTowerCorrelator thisDigitizedTowerCorrelator =
357  thisTower.createDigitizedTowerCorrelator(nGCTCard, i - corrFiberIndexOffset, k);
358  gctDigitizedTowersCorrelator->push_back(thisDigitizedTowerCorrelator);
359  }
360  }
361 }
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 57 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_iso().

◆ a0_80

constexpr float p2eg::a0_80 = 0.85
static

Definition at line 57 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_iso().

◆ a1_80

constexpr float p2eg::a1_80 = 0.0080
static

Definition at line 57 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_iso().

◆ b0

constexpr float p2eg::b0 = 0.38
static

Definition at line 58 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_looseTkiso().

◆ b1

constexpr float p2eg::b1 = 1.9
static

Definition at line 58 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_looseTkiso().

◆ b2

constexpr float p2eg::b2 = 0.05
static

Definition at line 58 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_looseTkiso().

◆ c0_ss

constexpr float p2eg::c0_ss = 0.94
static

Definition at line 59 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_ss().

◆ c1_ss

constexpr float p2eg::c1_ss = 0.052
static

Definition at line 59 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_ss().

◆ c2_ss

constexpr float p2eg::c2_ss = 0.044
static

Definition at line 59 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_ss().

◆ CRYSTAL_IN_ETA

constexpr int p2eg::CRYSTAL_IN_ETA = 15
static

Definition at line 50 of file Phase2L1CaloEGammaUtils.h.

Referenced by Phase2L1CaloEGammaEmulator::produce().

◆ CRYSTAL_IN_PHI

constexpr int p2eg::CRYSTAL_IN_PHI = 20
static

Definition at line 51 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 62 of file Phase2L1CaloEGammaUtils.h.

Referenced by Phase2L1CaloEGammaEmulator::produce().

◆ d0

constexpr float p2eg::d0 = 0.96
static

Definition at line 60 of file Phase2L1CaloEGammaUtils.h.

◆ d1

constexpr float p2eg::d1 = 0.0003
static

Definition at line 60 of file Phase2L1CaloEGammaUtils.h.

◆ e0_looseTkss

constexpr float p2eg::e0_looseTkss = 0.944
static

Definition at line 61 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_looseTkss().

◆ e1_looseTkss

constexpr float p2eg::e1_looseTkss = 0.65
static

Definition at line 61 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_looseTkss().

◆ e2_looseTkss

constexpr float p2eg::e2_looseTkss = 0.4
static

Definition at line 61 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.5
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 1598 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 41 of file Phase2L1CaloEGammaUtils.h.

Referenced by Phase2L1CaloEGammaEmulator::produce().

◆ n_clusters_link

constexpr int p2eg::n_clusters_link = 2
static

Definition at line 40 of file Phase2L1CaloEGammaUtils.h.

◆ N_CLUSTERS_PER_REGION

constexpr int p2eg::N_CLUSTERS_PER_REGION = 4
static

Definition at line 67 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 35 of file Phase2L1CaloEGammaUtils.h.

◆ n_crystals_cardPhi

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

Definition at line 36 of file Phase2L1CaloEGammaUtils.h.

◆ N_GCTCARDS

constexpr int p2eg::N_GCTCARDS = 3
static

Definition at line 76 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 77 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 39 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 73 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 34 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 32 of file Phase2L1CaloEGammaUtils.h.

Referenced by Phase2L1CaloEGammaEmulator::produce().

◆ n_towers_per_link

constexpr int p2eg::n_towers_per_link = 17
static

Definition at line 42 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 56 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