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)
 
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 eta, float ss)
 
bool passes_ss (float pt, float eta, 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 float eta0_loose_ss = 0.4
 
static constexpr float eta1_loose_ss = 0.5
 
static constexpr float eta2_loose_ss = 0.75
 
static constexpr float eta3_loose_ss = 0.85
 
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 float high_pt_threshold = 130.
 
static constexpr float loose_ss_offset = 0.89
 
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 363 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().

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

References p2eg::Cluster::clusterEnergy().

Referenced by Phase2L1CaloEGammaEmulator::produce().

873  {
874  return (lhs.clusterEnergy() > rhs.clusterEnergy());
875  }

◆ 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 191 of file Phase2L1CaloEGammaUtils.h.

References n_towers_per_link, and funct::void.

Referenced by Phase2L1CaloEGammaEmulator::produce().

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

References TOWER_IN_PHI, and funct::void.

Referenced by Phase2L1CaloEGammaEmulator::produce().

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

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

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

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

120  {
121  int etamin = 0;
122  if (cc % 2 == 0) // Even card: negative eta
123  etamin = (0);
124  else // Odd card: positive eta
126  return etamin;
127  }
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 130 of file Phase2L1CaloEGammaUtils.h.

References gpuPixelDoublets::cc, CRYSTALS_IN_TOWER_PHI, and phimax.

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

130  {
131  int phimax = ((cc / 2) + 1) * 4 * CRYSTALS_IN_TOWER_PHI - 1;
132  return phimax;
133  }
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 136 of file Phase2L1CaloEGammaUtils.h.

References gpuPixelDoublets::cc, CRYSTALS_IN_TOWER_PHI, and phimin.

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

136  {
137  int phimin = (cc / 2) * 4 * CRYSTALS_IN_TOWER_PHI;
138  return phimin;
139  }
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 142 of file Phase2L1CaloEGammaUtils.h.

References gpuPixelDoublets::cc, and CRYSTALS_IN_TOWER_ETA.

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

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

151  {
152  if ((cc % 2) == 1) {
153  // if cc is odd: positive eta
154  return int(cc / 2) * TOWER_IN_PHI * CRYSTALS_IN_TOWER_PHI;
155  } else {
156  // if cc is even, the bottom left corner is further in phi, hence the +4 and -1
157  return (((int(cc / 2) * TOWER_IN_PHI) + 4) * CRYSTALS_IN_TOWER_PHI) - 1;
158  }
159  }
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 91 of file Phase2L1GCT.h.

References p2eg::RCTcluster_t::crEta, p2eg::RCTcluster_t::crPhi, doProximityAndBremsStitching(), HLT_2024v11_cff::dPhi, p2eg::RCTcluster_t::et, HLT_2024v11_cff::eta1, HLT_2024v11_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().

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

189  {
190  p2eg::GCTcard_t GCTcombinedClusters;
191  p2eg::GCTinternal_t GCTout;
192 
193  // here we will stitch the clusters in phi and eta
194  GCTcombinedClusters = p2eg::getClustersCombined(GCTcard, nGCTCard);
195 
196  // create internal structure of GCT card
197  // 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
198  // we only need to care about clusters et in combinrdClusters, since the rest remains unchanged wrt input, the cluster that we set to 0
199  // remain in the data at the same place , it will just get 0 et now
200  // we need to code Positive and Negative Eta differently ! For negative Eta link 0 for each RCT
201  // region becomes 3 in GCT output, the RCT card is rotated around 0:0 point of the card
202  // First 16 fibers - positive Eta , second 16 - negative. Eta coded 0...16 and towEtaNeg = 0 or 1 for clusters ;
203  // Phi is coded 0...15 , in case if whole card 0...33 and subdevision 1/5 in crPhi and crEta 0...4 for
204  // position in tower
205  //
206  // towers are put in link starting from eta=0, the link number defines Eta negative or positive and Phi position of tower.
207  for (int i = 0; i < p2eg::N_RCTCARDS_PHI; i++) {
208  for (int j = 0; j < p2eg::N_RCTGCT_FIBERS; j++) {
209  for (int k = 0; k < p2eg::N_RCTCLUSTERS_FIBER; k++) {
210  bool isPositiveEta;
211  // positive eta: initialize from RCT clusters in pos object
212  isPositiveEta = true;
214  i, isPositiveEta, GCTcombinedClusters.RCTcardEtaPos[i].RCTtoGCTfiber[j].RCTclusters[k]);
215  // negative eta: initialize from RCT clusters in neg object
216  isPositiveEta = false;
217  GCTout.GCTCorrfiber[i * 4 + (3 - j) + p2eg::N_GCTPOSITIVE_FIBERS].GCTclusters[k].initFromRCTCluster(
218  i, isPositiveEta, GCTcombinedClusters.RCTcardEtaNeg[i].RCTtoGCTfiber[j].RCTclusters[k]);
219  }
220  for (int k = 0; k < N_RCTTOWERS_FIBER; k++) {
221  GCTout.GCTCorrfiber[i * 4 + j].GCTtowers[k].initFromRCTTower(
222  GCTcard.RCTcardEtaPos[i].RCTtoGCTfiber[j].RCTtowers[k]); // pos eta
223  GCTout.GCTCorrfiber[i * 4 + (3 - j) + p2eg::N_GCTPOSITIVE_FIBERS].GCTtowers[k].initFromRCTTower(
224  GCTcard.RCTcardEtaNeg[i].RCTtoGCTfiber[j].RCTtowers[k]); // neg eta
225  }
226  }
227  }
228  return GCTout;
229 }
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:91
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 234 of file Phase2L1GCT.h.

References p2eg::GCTtower_t::ecalEt, p2eg::GCTcluster_t::et, p2eg::GCTtower_t::et, PVValHelper::eta, HLT_2024v11_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().

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

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

Referenced by Phase2L1CaloEGammaEmulator::produce().

246  {
247  int no = int(local_iEta / (TOWER_IN_ETA * CRYSTALS_IN_TOWER_ETA));
248  assert(no < 6);
249  return no;
250  }
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 167 of file Phase2L1CaloEGammaUtils.h.

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

167  {
168  float size_cell = 2 * ECAL_eta_range / n_towers_Eta;
169  int etaID = int((eta + ECAL_eta_range) / size_cell);
170  return etaID;
171  }
static constexpr float ECAL_eta_range
static constexpr int n_towers_Eta

◆ getTower_absPhiID()

int p2eg::getTower_absPhiID ( float  phi)
inline

Definition at line 177 of file Phase2L1CaloEGammaUtils.h.

References createfilelist::int, M_PI, and n_towers_Phi.

177  {
178  float size_cell = 2 * M_PI / n_towers_Phi;
179  int phiID = int((phi + M_PI) / size_cell);
180  return phiID;
181  }
#define M_PI
static constexpr int n_towers_Phi

◆ getTowerEta_fromAbsID()

float p2eg::getTowerEta_fromAbsID ( int  id)
inline

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

226  {
227  float size_cell = 2 * ECAL_eta_range / n_towers_Eta;
228  float eta = (id * size_cell) - ECAL_eta_range + 0.5 * size_cell;
229  return eta;
230  }
static constexpr float ECAL_eta_range
static constexpr int n_towers_Eta

◆ getTowerPhi_fromAbsID()

float p2eg::getTowerPhi_fromAbsID ( int  id)
inline

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

236  {
237  float size_cell = 2 * M_PI / n_towers_Phi;
238  float phi = (id * size_cell) - M_PI + 0.5 * size_cell;
239  return phi;
240  }
#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 102 of file Phase2L1CaloEGammaUtils.h.

References gpuPixelDoublets::cc.

Referenced by getCard_iEtaMax().

102 { 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 904 of file Phase2L1CaloEGammaUtils.h.

References a0, a0_80, a1_80, high_pt_threshold, genparticles_cff::iso, DiDispStaMuonMonitor_cfi::pt, and slideIsoPtThreshold.

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

904  {
905  bool is_iso = true;
906  if (pt > high_pt_threshold)
907  is_iso = true;
908  else if (pt < slideIsoPtThreshold) {
909  if (!((a0_80 - a1_80 * pt) > iso))
910  is_iso = false;
911  } else {
912  if (iso > a0)
913  is_iso = false;
914  }
915  return is_iso;
916  }
static constexpr float high_pt_threshold
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 918 of file Phase2L1CaloEGammaUtils.h.

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

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

918  {
919  bool is_iso;
920  if (pt > high_pt_threshold)
921  is_iso = true;
922  else
923  is_iso = (b0 + b1 * std::exp(-b2 * pt) > iso);
924  return is_iso;
925  }
static constexpr float high_pt_threshold
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  eta,
float  ss 
)
inline

Definition at line 939 of file Phase2L1CaloEGammaUtils.h.

References funct::abs(), e0_looseTkss, e1_looseTkss, e2_looseTkss, PVValHelper::eta, eta0_loose_ss, eta1_loose_ss, eta2_loose_ss, eta3_loose_ss, JetChargeProducer_cfi::exp, high_pt_threshold, loose_ss_offset, DiDispStaMuonMonitor_cfi::pt, and contentValuesCheck::ss.

Referenced by Phase2L1CaloEGammaEmulator::produce().

939  {
940  bool is_ss;
941  if (pt > high_pt_threshold)
942  is_ss = true;
943  else if ((abs(eta) > eta0_loose_ss && abs(eta) < eta1_loose_ss) ||
944  (abs(eta) > eta2_loose_ss && abs(eta) < eta3_loose_ss)) // temporary adjustment
945  is_ss = ((loose_ss_offset - e1_looseTkss * std::exp(-e2_looseTkss * pt)) <= ss);
946  else
947  is_ss = ((e0_looseTkss - e1_looseTkss * std::exp(-e2_looseTkss * pt)) <= ss);
948  return is_ss;
949  }
static constexpr float e2_looseTkss
static constexpr float high_pt_threshold
static constexpr float eta0_loose_ss
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static constexpr float loose_ss_offset
static constexpr float e0_looseTkss
static constexpr float eta3_loose_ss
static constexpr float eta2_loose_ss
static constexpr float eta1_loose_ss
static constexpr float e1_looseTkss

◆ passes_ss()

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

Definition at line 927 of file Phase2L1CaloEGammaUtils.h.

References funct::abs(), c0_ss, c1_ss, c2_ss, PVValHelper::eta, eta0_loose_ss, eta1_loose_ss, eta2_loose_ss, eta3_loose_ss, JetChargeProducer_cfi::exp, high_pt_threshold, loose_ss_offset, DiDispStaMuonMonitor_cfi::pt, and contentValuesCheck::ss.

Referenced by Phase2L1CaloEGammaEmulator::produce().

927  {
928  bool is_ss;
929  if (pt > high_pt_threshold)
930  is_ss = true;
931  else if ((abs(eta) > eta0_loose_ss && abs(eta) < eta1_loose_ss) ||
932  (abs(eta) > eta2_loose_ss && abs(eta) < eta3_loose_ss)) // temporary adjustment
933  is_ss = ((loose_ss_offset + c1_ss * std::exp(-c2_ss * pt)) <= ss);
934  else
935  is_ss = ((c0_ss + c1_ss * std::exp(-c2_ss * pt)) <= ss);
936  return is_ss;
937  }
static constexpr float high_pt_threshold
static constexpr float c2_ss
static constexpr float eta0_loose_ss
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static constexpr float loose_ss_offset
static constexpr float c1_ss
static constexpr float eta3_loose_ss
static constexpr float eta2_loose_ss
static constexpr float c0_ss
static constexpr float eta1_loose_ss

◆ printl1tp2TowerInfo()

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

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

1613  {
1614  std::cout << "[Print l1tp2::CaloTower info:] [" << description << "]: "
1615  << ".ecalTowerEta() (float): " << thisTower.ecalTowerEt() << ", "
1616  << ".hcalTowerEta() (float): " << thisTower.hcalTowerEt() << ", "
1617  << ".towerIEta(): " << thisTower.towerIEta() << ", "
1618  << ".towerIPhi(): " << thisTower.towerIPhi() << ", "
1619  << ".towerEta() " << thisTower.towerEta() << ", "
1620  << ".towerPhi() " << thisTower.towerPhi() << std::endl;
1621  }
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_2024v11_cff::dPhi, p2eg::Cluster::getBrems(), p2eg::Cluster::getCalib(), 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<12> 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.getCalib(),
1525  c1.getIsSS(),
1526  c1.getIsLooseTkss(),
1527  rct_is_iso,
1528  rct_is_looseTkiso,
1529  c1.region());
1530  newc2 = p2eg::Cluster(0,
1531  c2.towerEta(),
1532  c2.towerPhi(),
1533  c2.clusterEta(),
1534  c2.clusterPhi(),
1535  c2.satur(),
1536  0,
1537  0,
1538  0,
1539  1.0,
1540  false,
1541  false,
1542  rct_is_iso,
1543  rct_is_looseTkiso,
1544  c2.region());
1545  cluster_list[i] = newc1;
1546  cluster_list[j] = newc2;
1547  } else {
1548  // Analogous to above portion
1549  newc1 = p2eg::Cluster(0,
1550  c1.towerEta(),
1551  c1.towerPhi(),
1552  c1.clusterEta(),
1553  c1.clusterPhi(),
1554  c1.satur(),
1555  0,
1556  0,
1557  0,
1558  1.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.getCalib(),
1574  c2.getIsSS(),
1575  c2.getIsLooseTkss(),
1576  rct_is_iso,
1577  rct_is_looseTkiso,
1578  c2.region());
1579  cluster_list[i] = newc1;
1580  cluster_list[j] = newc2;
1581  }
1582  }
1583  }
1584  }
1585  }
1586  }
1587 }
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 290 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().

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

◆ eta0_loose_ss

constexpr float p2eg::eta0_loose_ss = 0.4
static

Definition at line 63 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_looseTkss(), and passes_ss().

◆ eta1_loose_ss

constexpr float p2eg::eta1_loose_ss = 0.5
static

Definition at line 63 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_looseTkss(), and passes_ss().

◆ eta2_loose_ss

constexpr float p2eg::eta2_loose_ss = 0.75
static

Definition at line 63 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_looseTkss(), and passes_ss().

◆ eta3_loose_ss

constexpr float p2eg::eta3_loose_ss = 0.85
static

Definition at line 63 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_looseTkss(), and passes_ss().

◆ 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 1600 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

◆ high_pt_threshold

constexpr float p2eg::high_pt_threshold = 130.
static

◆ loose_ss_offset

constexpr float p2eg::loose_ss_offset = 0.89
static

Definition at line 62 of file Phase2L1CaloEGammaUtils.h.

Referenced by passes_looseTkss(), and passes_ss().

◆ 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 70 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 79 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 80 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 76 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