Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sbnobj/SBND/CRT/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ cet_make_library(
CRTStripHit.cxx
CRTTrack.cxx
CRTVeto.cxx
CRTBlob.cxx
FEBData.cxx
FEBTruthInfo.cxx
LIBRARIES
Expand Down
55 changes: 55 additions & 0 deletions sbnobj/SBND/CRT/CRTBlob.cxx
Original file line number Diff line number Diff line change
@@ -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<CRTTagger, int> &_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<CRTTagger, int> 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
49 changes: 49 additions & 0 deletions sbnobj/SBND/CRT/CRTBlob.hh
Original file line number Diff line number Diff line change
@@ -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 <map>

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<CRTTagger, int> 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<CRTTagger, int> &_tagger_sps);

virtual ~CRTBlob();

double Ts0() const;
double Ts0Err() const;
double Ts1() const;
double Ts1Err() const;
double PE() const;
std::map<CRTTagger, int> TaggerSPs() const;

int TotalSpacePoints() const;
int SpacePointsInTagger(const CRTTagger tagger) const;
};
}

#endif
1 change: 1 addition & 0 deletions sbnobj/SBND/CRT/classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
17 changes: 17 additions & 0 deletions sbnobj/SBND/CRT/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
<enum name="sbnd::crt::CRTTagger" ClassVersion="10"/>
<class name="std::set<sbnd::crt::CRTTagger>"/>
<class name="std::vector<sbnd::crt::CRTTagger>"/>
<class name="std::map<sbnd::crt::CRTTagger, int>"/>
<enum name="sbnd::crt::CoordSet" ClassVersion="10"/>
<enum name="sbnd::crt::CRTChannelStatus" ClassVersion="10"/>

Expand Down Expand Up @@ -182,4 +183,20 @@
<class name="art::Assns<sbnd::crt::CRTSpacePoint, sbnd::crt::CRTVeto, void>" />
<class name="art::Wrapper< art::Assns<sbnd::crt::CRTSpacePoint, sbnd::crt::CRTVeto, void> >" />

<!-- CRTBlob -->

<class name="sbnd::crt::CRTBlob" ClassVersion="10">
<version ClassVersion="10" checksum="3696724874"/>
</class>
<class name="std::vector<sbnd::crt::CRTBlob>"/>
<class name="art::Wrapper<sbnd::crt::CRTBlob>"/>
<class name="art::Wrapper<std::vector<sbnd::crt::CRTBlob> >"/>

<!-- associations -->

<class name="art::Assns<sbnd::crt::CRTSpacePoint, sbnd::crt::CRTBlob, void>" />
<class name="art::Wrapper< art::Assns<sbnd::crt::CRTSpacePoint, sbnd::crt::CRTBlob, void> >" />
<class name="art::Assns<sbnd::crt::CRTBlob, sbnd::crt::CRTSpacePoint, void>" />
<class name="art::Wrapper< art::Assns<sbnd::crt::CRTBlob, sbnd::crt::CRTSpacePoint, void> >" />

</lcgdict>