Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
151b2c9
Setup to start extended fragments feature
aliciavr Oct 9, 2025
1e492fd
Shift timing function
aliciavr Oct 9, 2025
3f93ceb
Waveforms decoding function
aliciavr Oct 9, 2025
b416a56
Add dump waveforms function
aliciavr Oct 9, 2025
0d9f644
Combine waveforms and correctly differentiates nominal from extended
aliciavr Oct 10, 2025
c1a42c0
Combine all extended fragments succesfully
aliciavr Oct 14, 2025
e165606
Add new comments for code documenting. New variable for debugging the…
aliciavr Oct 15, 2025
60036c5
Update SBN Document for reference
aliciavr Oct 15, 2025
2f7ff45
Add version number and update number of debug waveforms to 0
aliciavr Nov 5, 2025
15f34cd
First version of timing check implemented (some extended fragments do…
aliciavr Nov 6, 2025
3f44697
Add jittering debug option and combine fragments option
aliciavr Nov 7, 2025
43f7614
Update combination condition with timing features integrating the exp…
aliciavr Nov 24, 2025
177f2b4
Add warning for some unexpected types of fragments and fix fragments …
aliciavr Nov 25, 2025
9b056c4
remove or disable files which reference LegacyLArG4
lgarren Jan 30, 2026
9297360
remove or disable files which reference LegacyLArG4
lgarren Jan 30, 2026
a531049
remove or disable files which reference LegacyLArG4
lgarren Jan 30, 2026
cc0cd3a
Restore the shower merging algorithm in another place to avoid incons…
aliciavr Feb 3, 2026
888ecbb
Add fcl and pandora xml to support cluster validation metrics in ci s…
AndyChappell Feb 5, 2026
bcb99ee
Add synchronisation comment to Pandora Master xml
AndyChappell Feb 5, 2026
542d2f5
Add CRTBlob producer
henrylay97 Apr 3, 2025
5811843
Add blobs to CRT only fcls
henrylay97 Apr 3, 2025
8dba497
Modernise CMakeLists
henrylay97 Feb 16, 2026
5cb14c3
Change ADC saturation value to match data
henrylay97 Feb 20, 2025
6220ac4
Use saturation to correctly label strip hits
henrylay97 Feb 20, 2025
ae474af
Add option for blob branches in CRTAnalysis module
henrylay97 Feb 17, 2026
8e22b42
Clean up fcls
henrylay97 Feb 17, 2026
2215cc3
Manually check saturation
henrylay97 Feb 18, 2026
7e3ef07
Merge branch 'develop' into feature/chappell_ci_pandora_clstr
nathanielerowe Feb 19, 2026
6419fbf
Add channel mapping version of module and relevant config
henrylay97 Feb 6, 2024
bb8dc73
Add bash script for making pdf
henrylay97 Feb 6, 2024
50586c9
Z points North not South, duh
henrylay97 Feb 6, 2024
184da01
Update channel map evds to test David's updates
henrylay97 Jun 24, 2024
f97696f
New CRT gdml channel mapping evds
henrylay97 Aug 25, 2024
27d0e16
Changes to channel map evd producer
henrylay97 Sep 28, 2024
25bc903
New round of channel map evds
henrylay97 Jan 27, 2025
a30a782
Updated CRT channel mapping display
henrylay97 May 15, 2025
380b27f
Make tex script more configurable
henrylay97 Feb 20, 2026
9a5c2ed
Make compatible with current develop
henrylay97 Feb 20, 2026
a196d7c
Remove unnecessary fcl
henrylay97 Feb 20, 2026
b36419c
Add functionality for turning off inversion - useful for the channel …
henrylay97 Jul 9, 2024
2134fb7
More configurable
henrylay97 Feb 23, 2026
cc83f73
Correctly name parameter
henrylay97 Feb 23, 2026
e20d622
Make consistent between fcl and bash script
henrylay97 Feb 23, 2026
df8562a
Include table for no inversion channel map
henrylay97 Feb 23, 2026
02dc045
Ensure tex file is saved in correct area
henrylay97 Feb 23, 2026
3ba37b5
Update sbncode version to v10_14_02_03
nathanielerowe Feb 19, 2026
029de7c
Missing branch from CRTAnalysis
henrylay97 Feb 23, 2026
b674480
Add ADRIFT - module for CRT calibration
henrylay97 Feb 23, 2026
70411b5
Add CRTRateAnalysis - module for CRT real time rate analysis
henrylay97 Feb 23, 2026
a446e0b
Add CRTTopHatAnalysis - module for CRT beam top hat analysis
henrylay97 Feb 23, 2026
c752a91
Add relevant functions for ADRIFT to GeoService
henrylay97 Feb 23, 2026
263176b
Add skeleton for timing analysis
henrylay97 Feb 24, 2026
46bb0a2
Refactor cluster characterisation to allow external use of timing cor…
henrylay97 Feb 24, 2026
1459913
Update channel map service to add timing chains
henrylay97 Feb 24, 2026
75870c2
Fill space point branches in timing analysis
henrylay97 Feb 24, 2026
0f58321
Add track content to CRTTimingAnalysis module, plus a few bugfixes to…
henrylay97 Feb 25, 2026
1ca6df6
Make fcl changes to run CRTTimingAnalysis
henrylay97 Feb 25, 2026
8f8b77b
Make sure timing chain map is installed to path
henrylay97 Feb 25, 2026
cacb8d8
Add TPC slice based variables
henrylay97 Feb 25, 2026
5e7f17d
Add more reference shifts
henrylay97 Feb 25, 2026
2b8362d
Add a few missing branches
henrylay97 Feb 26, 2026
7bc5dee
More sensible default for uint
henrylay97 Feb 26, 2026
44a0672
Remove unnecessary tophat analysis module
henrylay97 Feb 27, 2026
cb47ee9
Remove reference to my data area
henrylay97 Feb 27, 2026
bdf38e4
Reduce code duplication
henrylay97 Feb 27, 2026
8efaff2
Correct some very old naming problems
henrylay97 Feb 27, 2026
076fc35
Add rate for tracks of limited angle
henrylay97 Mar 3, 2026
c505fda
Add xshift for CRT-TPC track matching
henrylay97 Mar 3, 2026
2771a92
Add track direction branches to spacepoint timing tree
henrylay97 Mar 5, 2026
a8353e2
If we're going to do comments lets get them right
henrylay97 Mar 5, 2026
1dd3071
Add README to point to documentation
henrylay97 Mar 5, 2026
3e9df79
Make safer - at John's suggestion
henrylay97 Mar 5, 2026
f27bb1b
Merge branch 'develop' into feature/hlay_crt_channel_map_evds
nathanielerowe Mar 6, 2026
b9c9abf
updating memory and cpu usage error bounds for CI tests
Mar 7, 2026
5f8afc2
Merge branch 'develop' into feature/hlay_crt_ana
nathanielerowe Mar 13, 2026
69a761a
Merge branch 'develop' into feature/aliciavr_XARAPUCA_offline_decoder…
nathanielerowe Mar 13, 2026
4360a3e
Merge pull request #847 from SBNSoftware/feature/aliciavr_XARAPUCA_of…
nathanielerowe Mar 13, 2026
6fde8ad
Merge branch 'develop' into bugfix/PandoraNeutrinoSettingsShowerMergi…
nathanielerowe Mar 13, 2026
9022e7b
Merge pull request #907 from SBNSoftware/bugfix/PandoraNeutrinoSettin…
nathanielerowe Mar 13, 2026
18f9f5b
Merge branch 'develop' into feature/lg_geant4_11
nathanielerowe Mar 13, 2026
8cb3f91
Merge pull request #903 from lgarren/feature/lg_geant4_11
nathanielerowe Mar 13, 2026
8d5b79e
Merge branch 'develop' into feature/hlay_crt_blobs
nathanielerowe Mar 13, 2026
f23c4b0
Merge pull request #916 from SBNSoftware/feature/hlay_crt_blobs
nathanielerowe Mar 13, 2026
5ae81e8
Merge branch 'develop' into feature/hlay_crt_saturation
nathanielerowe Mar 13, 2026
8f5dd42
Merge pull request #917 from SBNSoftware/feature/hlay_crt_saturation
nathanielerowe Mar 13, 2026
38d8ed4
Merge branch 'develop' into ci_memory_updates
nathanielerowe Mar 13, 2026
130c116
Merge pull request #921 from SBNSoftware/ci_memory_updates
nathanielerowe Mar 13, 2026
a1cccf8
Update sbncode version to v10_20_03
nathanielerowe Mar 13, 2026
30b75c8
Merge branch 'develop' into feature/hlay_crt_channel_map_evds
nathanielerowe Mar 13, 2026
c06fc26
Merge branch 'develop' into feature/hlay_crt_ana
nathanielerowe Mar 13, 2026
43e7807
Merge pull request #920 from SBNSoftware/feature/hlay_crt_ana
nathanielerowe Mar 13, 2026
1b8c860
Merge branch 'develop' into feature/hlay_crt_channel_map_evds
nathanielerowe Mar 13, 2026
4f6b3ea
Merge pull request #918 from SBNSoftware/feature/hlay_crt_channel_map…
nathanielerowe Mar 13, 2026
782ea81
Merge branch 'develop' into feature/chappell_ci_pandora_clstr
nathanielerowe Mar 13, 2026
04e41a8
Merge pull request #909 from SBNSoftware/feature/chappell_ci_pandora_…
nathanielerowe Mar 13, 2026
62fc4d5
Update versioning
nathanielerowe Mar 16, 2026
41d1365
Merge branch 'release/v10_20_03'
nathanielerowe Mar 16, 2026
9f1fff2
Merge tag 'v10_20_03' into develop
nathanielerowe Mar 16, 2026
229cb46
Remove LegacyLArG4 from MODULE_LIBRARIES
lynnt20 Apr 14, 2026
e64b8a4
Merge branch 'develop' into feature/lynnt_lightcalorimetry
nathanielerowe Apr 16, 2026
cb91113
Merge branch 'production/sbnd-gen2' into feature/lynnt_lightcalorimetry
nathanielerowe May 5, 2026
27d88f5
Merge branch 'production/sbnd-gen2' into feature/lynnt_lightcalorimetry
linyan-w Jul 7, 2026
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,424 changes: 1,424 additions & 0 deletions sbndcode/CRT/CRTAna/ADRIFT_module.cc

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions sbndcode/CRT/CRTAna/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
art_make(
MODULE_LIBRARIES
ROOT::Tree
ROOT::Graf3d
art_root_io::TFileService_service
larsim::Utils
lardata::DetectorClocksService
sbndaq_artdaq_core::sbndaq-artdaq-core_Obj_SBND
sbnobj::SBND_CRT
sbnobj::SBND_Timing
sbnobj::Common_Reco
sbndcode_CRT_CRTBackTracker
sbndcode_CRT_CRTReco
sbndcode_ChannelMaps_CRT_CRTChannelMapService_service
)

install_fhicl()
149 changes: 108 additions & 41 deletions sbndcode/CRT/CRTAna/CRTAnalysis_module.cc

Large diffs are not rendered by default.

292 changes: 292 additions & 0 deletions sbndcode/CRT/CRTAna/CRTRateAnalysis_module.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,292 @@
////////////////////////////////////////////////////////////////////////
// Class: CRTRateAnalysis
// Plugin Type: analyzer (Unknown Unknown)
// File: CRTRateAnalysis_module.cc
//
// Generated at Tue Jan 7 05:28:06 2025 by Henry Lay using cetskelgen
// from cetlib version 3.18.02.
////////////////////////////////////////////////////////////////////////

#include "art/Framework/Core/EDAnalyzer.h"
#include "art/Framework/Core/ModuleMacros.h"
#include "art/Framework/Principal/Event.h"
#include "art/Framework/Principal/Handle.h"
#include "art/Framework/Principal/Run.h"
#include "art/Framework/Principal/SubRun.h"
#include "canvas/Utilities/InputTag.h"
#include "fhiclcpp/ParameterSet.h"
#include "messagefacility/MessageLogger/MessageLogger.h"
#include "art_root_io/TFileService.h"

#include "TTree.h"

#include "canvas/Persistency/Common/FindOneP.h"
#include "canvas/Persistency/Common/FindManyP.h"

#include "artdaq-core/Data/RawEvent.hh"

#include "sbnobj/SBND/CRT/FEBData.hh"
#include "sbnobj/SBND/CRT/CRTSpacePoint.hh"
#include "sbnobj/SBND/CRT/CRTCluster.hh"
#include "sbnobj/SBND/CRT/CRTBlob.hh"

#include "sbndcode/Geometry/GeometryWrappers/CRTGeoService.h"
#include "sbndcode/ChannelMaps/CRT/CRTChannelMapService.h"

namespace sbnd {
namespace crt {
class CRTRateAnalysis;
}
}


class sbnd::crt::CRTRateAnalysis : public art::EDAnalyzer {
public:
explicit CRTRateAnalysis(fhicl::ParameterSet const& p);
// The compiler-generated destructor is fine for non-base
// classes without bare pointers or other resource use.

// Plugins should not be copied or assigned.
CRTRateAnalysis(CRTRateAnalysis const&) = delete;
CRTRateAnalysis(CRTRateAnalysis&&) = delete;
CRTRateAnalysis& operator=(CRTRateAnalysis const&) = delete;
CRTRateAnalysis& operator=(CRTRateAnalysis&&) = delete;

// Required functions.
void analyze(art::Event const& e) override;

void ResetEventVars();
void ResetRawVars();
void ResetSpacePointVars();
void ResetBlobVars();

private:

art::ServiceHandle<CRTGeoService> fCRTGeoService;
art::ServiceHandle<SBND::CRTChannelMapService> fCRTChannelMapService;

std::string fFEBDataModuleLabel, fCRTSpacePointModuleLabel,
fCRTBlobModuleLabel, fDAQHeaderModuleLabel, fDAQHeaderInstanceLabel;

TTree *fEventTree, *fRawTree, *fSpacePointTree, *fBlobTree;

int32_t _run, _subrun, _event;
uint32_t _event_header_ts;

int16_t _tagger, _module;
uint16_t _max_channel;

int16_t _n_hits;
double _x, _y, _z, _pe;

int16_t _n_total_sps, _n_bottom_sps, _n_bottom_sps_twohits, _n_south_sps,
_n_north_sps, _n_west_sps, _n_east_sps, _n_toplow_sps, _n_tophigh_sps;
};


sbnd::crt::CRTRateAnalysis::CRTRateAnalysis(fhicl::ParameterSet const& p)
: EDAnalyzer{p}
, fFEBDataModuleLabel(p.get<std::string>("FEBDataModuleLabel"))
, fCRTSpacePointModuleLabel(p.get<std::string>("CRTSpacePointModuleLabel"))
, fCRTBlobModuleLabel(p.get<std::string>("CRTBlobModuleLabel"))
, fDAQHeaderModuleLabel(p.get<std::string>("DAQHeaderModuleLabel"))
, fDAQHeaderInstanceLabel(p.get<std::string>("DAQHeaderInstanceLabel"))
{
art::ServiceHandle<art::TFileService> fs;

fEventTree = fs->make<TTree>("events", "");
fEventTree->Branch("run", &_run);
fEventTree->Branch("subrun", &_subrun);
fEventTree->Branch("event", &_event);
fEventTree->Branch("event_header_ts", &_event_header_ts);

fRawTree = fs->make<TTree>("readouts", "");
fRawTree->Branch("run", &_run);
fRawTree->Branch("subrun", &_subrun);
fRawTree->Branch("event", &_event);
fRawTree->Branch("event_header_ts", &_event_header_ts);
fRawTree->Branch("tagger", &_tagger);
fRawTree->Branch("module", &_module);
fRawTree->Branch("max_channel", &_max_channel);

fSpacePointTree = fs->make<TTree>("spacepoints", "");
fSpacePointTree->Branch("run", &_run);
fSpacePointTree->Branch("subrun", &_subrun);
fSpacePointTree->Branch("event", &_event);
fSpacePointTree->Branch("event_header_ts", &_event_header_ts);
fSpacePointTree->Branch("tagger", &_tagger);
fSpacePointTree->Branch("n_hits", &_n_hits);
fSpacePointTree->Branch("x", &_x);
fSpacePointTree->Branch("y", &_y);
fSpacePointTree->Branch("z", &_z);
fSpacePointTree->Branch("pe", &_pe);

fBlobTree = fs->make<TTree>("blobs", "");
fBlobTree->Branch("run", &_run);
fBlobTree->Branch("subrun", &_subrun);
fBlobTree->Branch("event", &_event);
fBlobTree->Branch("event_header_ts", &_event_header_ts);
fBlobTree->Branch("n_total_sps", &_n_total_sps);
fBlobTree->Branch("n_bottom_sps", &_n_bottom_sps);
fBlobTree->Branch("n_bottom_sps_twohits", &_n_bottom_sps_twohits);
fBlobTree->Branch("n_south_sps", &_n_south_sps);
fBlobTree->Branch("n_north_sps", &_n_north_sps);
fBlobTree->Branch("n_west_sps", &_n_west_sps);
fBlobTree->Branch("n_east_sps", &_n_east_sps);
fBlobTree->Branch("n_toplow_sps", &_n_toplow_sps);
fBlobTree->Branch("n_tophigh_sps", &_n_tophigh_sps);
fBlobTree->Branch("pe", &_pe);
}

void sbnd::crt::CRTRateAnalysis::analyze(art::Event const& e)
{
ResetEventVars();

_run = e.id().run();
_subrun = e.id().subRun();
_event = e.id().event();

art::Handle<artdaq::detail::RawEventHeader> DAQHeaderHandle;
e.getByLabel(fDAQHeaderModuleLabel, fDAQHeaderInstanceLabel, DAQHeaderHandle);

if(DAQHeaderHandle.isValid())
{
artdaq::RawEvent rawHeaderEvent = artdaq::RawEvent(*DAQHeaderHandle);
uint64_t raw_ts = rawHeaderEvent.timestamp();
_event_header_ts = raw_ts / static_cast<uint32_t>(1e9);
}

fEventTree->Fill();

art::Handle<std::vector<FEBData>> FEBDataHandle;
e.getByLabel(fFEBDataModuleLabel, FEBDataHandle);

std::vector<art::Ptr<FEBData>> FEBDataVec;
art::fill_ptr_vector(FEBDataVec, FEBDataHandle);

for(auto const& data : FEBDataVec)
{
ResetRawVars();
_tagger = fCRTGeoService->AuxDetIndexToTaggerEnum(data->Mac5());
_module = data->Mac5();

int max_adc = -1, max_ch = -1;

for(int ch = 0; ch < 32; ++ch)
{
int adc = data->ADC(ch);

if(adc > max_adc)
{
max_adc = adc;
max_ch = ch;
}
}

_max_channel = fCRTChannelMapService->ConstructOfflineChannelIDFromOfflineModuleIDAndOfflineLocalChannel(_module, max_ch);

fRawTree->Fill();
}

art::Handle<std::vector<CRTSpacePoint>> CRTSpacePointHandle;
e.getByLabel(fCRTSpacePointModuleLabel, CRTSpacePointHandle);

std::vector<art::Ptr<CRTSpacePoint>> CRTSpacePointVec;
art::fill_ptr_vector(CRTSpacePointVec, CRTSpacePointHandle);

art::FindOneP<CRTCluster> spacePointsToClusters(CRTSpacePointHandle, e, fCRTSpacePointModuleLabel);

for(auto const& spacePoint : CRTSpacePointVec)
{
ResetSpacePointVars();

const art::Ptr<CRTCluster> cluster = spacePointsToClusters.at(spacePoint.key());

_tagger = cluster->Tagger();
_n_hits = cluster->NHits();
_x = spacePoint->X();
_y = spacePoint->Y();
_z = spacePoint->Z();
_pe = spacePoint->PE();

fSpacePointTree->Fill();
}

art::Handle<std::vector<CRTBlob>> CRTBlobHandle;
e.getByLabel(fCRTBlobModuleLabel, CRTBlobHandle);

std::vector<art::Ptr<CRTBlob>> CRTBlobVec;
art::fill_ptr_vector(CRTBlobVec, CRTBlobHandle);

art::FindManyP<CRTSpacePoint> blobsToSpacePoints(CRTBlobHandle, e, fCRTBlobModuleLabel);

for(auto const& blob : CRTBlobVec)
{
ResetBlobVars();

_n_total_sps = blob->TotalSpacePoints();
_n_bottom_sps = blob->SpacePointsInTagger(kBottomTagger);
_n_south_sps = blob->SpacePointsInTagger(kSouthTagger);
_n_north_sps = blob->SpacePointsInTagger(kNorthTagger);
_n_west_sps = blob->SpacePointsInTagger(kWestTagger);
_n_east_sps = blob->SpacePointsInTagger(kEastTagger);
_n_toplow_sps = blob->SpacePointsInTagger(kTopLowTagger);
_n_tophigh_sps = blob->SpacePointsInTagger(kTopHighTagger);
_pe = blob->PE();

_n_bottom_sps_twohits = 0;

const std::vector<art::Ptr<CRTSpacePoint>> spacePoints = blobsToSpacePoints.at(blob.key());

for(auto const& spacePoint : spacePoints)
{
const art::Ptr<CRTCluster> cluster = spacePointsToClusters.at(spacePoint.key());

if(cluster->Tagger() == kBottomTagger && cluster->NHits() > 1)
++_n_bottom_sps_twohits;
}

fBlobTree->Fill();
}
}

void sbnd::crt::CRTRateAnalysis::ResetEventVars()
{
_run = -1; _subrun = -1; _event = -1;
_event_header_ts = std::numeric_limits<uint32_t>::max();
}

void sbnd::crt::CRTRateAnalysis::ResetRawVars()
{
_tagger = -1; _module = -1;
_max_channel = std::numeric_limits<uint16_t>::max();
}

void sbnd::crt::CRTRateAnalysis::ResetSpacePointVars()
{
_tagger = -1;

_n_hits = -1;

_x = std::numeric_limits<double>::lowest();
_y = std::numeric_limits<double>::lowest();
_z = std::numeric_limits<double>::lowest();
_pe = std::numeric_limits<double>::lowest();
}

void sbnd::crt::CRTRateAnalysis::ResetBlobVars()
{
_n_total_sps = -1;
_n_bottom_sps = -1;
_n_bottom_sps_twohits = -1;
_n_south_sps = -1;
_n_north_sps = -1;
_n_west_sps = -1;
_n_east_sps = -1;
_n_toplow_sps = -1;
_n_tophigh_sps = -1;

_pe = std::numeric_limits<double>::lowest();
}

DEFINE_ART_MODULE(sbnd::crt::CRTRateAnalysis)
Loading