Skip to content

Commit 4ee6709

Browse files
authored
Merge branch 'develop' into feature/acastill_corrected_opflash
2 parents cb45ad5 + fc26e0a commit 4ee6709

7 files changed

Lines changed: 237 additions & 54 deletions

File tree

sbncode/CAFMaker/CAFMakerParams.h

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ namespace caf
1616
template<class T> using Atom = fhicl::Atom<T>;
1717
template<class T> using Sequence = fhicl::Sequence<T>;
1818
template<class T> using Table = fhicl::Table<T>;
19+
template<class T> using OptionalTable = fhicl::OptionalTable<T>;
1920
using Comment = fhicl::Comment;
2021
using Name = fhicl::Name;
2122
using string = std::string;
@@ -476,6 +477,92 @@ namespace caf
476477
25.
477478
};
478479

480+
struct PFOCharLabels_t {
481+
Atom<string> EndFractionName {
482+
Name("EndFractionName"),
483+
Comment("Provide the tool name for the EndFraction BDT variable."),
484+
"LArThreeDChargeFeatureTool_EndFraction"
485+
};
486+
487+
Atom<string> FractionalSpreadName {
488+
Name("FractionalSpreadName"),
489+
Comment("Provide the tool name for the FractionalSpread BDT variable."),
490+
"LArThreeDChargeFeatureTool_FractionalSpread"
491+
};
492+
493+
Atom<string> DiffStraightLineMeanName {
494+
Name("DiffStraightLineMeanName"),
495+
Comment("Provide the tool name for the DiffStraightLineMean BDT variable."),
496+
"LArThreeDLinearFitFeatureTool_DiffStraightLineMean"
497+
};
498+
499+
Atom<string> LengthName {
500+
Name("LengthName"),
501+
Comment("Provide the tool name for the Length BDT variable."),
502+
"LArThreeDLinearFitFeatureTool_Length"
503+
};
504+
505+
Atom<string> MaxFitGapLengthName {
506+
Name("MaxFitGapLengthName"),
507+
Comment("Provide the tool name for the MaxFitGapLength BDT variable."),
508+
"LArThreeDLinearFitFeatureTool_MaxFitGapLength"
509+
};
510+
511+
Atom<string> SlidingLinearFitRMSName {
512+
Name("SlidingLinearFitRMSName"),
513+
Comment("Provide the tool name for the SlidingLinearFitRMS BDT variable."),
514+
"LArThreeDLinearFitFeatureTool_SlidingLinearFitRMS"
515+
};
516+
517+
Atom<string> AngleDiffName {
518+
Name("AngleDiffName"),
519+
Comment("Provide the tool name for the AngleDiff BDT variable."),
520+
"LArThreeDOpeningAngleFeatureTool_AngleDiff"
521+
};
522+
523+
Atom<string> SecondaryPCARatioName {
524+
Name("SecondaryPCARatioName"),
525+
Comment("Provide the tool name for the SecondaryPCARatio BDT variable."),
526+
"LArThreeDPCAFeatureTool_SecondaryPCARatio"
527+
};
528+
529+
Atom<string> TertiaryPCARatioName {
530+
Name("TertiaryPCARatioName"),
531+
Comment("Provide the tool name for the TertiaryPCARatio BDT variable."),
532+
"LArThreeDPCAFeatureTool_TertiaryPCARatio"
533+
};
534+
535+
Atom<string> VertexDistanceName {
536+
Name("VertexDistanceName"),
537+
Comment("Provide the tool name for the VertexDistance BDT variable."),
538+
"LArThreeDVertexDistanceFeatureTool_VertexDistance"
539+
};
540+
541+
Atom<string> HaloTotalRatioName {
542+
Name("HaloTotalRatioName"),
543+
Comment("Provide the tool name for the HaloTotalRatio BDT variable."),
544+
"LArConeChargeFeatureTool_HaloTotalRatio"
545+
};
546+
547+
Atom<string> ConcentrationName {
548+
Name("ConcentrationName"),
549+
Comment("Provide the tool name for the Concentration BDT variable."),
550+
"LArConeChargeFeatureTool_Concentration"
551+
552+
};
553+
554+
Atom<string> ConicalnessName {
555+
Name("ConicalnessName"),
556+
Comment("Provide the tool name for the Conicalness BDT variable."),
557+
"LArConeChargeFeatureTool_Conicalness"
558+
};
559+
};
560+
561+
OptionalTable<PFOCharLabels_t> PFOCharLabels {
562+
Name("PFOCharLabels"),
563+
Comment("Provide tool names for the Pandora track/shower discrimination BDT variables.")
564+
};
565+
479566
Atom<bool> ReferencePMTFromTriggerToBeam {
480567
Name("ReferencePMTFromTriggerToBeam"),
481568
Comment("Whether to switch the reference time of PMT reco from 'trigger' to 'beam spill' time."),

sbncode/CAFMaker/CAFMaker_module.cc

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2265,7 +2265,24 @@ void CAFMaker::produce(art::Event& evt) noexcept {
22652265
}
22662266

22672267
const larpandoraobj::PFParticleMetadata *pfpMeta = (fmPFPMeta.at(iPart).empty()) ? NULL : fmPFPMeta.at(iPart).at(0).get();
2268-
FillPFPVars(thisParticle, primary, pfpMeta, thisPFPT0, pfp);
2268+
caf::CAFMakerParams::PFOCharLabels_t const& pfoCharParams
2269+
= fParams.PFOCharLabels().value_or(caf::CAFMakerParams::PFOCharLabels_t{});
2270+
const caf::PFOCharLabelsStruct pfoCharLabels {
2271+
pfoCharParams.EndFractionName(),
2272+
pfoCharParams.FractionalSpreadName(),
2273+
pfoCharParams.DiffStraightLineMeanName(),
2274+
pfoCharParams.LengthName(),
2275+
pfoCharParams.MaxFitGapLengthName(),
2276+
pfoCharParams.SlidingLinearFitRMSName(),
2277+
pfoCharParams.AngleDiffName(),
2278+
pfoCharParams.SecondaryPCARatioName(),
2279+
pfoCharParams.TertiaryPCARatioName(),
2280+
pfoCharParams.VertexDistanceName(),
2281+
pfoCharParams.HaloTotalRatioName(),
2282+
pfoCharParams.ConcentrationName(),
2283+
pfoCharParams.ConicalnessName()
2284+
};
2285+
FillPFPVars(thisParticle, primary, pfpMeta, thisPFPT0, pfp, pfoCharLabels);
22692286

22702287
if (fmCNNScores.isValid()) {
22712288
const sbn::PFPCNNScore *cnnScores = fmCNNScores.at(iPart).at(0).get();

sbncode/CAFMaker/FillReco.cxx

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,7 @@ namespace caf
10231023
const larpandoraobj::PFParticleMetadata *pfpMeta,
10241024
const art::Ptr<anab::T0> t0,
10251025
caf::SRPFP& srpfp,
1026+
const PFOCharLabelsStruct& pfoCharLabels,
10261027
bool allowEmpty)
10271028
{
10281029
srpfp.id = particle.Self();
@@ -1046,19 +1047,19 @@ namespace caf
10461047
// Pfo Characterisation features
10471048
srpfp.pfochar.setDefault();
10481049

1049-
CopyPropertyIfSet(propertiesMap, "LArThreeDChargeFeatureTool_EndFraction", srpfp.pfochar.chgendfrac);
1050-
CopyPropertyIfSet(propertiesMap, "LArThreeDChargeFeatureTool_FractionalSpread", srpfp.pfochar.chgfracspread);
1051-
CopyPropertyIfSet(propertiesMap, "LArThreeDLinearFitFeatureTool_DiffStraightLineMean", srpfp.pfochar.linfitdiff);
1052-
CopyPropertyIfSet(propertiesMap, "LArThreeDLinearFitFeatureTool_Length", srpfp.pfochar.linfitlen);
1053-
CopyPropertyIfSet(propertiesMap, "LArThreeDLinearFitFeatureTool_MaxFitGapLength", srpfp.pfochar.linfitgaplen);
1054-
CopyPropertyIfSet(propertiesMap, "LArThreeDLinearFitFeatureTool_SlidingLinearFitRMS", srpfp.pfochar.linfitrms);
1055-
CopyPropertyIfSet(propertiesMap, "LArThreeDOpeningAngleFeatureTool_AngleDiff", srpfp.pfochar.openanglediff);
1056-
CopyPropertyIfSet(propertiesMap, "LArThreeDPCAFeatureTool_SecondaryPCARatio", srpfp.pfochar.pca2ratio);
1057-
CopyPropertyIfSet(propertiesMap, "LArThreeDPCAFeatureTool_TertiaryPCARatio", srpfp.pfochar.pca3ratio);
1058-
CopyPropertyIfSet(propertiesMap, "LArThreeDVertexDistanceFeatureTool_VertexDistance", srpfp.pfochar.vtxdist);
1059-
CopyPropertyIfSet(propertiesMap, "LArConeChargeFeatureTool_HaloTotalRatio", srpfp.pfochar.halototratio);
1060-
CopyPropertyIfSet(propertiesMap, "LArConeChargeFeatureTool_Concentration", srpfp.pfochar.concentration);
1061-
CopyPropertyIfSet(propertiesMap, "LArConeChargeFeatureTool_Conicalness", srpfp.pfochar.conicalness);
1050+
CopyPropertyIfSet(propertiesMap, pfoCharLabels.EndFractionName, srpfp.pfochar.chgendfrac);
1051+
CopyPropertyIfSet(propertiesMap, pfoCharLabels.FractionalSpreadName, srpfp.pfochar.chgfracspread);
1052+
CopyPropertyIfSet(propertiesMap, pfoCharLabels.DiffStraightLineMeanName, srpfp.pfochar.linfitdiff);
1053+
CopyPropertyIfSet(propertiesMap, pfoCharLabels.LengthName, srpfp.pfochar.linfitlen);
1054+
CopyPropertyIfSet(propertiesMap, pfoCharLabels.MaxFitGapLengthName, srpfp.pfochar.linfitgaplen);
1055+
CopyPropertyIfSet(propertiesMap, pfoCharLabels.SlidingLinearFitRMSName, srpfp.pfochar.linfitrms);
1056+
CopyPropertyIfSet(propertiesMap, pfoCharLabels.AngleDiffName, srpfp.pfochar.openanglediff);
1057+
CopyPropertyIfSet(propertiesMap, pfoCharLabels.SecondaryPCARatioName, srpfp.pfochar.pca2ratio);
1058+
CopyPropertyIfSet(propertiesMap, pfoCharLabels.TertiaryPCARatioName, srpfp.pfochar.pca3ratio);
1059+
CopyPropertyIfSet(propertiesMap, pfoCharLabels.VertexDistanceName, srpfp.pfochar.vtxdist);
1060+
CopyPropertyIfSet(propertiesMap, pfoCharLabels.HaloTotalRatioName, srpfp.pfochar.halototratio);
1061+
CopyPropertyIfSet(propertiesMap, pfoCharLabels.ConcentrationName, srpfp.pfochar.concentration);
1062+
CopyPropertyIfSet(propertiesMap, pfoCharLabels.ConicalnessName, srpfp.pfochar.conicalness);
10621063
}
10631064
if (t0) {
10641065
srpfp.t0 = t0->Time() / 1e3; /* ns -> us */
@@ -1181,6 +1182,8 @@ namespace caf
11811182
slice.barycenterFM.deltaZ_Trigger = matchInfo->deltaZ_Trigger;
11821183
slice.barycenterFM.deltaY_Trigger = matchInfo->deltaY_Trigger;
11831184
slice.barycenterFM.radius_Trigger = matchInfo->radius_Trigger;
1185+
slice.barycenterFM.score = matchInfo->score;
1186+
slice.barycenterFM.chi2 = matchInfo->chi2;
11841187
}
11851188
}
11861189

sbncode/CAFMaker/FillReco.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,29 @@ namespace caf
141141
caf::SRHit& srhit,
142142
bool allowEmpty = false);
143143

144+
struct PFOCharLabelsStruct {
145+
std::string EndFractionName;
146+
std::string FractionalSpreadName;
147+
std::string DiffStraightLineMeanName;
148+
std::string LengthName;
149+
std::string MaxFitGapLengthName;
150+
std::string SlidingLinearFitRMSName;
151+
std::string AngleDiffName;
152+
std::string SecondaryPCARatioName;
153+
std::string TertiaryPCARatioName;
154+
std::string VertexDistanceName;
155+
std::string HaloTotalRatioName;
156+
std::string ConcentrationName;
157+
std::string ConicalnessName;
158+
};
159+
144160
void FillPFPVars(const recob::PFParticle &particle,
145161
const recob::PFParticle *primary,
146162
const larpandoraobj::PFParticleMetadata *pfpMeta,
147163
const art::Ptr<anab::T0> t0,
148164
caf::SRPFP& srpfp,
149-
bool allowEmpty= false);
165+
const PFOCharLabelsStruct& pfoCharLabels,
166+
bool allowEmpty = false);
150167

151168
void FillCNNScores(const recob::PFParticle &particle,
152169
const sbn::PFPCNNScore *cnnscore,

sbncode/Calibration/TrackCaloSkimmer.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
#include "sbnobj/Common/Calibration/TrackCaloSkimmerObj.h"
6464
#include "sbnobj/Common/CRT/CRTHitT0TaggingInfo.hh"
6565
#include "sbnobj/Common/CRT/CRTHitT0TaggingTruthInfo.hh"
66+
#include "sbnobj/SBND/CRT/CRTTrack.hh"
67+
#include "sbnobj/SBND/CRT/CRTSpacePoint.hh"
6668

6769
#include "ITCSSelectionTool.h"
6870

@@ -98,9 +100,12 @@ class sbn::TrackCaloSkimmer : public art::EDAnalyzer {
98100
double t0Pandora;
99101
double t0CRTTrack;
100102
double t0CRTHit;
103+
double t0CRTSpacePoint;
101104
bool hasT0Pandora;
102105
bool hasT0CRTTrack;
103106
bool hasT0CRTHit;
107+
bool hasT0CRTSpacePoint;
108+
double crtMatchingScore;
104109
};
105110

106111
// Internal data struct
@@ -178,7 +183,8 @@ class sbn::TrackCaloSkimmer : public art::EDAnalyzer {
178183
const geo::WireReadoutGeom *wireReadout,
179184
const detinfo::DetectorClocksData &dclock,
180185
const cheat::BackTrackerService *bt_serv,
181-
const detinfo::DetectorPropertiesData &dprop);
186+
const detinfo::DetectorPropertiesData &dprop,
187+
const float &xshift);
182188
void FillTrackCRTHitInfo(const std::vector<art::Ptr<sbn::crt::CRTHitT0TaggingInfo>> &tag);
183189

184190
// helpers
@@ -192,6 +198,7 @@ class sbn::TrackCaloSkimmer : public art::EDAnalyzer {
192198
art::InputTag fPFPT0producer;
193199
art::InputTag fCRTTrackT0producer;
194200
art::InputTag fCRTHitT0producer;
201+
art::InputTag fCRTSpacePointT0producer;
195202
art::InputTag fCALOproducer;
196203
art::InputTag fTRKproducer;
197204
art::InputTag fTRKHMproducer;
@@ -216,6 +223,7 @@ class sbn::TrackCaloSkimmer : public art::EDAnalyzer {
216223
double fTopCRTDistanceCutPassing;
217224
double fSideCRTDistanceCutStopping;
218225
double fSideCRTDistanceCutPassing;
226+
bool fAllowShowerLikePFPs;
219227

220228
// tools
221229
std::vector<std::unique_ptr<sbn::ITCSSelectionTool>> fSelectionTools;

0 commit comments

Comments
 (0)