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

Member Function Documentation

◆ deta()

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

Definition at line 305 of file L1EGammaCrystalsEmulatorProducer.cc.

305 { 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 306 of file L1EGammaCrystalsEmulatorProducer.cc.

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  };

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

◆ diphi()

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

Definition at line 316 of file L1EGammaCrystalsEmulatorProducer.cc.

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  };

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

◆ distanceTo()

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

Definition at line 328 of file L1EGammaCrystalsEmulatorProducer.cc.

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  };

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

◆ dphi()

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

Definition at line 313 of file L1EGammaCrystalsEmulatorProducer.cc.

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

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

◆ energy()

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

Definition at line 299 of file L1EGammaCrystalsEmulatorProducer.cc.

299 { return energy_; };

References energy_.

Referenced by Jet.Jet::rawEnergy().

◆ id()

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

Definition at line 303 of file L1EGammaCrystalsEmulatorProducer.cc.

303 { return id_; };

References id_.

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

◆ isEndcapHit()

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

Definition at line 300 of file L1EGammaCrystalsEmulatorProducer.cc.

300 { return isEndcapHit_; };

References isEndcapHit_.

◆ operator==()

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

Definition at line 333 of file L1EGammaCrystalsEmulatorProducer.cc.

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

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

◆ position()

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

Definition at line 302 of file L1EGammaCrystalsEmulatorProducer.cc.

302 { 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 296 of file L1EGammaCrystalsEmulatorProducer.cc.

296 { id_ = id; };

References id(), and id_.

Referenced by L1EGCrystalClusterEmulatorProducer::produce().

◆ setIdHcal()

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

Definition at line 295 of file L1EGammaCrystalsEmulatorProducer.cc.

295 { id_hcal_ = idhcal; };

References id_hcal_.

Referenced by L1EGCrystalClusterEmulatorProducer::produce().

◆ setIsEndcapHit()

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

Definition at line 292 of file L1EGammaCrystalsEmulatorProducer.cc.

292 { isEndcapHit_ = isEC; };

References isEndcapHit_.

◆ setPosition()

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

Definition at line 294 of file L1EGammaCrystalsEmulatorProducer.cc.

294 { 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 293 of file L1EGammaCrystalsEmulatorProducer.cc.

293 { used_ = isUsed; };

References used_.

◆ used()

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

Definition at line 301 of file L1EGammaCrystalsEmulatorProducer.cc.

301 { return used_; };

References used_.

Member Data Documentation

◆ energy_

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

Definition at line 280 of file L1EGammaCrystalsEmulatorProducer.cc.

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

◆ id_

EBDetId L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id_
private

Definition at line 286 of file L1EGammaCrystalsEmulatorProducer.cc.

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

◆ id_hcal_

HcalDetId L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id_hcal_
private

Definition at line 285 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by setIdHcal().

◆ isEndcapHit_

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::isEndcapHit_ = false
private

◆ position_

GlobalVector L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::position_
private

Definition at line 284 of file L1EGammaCrystalsEmulatorProducer.cc.

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

◆ pt_

float L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::pt_ = 0
private

Definition at line 279 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by pt(), and setPt().

◆ stale_

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::stale_ = false
private

Definition at line 282 of file L1EGammaCrystalsEmulatorProducer.cc.

◆ used_

bool L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::used_ = false
private

Definition at line 283 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by setUsed(), and used().

L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::energy_
float energy_
Definition: L1EGammaCrystalsEmulatorProducer.cc:280
PI
Definition: PayloadInspector.h:19
EBDetId::ieta
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49
L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::position_
GlobalVector position_
Definition: L1EGammaCrystalsEmulatorProducer.cc:284
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:285
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:279
L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::position
const GlobalVector & position() const
Definition: L1EGammaCrystalsEmulatorProducer.cc:302
L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id_
EBDetId id_
Definition: L1EGammaCrystalsEmulatorProducer.cc:286
trackingPlots.other
other
Definition: trackingPlots.py:1465
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::used_
bool used_
Definition: L1EGammaCrystalsEmulatorProducer.cc:283
L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::isEndcapHit_
bool isEndcapHit_
Definition: L1EGammaCrystalsEmulatorProducer.cc:281
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:303
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id
const EBDetId & id() const
Definition: L1EGammaCrystalsEmulatorProducer.cc:303