diff --git a/sbnobj/SBND/CRT/CMakeLists.txt b/sbnobj/SBND/CRT/CMakeLists.txt index 17cc6734..4b8193b8 100644 --- a/sbnobj/SBND/CRT/CMakeLists.txt +++ b/sbnobj/SBND/CRT/CMakeLists.txt @@ -7,6 +7,7 @@ cet_make_library( CRTStripHit.cxx CRTTrack.cxx CRTVeto.cxx + CRTBlob.cxx FEBData.cxx FEBTruthInfo.cxx LIBRARIES diff --git a/sbnobj/SBND/CRT/CRTBlob.cxx b/sbnobj/SBND/CRT/CRTBlob.cxx new file mode 100644 index 00000000..fcb2cde8 --- /dev/null +++ b/sbnobj/SBND/CRT/CRTBlob.cxx @@ -0,0 +1,55 @@ +#ifndef SBND_CRTBLOB_CXX +#define SBND_CRTBLOB_CXX + +#include "sbnobj/SBND/CRT/CRTBlob.hh" + +namespace sbnd { + + namespace crt { + + CRTBlob::CRTBlob() + : fTs0 (0.) + , fTs0Err (0.) + , fTs1 (0.) + , fTs1Err (0.) + , fPE (0.) + , fTaggerSPs ({}) + {} + + CRTBlob::CRTBlob(const double &_ts0, const double &_ets0, const double &_ts1, const double &_ets1, + const double &_pe, const std::map &_tagger_hits) + : fTs0 (_ts0) + , fTs0Err (_ets0) + , fTs1 (_ts1) + , fTs1Err (_ets1) + , fPE (_pe) + , fTaggerSPs (_tagger_hits) + {} + + CRTBlob::~CRTBlob() {} + + double CRTBlob::Ts0() const {return fTs0; } + double CRTBlob::Ts0Err() const { return fTs0Err; } + double CRTBlob::Ts1() const {return fTs1; } + double CRTBlob::Ts1Err() const { return fTs1Err; } + double CRTBlob::PE() const { return fPE; } + std::map CRTBlob::TaggerSPs() const { return fTaggerSPs; } + + int CRTBlob::TotalSpacePoints() const + { + int total = 0; + + for(auto const& [ tagger, count ] : fTaggerSPs) + total += count; + + return total; + } + + int CRTBlob::SpacePointsInTagger(const CRTTagger tagger) const + { + return fTaggerSPs.at(tagger); + } + } +} + +#endif diff --git a/sbnobj/SBND/CRT/CRTBlob.hh b/sbnobj/SBND/CRT/CRTBlob.hh new file mode 100644 index 00000000..07bb792c --- /dev/null +++ b/sbnobj/SBND/CRT/CRTBlob.hh @@ -0,0 +1,49 @@ +/** + * \class CRTBlob + * + * \brief Product to store a blob of CRT activity across all walls + * + * \author Henry Lay (h.lay@sheffield.ac.uk) + * + */ + +#ifndef SBND_CRTBLOB_HH +#define SBND_CRTBLOB_HH + +#include "sbnobj/SBND/CRT/CRTEnums.hh" + +#include + +namespace sbnd::crt { + + class CRTBlob { + + double fTs0; // average time according to T0 clock [ns] + double fTs0Err; // error on average time according to T0 clock [ns] + double fTs1; // average time according to T1 clock [ns] + double fTs1Err; // error on average time according to T1 clock [ns] + double fPE; // total PE + std::map fTaggerSPs; // how many spacepoints from each tagger contribute to the blob + + public: + + CRTBlob(); + + CRTBlob(const double &_ts0, const double &_ets0, const double &_ts1, const double &_ets1, const double &_pe, + const std::map &_tagger_sps); + + virtual ~CRTBlob(); + + double Ts0() const; + double Ts0Err() const; + double Ts1() const; + double Ts1Err() const; + double PE() const; + std::map TaggerSPs() const; + + int TotalSpacePoints() const; + int SpacePointsInTagger(const CRTTagger tagger) const; + }; +} + +#endif diff --git a/sbnobj/SBND/CRT/classes.h b/sbnobj/SBND/CRT/classes.h index 169c423b..d5a641a0 100644 --- a/sbnobj/SBND/CRT/classes.h +++ b/sbnobj/SBND/CRT/classes.h @@ -9,6 +9,7 @@ #include "sbnobj/SBND/CRT/CRTEnums.hh" #include "sbnobj/SBND/CRT/CRTTrack.hh" #include "sbnobj/SBND/CRT/CRTVeto.hh" +#include "sbnobj/SBND/CRT/CRTBlob.hh" #include "sbnobj/Common/CRT/CRTHit.hh" #include "sbnobj/Common/CRT/CRTHit_Legacy.hh" #include "lardataobj/Simulation/AuxDetSimChannel.h" diff --git a/sbnobj/SBND/CRT/classes_def.xml b/sbnobj/SBND/CRT/classes_def.xml index 96e69b17..4e0c0791 100644 --- a/sbnobj/SBND/CRT/classes_def.xml +++ b/sbnobj/SBND/CRT/classes_def.xml @@ -101,6 +101,7 @@ + @@ -182,4 +183,20 @@ + + + + + + + + + + + + + + + +