CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L1EGCrystalClusterEmulatorProducer::SimpleCaloHit Class Reference

Public Member Functions

float deta (SimpleCaloHit &other) const
 
int dieta (SimpleCaloHit &other) const
 
int dieta_byCrystalID (SimpleCaloHit &other) const
 
int diphi (SimpleCaloHit &other) const
 
int diphi_byCrystalID (SimpleCaloHit &other) const
 
float distanceTo (SimpleCaloHit &other) const
 
float dphi (SimpleCaloHit &other) const
 
float energy () const
 
const EBDetIdid () const
 
int id_iEta ()
 
int id_iPhi ()
 
bool isEndcapHit () const
 
bool isInCard (int cc) const
 
bool isInCardAndRegion (int cc, int nregion) const
 
bool operator== (SimpleCaloHit &other) const
 
const GlobalVectorposition () const
 
float pt () const
 
void setEnergy (float et)
 
void setId (const EBDetId &id)
 
void setIdHcal (const HcalDetId &idhcal)
 
void setIsEndcapHit (bool isEC)
 
void setPosition (const GlobalVector &pos)
 
void setPt ()
 
void setUsed (bool isUsed)
 
bool used () const
 

Private Attributes

float energy_ = 0.
 
EBDetId id_
 
HcalDetId id_hcal_
 
bool isEndcapHit_ = false
 
GlobalVector position_
 
float pt_ = 0
 
bool stale_ = false
 
bool used_ = false
 

Detailed Description

Definition at line 315 of file L1EGammaCrystalsEmulatorProducer.cc.

Member Function Documentation

◆ deta()

float L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::deta ( SimpleCaloHit other) const
inline

◆ dieta()

int L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::dieta ( SimpleCaloHit other) const
inline

Definition at line 364 of file L1EGammaCrystalsEmulatorProducer.cc.

References id_, EBDetId::ieta(), isEndcapHit_, and trackingPlots::other.

364  {
365  if (isEndcapHit_ || other.isEndcapHit())
366  return 9999; // We shouldn't compare integer indices in endcap, the map is not linear
367  if (id_.ieta() * other.id().ieta() > 0)
368  return id_.ieta() - other.id().ieta();
369  return id_.ieta() - other.id().ieta() - 1;
370  };
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49

◆ dieta_byCrystalID()

int L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::dieta_byCrystalID ( SimpleCaloHit other) const
inline

◆ diphi()

int L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::diphi ( SimpleCaloHit other) const
inline

Definition at line 374 of file L1EGammaCrystalsEmulatorProducer.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), id(), EBDetId::iphi(), isEndcapHit_, trackingPlots::other, PI, and mps_fire::result.

374  {
375  if (isEndcapHit_ || other.isEndcapHit())
376  return 9999; // We shouldn't compare integer indices in endcap, the map is not linear
377  // Logic from EBDetId::distancePhi() without the abs()
378  static constexpr int PI = 180;
379  int result = id().iphi() - other.id().iphi();
380  while (result > PI)
381  result -= 2 * PI;
382  while (result <= -PI)
383  result += 2 * PI;
384  return result;
385  };
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51
#define PI
Definition: QcdUeDQM.h:37

◆ diphi_byCrystalID()

int L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::diphi_byCrystalID ( SimpleCaloHit other) const
inline

◆ distanceTo()

float L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::distanceTo ( SimpleCaloHit other) const
inline

Definition at line 394 of file L1EGammaCrystalsEmulatorProducer.cc.

References mag(), trackingPlots::other, and position().

394  {
395  // Treat position as a point, measure 3D distance
396  // This is used for endcap hits, where we don't have a rectangular mapping
397  return (position() - other.position()).mag();
398  };
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())

◆ dphi()

float L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::dphi ( SimpleCaloHit other) const
inline

Definition at line 371 of file L1EGammaCrystalsEmulatorProducer.cc.

References reco::deltaPhi(), trackingPlots::other, PV3DBase< T, PVType, FrameType >::phi(), and position_.

371  {
372  return reco::deltaPhi(static_cast<float>(position_.phi()), static_cast<float>(other.position().phi()));
373  };
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66

◆ energy()

float L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::energy ( ) const
inline

◆ id()

const EBDetId& L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id ( void  ) const
inline

◆ id_iEta()

int L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id_iEta ( )
inline

Definition at line 392 of file L1EGammaCrystalsEmulatorProducer.cc.

References id_, and EBDetId::ieta().

392 { return id_.ieta(); }
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49

◆ id_iPhi()

int L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id_iPhi ( )
inline

Definition at line 393 of file L1EGammaCrystalsEmulatorProducer.cc.

References id_, and EBDetId::iphi().

393 { return id_.iphi(); }
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51

◆ isEndcapHit()

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::isEndcapHit ( ) const
inline

◆ isInCard()

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::isInCard ( int  cc) const
inline

◆ isInCardAndRegion()

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::isInCardAndRegion ( int  cc,
int  nregion 
) const
inline

Definition at line 356 of file L1EGammaCrystalsEmulatorProducer.cc.

References gpuPixelDoublets::cc, PVValHelper::eta, getCrystal_etaID(), getEtaMax_region(), getEtaMin_region(), isInCard(), and position().

356  {
357  bool isInRegionEta = (getCrystal_etaID(position().eta()) < getEtaMax_region(cc, nregion) &&
358  getCrystal_etaID(position().eta()) >= getEtaMin_region(cc, nregion));
359  return (isInCard(cc) && isInRegionEta);
360  }
int getCrystal_etaID(float eta)
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
int getEtaMax_region(int card, int nregion)
int getEtaMin_region(int card, int nregion)

◆ operator==()

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::operator== ( SimpleCaloHit other) const
inline

◆ position()

const GlobalVector& L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::position ( ) const
inline

◆ pt()

float L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::pt ( ) const
inline

◆ setEnergy()

void L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setEnergy ( float  et)
inline

◆ setId()

void L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setId ( const EBDetId id)
inline

◆ setIdHcal()

void L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setIdHcal ( const HcalDetId idhcal)
inline

◆ setIsEndcapHit()

void L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setIsEndcapHit ( bool  isEC)
inline

◆ setPosition()

void L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setPosition ( const GlobalVector pos)
inline

◆ setPt()

void L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setPt ( )
inline

◆ setUsed()

void L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setUsed ( bool  isUsed)
inline

◆ used()

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::used ( ) const
inline

Member Data Documentation

◆ energy_

float L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::energy_ = 0.
private

Definition at line 318 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by energy(), operator==(), setEnergy(), and setPt().

◆ id_

EBDetId L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id_
private

Definition at line 324 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by dieta(), id(), id_iEta(), id_iPhi(), operator==(), and setId().

◆ id_hcal_

HcalDetId L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id_hcal_
private

Definition at line 323 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by setIdHcal().

◆ isEndcapHit_

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::isEndcapHit_ = false
private

◆ position_

GlobalVector L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::position_
private

◆ pt_

float L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::pt_ = 0
private

Definition at line 317 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by pt(), and setPt().

◆ stale_

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::stale_ = false
private

Definition at line 320 of file L1EGammaCrystalsEmulatorProducer.cc.

◆ used_

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::used_ = false
private

Definition at line 321 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by setUsed(), and used().