00001 #include "PhotonEventResult.h" 00002 #include "MessageService/MsgService.h" 00003 #include "Conventions/Munits.h" 00004 #include "TString.h" 00005 00006 ClassImp(PhotonEventResult) 00007 00008 PhotonEventResult::PhotonEventResult() : 00009 TNamed("PhotonEventResult","PhotonTransport Event Statistics") 00010 { 00011 Reset(); 00012 } 00013 00014 PhotonEventResult::PhotonEventResult(const PhotonEventResult& rhs) : 00015 TNamed("PhotonEventResult","PhotonTransport Event Statistics") 00016 { 00017 (*this)=rhs; 00018 } 00019 00020 void PhotonEventResult::operator=(const PhotonEventResult& rhs) 00021 { 00022 totalHits = rhs.totalHits; 00023 totalHitEnergy = rhs.totalHitEnergy; 00024 totalStripsHit = rhs.totalStripsHit; 00025 hitsDiscardedGeom = rhs.hitsDiscardedGeom; 00026 hitsDiscardedBad = rhs.hitsDiscardedBad; 00027 energyDiscardedGeom = rhs.energyDiscardedGeom; 00028 energyDiscardedBad = rhs.energyDiscardedBad; 00029 bluePhotons = rhs.bluePhotons; 00030 greenPhotons = rhs.greenPhotons; 00031 bluePhotons_nonprescaled = rhs.bluePhotons_nonprescaled; 00032 greenPhotons_nonprescaled = rhs.greenPhotons_nonprescaled; 00033 totalPE = rhs.totalPE; 00034 noisePE = rhs.noisePE; 00035 afterpulsePE = rhs.afterpulsePE; 00036 totalPixels = rhs.totalPixels; 00037 } 00038 00039 void 00040 PhotonEventResult::Reset() 00041 { 00042 totalHits =0; 00043 totalHitEnergy =0; 00044 totalStripsHit =0; 00045 hitsDiscardedGeom =0; 00046 hitsDiscardedBad =0; 00047 energyDiscardedGeom =0; 00048 energyDiscardedBad =0; 00049 bluePhotons =0; 00050 greenPhotons =0; 00051 bluePhotons_nonprescaled =0; 00052 greenPhotons_nonprescaled =0; 00053 totalPE =0; 00054 noisePE =0; 00055 afterpulsePE =0; 00056 totalPixels =0; 00057 fStripsHit.clear(); 00058 fPixelsHit.clear(); 00059 } 00060 00061 00062 ostream& operator<<(ostream& os, const PhotonEventResult& r) 00063 { return r.FormatToOStream(os); } 00064 00065 void PhotonEventResult::Print(Option_t *option) const 00066 { 00067 FormatToOStream(std::cout,option); 00068 } 00069 00070 00071 std::ostream& PhotonEventResult::FormatToOStream(std::ostream& os, 00072 Option_t*) const 00073 { 00074 os << "PhotonEventResult: " << endl 00075 << " Total Scint Hits: " << totalHits << endl 00076 << " Total Hit Energy: " << totalHitEnergy/Munits::MeV << " MeV" << endl 00077 << " Total Strips Hit: " << totalStripsHit << endl 00078 << " Hits Discarded (bad geom) " << hitsDiscardedGeom << endl 00079 << " Hits Discarded (bad hit) " << hitsDiscardedBad << endl 00080 << " Energy Discarded (bad geom) " << energyDiscardedGeom/Munits::MeV << " MeV" << endl 00081 << " Energy Discarded (bad hit) " << energyDiscardedBad/Munits::MeV << " MeV" << endl 00082 << " Number of Blue Photons: " << bluePhotons << " (pre: " << 00083 bluePhotons_nonprescaled << ")" << endl 00084 << " Number of Green Photons: " << greenPhotons << " (pre: " << 00085 greenPhotons_nonprescaled << ")" << endl 00086 << " Number of PE: " << totalPE << endl 00087 << " Number of noise PE: " << noisePE << endl 00088 << " Number of afterpulse PE: " << afterpulsePE << endl 00089 << " Pixels hit: " << totalPixels << endl; 00090 00091 return os; 00092 } 00093