Skip to content

Commit 7f4e4e1

Browse files
authored
Merge branch 'develop' into release/Mar25Production
2 parents afb8350 + ac0dda7 commit 7f4e4e1

6 files changed

Lines changed: 86 additions & 20 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
1717

1818
find_package(cetmodules 3.20.00 REQUIRED)
19-
project(sbncode VERSION 10.04.08 LANGUAGES CXX)
19+
project(sbncode VERSION 10.05.00 LANGUAGES CXX)
2020

2121
message(STATUS "\n\n ========================== ${PROJECT_NAME} ==========================")
2222

sbncode/CAFMaker/CAFMaker_module.cc

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,26 +1665,50 @@ void CAFMaker::produce(art::Event& evt) noexcept {
16651665

16661666
// Get all of the OpFlashes
16671667
std::vector<caf::SROpFlash> srflashes;
1668+
if(fDet == kICARUS)
1669+
{
1670+
for (const std::string& pandora_tag_suffix : pandora_tag_suffixes) {
1671+
art::Handle<std::vector<recob::OpFlash>> flashes_handle;
1672+
GetByLabelStrict(evt, fParams.OpFlashLabel() + pandora_tag_suffix, flashes_handle);
1673+
// fill into event
1674+
if (flashes_handle.isValid()) {
1675+
const std::vector<recob::OpFlash> &opflashes = *flashes_handle;
1676+
int cryostat = ( pandora_tag_suffix.find("W") != std::string::npos ) ? 1 : 0;
16681677

1669-
for (const std::string& pandora_tag_suffix : pandora_tag_suffixes) {
1670-
art::Handle<std::vector<recob::OpFlash>> flashes_handle;
1671-
GetByLabelStrict(evt, fParams.OpFlashLabel() + pandora_tag_suffix, flashes_handle);
1672-
// fill into event
1673-
if (flashes_handle.isValid()) {
1674-
const std::vector<recob::OpFlash> &opflashes = *flashes_handle;
1675-
int cryostat = ( pandora_tag_suffix.find("W") != std::string::npos ) ? 1 : 0;
1678+
// get associated OpHits for each OpFlash
1679+
art::FindMany<recob::OpHit> findManyHits(flashes_handle, evt, fParams.OpFlashLabel() + pandora_tag_suffix);
16761680

1677-
// get associated OpHits for each OpFlash
1678-
art::FindMany<recob::OpHit> findManyHits(flashes_handle, evt, fParams.OpFlashLabel() + pandora_tag_suffix);
1681+
int iflash=0;
1682+
for (const recob::OpFlash& flash : opflashes) {
16791683

1680-
int iflash=0;
1681-
for (const recob::OpFlash& flash : opflashes) {
1684+
std::vector<recob::OpHit const*> const& ophits = findManyHits.at(iflash);
16821685

1683-
std::vector<recob::OpHit const*> const& ophits = findManyHits.at(iflash);
1686+
srflashes.emplace_back();
1687+
FillICARUSOpFlash(flash, ophits, cryostat, srflashes.back());
1688+
iflash++;
1689+
}
1690+
}
1691+
}
1692+
}
1693+
else if(fDet == kSBND)
1694+
{
1695+
std::vector<std::string> tpc_suffixes_sbnd = {"tpc0", "tpc1"};
16841696

1685-
srflashes.emplace_back();
1686-
FillOpFlash(flash, ophits, cryostat, srflashes.back());
1687-
iflash++;
1697+
for (size_t tpc=0; tpc<tpc_suffixes_sbnd.size(); tpc++) {
1698+
art::Handle<std::vector<recob::OpFlash>> flashes_handle;
1699+
GetByLabelStrict(evt, fParams.OpFlashLabel() + tpc_suffixes_sbnd[tpc], flashes_handle);
1700+
// fill into event
1701+
if (flashes_handle.isValid()) {
1702+
const std::vector<recob::OpFlash> &opflashes = *flashes_handle;
1703+
// get associated OpHits for each OpFlash
1704+
art::FindMany<recob::OpHit> findManyHits(flashes_handle, evt, fParams.OpFlashLabel() + tpc_suffixes_sbnd[tpc]);
1705+
int iflash=0;
1706+
for (const recob::OpFlash& flash : opflashes) {
1707+
std::vector<recob::OpHit const*> const& ophits = findManyHits.at(iflash);
1708+
srflashes.emplace_back();
1709+
FillSBNDOpFlash(flash, ophits, tpc, srflashes.back());
1710+
iflash++;
1711+
}
16881712
}
16891713
}
16901714
}

sbncode/CAFMaker/FillReco.cxx

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ namespace caf
179179
}
180180

181181

182-
void FillOpFlash(const recob::OpFlash &flash,
182+
void FillICARUSOpFlash(const recob::OpFlash &flash,
183183
std::vector<recob::OpHit const*> const& hits,
184184
int cryo,
185185
caf::SROpFlash &srflash,
@@ -227,6 +227,41 @@ namespace caf
227227
}
228228
}
229229

230+
void FillSBNDOpFlash(const recob::OpFlash &flash,
231+
std::vector<recob::OpHit const*> const& hits,
232+
int tpc,
233+
caf::SROpFlash &srflash,
234+
bool allowEmpty) {
235+
236+
srflash.setDefault();
237+
238+
srflash.time = flash.Time();
239+
srflash.timewidth = flash.TimeWidth();
240+
241+
double firstTime = std::numeric_limits<double>::max();
242+
for(const auto& hit: hits){
243+
double const hitTime = hit->HasStartTime()? hit->StartTime(): hit->PeakTime();
244+
if (firstTime > hitTime)
245+
firstTime = hitTime;
246+
}
247+
srflash.firsttime = firstTime;
248+
srflash.tpc = tpc;
249+
250+
srflash.totalpe = flash.TotalPE();
251+
srflash.fasttototal = flash.FastToTotal();
252+
srflash.onbeamtime = flash.OnBeamTime();
253+
254+
srflash.center.SetXYZ( -9999.f, flash.YCenter(), flash.ZCenter() );
255+
srflash.width.SetXYZ( -9999.f, flash.YWidth(), flash.ZWidth() );
256+
257+
// Checks if ( recob::OpFlash.XCenter() != std::numeric_limits<double>::max() )
258+
// See LArSoft OpFlash.h at https://nusoft.fnal.gov/larsoft/doxsvn/html/OpFlash_8h_source.html
259+
if ( flash.hasXCenter() ) {
260+
srflash.center.SetX( flash.XCenter() );
261+
srflash.width.SetX( flash.XWidth() );
262+
}
263+
}
264+
230265
std::vector<float> double_to_float_vector(const std::vector<double>& v)
231266
{
232267
std::vector<float> ret;

sbncode/CAFMaker/FillReco.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,18 @@ namespace caf
219219
caf::SRSBNDCRTTrack &srsbndcrttrack,
220220
bool allowEmpty = false);
221221

222-
void FillOpFlash(const recob::OpFlash &flash,
222+
void FillICARUSOpFlash(const recob::OpFlash &flash,
223223
std::vector<recob::OpHit const*> const& hits,
224224
int cryo,
225225
caf::SROpFlash &srflash,
226226
bool allowEmpty = false);
227+
228+
void FillSBNDOpFlash(const recob::OpFlash &flash,
229+
std::vector<recob::OpHit const*> const& hits,
230+
int tpc,
231+
caf::SROpFlash &srflash,
232+
bool allowEmpty = false);
233+
227234
void FillCRTPMTMatch(const sbn::crt::CRTPMTMatching &match,
228235
caf::SRCRTPMTMatch &srmatch,
229236
bool allowEmpty = false);

sbncode/HitFinder/ChannelROIToWire_module.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void ChannelROIToWire::produce(art::Event& evt)
141141

142142
std::vector<float> dataVec(range.data().size());
143143

144-
for(size_t binIdx = 0; binIdx < range.data().size(); binIdx++) dataVec[binIdx] = std::round(range.data()[binIdx] * ADCScaleFactor);
144+
for(size_t binIdx = 0; binIdx < range.data().size(); binIdx++) dataVec[binIdx] = std::round(range.data()[binIdx] / ADCScaleFactor);
145145

146146
ROIVec.add_range(startTick, std::move(dataVec));
147147
}

ups/product_deps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ product version qual flags <table_format=2>
255255
genie_xsec v3_04_00 -
256256
larcv2 v2_2_6 -
257257
larsoft v10_05_00 -
258-
sbnalg v10_04_08 -
258+
sbnalg v10_05_00 -
259259
sbndaq_artdaq_core v1_10_06 -
260260
sbndata v01_07 -
261261
systematicstools v01_04_04 -

0 commit comments

Comments
 (0)