Skip to content

Commit ef80c75

Browse files
committed
Fixed Timing bug for RWM referencing in BNBLight
1 parent 7d6db5d commit ef80c75

3 files changed

Lines changed: 35 additions & 7 deletions

File tree

sbndcode/CRT/CRTVeto/CRTVetoProducer_module.cc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ sbnd::crt::CRTVetoProducer::CRTVetoProducer(fhicl::ParameterSet const& p)
109109
, fCRTClusterModuleLabel(p.get<std::string>("CRTClusterModuleLabel"))
110110
, fCRTSpacePointModuleLabel(p.get<std::string>("CRTSpacePointModuleLabel"))
111111
, fCRTTimingReferenceInfoLabel(p.get<std::string>("CRTTimingReferenceInfoLabel"))
112-
, fSPECTDCModuleLabel(p.get<std::string>("SPECTDCModuleLabel"))
112+
, fSPECTDCModuleLabel(p.get<std::string>("SPECTDCModuleLabel", ""))
113113
, fIsData(p.get<bool>("IsData"))
114114
, fDAQHeaderModuleLabel(p.get<std::string>("DAQHeaderModuleLabel", ""))
115115
, fDAQHeaderInstanceLabel(p.get<std::string>("DAQHeaderInstanceLabel", ""))
@@ -137,8 +137,9 @@ void sbnd::crt::CRTVetoProducer::produce(art::Event& e)
137137
std::cout << std::endl;
138138

139139
// May only be needed for BNB+Light Data --> TODO
140-
uint64_t raw_ts = 0, ref_time = 0;
141-
uint32_t ref_time_ns = 0;
140+
uint64_t raw_ts = 0;
141+
int64_t ref_time = 0;
142+
int64_t ref_time_ns = 0;
142143

143144
// Data needs to be handled differently than MC
144145

@@ -197,7 +198,7 @@ void sbnd::crt::CRTVetoProducer::produce(art::Event& e)
197198
std::cout << std::endl;
198199
std::cout << std::endl;
199200
}
200-
ref_time_ns = ref_time % static_cast<uint64_t>(1e9);
201+
ref_time_ns = ref_time % static_cast<int64_t>(1e9);
201202

202203
} // end of check for Data
203204

@@ -278,7 +279,10 @@ void sbnd::crt::CRTVetoProducer::produce(art::Event& e)
278279
}
279280
} // end loop over space points
280281
} // end of loop over clusters
281-
282+
283+
std::cout << "Finished Loop over Clusters --> Produce CRTVeto products" << std::endl;
284+
std::cout << std::endl;
285+
282286
int Nwalls_all = S + N + E + W;
283287
int Nwalls_noNorth = S + E + W;
284288
int Ntop = TL + TH;

sbndcode/CRT/CRTVeto/crtvetoproducer_sbnd.fcl

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,27 @@ crtvetoproducer_data_sbnd.IsData: true
2323
#crtvetoproducer_data_sbnd.WindowEnd: 2.065
2424

2525
# Values for testing
26-
crtvetoproducer_data_sbnd.WindowStart: -2
27-
crtvetoproducer_data_sbnd.WindowEnd: 2
26+
crtvetoproducer_data_sbnd.WindowStart: -1.135
27+
crtvetoproducer_data_sbnd.WindowEnd: 0.565
2828
crtvetoproducer_data_sbnd.SPECTDCModuleLabel: "tdcdecoder"
2929

3030
crtvetoproducer_data_sbnd.DAQHeaderModuleLabel: "daq"
3131
crtvetoproducer_data_sbnd.DAQHeaderInstanceLabel: "RawEventHeader"
3232
crtvetoproducer_data_sbnd.RawTSCorrection: 367000
3333
crtvetoproducer_data_sbnd.MaxAllowedRefTimeDiff: 3000000
3434

35+
# Top Hat Configuration for Debugging
36+
crtvetoproducer_data_sbnd_tophat: @local::crtvetoproducer_sbnd
37+
crtvetoproducer_data_sbnd_tophat.CRTGeoAlg: @local::crtgeoalg_data_sbnd
38+
crtvetoproducer_data_sbnd_tophat.IsData: true
39+
40+
# Values for testing
41+
crtvetoproducer_data_sbnd_tophat.SPECTDCModuleLabel: "tdcdecoder"
42+
crtvetoproducer_data_sbnd_tophat.DAQHeaderModuleLabel: "daq"
43+
crtvetoproducer_data_sbnd_tophat.DAQHeaderInstanceLabel: "RawEventHeader"
44+
crtvetoproducer_data_sbnd_tophat.RawTSCorrection: 367000
45+
crtvetoproducer_data_sbnd_tophat.MaxAllowedRefTimeDiff: 3000000
46+
crtvetoproducer_data_sbnd_tophat.WindowStart: -2
47+
crtvetoproducer_data_sbnd_tophat.WindowEnd: 2
48+
3549
END_PROLOG
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include "crt_channel_map_service.fcl"
2+
#include "crt_calib_service.fcl"
3+
#include "run_crtveto.fcl"
4+
5+
services.message: @local::sbnd_message_services
6+
services.CRTChannelMapService: @local::crt_channel_map_standard
7+
services.CRTCalibService: @local::crt_calib_service
8+
9+
physics.producers.crtveto: @local::crtvetoproducer_data_sbnd_tophat
10+

0 commit comments

Comments
 (0)