File indexing completed on 2025-01-17 09:55:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef SIPM_SIPMDEBUGINFO_H
0013 #define SIPM_SIPMDEBUGINFO_H
0014
0015 #include <iomanip>
0016 #include <iostream>
0017 #include <stdint.h>
0018
0019 namespace sipm {
0020
0021 struct SiPMDebugInfo {
0022 SiPMDebugInfo() = default;
0023 inline SiPMDebugInfo(uint32_t, uint32_t, uint32_t, uint32_t,uint32_t, uint32_t) noexcept;
0024 uint32_t nPhotons;
0025 uint32_t nPhotoelectrons;
0026 uint32_t nDcr;
0027 uint32_t nXt;
0028 uint32_t nDXt;
0029 uint32_t nAp;
0030 friend std::ostream& operator<< (std::ostream&, const SiPMDebugInfo&);
0031 };
0032
0033
0034 inline SiPMDebugInfo::SiPMDebugInfo(uint32_t aPh, uint32_t aPe, uint32_t aDcr, uint32_t aXt, uint32_t aDXt, uint32_t aAp) noexcept
0035 : nPhotons(aPh), nPhotoelectrons(aPe), nDcr(aDcr), nXt(aXt), nDXt(aDXt), nAp(aAp) {}
0036
0037 inline std::ostream& operator<< (std::ostream& out, const SiPMDebugInfo& obj){
0038 out << std::setprecision(2)<<std::fixed;
0039 out << "Address :"<<std::addressof(obj)<<"\n";
0040 out << "===> SiPM Debug Info <===\n";
0041 out << "Number of photons arrived to the sensor: " << obj.nPhotons << "\n";
0042 out << "Number of photons detected (photoelectrons): " << obj.nPhotoelectrons << "\n";
0043 out << "Number of dark count events (DCR): " << obj.nDcr << "\n";
0044 out << "Number of optical crosstalk events (XT): " << obj.nXt << "\n";
0045 out << "Number of delayed optical crosstalk events (DXT): " << obj.nDXt << "\n";
0046 out << "Number of afterpulsing events (AP): " << obj.nAp << "\n";
0047 return out;
0048 }
0049 }
0050 #endif