Skip to content

Commit b68ace3

Browse files
committed
move parameters to fcl
1 parent 063cf66 commit b68ace3

2 files changed

Lines changed: 59 additions & 24 deletions

File tree

sbndcode/Timing/FrameShift/FrameShift_module.cc

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -169,40 +169,40 @@ sbnd::FrameShift::FrameShift(fhicl::ParameterSet const& p)
169169
: EDProducer{p} // ,
170170
// More initializers here.
171171
{
172-
fDAQHeaderInstanceLabel = p.get<std::string>("DAQHeaderInstanceLabel", "RawEventHeader");
173-
fDAQHeaderModuleLabel = p.get<std::string>("DAQHeaderModuleLabel", "daq");
174-
fRawTSCorrection = p.get<uint64_t>("RawTSCorrection", 367000);
175-
fMaxAllowedRefTimeDiff = p.get<uint64_t>("MaxAllowedRefTimeDiff", 3000000); //3 ms
172+
fDAQHeaderInstanceLabel = p.get<std::string>("DAQHeaderInstanceLabel");
173+
fDAQHeaderModuleLabel = p.get<std::string>("DAQHeaderModuleLabel");
174+
fRawTSCorrection = p.get<uint64_t>("RawTSCorrection");
175+
fMaxAllowedRefTimeDiff = p.get<uint64_t>("MaxAllowedRefTimeDiff");
176176

177-
fTimingRefPmtLabel = p.get<art::InputTag>("TimingRefPmtLabel", "pmtdecoder");
178-
fTimingRefCrtLabel = p.get<art::InputTag>("TimingRefCrtLabel", "crtstrips");
177+
fTimingRefPmtLabel = p.get<art::InputTag>("TimingRefPmtLabel");
178+
fTimingRefCrtLabel = p.get<art::InputTag>("TimingRefCrtLabel");
179179

180-
fTdcDecodeLabel = p.get<art::InputTag>("TdcDecodeLabel", "tdcdecoder");
181-
fPtbDecodeLabel = p.get<art::InputTag>("PtbDecodeLabel", "ptbdecoder");
180+
fTdcDecodeLabel = p.get<art::InputTag>("TdcDecodeLabel");
181+
fPtbDecodeLabel = p.get<art::InputTag>("PtbDecodeLabel");
182182

183-
fPtbEtrigHlts = p.get<std::vector<int>>("PtbEtrigHlts", {1, 2, 3, 4, 5, 14, 15});
183+
fPtbEtrigHlts = p.get<std::vector<int>>("PtbEtrigHlts");
184184

185-
fBeamEtrigHlt = p.get<std::vector<int>>("BeamEtrigHlt", {1,2});
186-
fOffbeamEtrigHlt = p.get<std::vector<int>>("OffbeamEtrigHlt", {3,4});
187-
fXmuonEtrigHlt = p.get<std::vector<int>>("XmuonEtrigHlt", {5, 14, 15});
185+
fBeamEtrigHlt = p.get<std::vector<int>>("BeamEtrigHlt");
186+
fOffbeamEtrigHlt = p.get<std::vector<int>>("OffbeamEtrigHlt");
187+
fXmuonEtrigHlt = p.get<std::vector<int>>("XmuonEtrigHlt");
188188

189-
fBeamCrtT1Hlt = p.get<int>("BeamCrtT1Hlt", 20);
190-
fOffbeamCrtT1Hlt = p.get<int>("OffbeamCrtT1Hlt", 21);
189+
fBeamCrtT1Hlt = p.get<int>("BeamCrtT1Hlt");
190+
fOffbeamCrtT1Hlt = p.get<int>("OffbeamCrtT1Hlt");
191191

192-
fBeamGateHlt = p.get<int>("BeamGateHlt", 26);
193-
fOffbeamGateHlt = p.get<int>("OffbeamGateHlt", 27);
192+
fBeamGateHlt = p.get<int>("BeamGateHlt");
193+
fOffbeamGateHlt = p.get<int>("OffbeamGateHlt");
194194

195-
fDebugDAQHeader = p.get<bool>("DebugDAQHeader", false);
196-
fDebugTimingRef = p.get<bool>("DebugTimingRef", false);
197-
fDebugPtb = p.get<bool>("DebugPtb", false);
198-
fDebugTdc = p.get<bool>("DebugTdc", false);
199-
fDebugFrame = p.get<bool>("DebugFrame", false);
195+
fDebugDAQHeader = p.get<bool>("DebugDAQHeader");
196+
fDebugTimingRef = p.get<bool>("DebugTimingRef");
197+
fDebugPtb = p.get<bool>("DebugPtb");
198+
fDebugTdc = p.get<bool>("DebugTdc");
199+
fDebugFrame = p.get<bool>("DebugFrame");
200200

201201
//TODO: Get from database instead of fhicl parameters
202-
_frame_data2mc = p.get<double>("ShiftData2MC", 0);
202+
_frame_data2mc = p.get<double>("ShiftData2MC");
203203

204204
//TODO: Get from database instead of fhicl parameters
205-
fShiftRWM2Gate = p.get<double>("ShiftRWM2Gate", 1738);
205+
fShiftRWM2Gate = p.get<double>("ShiftRWM2Gate");
206206

207207
produces< sbnd::timing::FrameShiftInfo >();
208208
produces< sbnd::timing::TimingInfo >();
@@ -661,7 +661,8 @@ void sbnd::FrameShift::produce(art::Event& e)
661661
// + Data: t = 0 = abitrary. All subsystem electronics time is reference to the last PPS
662662

663663
if(_isBeam){
664-
_frame_apply_at_caf = _frame_tdc_rwm + fShiftRWM2Gate; // +frame_data2mc
664+
_frame_tdc_rwm += fShiftRWM2Gate; //
665+
_frame_apply_at_caf = _frame_tdc_rwm; // +frame_data2mc
665666
}
666667
else if(_isOffbeam){
667668
_frame_apply_at_caf = _frame_hlt_gate; //+frame_data2mc

sbndcode/Timing/FrameShift/frameshift_sbnd_data.fcl

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,39 @@ BEGIN_PROLOG
22
frameshift_data:
33
{
44
module_type: "FrameShift"
5+
6+
DAQHeaderInstanceLabel: "RawEventHeader"
7+
DAQHeaderModuleLabel: "daq"
8+
RawTSCorrection: 367000 //367 us
9+
MaxAllowedRefTimeDiff: 3000000 //3 ms
10+
11+
TimingRefPmtLabel: "pmtdecoder"
12+
TimingRefCrtLabel: "crtstrips"
13+
14+
TdcDecodeLabel: "tdcdecoder"
15+
PtbDecodeLabel: "ptbdecoder"
16+
17+
PtbEtrigHlts: [1, 2, 3, 4, 5, 14, 15]
18+
19+
BeamEtrigHlt: [1,2]
20+
OffbeamEtrigHlt: [3,4]
21+
XmuonEtrigHlt: [5, 14, 15]
22+
23+
BeamCrtT1Hlt: 20
24+
OffbeamCrtT1Hlt: 21
25+
26+
BeamGateHlt: 26
27+
OffbeamGateHlt: 27
28+
29+
DebugDAQHeader: false
30+
DebugTimingRef: false
31+
DebugPtb: false
32+
DebugTdc: false
33+
DebugFrame: false
34+
35+
ShiftData2MC: 0
36+
ShiftRWM2Gate: 1738
537
}
38+
39+
640
END_PROLOG

0 commit comments

Comments
 (0)