Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:40

0001 ///////////////////////////////////////////////////////////////////////////////
0002 // File: CaloHit.cc
0003 // Description: Temporary Hit class for QIE Analysis
0004 ///////////////////////////////////////////////////////////////////////////////
0005 #include "SimDataFormats/CaloHit/interface/CaloHit.h"
0006 
0007 #include <iomanip>
0008 
0009 CaloHit::CaloHit(int deti, int layi, double ei, double etai, double fi, double timi, uint32_t idi)
0010     : deth(deti), layerh(layi), eh(ei), etah(etai), phih(fi), timeh(timi), idh(idi) {}
0011 
0012 CaloHit::CaloHit() : deth(0), layerh(0), eh(0), etah(0), phih(0), timeh(0), idh(0) {}
0013 
0014 CaloHit::~CaloHit() {}
0015 
0016 bool CaloHit::operator<(const CaloHit& hit) const {
0017   return (eh / cosh(etah) < hit.e() / cosh(hit.eta())) ? false : true;
0018 }
0019 
0020 std::ostream& operator<<(std::ostream& os, const CaloHit& hit) {
0021   os << "E " << std::setw(6) << hit.e() << " eta " << std::setw(6) << hit.eta() << " phi " << std::setw(6) << hit.phi()
0022      << " t " << std::setw(6) << hit.t() << " layer " << hit.layer() << " det " << hit.det() << " id 0x" << std::hex
0023      << hit.id() << std::dec;
0024   return os;
0025 }