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 263 of file Phase2L1CaloEGammaUtils.h.

Member Function Documentation

◆ crystaliEta()

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

Definition at line 292 of file Phase2L1CaloEGammaUtils.h.

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

Referenced by crystalLocaliEta(), and isInCard().

292  {
293  float size_cell = 2 * ECAL_eta_range / (CRYSTALS_IN_TOWER_ETA * n_towers_Eta);
294  int iEta = int((position().eta() + ECAL_eta_range) / size_cell);
295  return iEta;
296  }
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 302 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().

302  {
303  float phi = position().phi();
304  float size_cell = 2 * M_PI / (CRYSTALS_IN_TOWER_PHI * n_towers_Phi);
305  int iPhi = int((phi + M_PI) / size_cell);
306  return iPhi;
307  }
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 322 of file Phase2L1CaloEGammaUtils.h.

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

322 { 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 328 of file Phase2L1CaloEGammaUtils.h.

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

328 { 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 282 of file Phase2L1CaloEGammaUtils.h.

References energy_.

Referenced by Jet.Jet::rawEnergy().

282 { return energy_; };

◆ et_uint()

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

Definition at line 283 of file Phase2L1CaloEGammaUtils.h.

References et_uint_.

Referenced by setEt_uint().

283 { return et_uint_; };

◆ id()

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

Definition at line 285 of file Phase2L1CaloEGammaUtils.h.

References id_.

Referenced by setId().

285 { return id_; };

◆ isInCard()

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

◆ position()

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

Definition at line 284 of file Phase2L1CaloEGammaUtils.h.

References position_.

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

284 { return position_; };

◆ printHitInfo()

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

Definition at line 333 of file Phase2L1CaloEGammaUtils.h.

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

333  {
334  std::cout << "[printHitInfo]: [" << description << "]"
335  << " hit with energy " << pt() << " at eta " << position().eta() << ", phi " << position().phi()
336  << std::endl;
337  }
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 276 of file Phase2L1CaloEGammaUtils.h.

References et_uint(), and et_uint_.

Referenced by Phase2L1CaloEGammaEmulator::produce().

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

◆ setId()

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

Definition at line 279 of file Phase2L1CaloEGammaUtils.h.

References id(), and id_.

Referenced by Phase2L1CaloEGammaEmulator::produce().

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

◆ setIdHcal()

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

Definition at line 278 of file Phase2L1CaloEGammaUtils.h.

References id_hcal_.

Referenced by Phase2L1CaloEGammaEmulator::produce().

278 { id_hcal_ = idhcal; };

◆ setPosition()

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

Definition at line 277 of file Phase2L1CaloEGammaUtils.h.

References position_.

Referenced by Phase2L1CaloEGammaEmulator::produce().

277 { position_ = pos; };

◆ setPt()

void p2eg::SimpleCaloHit::setPt ( )
inline

Definition at line 274 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().

274 { 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 266 of file Phase2L1CaloEGammaUtils.h.

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

◆ et_uint_

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

Definition at line 267 of file Phase2L1CaloEGammaUtils.h.

Referenced by et_uint(), and setEt_uint().

◆ id_

EBDetId p2eg::SimpleCaloHit::id_
private

Definition at line 270 of file Phase2L1CaloEGammaUtils.h.

Referenced by id(), and setId().

◆ id_hcal_

HcalDetId p2eg::SimpleCaloHit::id_hcal_
private

Definition at line 269 of file Phase2L1CaloEGammaUtils.h.

Referenced by setIdHcal().

◆ position_

GlobalVector p2eg::SimpleCaloHit::position_
private

Definition at line 268 of file Phase2L1CaloEGammaUtils.h.

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

◆ pt_

float p2eg::SimpleCaloHit::pt_ = 0
private

Definition at line 265 of file Phase2L1CaloEGammaUtils.h.

Referenced by pt(), and setPt().