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 diphi (SimpleCaloHit &other) const
 
float distanceTo (SimpleCaloHit &other) const
 
float dphi (SimpleCaloHit &other) const
 
float energy () const
 
const EBDetIdid () const
 
bool isEndcapHit () 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 274 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 303 of file L1EGammaCrystalsEmulatorProducer.cc.

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

303  {
304  if (isEndcapHit_ || other.isEndcapHit())
305  return 9999; // We shouldn't compare integer indices in endcap, the map is not linear
306  if (id_.ieta() * other.id().ieta() > 0)
307  return id_.ieta() - other.id().ieta();
308  return id_.ieta() - other.id().ieta() - 1;
309  };
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49

◆ diphi()

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

Definition at line 313 of file L1EGammaCrystalsEmulatorProducer.cc.

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

313  {
314  if (isEndcapHit_ || other.isEndcapHit())
315  return 9999; // We shouldn't compare integer indices in endcap, the map is not linear
316  // Logic from EBDetId::distancePhi() without the abs()
317  static constexpr int PI = 180;
318  int result = id().iphi() - other.id().iphi();
319  while (result > PI)
320  result -= 2 * PI;
321  while (result <= -PI)
322  result += 2 * PI;
323  return result;
324  };
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51
#define PI
Definition: QcdUeDQM.h:37

◆ distanceTo()

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

Definition at line 325 of file L1EGammaCrystalsEmulatorProducer.cc.

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

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

◆ dphi()

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

Definition at line 310 of file L1EGammaCrystalsEmulatorProducer.cc.

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

310  {
311  return reco::deltaPhi(static_cast<float>(position_.phi()), static_cast<float>(other.position().phi()));
312  };
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

◆ isEndcapHit()

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

◆ 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 277 of file L1EGammaCrystalsEmulatorProducer.cc.

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

◆ id_

EBDetId L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id_
private

Definition at line 283 of file L1EGammaCrystalsEmulatorProducer.cc.

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

◆ id_hcal_

HcalDetId L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id_hcal_
private

Definition at line 282 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by setIdHcal().

◆ isEndcapHit_

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::isEndcapHit_ = false
private

◆ position_

GlobalVector L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::position_
private

Definition at line 281 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by deta(), dphi(), position(), setEnergy(), setPosition(), and setPt().

◆ pt_

float L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::pt_ = 0
private

Definition at line 276 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by pt(), and setPt().

◆ stale_

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::stale_ = false
private

Definition at line 279 of file L1EGammaCrystalsEmulatorProducer.cc.

◆ used_

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::used_ = false
private

Definition at line 280 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by setUsed(), and used().