CMS 3D CMS Logo

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

#include <Phase2L1CaloEGammaUtils.h>

Public Member Functions

int crystaliEta (void) const
 
int crystaliPhi (void) const
 
int crystalLocaliEta (int cc) const
 
int crystalLocaliPhi (int cc) const
 
float energy () const
 
ap_uint< 10 > et_uint () const
 
const EBDetIdid () const
 
bool isInCard (int cc) const
 
const GlobalVectorposition () const
 
void printHitInfo (std::string description="") const
 
float pt () const
 
void setEnergy (float et)
 
void setEt_uint (ap_uint< 10 > et_uint)
 
void setId (const EBDetId &id)
 
void setIdHcal (const HcalDetId &idhcal)
 
void setPosition (const GlobalVector &pos)
 
void setPt ()
 

Private Attributes

float energy_ = 0.
 
ap_uint< 10 > et_uint_
 
EBDetId id_
 
HcalDetId id_hcal_
 
GlobalVector position_
 
float pt_ = 0
 

Detailed Description

Definition at line 259 of file Phase2L1CaloEGammaUtils.h.

Member Function Documentation

◆ crystaliEta()

int p2eg::SimpleCaloHit::crystaliEta ( void  ) const
inline

Definition at line 288 of file Phase2L1CaloEGammaUtils.h.

References p2eg::CRYSTALS_IN_TOWER_ETA, p2eg::ECAL_eta_range, PVValHelper::eta, l1tPhase2CaloJetEmulator_cfi::iEta, createfilelist::int, p2eg::n_towers_Eta, and position().

Referenced by crystalLocaliEta(), and isInCard().

288  {
289  float size_cell = 2 * ECAL_eta_range / (CRYSTALS_IN_TOWER_ETA * n_towers_Eta);
290  int iEta = int((position().eta() + ECAL_eta_range) / size_cell);
291  return iEta;
292  }
static constexpr float ECAL_eta_range
static constexpr int n_towers_Eta
const GlobalVector & position() const
static constexpr int CRYSTALS_IN_TOWER_ETA

◆ crystaliPhi()

int p2eg::SimpleCaloHit::crystaliPhi ( void  ) const
inline

Definition at line 298 of file Phase2L1CaloEGammaUtils.h.

References p2eg::CRYSTALS_IN_TOWER_PHI, createfilelist::int, M_PI, p2eg::n_towers_Phi, PV3DBase< T, PVType, FrameType >::phi(), and position().

Referenced by crystalLocaliPhi(), and isInCard().

298  {
299  float phi = position().phi();
300  float size_cell = 2 * M_PI / (CRYSTALS_IN_TOWER_PHI * n_towers_Phi);
301  int iPhi = int((phi + M_PI) / size_cell);
302  return iPhi;
303  }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
static constexpr int n_towers_Phi
const GlobalVector & position() const
#define M_PI
static constexpr int CRYSTALS_IN_TOWER_PHI

◆ crystalLocaliEta()

int p2eg::SimpleCaloHit::crystalLocaliEta ( int  cc) const
inline

Definition at line 318 of file Phase2L1CaloEGammaUtils.h.

References funct::abs(), gpuPixelDoublets::cc, crystaliEta(), and p2eg::getCard_refCrystal_iEta().

318 { return abs(getCard_refCrystal_iEta(cc) - crystaliEta()); }
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
int getCard_refCrystal_iEta(int cc)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ crystalLocaliPhi()

int p2eg::SimpleCaloHit::crystalLocaliPhi ( int  cc) const
inline

Definition at line 324 of file Phase2L1CaloEGammaUtils.h.

References funct::abs(), gpuPixelDoublets::cc, crystaliPhi(), and p2eg::getCard_refCrystal_iPhi().

324 { return abs(getCard_refCrystal_iPhi(cc) - crystaliPhi()); }
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int getCard_refCrystal_iPhi(int cc)

◆ energy()

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

Definition at line 278 of file Phase2L1CaloEGammaUtils.h.

References energy_.

Referenced by Jet.Jet::rawEnergy().

278 { return energy_; };

◆ et_uint()

ap_uint<10> p2eg::SimpleCaloHit::et_uint ( ) const
inline

Definition at line 279 of file Phase2L1CaloEGammaUtils.h.

References et_uint_.

Referenced by setEt_uint().

279 { return et_uint_; };

◆ id()

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

Definition at line 281 of file Phase2L1CaloEGammaUtils.h.

References id_.

Referenced by setId().

281 { return id_; };

◆ isInCard()

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

◆ position()

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

Definition at line 280 of file Phase2L1CaloEGammaUtils.h.

References position_.

Referenced by crystaliEta(), crystaliPhi(), and printHitInfo().

280 { return position_; };

◆ printHitInfo()

void p2eg::SimpleCaloHit::printHitInfo ( std::string  description = "") const
inline

Definition at line 329 of file Phase2L1CaloEGammaUtils.h.

References gather_cfg::cout, makeListRunsInFiles::description, PV3DBase< T, PVType, FrameType >::eta(), PV3DBase< T, PVType, FrameType >::phi(), position(), and pt().

329  {
330  std::cout << "[printHitInfo]: [" << description << "]"
331  << " hit with energy " << pt() << " at eta " << position().eta() << ", phi " << position().phi()
332  << std::endl;
333  }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
T eta() const
Definition: PV3DBase.h:73
const GlobalVector & position() const

◆ pt()

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

◆ setEnergy()

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

◆ setEt_uint()

void p2eg::SimpleCaloHit::setEt_uint ( ap_uint< 10 >  et_uint)
inline

Definition at line 272 of file Phase2L1CaloEGammaUtils.h.

References et_uint(), and et_uint_.

Referenced by Phase2L1CaloEGammaEmulator::produce().

272 { et_uint_ = et_uint; }
ap_uint< 10 > et_uint() const

◆ setId()

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

Definition at line 275 of file Phase2L1CaloEGammaUtils.h.

References id(), and id_.

Referenced by Phase2L1CaloEGammaEmulator::produce().

275 { id_ = id; };
const EBDetId & id() const

◆ setIdHcal()

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

Definition at line 274 of file Phase2L1CaloEGammaUtils.h.

References id_hcal_.

Referenced by Phase2L1CaloEGammaEmulator::produce().

274 { id_hcal_ = idhcal; };

◆ setPosition()

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

Definition at line 273 of file Phase2L1CaloEGammaUtils.h.

References position_.

Referenced by Phase2L1CaloEGammaEmulator::produce().

273 { position_ = pos; };

◆ setPt()

void p2eg::SimpleCaloHit::setPt ( )
inline

Definition at line 270 of file Phase2L1CaloEGammaUtils.h.

References energy_, PV3DBase< T, PVType, FrameType >::mag2(), position_, pt_, funct::sin(), and PV3DBase< T, PVType, FrameType >::theta().

Referenced by Phase2L1CaloEGammaEmulator::produce().

270 { pt_ = (position_.mag2() > 0) ? energy_ * sin(position_.theta()) : 0; };
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
T mag2() const
Definition: PV3DBase.h:63
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72

Member Data Documentation

◆ energy_

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

Definition at line 262 of file Phase2L1CaloEGammaUtils.h.

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

◆ et_uint_

ap_uint<10> p2eg::SimpleCaloHit::et_uint_
private

Definition at line 263 of file Phase2L1CaloEGammaUtils.h.

Referenced by et_uint(), and setEt_uint().

◆ id_

EBDetId p2eg::SimpleCaloHit::id_
private

Definition at line 266 of file Phase2L1CaloEGammaUtils.h.

Referenced by id(), and setId().

◆ id_hcal_

HcalDetId p2eg::SimpleCaloHit::id_hcal_
private

Definition at line 265 of file Phase2L1CaloEGammaUtils.h.

Referenced by setIdHcal().

◆ position_

GlobalVector p2eg::SimpleCaloHit::position_
private

Definition at line 264 of file Phase2L1CaloEGammaUtils.h.

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

◆ pt_

float p2eg::SimpleCaloHit::pt_ = 0
private

Definition at line 261 of file Phase2L1CaloEGammaUtils.h.

Referenced by pt(), and setPt().