Skip to content

Commit b76af04

Browse files
Merge branch 'develop' into feature/aliciavr_XARAPUCA_offline_decoder
2 parents cb44cbd + ebe8a20 commit b76af04

17 files changed

Lines changed: 679 additions & 96 deletions

sbndcode/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ add_subdirectory(OpT0Finder)
2121
add_subdirectory(ShowerAna)
2222
add_subdirectory(Commissioning)
2323
add_subdirectory(Trigger)
24+
add_subdirectory(Timing)
2425
add_subdirectory(PTBAna)
2526

2627
# subdirectory for gallery stuff
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
art_make(
2-
MODULE_LIBRARIES
1+
cet_build_plugin( SBNDPMTDecoder art::module
2+
SOURCE SBNDPMTDecoder_module.cc
3+
LIBRARIES
34
sbndaq_artdaq_core::sbndaq-artdaq-core_Overlays_SBND
45
sbnobj::SBND_Timing
5-
6+
lardata::Utilities
7+
canvas::canvas
68
lardataobj::RecoBase
7-
9+
lardataobj::RawData
10+
lardataobj::headers
811
art_root_io::TFileService_service
912
art_root_io::tfile_support
1013
artdaq_core::artdaq-core_Data
11-
1214
ROOT::Core
1315
ROOT::Tree
14-
1516
)
1617

1718
install_fhicl()
19+
install_headers()
20+
install_source()

sbndcode/Decoders/PMT/SBNDPMTDecoder_module.cc

Lines changed: 324 additions & 68 deletions
Large diffs are not rendered by default.

sbndcode/Decoders/PMT/pmtdecoder.fcl

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,46 @@ pmtdecoder:
1313

1414
# configure CAEN inputs
1515
caen_fragment_name: [ "CAENV1730", "ContainerCAENV1730" ]
16-
ignore_fragid: [8] # boards to ignore for testing purposes, fragid==8 is the timing board, this is 0-indexed!
16+
ignore_fragid: [] # boards to ignore for testing purposes, fragid==8 is the timing board, this is 0-indexed!
1717
nominal_length: 5000 # expected waveform length
18+
raw_ts_correction: 367000 # ns, correction to the rawheader timestamp
1819

1920
# configure SPEC TDC inputs
2021
spectdc_product_name: "tdcdecoder" # used if the tdc decoder has been run
21-
spectdc_ftrig_ch: 3 # this should be the channel number of the spec tdc that stores the flash trigger
22-
spectdc_etrig_ch: 4 # this should be the channel number of the spec tdc that stores the event trigger
22+
spectdc_ftrig_ch: 3 # channel number of the spec tdc that stores the flash trigger
23+
spectdc_etrig_ch: 4 # channel number of the spec tdc that stores the event trigger
2324

24-
# configure PTB inputs
25+
# configure PTB inputs; the HLT with the smallest trigger word will be used (within some range to the rawheader timestamp)
2526
ptb_product_name: "ptbdecoder"
26-
ptb_etrig_trigword: 0x0000000000000000
27+
ptb_etrig_trigword_min: 1 # minimum trigger word (in decimal)
28+
ptb_etrig_trigword_max: 100000 # maximum trigger word (in decimal)
2729
ptb_etrig_wordtype: 2
30+
ptb_trig_raw_diff_max: 3000000 # the maximum allowed time difference in ns
2831

2932
# configure output options
33+
# use time difference between reference + CAEN used to determine rollover and/or weirdness
34+
allowed_time_diff: 3000 # us!! not nanoseconds
3035
# configure the output data product instance names
3136
pmtInstanceName: "PMTChannels"
3237
ftrigInstanceName: "FTrigChannels"
38+
timingInstanceName: "TimingChannels"
3339
output_ftrig_wvfm: true # whether or not to output the ftrig as an opdetwaveform (artroot data product)
40+
output_timing_wvfm: true # whether or not to output the timing caen wvfms as an opdetwaveform (artroot data product)
41+
ignore_timing_ch: [4,5,6,7,8,9,10,11,12,13,14] # only ch0=BES, ch1=RWM, ch2=ETRIG, ch3=MSUM, ch15=FTRIG
3442

3543
# more detailed configurables
3644
n_maxflashes: 30 # maximum number of flashes anticipated, this is used for memory allocation
37-
n_caenboards: 8 # number of caen boards; this is used for memory allocation
45+
n_caenboards: 9 # number of caen boards; this is used for memory allocation
46+
# 1-8 = PMT caens, 9th = timing caen
3847
threshold_ftrig: 16350 # the threshold for the flash trigger channel
3948

4049
fragid_offset: 40960 # the offset to subtract to get single digit fragids; if use_set_map is true, should set this to 0
4150
hist_evt: 1 # the # of the event used to generate the histograms, 1st event by default
4251

43-
# for when the fragIDs are mapped to the old configuration...
44-
set_fragid_map: [3,7,5,9,11,13,15,17,19] # digitizers 0-8 are mapped to these fragids
52+
# for when the fragIDs are mapped to the old configuration or you need to hardcode fragids...
53+
## to use this, must set `fragid_offset` to 0!!!
4554
use_set_map: false
55+
set_fragid_map: [3,7,5,9,11,13,15,17,19] # use if `use_set_map` is true: digitizers 0-8 are mapped to these fragids
4656

4757
# ordered in sets of 15 by increasing fragID
4858
# the PMT_to_Digitizers.txt file in the same directory is the reference for this
@@ -54,7 +64,8 @@ pmtdecoder:
5464
173,172,227,226,197,196,171,170,225,224,169,168,223,222,167, # digitizer 4
5565
195,194,221,220,165,164,219,218,193,192,163,162,217,216,166, # digitizer 5
5666
251,250,305,304,275,274,249,248,303,302,247,246,301,300,245, # digitizer 6
57-
273,272,299,298,243,242,297,296,271,270,241,240,295,294,244] # digitizer 7
67+
273,272,299,298,243,242,297,296,271,270,241,240,295,294,244, # digitizer 7
68+
900,901,902,903,904,905,906,907,908,909,910,911,912,913,914] # digitizer 8 (TIMING CAEN)
5869
}
5970

6071
END_PROLOG

sbndcode/JobConfigurations/standard/reco/reco2_data.fcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ physics.reco2: [ pandora, pandoraTrack, pandoraShower, pandoraShowerSBN, pandora
2424
physics.analyzers.caloskim.G4producer: ""
2525
physics.analyzers.caloskim.SimChannelproducer: ""
2626
physics.caloskimana_tpconly: [ caloskim ]
27-
physics.end_paths: [stream1, caloskimana_tpconly]
27+
physics.end_paths: [stream1, caloskimana_tpconly]

sbndcode/Timing/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
art_dictionary(DICTIONARY_LIBRARIES
2+
lardataobj::RawData)
3+
4+
install_headers()
5+
# install_fhicl()
6+
# install_source()

sbndcode/Timing/SBNDRawTimingObj.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
////////////////////////////////////////////////////////////////////////
2+
//
3+
// An offline object to associate original CAEN1730 timing information to
4+
// the decoded OpDetWaveforms to aid in downstream timing reconstruction
5+
// author: Lynn Tung
6+
// with inspiration taken from Tom Junk's offline ptb object
7+
//
8+
////////////////////////////////////////////////////////////////////////
9+
10+
#ifndef sbndtiming_H
11+
#define sbndtiming_H
12+
13+
#include <stdint.h>
14+
#include <vector>
15+
16+
namespace raw {
17+
class TimingReferenceInfo {
18+
public:
19+
TimingReferenceInfo() {}; // constructor
20+
TimingReferenceInfo(uint16_t timingType,
21+
uint16_t timingChannel) :
22+
timingType(timingType), timingChannel(timingChannel) {};
23+
24+
uint16_t timingType; // e.g. SPECTDC = 0; PTB HLT = 1; CAEN-only = 3
25+
uint16_t timingChannel; // e.g. TDC ETRIG = 4; PTB BNB Beam+Light = 2
26+
};
27+
28+
namespace pmt {
29+
class BoardTimingInfo {
30+
// Associate one of these to every opdetwaveform in the board/digitizer, one per trigger
31+
public:
32+
BoardTimingInfo() {}; // constructor
33+
BoardTimingInfo(uint16_t postPercent,
34+
std::vector<uint32_t> &triggerTimeTag) :
35+
postPercent(postPercent), triggerTimeTag(triggerTimeTag) {};
36+
37+
uint16_t postPercent; // # 0-100, represents a percentage
38+
std::vector<uint32_t> triggerTimeTag; // ns
39+
};
40+
}
41+
}
42+
43+
#endif

sbndcode/Timing/classes.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//File: classes.h
2+
//Brief: Include directives needed to generate header(s) for the raw::pmt::sbndpmt data product.
3+
//Author: Lynn Tung
4+
5+
//ART includes
6+
#include "canvas/Persistency/Common/Wrapper.h"
7+
#include "canvas/Persistency/Common/Assns.h"
8+
9+
//local includes
10+
#include "sbndcode/Timing/SBNDRawTimingObj.h"
11+
12+
//larsoft includes
13+
#include "lardataobj/RawData/OpDetWaveform.h"

sbndcode/Timing/classes_def.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!--
2+
File: classes_def.xml
3+
Brief: Data product definitions for pmt timing data products.
4+
Author: Lynn Tung
5+
-->
6+
7+
<lcgdict>
8+
<class name="raw::TimingReferenceInfo">
9+
</class>
10+
<class name="std::vector<raw::TimingReferenceInfo>"/>
11+
<class name="art::Wrapper<raw::TimingReferenceInfo>"/>
12+
<class name="art::Wrapper<std::vector<raw::TimingReferenceInfo> >"/>
13+
14+
<class name="raw::pmt::BoardTimingInfo">
15+
</class>
16+
<class name="std::vector<raw::pmt::BoardTimingInfo>"/>
17+
<class name="art::Wrapper<std::vector<raw::pmt::BoardTimingInfo>>"/>
18+
19+
<class name="std::pair<art::Ptr<raw::pmt::BoardTimingInfo>, art::Ptr<raw::OpDetWaveform>>"/>
20+
<class name="std::pair<art::Ptr<raw::OpDetWaveform>, art::Ptr<raw::pmt::BoardTimingInfo>>"/>
21+
<class name="art::Assns<raw::pmt::BoardTimingInfo, raw::OpDetWaveform, void>"/>
22+
<class name="art::Assns<raw::OpDetWaveform, raw::pmt::BoardTimingInfo, void>"/>
23+
<class name="art::Wrapper<art::Assns<raw::pmt::BoardTimingInfo, raw::OpDetWaveform, void>>"/>
24+
<class name="art::Wrapper<art::Assns<raw::OpDetWaveform, raw::pmt::BoardTimingInfo, void>>"/>
25+
26+
</lcgdict>

sbndcode/WireCell/cfg/pgrapher/experiment/sbnd/chndb-base.jsonnet

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,21 @@ function(params, anode, field, n, rms_cuts=[])
2020
// For MicroBooNE, channel groups is a 2D list. Each element is
2121
// one group of channels which should be considered together for
2222
// coherent noise filtering.
23-
groups: [std.range( 0 + n * 5638 + g*32, 0 + n * 5638 + (g+1)*32 - 1) for g in std.range(0,149)] +
24-
[std.range(4806 + n * 5638 + g*32, 4806 + n * 5638 + (g+1)*32 - 1) for g in std.range(0,25)] ,
23+
// 5638 is the number of channels in a single APA, (1984*2 + 1670), including the 6 channel gap.
24+
// 4806 is the number of channels for both induction + half of real collection wires + 6 channel gap
25+
groups: [std.range( 0 + n * 5638 + g*32, 0 + n * 5638 + (g+1)*32 - 1) for g in std.range(0,150)] +
26+
[std.range(4806 + n * 5638 + g*32, 4806 + n * 5638 + (g+1)*32 - 1) for g in std.range(0,26)] ,
2527

2628

2729
// Externally determined "bad" channels.
2830
//
2931
// Dead channels: 3232:3263 (inclusive) (East V). 4160:4191 (East Y)
32+
// Jumpered region: 4800:4805 (inclusive, East Y), 10438:10443 (inclusive, West Y)
33+
// No response: 546, 607, 8574
3034
// Shorted channels: 7169 (West U), 8378 (West V).
3135
// There are four physically missing wires ( = bad channels) due to combs, in the center of each 1/2 APA.
3236
// They are 4374 and 5231 (East Y), 10012 and 10869 (West Y).
33-
// So in total, there are 76 bad channels.
37+
// So in total, there are 88 bad channels.
3438
//
3539
//bad: [],
3640
bad: [546, 607] + std.range(3232, 3263) + std.range(4160, 4191) + [4374, 4800, 4801, 4802, 4803, 4804, 4805, 5060, 5231, 5636, 5637, 7169, 8378, 8574, 10012, 10869, 10438, 10439, 10440, 10441, 10442, 10443],
@@ -53,15 +57,15 @@ function(params, anode, field, n, rms_cuts=[])
5357
response_offset: 0.0, // ticks?
5458
pad_window_front: 10, // ticks?
5559
pad_window_back: 10, // ticks?
56-
decon_limit: 0.02,
60+
decon_limit: 0.02, // (SignalProtection, same as upper_decon_limit (default 0.02))
5761
decon_limit1: 0.09,
58-
adc_limit: 15,
62+
adc_limit: 10,
5963
roi_min_max_ratio: 0.8, // default 0.8
6064
min_rms_cut: 1.0, // units???
6165
max_rms_cut: 30.0, // units???
6266

6367
// parameter used to make "rcrc" spectrum
64-
rcrc: 1.1 * wc.millisecond, // 1.1 for collection, 3.3 for induction
68+
rcrc: 0.5 * wc.millisecond, // 1.1 for collection, 3.3 for induction
6569
rc_layers: 1, // default 2
6670

6771
// parameters used to make "config" spectrum

0 commit comments

Comments
 (0)