CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 277 of file L1EGammaCrystalsEmulatorProducer.cc.

Member Function Documentation

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

Definition at line 305 of file L1EGammaCrystalsEmulatorProducer.cc.

References PV3DBase< T, PVType, FrameType >::eta(), position(), and position_.

305 { return position_.eta() - other.position().eta(); };
T eta() const
Definition: PV3DBase.h:73
int L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::dieta ( SimpleCaloHit other) const
inline

Definition at line 306 of file L1EGammaCrystalsEmulatorProducer.cc.

References id(), id_, EBDetId::ieta(), isEndcapHit(), and isEndcapHit_.

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

Definition at line 316 of file L1EGammaCrystalsEmulatorProducer.cc.

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

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

Definition at line 328 of file L1EGammaCrystalsEmulatorProducer.cc.

References mag(), and position().

328  {
329  // Treat position as a point, measure 3D distance
330  // This is used for endcap hits, where we don't have a rectangular mapping
331  return (position() - other.position()).mag();
332  };
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
float L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::dphi ( SimpleCaloHit other) const
inline

Definition at line 313 of file L1EGammaCrystalsEmulatorProducer.cc.

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

313  {
314  return reco::deltaPhi(static_cast<float>(position_.phi()), static_cast<float>(other.position().phi()));
315  };
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
float L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::energy ( ) const
inline
const EBDetId& L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id ( void  ) const
inline
bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::isEndcapHit ( ) const
inline
bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::operator== ( SimpleCaloHit other) const
inline
const GlobalVector& L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::position ( ) const
inline
float L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::pt ( ) const
inline
void L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setEnergy ( float  et)
inline
void L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setId ( const EBDetId id)
inline
void L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setIdHcal ( const HcalDetId idhcal)
inline
void L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setIsEndcapHit ( bool  isEC)
inline
void L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setPosition ( const GlobalVector pos)
inline
void L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setPt ( )
inline
void L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setUsed ( bool  isUsed)
inline
bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::used ( ) const
inline

Member Data Documentation

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

Definition at line 280 of file L1EGammaCrystalsEmulatorProducer.cc.

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

EBDetId L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id_
private

Definition at line 286 of file L1EGammaCrystalsEmulatorProducer.cc.

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

HcalDetId L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id_hcal_
private

Definition at line 285 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by setIdHcal().

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::isEndcapHit_ = false
private
GlobalVector L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::position_
private

Definition at line 284 of file L1EGammaCrystalsEmulatorProducer.cc.

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

float L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::pt_ = 0
private

Definition at line 279 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by pt(), and setPt().

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::stale_ = false
private

Definition at line 282 of file L1EGammaCrystalsEmulatorProducer.cc.

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::used_ = false
private

Definition at line 283 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by setUsed(), and used().