Skip to content

Commit c9dd8f7

Browse files
authored
Merge pull request #538 from SBNSoftware/release/Mar25Production
Merge `release/Mar25Production` into develop
2 parents ac0dda7 + 7f4e4e1 commit c9dd8f7

4 files changed

Lines changed: 43 additions & 5 deletions

File tree

sbncode/CAFMaker/CAFMakerParams.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,12 @@ namespace caf
278278
"pandoraTrackCRTHit"
279279
};
280280

281+
Atom<string> CRTHitMatchInfoLabel {
282+
Name("CRTHitMatchInfoLabel"),
283+
Comment("Base label of additional information on track to CRT hit matching producer."),
284+
"CRTT0Tagging"
285+
};
286+
281287
Atom<string> CRTTrackMatchLabel {
282288
Name("CRTTrackMatchLabel"),
283289
Comment("Base label of track to CRT track matching producer."),

sbncode/CAFMaker/CAFMaker_module.cc

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
#include "nusimdata/SimulationBase/MCNeutrino.h"
102102
#include "nusimdata/SimulationBase/GTruth.h"
103103

104+
#include "sbnobj/Common/CRT/CRTHitT0TaggingInfo.hh"
104105
#include "sbnobj/Common/EventGen/MeVPrtl/MeVPrtlTruth.h"
105106
#include "sbnobj/Common/Reco/RangeP.h"
106107
#include "sbnobj/Common/SBNEventWeight/EventWeightMap.h"
@@ -1950,9 +1951,14 @@ void CAFMaker::produce(art::Event& evt) noexcept {
19501951

19511952
// NOTE: The sbn::crt::CRTHit is associated to the T0. It's a bit awkward to
19521953
// access that here, so we do it per-track (see code where fmCRTHitMatch is accessed below)
1954+
19531955
art::FindManyP<anab::T0> fmCRTHitMatch =
19541956
FindManyPStrict<anab::T0>(slcTracks, evt,
1955-
fParams.CRTHitMatchLabel() + slice_tag_suff);
1957+
fParams.CRTHitMatchLabel());
1958+
1959+
art::FindManyP<sbn::crt::CRTHitT0TaggingInfo> fmCRTHitMatchInfo =
1960+
FindManyPStrict<sbn::crt::CRTHitT0TaggingInfo>(slcTracks, evt,
1961+
fParams.CRTHitMatchInfoLabel());
19561962

19571963
// TODO: also save the sbn::crt::CRTTrack in the matching so that CAFMaker has access to it
19581964
art::FindManyP<anab::T0> fmCRTTrackMatch =
@@ -2191,14 +2197,19 @@ void CAFMaker::produce(art::Event& evt) noexcept {
21912197
fParams.TrackHitFillRRStartCut(), fParams.TrackHitFillRREndCut(),
21922198
dprop, trk);
21932199
}
2200+
21942201
if (fmCRTHitMatch.isValid() && fDet == kICARUS) {
21952202
art::FindManyP<sbn::crt::CRTHit> CRTT02Hit = FindManyPStrict<sbn::crt::CRTHit>
2196-
(fmCRTHitMatch.at(iPart), evt, fParams.CRTHitMatchLabel() + slice_tag_suff);
2203+
(fmCRTHitMatch.at(iPart), evt, fParams.CRTHitMatchLabel());
21972204

21982205
std::vector<art::Ptr<sbn::crt::CRTHit>> crthitmatch;
2199-
if (CRTT02Hit.isValid() && CRTT02Hit.size() == 1) crthitmatch = CRTT02Hit.at(0);
2200-
2201-
FillTrackCRTHit(fmCRTHitMatch.at(iPart), crthitmatch, fParams.CRTUseTS0(), CRT_T0_reference_time, CRT_T1_reference_time, trk);
2206+
std::vector<art::Ptr<sbn::crt::CRTHitT0TaggingInfo>> crthittagginginfo;
2207+
if(CRTT02Hit.isValid() && CRTT02Hit.size() == 1){
2208+
crthitmatch = CRTT02Hit.at(0);
2209+
crthittagginginfo = fmCRTHitMatchInfo.at(iPart);
2210+
}
2211+
2212+
FillTrackCRTHit(fmCRTHitMatch.at(iPart), crthitmatch, crthittagginginfo, fParams.CRTUseTS0(), CRT_T0_reference_time, CRT_T1_reference_time, trk);
22022213
}
22032214
// NOTE: SEE TODO AT fmCRTTrackMatch
22042215
if (fmCRTTrackMatch.isValid() && fDet == kICARUS) {

sbncode/CAFMaker/FillReco.cxx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,18 +581,37 @@ namespace caf
581581

582582
//......................................................................
583583

584+
584585
void FillTrackCRTHit(const std::vector<art::Ptr<anab::T0>> &t0match,
585586
const std::vector<art::Ptr<sbn::crt::CRTHit>> &hitmatch,
587+
const std::vector<art::Ptr<sbn::crt::CRTHitT0TaggingInfo>> &hitmatchinfo,
586588
bool use_ts0,
587589
int64_t CRT_T0_reference_time, // ns, signed
588590
double CRT_T1_reference_time, // us
589591
caf::SRTrack &srtrack,
590592
bool allowEmpty)
591593
{
594+
// Francesco Poppi: In the current implementation, hitmatch and hitmatchinfo are
595+
// vectors of pointers, but currently they are vector of size 1.
596+
// The reason behind the current implementation is that we only store the
597+
// best CRT candidate in the selection, eventually, we can store a vector
598+
// of "good" candidates and fill additional infos for all of them.
599+
// This is a TODO.
592600
if (t0match.size()) {
593601
assert(t0match.size() == 1);
594602
srtrack.crthit.distance = t0match[0]->fTriggerConfidence;
603+
srtrack.crthit.region = t0match[0]->fID;
604+
srtrack.crthit.sys = t0match[0]->fTriggerBits;
605+
if(hitmatchinfo.size() == 1){
606+
srtrack.crthit.deltaX = hitmatchinfo[0]->DeltaX;
607+
srtrack.crthit.deltaY = hitmatchinfo[0]->DeltaY;
608+
srtrack.crthit.deltaZ = hitmatchinfo[0]->DeltaZ;
609+
srtrack.crthit.crossX = hitmatchinfo[0]->CrossX;
610+
srtrack.crthit.crossY = hitmatchinfo[0]->CrossY;
611+
srtrack.crthit.crossZ = hitmatchinfo[0]->CrossZ;
612+
}
595613
srtrack.crthit.hit.time = t0match[0]->fTime / 1e3; /* ns -> us */
614+
srtrack.crthit.hit.plane = t0match[0]->fID;
596615
}
597616
if (hitmatch.size()) {
598617
FillCRTHit(*hitmatch[0], use_ts0, CRT_T0_reference_time, CRT_T1_reference_time, srtrack.crthit.hit, allowEmpty);

sbncode/CAFMaker/FillReco.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include "sbnobj/SBND/CRT/CRTSpacePoint.hh"
4141
#include "sbnobj/SBND/CRT/CRTTrack.hh"
4242
#include "sbnobj/Common/CRT/CRTPMTMatching.hh"
43+
#include "sbnobj/Common/CRT/CRTHitT0TaggingInfo.hh"
4344
#include "nusimdata/SimulationBase/MCParticle.h"
4445
#include "nusimdata/SimulationBase/MCTruth.h"
4546

@@ -132,6 +133,7 @@ namespace caf
132133

133134
void FillTrackCRTHit(const std::vector<art::Ptr<anab::T0>> &t0match,
134135
const std::vector<art::Ptr<sbn::crt::CRTHit>> &hitmatch,
136+
const std::vector<art::Ptr<sbn::crt::CRTHitT0TaggingInfo>> &hitmatchinfo,
135137
bool use_ts0,
136138
int64_t CRT_T0_reference_time, // ns, signed
137139
double CRT_T1_reference_time, // us

0 commit comments

Comments
 (0)