Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-17 09:55:58

0001 /** @struct sipm::SiPMDebugInfo SimSiPM/SimSiPM/SiPMDebugInfo.h SiPMDebugInfo.h
0002  *
0003  *  @brief Stores MC-Truth informations.
0004  *
0005  *  This class is used to store some MC-Truth informations about the generated
0006  *  event for debug purposes.
0007  *
0008  *  @author Edoardo Proserpio
0009  *  @date 2020
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;        ///< Number of photons given as input.
0025   uint32_t nPhotoelectrons; ///< Number of photoelectrons (hitted cells).
0026   uint32_t nDcr;            ///< Number of DCR events generated.
0027   uint32_t nXt;             ///< Number of XT events generated.
0028   uint32_t nDXt;            ///< Number of delayed XT events generated.
0029   uint32_t nAp;             ///< Number of AP events generated.
0030   friend std::ostream& operator<< (std::ostream&, const SiPMDebugInfo&);
0031 };
0032 
0033 /** @brief Constructor of SiPMDebugInfo */
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 } /* namespace sipm */
0050 #endif /* SIPM_SIPMDEBUGINFO_H */