Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions sbncode/CAFMaker/CAFMakerParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,92 @@ namespace caf
25.
};

struct PFOCharLabels_t {
Atom<string> EndFractionName {
Name("EndFractionName"),
Comment("Provide the tool name for the EndFraction BDT variable."),
"LArThreeDChargeFeatureTool_EndFraction"
};

Atom<string> FractionalSpreadName {
Name("FractionalSpreadName"),
Comment("Provide the tool name for the FractionalSpread BDT variable."),
"LArThreeDChargeFeatureTool_FractionalSpread"
};

Atom<string> DiffStraightLineMeanName {
Name("DiffStraightLineMeanName"),
Comment("Provide the tool name for the DiffStraightLineMean BDT variable."),
"LArThreeDChargeFeatureTool_DiffStraightLineMean"
Comment thread
rtriozzi marked this conversation as resolved.
Outdated
};

Atom<string> LengthName {
Name("LengthName"),
Comment("Provide the tool name for the Length BDT variable."),
"LArThreeDChargeFeatureTool_Length"
Comment thread
rtriozzi marked this conversation as resolved.
Outdated
};

Atom<string> MaxFitGapLengthName {
Name("MaxFitGapLengthName"),
Comment("Provide the tool name for the MaxFitGapLength BDT variable."),
"LArThreeDChargeFeatureTool_MaxFitGapLength"
Comment thread
rtriozzi marked this conversation as resolved.
Outdated
};

Atom<string> SlidingLinearFitRMSName {
Name("SlidingLinearFitRMSName"),
Comment("Provide the tool name for the SlidingLinearFitRMS BDT variable."),
"LArThreeDChargeFeatureTool_SlidingLinearFitRMS"
Comment thread
rtriozzi marked this conversation as resolved.
Outdated
};

Atom<string> AngleDiffName {
Name("AngleDiffName"),
Comment("Provide the tool name for the AngleDiff BDT variable."),
"LArThreeDChargeFeatureTool_AngleDiff"
Comment thread
rtriozzi marked this conversation as resolved.
Outdated
};

Atom<string> SecondaryPCARatioName {
Name("SecondaryPCARatioName"),
Comment("Provide the tool name for the SecondaryPCARatio BDT variable."),
"LArThreeDChargeFeatureTool_SecondaryPCARatio"
Comment thread
rtriozzi marked this conversation as resolved.
Outdated
};

Atom<string> TertiaryPCARatioName {
Name("TertiaryPCARatioName"),
Comment("Provide the tool name for the TertiaryPCARatio BDT variable."),
"LArThreeDChargeFeatureTool_TertiaryPCARatio"
Comment thread
rtriozzi marked this conversation as resolved.
Outdated
};

Atom<string> VertexDistanceName {
Name("VertexDistanceName"),
Comment("Provide the tool name for the VertexDistance BDT variable."),
"LArThreeDChargeFeatureTool_VertexDistanceName"
Comment thread
rtriozzi marked this conversation as resolved.
Outdated
};

Atom<string> HaloTotalRatioName {
Name("HaloTotalRatioName"),
Comment("Provide the tool name for the HaloTotalRatio BDT variable."),
"LArThreeDChargeFeatureTool_HaloTotalRatioName"
Comment thread
rtriozzi marked this conversation as resolved.
Outdated
};

Atom<string> ConcentrationName {
Name("ConcentrationName"),
Comment("Provide the tool name for the Concentration BDT variable."),
"LArThreeDChargeFeatureTool_Concentration"
Comment thread
rtriozzi marked this conversation as resolved.
Outdated

};

Atom<string> ConicalnessName {
Name("ConicalnessName"),
Comment("Provide the tool name for the Conicalness BDT variable."),
"LArThreeDChargeFeatureTool_Conicalness"
Comment thread
rtriozzi marked this conversation as resolved.
Outdated
};
};

Table<PFOCharLabels_t> PFOCharLabels {
Name("PFOCharLabels"),
Comment("Provide tool names for the Pandora track/shower discrimination BDT variables.")
};
Comment thread
rtriozzi marked this conversation as resolved.
Outdated

Atom<bool> ReferencePMTFromTriggerToBeam {
Name("ReferencePMTFromTriggerToBeam"),
Comment("Whether to switch the reference time of PMT reco from 'trigger' to 'beam spill' time."),
Expand Down
17 changes: 16 additions & 1 deletion sbncode/CAFMaker/CAFMaker_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2098,7 +2098,22 @@ void CAFMaker::produce(art::Event& evt) noexcept {
}

const larpandoraobj::PFParticleMetadata *pfpMeta = (fmPFPMeta.at(iPart).empty()) ? NULL : fmPFPMeta.at(iPart).at(0).get();
FillPFPVars(thisParticle, primary, pfpMeta, thisPFPT0, pfp);
const caf::PFOCharLabelsStruct pfoCharLabels {
fParams.PFOCharLabels().EndFractionName(),
fParams.PFOCharLabels().FractionalSpreadName(),
fParams.PFOCharLabels().DiffStraightLineMeanName(),
fParams.PFOCharLabels().LengthName(),
fParams.PFOCharLabels().MaxFitGapLengthName(),
fParams.PFOCharLabels().SlidingLinearFitRMSName(),
fParams.PFOCharLabels().AngleDiffName(),
fParams.PFOCharLabels().SecondaryPCARatioName(),
fParams.PFOCharLabels().TertiaryPCARatioName(),
fParams.PFOCharLabels().VertexDistanceName(),
fParams.PFOCharLabels().HaloTotalRatioName(),
fParams.PFOCharLabels().ConcentrationName(),
fParams.PFOCharLabels().ConicalnessName()
};
Comment thread
rtriozzi marked this conversation as resolved.
FillPFPVars(thisParticle, primary, pfpMeta, thisPFPT0, pfp, pfoCharLabels);

if (fmCNNScores.isValid()) {
const sbn::PFPCNNScore *cnnScores = fmCNNScores.at(iPart).at(0).get();
Expand Down
27 changes: 14 additions & 13 deletions sbncode/CAFMaker/FillReco.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,7 @@ namespace caf
const larpandoraobj::PFParticleMetadata *pfpMeta,
const art::Ptr<anab::T0> t0,
caf::SRPFP& srpfp,
const PFOCharLabelsStruct& pfoCharLabels,
bool allowEmpty)
{
srpfp.id = particle.Self();
Expand All @@ -918,19 +919,19 @@ namespace caf
// Pfo Characterisation features
srpfp.pfochar.setDefault();

CopyPropertyIfSet(propertiesMap, "LArThreeDChargeFeatureTool_EndFraction", srpfp.pfochar.chgendfrac);
Comment thread
brucehoward-physics marked this conversation as resolved.
CopyPropertyIfSet(propertiesMap, "LArThreeDChargeFeatureTool_FractionalSpread", srpfp.pfochar.chgfracspread);
CopyPropertyIfSet(propertiesMap, "LArThreeDLinearFitFeatureTool_DiffStraightLineMean", srpfp.pfochar.linfitdiff);
CopyPropertyIfSet(propertiesMap, "LArThreeDLinearFitFeatureTool_Length", srpfp.pfochar.linfitlen);
CopyPropertyIfSet(propertiesMap, "LArThreeDLinearFitFeatureTool_MaxFitGapLength", srpfp.pfochar.linfitgaplen);
CopyPropertyIfSet(propertiesMap, "LArThreeDLinearFitFeatureTool_SlidingLinearFitRMS", srpfp.pfochar.linfitrms);
CopyPropertyIfSet(propertiesMap, "LArThreeDOpeningAngleFeatureTool_AngleDiff", srpfp.pfochar.openanglediff);
CopyPropertyIfSet(propertiesMap, "LArThreeDPCAFeatureTool_SecondaryPCARatio", srpfp.pfochar.pca2ratio);
CopyPropertyIfSet(propertiesMap, "LArThreeDPCAFeatureTool_TertiaryPCARatio", srpfp.pfochar.pca3ratio);
CopyPropertyIfSet(propertiesMap, "LArThreeDVertexDistanceFeatureTool_VertexDistance", srpfp.pfochar.vtxdist);
CopyPropertyIfSet(propertiesMap, "LArConeChargeFeatureTool_HaloTotalRatio", srpfp.pfochar.halototratio);
CopyPropertyIfSet(propertiesMap, "LArConeChargeFeatureTool_Concentration", srpfp.pfochar.concentration);
CopyPropertyIfSet(propertiesMap, "LArConeChargeFeatureTool_Conicalness", srpfp.pfochar.conicalness);
CopyPropertyIfSet(propertiesMap, pfoCharLabels.EndFractionName, srpfp.pfochar.chgendfrac);
CopyPropertyIfSet(propertiesMap, pfoCharLabels.FractionalSpreadName, srpfp.pfochar.chgfracspread);
CopyPropertyIfSet(propertiesMap, pfoCharLabels.DiffStraightLineMeanName, srpfp.pfochar.linfitdiff);
CopyPropertyIfSet(propertiesMap, pfoCharLabels.LengthName, srpfp.pfochar.linfitlen);
CopyPropertyIfSet(propertiesMap, pfoCharLabels.MaxFitGapLengthName, srpfp.pfochar.linfitgaplen);
CopyPropertyIfSet(propertiesMap, pfoCharLabels.SlidingLinearFitRMSName, srpfp.pfochar.linfitrms);
CopyPropertyIfSet(propertiesMap, pfoCharLabels.AngleDiffName, srpfp.pfochar.openanglediff);
CopyPropertyIfSet(propertiesMap, pfoCharLabels.SecondaryPCARatioName, srpfp.pfochar.pca2ratio);
CopyPropertyIfSet(propertiesMap, pfoCharLabels.TertiaryPCARatioName, srpfp.pfochar.pca3ratio);
CopyPropertyIfSet(propertiesMap, pfoCharLabels.VertexDistanceName, srpfp.pfochar.vtxdist);
CopyPropertyIfSet(propertiesMap, pfoCharLabels.HaloTotalRatioName, srpfp.pfochar.halototratio);
CopyPropertyIfSet(propertiesMap, pfoCharLabels.ConcentrationName, srpfp.pfochar.concentration);
CopyPropertyIfSet(propertiesMap, pfoCharLabels.ConicalnessName, srpfp.pfochar.conicalness);
}
if (t0) {
srpfp.t0 = t0->Time() / 1e3; /* ns -> us */
Expand Down
19 changes: 18 additions & 1 deletion sbncode/CAFMaker/FillReco.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,29 @@ namespace caf
caf::SRHit& srhit,
bool allowEmpty = false);

struct PFOCharLabelsStruct {
std::string EndFractionName;
std::string FractionalSpreadName;
std::string DiffStraightLineMeanName;
std::string LengthName;
std::string MaxFitGapLengthName;
std::string SlidingLinearFitRMSName;
std::string AngleDiffName;
std::string SecondaryPCARatioName;
std::string TertiaryPCARatioName;
std::string VertexDistanceName;
std::string HaloTotalRatioName;
std::string ConcentrationName;
std::string ConicalnessName;
};

void FillPFPVars(const recob::PFParticle &particle,
const recob::PFParticle *primary,
const larpandoraobj::PFParticleMetadata *pfpMeta,
const art::Ptr<anab::T0> t0,
caf::SRPFP& srpfp,
bool allowEmpty= false);
const PFOCharLabelsStruct& pfoCharLabels,
bool allowEmpty = false);

void FillCNNScores(const recob::PFParticle &particle,
const sbn::PFPCNNScore *cnnscore,
Expand Down