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

Member Function Documentation

◆ deta()

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

Definition at line 304 of file L1EGammaCrystalsEmulatorProducer.cc.

304 { return position_.eta() - other.position().eta(); };

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

◆ dieta()

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

Definition at line 305 of file L1EGammaCrystalsEmulatorProducer.cc.

305  {
306  if (isEndcapHit_ || other.isEndcapHit())
307  return 9999; // We shouldn't compare integer indices in endcap, the map is not linear
308  if (id_.ieta() * other.id().ieta() > 0)
309  return id_.ieta() - other.id().ieta();
310  return id_.ieta() - other.id().ieta() - 1;
311  };

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

◆ diphi()

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

Definition at line 315 of file L1EGammaCrystalsEmulatorProducer.cc.

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

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

◆ distanceTo()

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

Definition at line 327 of file L1EGammaCrystalsEmulatorProducer.cc.

327  {
328  // Treat position as a point, measure 3D distance
329  // This is used for endcap hits, where we don't have a rectangular mapping
330  return (position() - other.position()).mag();
331  };

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

◆ dphi()

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

Definition at line 312 of file L1EGammaCrystalsEmulatorProducer.cc.

312  {
313  return reco::deltaPhi(static_cast<float>(position_.phi()), static_cast<float>(other.position().phi()));
314  };

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

◆ energy()

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

Definition at line 298 of file L1EGammaCrystalsEmulatorProducer.cc.

298 { return energy_; };

References energy_.

Referenced by Jet.Jet::rawEnergy().

◆ id()

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

Definition at line 302 of file L1EGammaCrystalsEmulatorProducer.cc.

302 { return id_; };

References id_.

Referenced by diphi(), L1EGCrystalClusterEmulatorProducer::produce(), and setId().

◆ isEndcapHit()

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

Definition at line 299 of file L1EGammaCrystalsEmulatorProducer.cc.

299 { return isEndcapHit_; };

References isEndcapHit_.

◆ operator==()

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

Definition at line 332 of file L1EGammaCrystalsEmulatorProducer.cc.

332  {
333  return (id_ == other.id() && position() == other.position() && energy_ == other.energy() &&
334  isEndcapHit_ == other.isEndcapHit());
335  };

References energy_, id_, isEndcapHit_, trackingPlots::other, and position().

◆ position()

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

Definition at line 301 of file L1EGammaCrystalsEmulatorProducer.cc.

301 { return position_; };

References position_.

Referenced by distanceTo(), operator==(), and L1EGCrystalClusterEmulatorProducer::produce().

◆ pt()

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

◆ setEnergy()

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

◆ setId()

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

Definition at line 295 of file L1EGammaCrystalsEmulatorProducer.cc.

295 { id_ = id; };

References id(), and id_.

Referenced by L1EGCrystalClusterEmulatorProducer::produce().

◆ setIdHcal()

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

Definition at line 294 of file L1EGammaCrystalsEmulatorProducer.cc.

294 { id_hcal_ = idhcal; };

References id_hcal_.

Referenced by L1EGCrystalClusterEmulatorProducer::produce().

◆ setIsEndcapHit()

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

Definition at line 291 of file L1EGammaCrystalsEmulatorProducer.cc.

291 { isEndcapHit_ = isEC; };

References isEndcapHit_.

◆ setPosition()

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

Definition at line 293 of file L1EGammaCrystalsEmulatorProducer.cc.

293 { position_ = pos; };

References position_.

Referenced by L1EGCrystalClusterEmulatorProducer::produce().

◆ setPt()

void L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setPt ( )
inline

◆ setUsed()

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

Definition at line 292 of file L1EGammaCrystalsEmulatorProducer.cc.

292 { used_ = isUsed; };

References used_.

◆ used()

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

Definition at line 300 of file L1EGammaCrystalsEmulatorProducer.cc.

300 { return used_; };

References used_.

Member Data Documentation

◆ energy_

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

Definition at line 279 of file L1EGammaCrystalsEmulatorProducer.cc.

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

◆ id_

EBDetId L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id_
private

Definition at line 285 of file L1EGammaCrystalsEmulatorProducer.cc.

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

◆ id_hcal_

HcalDetId L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id_hcal_
private

Definition at line 284 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by setIdHcal().

◆ isEndcapHit_

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::isEndcapHit_ = false
private

◆ position_

GlobalVector L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::position_
private

Definition at line 283 of file L1EGammaCrystalsEmulatorProducer.cc.

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

◆ pt_

float L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::pt_ = 0
private

Definition at line 278 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by pt(), and setPt().

◆ stale_

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::stale_ = false
private

Definition at line 281 of file L1EGammaCrystalsEmulatorProducer.cc.

◆ used_

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::used_ = false
private

Definition at line 282 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by setUsed(), and used().

L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::energy_
float energy_
Definition: L1EGammaCrystalsEmulatorProducer.cc:279
PI
Definition: PayloadInspector.h:20
EBDetId::ieta
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49
L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::position_
GlobalVector position_
Definition: L1EGammaCrystalsEmulatorProducer.cc:283
PI
#define PI
Definition: QcdUeDQM.h:37
reco::deltaPhi
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
PV3DBase::theta
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
pos
Definition: PixelAliasList.h:18
L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id_hcal_
HcalDetId id_hcal_
Definition: L1EGammaCrystalsEmulatorProducer.cc:284
PV3DBase::mag2
T mag2() const
Definition: PV3DBase.h:63
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::pt_
float pt_
Definition: L1EGammaCrystalsEmulatorProducer.cc:278
L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::position
const GlobalVector & position() const
Definition: L1EGammaCrystalsEmulatorProducer.cc:301
L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id_
EBDetId id_
Definition: L1EGammaCrystalsEmulatorProducer.cc:285
trackingPlots.other
other
Definition: trackingPlots.py:1467
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::used_
bool used_
Definition: L1EGammaCrystalsEmulatorProducer.cc:282
L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::isEndcapHit_
bool isEndcapHit_
Definition: L1EGammaCrystalsEmulatorProducer.cc:280
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
EBDetId::iphi
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51
mps_fire.result
result
Definition: mps_fire.py:311
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id
const EBDetId & id() const
Definition: L1EGammaCrystalsEmulatorProducer.cc:302