/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
SimDataFormats/CaloHit/interface/PCaloHit.h
82 строки
3 KB
Matti Kortelainen
Move stored types in io_v1 namespace, reset class versions to 3
22 май 2026, 18:18
22 май 2026, 18:18
909f324
Код
Авторство
О чём код?
#ifndef SimDataFormats_PCaloHit_H #define SimDataFormats_PCaloHit_H #include "SimDataFormats/EncodedEventId/interface/EncodedEventId.h" #include <iosfwd> // Persistent Calorimeter hit namespace io_v1 { class PCaloHit { public: PCaloHit(float e = 0., float t = 0., int i = 0, float emFraction = 1., uint16_t d = 0) : myEnergy(e), myEMFraction(emFraction), myTime(t), myItra(i), myDepth(d) {} PCaloHit(unsigned int id, float e = 0., float t = 0., int i = 0, float emFraction = 1., uint16_t d = 0) : myEnergy(e), myEMFraction(emFraction), myTime(t), myItra(i), detId(id), myDepth(d) {} PCaloHit(float eEM, float eHad, float t, int i = 0, uint16_t d = 0); PCaloHit(unsigned int id, float eEM, float eHad, float t, int i = 0, uint16_t d = 0); //Names static const char *name() { return "Hit"; } const char *getName() const { return name(); } //Energy deposit of the Hit double energy() const { return myEnergy; } double energyEM() const { return myEMFraction * myEnergy; } double energyHad() const { return (1. - myEMFraction) * myEnergy; } void setEnergy(double e) { myEnergy = e; } //Time of the deposit double time() const { return myTime; } //Geant track number int geantTrackId() const { return myItra; } //DetId where the Hit is recorded void setID(unsigned int id) { detId = id; } unsigned int id() const { return detId; } //Encoded depth in the detector //for ECAL: # radiation length, 30 == APD //for HCAL: void setDepth(uint16_t depth) { myDepth = depth; } uint16_t depth() const { return myDepth; } //Event Id (for signal/pileup discrimination) void setEventId(EncodedEventId e) { theEventId = e; } EncodedEventId eventId() const { return theEventId; } // new method used by the new transient CF void setTime(float t) { myTime = t; } //Comparisons bool operator<(const PCaloHit &d) const { return myEnergy < d.myEnergy; } //Same Hit (by value) bool operator==(const PCaloHit &d) const { return (myEnergy == d.myEnergy && detId == d.detId); } static const int kEcalDepthIdMask = 0x3; static const int kEcalDepthMask = 0x1FFF; static const int kEcalDepthOffset = 3; static const int kEcalDepthRefz = 0X4; protected: float myEnergy; float myEMFraction; float myTime; int myItra; unsigned int detId; uint16_t myDepth; EncodedEventId theEventId; }; std::ostream &operator<<(std::ostream &, const PCaloHit &); } // namespace io_v1 using PCaloHit = io_v1::PCaloHit; #endif // _SimDataFormats_SimCaloHit_PCaloHit_h_