Skip to content

Commit 3af3ff2

Browse files
Merge pull request #609 from SBNSoftware/feature/hlay_crt_data_timing_cherry_pick
CRT Data Timing (Cherry-Picked)
2 parents e278101 + 1b3e197 commit 3af3ff2

4 files changed

Lines changed: 224 additions & 62 deletions

File tree

sbndcode/CRT/CRTAna/CRTAnalysis_module.cc

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "sbndcode/CRT/CRTBackTracker/CRTBackTrackerAlg.h"
4040
#include "sbndcode/CRT/CRTUtils/CRTCommonUtils.h"
4141
#include "sbndcode/Decoders/PTB/sbndptb.h"
42+
#include "sbndcode/Timing/SBNDRawTimingObj.h"
4243

4344
namespace sbnd::crt {
4445
class CRTAnalysis;
@@ -94,7 +95,7 @@ class sbnd::crt::CRTAnalysis : public art::EDAnalyzer {
9495
std::string fMCParticleModuleLabel, fSimDepositModuleLabel, fFEBDataModuleLabel, fCRTStripHitModuleLabel,
9596
fCRTClusterModuleLabel, fCRTSpacePointModuleLabel, fCRTTrackModuleLabel, fTPCTrackModuleLabel,
9697
fCRTSpacePointMatchingModuleLabel, fCRTTrackMatchingModuleLabel, fPFPModuleLabel, fPTBModuleLabel,
97-
fTDCModuleLabel;
98+
fTDCModuleLabel, fTimingReferenceModuleLabel;
9899
bool fDebug, fDataMode, fNoTPC, fHasPTB, fHasTDC;
99100

100101
TTree* fTree;
@@ -104,6 +105,8 @@ class sbnd::crt::CRTAnalysis : public art::EDAnalyzer {
104105
int _run;
105106
int _subrun;
106107
int _event;
108+
int _crt_timing_reference_type;
109+
int _crt_timing_reference_channel;
107110

108111
//mc truth
109112
std::vector<int16_t> _mc_trackid;
@@ -331,6 +334,7 @@ sbnd::crt::CRTAnalysis::CRTAnalysis(fhicl::ParameterSet const& p)
331334
fPFPModuleLabel = p.get<std::string>("PFPModuleLabel", "pandora");
332335
fPTBModuleLabel = p.get<std::string>("PTBModuleLabel", "ptbdecoder");
333336
fTDCModuleLabel = p.get<std::string>("TDCModuleLabel", "tdcdecoder");
337+
fTimingReferenceModuleLabel = p.get<std::string>("TimingReferenceModuleLabel", "crtstrips");
334338
fDebug = p.get<bool>("Debug", false);
335339
fDataMode = p.get<bool>("DataMode", false);
336340
fNoTPC = p.get<bool>("NoTPC", false);
@@ -346,6 +350,8 @@ sbnd::crt::CRTAnalysis::CRTAnalysis(fhicl::ParameterSet const& p)
346350
fTree->Branch("run", &_run);
347351
fTree->Branch("subrun", &_subrun);
348352
fTree->Branch("event", &_event);
353+
fTree->Branch("crt_timing_reference_type", &_crt_timing_reference_type);
354+
fTree->Branch("crt_timing_reference_channel", &_crt_timing_reference_channel);
349355

350356
if(!fDataMode)
351357
{
@@ -621,6 +627,17 @@ void sbnd::crt::CRTAnalysis::analyze(art::Event const& e)
621627

622628
if(fDebug) std::cout << "This is event " << _run << "-" << _subrun << "-" << _event << std::endl;
623629

630+
_crt_timing_reference_type = -1;
631+
_crt_timing_reference_channel = -1;
632+
633+
art::Handle<raw::TimingReferenceInfo> TimingReferenceHandle;
634+
e.getByLabel(fTimingReferenceModuleLabel, TimingReferenceHandle);
635+
if(TimingReferenceHandle.isValid())
636+
{
637+
_crt_timing_reference_type = TimingReferenceHandle->timingType;
638+
_crt_timing_reference_channel = TimingReferenceHandle->timingChannel;
639+
}
640+
624641
if(fHasPTB)
625642
{
626643
// Get PTBs

sbndcode/CRT/CRTReco/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ art_make_library(
77

88
simple_plugin(
99
CRTStripHitProducer module
10+
artdaq_core::artdaq-core_Data
1011
sbnobj::SBND_CRT
1112
sbnobj::SBND_Timing
1213
sbndcode_GeoWrappers

0 commit comments

Comments
 (0)