Skip to content

Commit ac7dd5d

Browse files
Merge branch 'develop' into bugfix/hlay_crt_nwall_geom_for_reco
2 parents f0cb00e + 1827cb6 commit ac7dd5d

18 files changed

Lines changed: 4867 additions & 127 deletions

sbndcode/Calibration/CRT/CalibService/SBNDCRTPedestals_v2.txt

Lines changed: 4480 additions & 0 deletions
Large diffs are not rendered by default.

sbndcode/Calibration/CRT/CalibService/crt_calib_service.fcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ BEGIN_PROLOG
33
crt_calib_service:
44
{
55
TimingOffsetFileName: "SBNDCRTTimingOffsets_v1.txt"
6-
PedestalFileName: "SBNDCRTPedestals_v1.txt"
6+
PedestalFileName: "SBNDCRTPedestals_v2.txt"
77
}
88

99
END_PROLOG

sbndcode/Calibration/DQM/FilterChoppy_module.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,13 @@ namespace filt{
105105
// exit if the data isn't present
106106
if (!timestamp_handle.isValid()) {
107107
std::cerr << "Error: missing timestamps with producer (" << "daq" << ")" << std::endl;
108-
return false;
108+
return true; // don't want to filter out events missing TPC data (e.g. CRT-only runs)
109109
}
110+
if (timestamp_handle->size() == 0) {
111+
std::cerr << "Error: missing timestamps with producer (" << "daq" << ")" << std::endl;
112+
return true; // don't want to filter out events missing TPC data (e.g. CRT-only runs)
113+
}
114+
110115
art::fill_ptr_vector(raw_timestamps_handle, timestamp_handle);
111116

112117
// collect TS

sbndcode/Commissioning/fcls/hitdumpermodule.fcl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ hitdumper:
99
MaxHits: 100000
1010
MaxOpHits: 100000
1111
MaxSamples: 5001
12-
MaxCRTStripHits: 5000
13-
MaxCRTSpacePoints: 500
14-
MaxCRTTracks: 100
12+
MaxCRTStripHits: 10000
13+
MaxCRTSpacePoints: 10000
14+
MaxCRTTracks: 10000
1515

1616
DigitModuleLabel: "daq"
1717
HitsModuleLabel: "fasthit"

sbndcode/Decoders/XARAPUCA/SBNDXARAPUCADecoder_module.cc

Lines changed: 251 additions & 79 deletions
Large diffs are not rendered by default.

sbndcode/Decoders/XARAPUCA/run_xarapucadecoder.fcl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "xarapucadecoder.fcl"
2+
#include "spectdc_decoder_sbnd.fcl"
23

34
process_name: XARAPUCADecoder
45

@@ -21,6 +22,7 @@ outputs: {
2122
physics: {
2223

2324
producers: {
25+
tdcdecoder: @local::spec_tdc_decoder_sbnd
2426
xarapucadecoder: @local::xarapucadecoder
2527
}
2628

@@ -29,7 +31,7 @@ physics: {
2931
analyzers:{}
3032

3133

32-
reco: [xarapucadecoder]
34+
reco: [tdcdecoder, xarapucadecoder]
3335

3436

3537
# Defines the output stream, there could be more than one if using filters.

sbndcode/Decoders/XARAPUCA/xarapucadecoder.fcl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,22 @@ xarapucadecoder:
1414
fragment_id_offset: 41216 # Offset to be applied to the fragment IDs (0xA100).
1515
board_id_list: [7, 13, 16, 19] # Slots where the boards are installed.
1616
# - Timing configuration.
17+
timing_priority: 0 # 0 SPEC-TDC ETT, 1 CAEN-only.
1718
ns_per_sample: 16 # Nanoseconds per sample.
19+
# - SPEC-TDC access configuration
20+
spectdc_product_name: "tdcdecoder" # Name for getting SPEC-TDC Decoder products.
21+
spectdc_ftrig_ch: 3 # Channel assigned to flash triggers.
22+
spectdc_etrig_ch: 4 # Channel assigned to event triggers.
1823

1924
# OUTPUT configuration:
2025
# - Output data product instance name.
21-
product_instance_name: "XARAPUCAChannels" # Name for the instance product created.
22-
store_debug_waveforms: 0 # Number of waveforms to store (0: none, -1: all, n: first n waveforms).
26+
waveforms_instance_name: "XARAPUCAChannels" # Name for the instance product containing the raw decoded waveforms.
27+
timing_instance_name: "" # Name for the instance product containing the timing reference information.
28+
store_debug_waveforms: 0 # Number of waveforms to store (0: none, -1: all, n: first n waveforms).
2329
# - Debug options.
2430
debug_all: false # (De)activates all debug options.
25-
debug_handle: false # (De)activates art::Handle data printing.
31+
debug_tdc_handle: false # (De)activates SPEC-TDC art::Handle information printing.
32+
debug_fragments_handle: false # (De)activates V1740B CAEN fragments art::Handle information printing.
2633
debug_timing: false # (De)activates timing data printing.
2734
debug_buffer: false # (De)activates buffer status printing.
2835
debug_waveforms: false # (De)activates waveforms decoding printing.

sbndcode/Decoders/run_decoders_job.fcl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
#include "pmtdecoder.fcl"
2525

26+
#include "xarapucadecoder.fcl"
27+
2628
#include "spectdc_decoder_sbnd.fcl"
2729

2830
#include "SBNDPTBDecoderDefaults.fcl"
@@ -55,6 +57,7 @@ physics:
5557
ntbdecoder: @local::NTBDecoderDefaults
5658
tdcdecoder: @local::spec_tdc_decoder_sbnd
5759
pmtdecoder: @local::pmtdecoder
60+
xarapucadecoder: @local::xarapucadecoder
5861
ptbdecoder: @local::SBNDPTBDecoderDefaults
5962
crtdecoder: @local::crt_decoder
6063
}
@@ -68,8 +71,8 @@ physics:
6871

6972
analyzers: {}
7073

71-
dropchoppy: [ daq, ntbdecoder, crtdecoder, ptbdecoder, tdcdecoder, pmtdecoder, filterchoppy ]
72-
savechoppy: [ daq, ntbdecoder, crtdecoder, ptbdecoder, tdcdecoder, pmtdecoder, "!filterchoppy" ]
74+
dropchoppy: [ daq, ntbdecoder, crtdecoder, ptbdecoder, tdcdecoder, pmtdecoder, xarapucadecoder, filterchoppy ]
75+
savechoppy: [ daq, ntbdecoder, crtdecoder, ptbdecoder, tdcdecoder, pmtdecoder, xarapucadecoder, "!filterchoppy" ]
7376
trigger_paths: [ dropchoppy, savechoppy ]
7477

7578
stream1: [ out1 ]

sbndcode/Trigger/MetricAnalyzer_module.cc

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,15 @@ class sbndaq::MetricAnalyzer : public art::EDAnalyzer {
4646

4747
private:
4848
std::string fmetric_instance_name;
49-
std::string fmetric_module_label;
49+
std::vector<std::string> fmetric_module_labels;
50+
std::vector<int> fstream_labels;
5051

5152
std::string fspectdc_module_label;
5253
uint32_t fspectdc_etrig_ch;
5354

5455
TTree* tree;
5556
int _run, _subrun, _event;
57+
int _stream;
5658
float _flash_peakpe;
5759
float _flash_peaktime; // us
5860
float _trigger_dt; // us
@@ -66,7 +68,13 @@ sbndaq::MetricAnalyzer::MetricAnalyzer(fhicl::ParameterSet const& p)
6668
: EDAnalyzer{p} // ,
6769
// More initializers here.
6870
{
69-
fmetric_module_label = p.get<std::string>("metric_module_label","pmtmetricproducer");
71+
fmetric_module_labels = p.get<std::vector<std::string>>("metric_module_labels",{"pmtmetricproducer",
72+
"pmtmetricbnbzero",
73+
"pmtmetricbnblight",
74+
"pmtmetricoffbeamzero",
75+
"pmtmetricoffbeamlight",
76+
"pmtmetriccrossingsmuon"});
77+
fstream_labels = p.get<std::vector<int>>("stream_labels",{0,1,2,3,4,5});
7078
fmetric_instance_name = p.get<std::string>("metric_instance_name","");
7179
fspectdc_module_label = p.get<std::string>("spectdc_module_name","tdcdecoder");
7280
fspectdc_etrig_ch = p.get<uint32_t>("spectdc_etrig_ch",4);
@@ -76,6 +84,7 @@ sbndaq::MetricAnalyzer::MetricAnalyzer(fhicl::ParameterSet const& p)
7684
tree->Branch("run",&_run,"run/I");
7785
tree->Branch("subrun",&_subrun,"subrun/I");
7886
tree->Branch("event",&_event,"event/I");
87+
tree->Branch("stream",&_stream,"stream/I");
7988
tree->Branch("flash_peakpe",&_flash_peakpe,"flash_peakpe/F");
8089
tree->Branch("flash_peaktime",&_flash_peaktime,"flash_peaktime/F");
8190
tree->Branch("trigger_dt",&_trigger_dt,"trigger_dt/F");
@@ -91,27 +100,47 @@ void sbndaq::MetricAnalyzer::analyze(art::Event const& e)
91100
_event = e.id().event();
92101

93102
// initialize tree variables
103+
_stream = -1;
94104
_flash_peakpe = -999999999;
95105
_flash_peaktime = -999999999;
96106
_trigger_dt = -999999999;
97107
_timing_type = -1;
98108
_tdc_etrig = -999999999;
99109
_tdc_bes = -999999999;
100110

101-
art::Handle<std::vector<sbnd::trigger::pmtSoftwareTrigger>> metricHandle;
102-
if (fmetric_instance_name.empty()) e.getByLabel(fmetric_module_label,metricHandle);
103-
else e.getByLabel(fmetric_module_label,fmetric_instance_name,metricHandle);
104-
if (!metricHandle.isValid() || metricHandle->size() == 0){
105-
std::cout << "No Metrics found" << std::endl;
106-
tree->Fill();
111+
if (fstream_labels.size() != fmetric_module_labels.size()){
112+
std::cout << "Error: stream labels and metric module labels are not the same size" << std::endl;
107113
return;
108114
}
109-
else{
115+
116+
bool found_metrics = false;
117+
118+
size_t nlabels = fmetric_module_labels.size();
119+
for (size_t i=0; i<nlabels; i++){
120+
auto label = fmetric_module_labels[i];
121+
122+
art::Handle<std::vector<sbnd::trigger::pmtSoftwareTrigger>> metricHandle;
123+
if (fmetric_instance_name.empty()){
124+
e.getByLabel(label,metricHandle);
125+
}
126+
else{
127+
e.getByLabel(label,fmetric_instance_name,metricHandle);
128+
}
129+
130+
if (!metricHandle.isValid() || metricHandle->size() == 0)
131+
continue;
132+
found_metrics = true;
110133
const std::vector<sbnd::trigger::pmtSoftwareTrigger> metric_v(*metricHandle);
111134
auto metric = metric_v[0];
112135
_trigger_dt = float(metric.trig_ts)/1e3;
113136
_flash_peakpe = metric.peakPE;
114137
_flash_peaktime = metric.peaktime;
138+
_stream = fstream_labels[i];
139+
}
140+
if (!found_metrics){
141+
std::cout << "No Metrics found" << std::endl;
142+
tree->Fill();
143+
return;
115144
}
116145

117146
// see if etrig exists

sbndcode/Trigger/MetricFilter_module.cc

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class sbndaq::MetricFilter : public art::EDFilter {
4343

4444
private:
4545
std::string fmetric_instance_name;
46-
std::string fmetric_module_label;
46+
std::vector<std::string> fmetric_module_labels;
4747

4848
float ftime_min; // us
4949
float ftime_max; // us
@@ -58,7 +58,12 @@ sbndaq::MetricFilter::MetricFilter(fhicl::ParameterSet const& p)
5858
: EDFilter{p} // ,
5959
// More initializers here.
6060
{
61-
fmetric_module_label = p.get<std::string>("metric_module_label","pmtmetricproducer");
61+
fmetric_module_labels = p.get<std::vector<std::string>>("metric_module_labels",{"pmtmetricproducer",
62+
"pmtmetricbnbzero",
63+
"pmtmetricbnblight",
64+
"pmtmetricoffbeamzero",
65+
"pmtmetricoffbeamlight",
66+
"pmtmetriccrossingmuon"});
6267
fmetric_instance_name = p.get<std::string>("metric_instance_name","");
6368
ftime_min = p.get<float>("time_min",0);
6469
ftime_max = p.get<float>("time_max",3);
@@ -67,24 +72,38 @@ sbndaq::MetricFilter::MetricFilter(fhicl::ParameterSet const& p)
6772

6873
bool sbndaq::MetricFilter::filter(art::Event& e)
6974
{
70-
// Implementation of required member function here.
71-
art::Handle<std::vector<sbnd::trigger::pmtSoftwareTrigger>> metricHandle;
72-
if (fmetric_instance_name.empty()) e.getByLabel(fmetric_module_label,metricHandle);
73-
else e.getByLabel(fmetric_module_label,fmetric_instance_name,metricHandle);
74-
if (!metricHandle.isValid() || metricHandle->size() == 0){
75-
return false;
76-
}
77-
else{
75+
bool pass = false;
76+
77+
bool found_metrics = false;
78+
size_t nlabels = fmetric_module_labels.size();
79+
for (size_t i=0; i<nlabels; i++){
80+
auto label = fmetric_module_labels[i];
81+
82+
art::Handle<std::vector<sbnd::trigger::pmtSoftwareTrigger>> metricHandle;
83+
if (fmetric_instance_name.empty()){
84+
e.getByLabel(label,metricHandle);
85+
}
86+
else{
87+
e.getByLabel(label,fmetric_instance_name,metricHandle);
88+
}
89+
90+
if (!metricHandle.isValid() || metricHandle->size() == 0)
91+
continue;
92+
found_metrics = true;
7893
const std::vector<sbnd::trigger::pmtSoftwareTrigger> metric_v(*metricHandle);
7994
auto metric = metric_v[0];
8095
auto flash_peakpe = metric.peakPE;
8196
auto flash_peaktime = metric.peaktime; // us
8297

8398
bool pass_timing = (flash_peaktime > ftime_min) && (flash_peaktime < ftime_max);
8499
bool pass_pe = flash_peakpe > fpe_thresh;
85-
return pass_timing && pass_pe;
100+
pass = (pass_timing && pass_pe);
86101
}
87-
102+
if (!found_metrics){
103+
std::cout << "No Metrics found" << std::endl;
104+
pass=false;
105+
}
106+
return pass;
88107
}
89108

90109
DEFINE_ART_MODULE(sbndaq::MetricFilter)

0 commit comments

Comments
 (0)