Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
18b28ec
first draft of adding blips
Jjm321814 Oct 29, 2025
daa5c8e
Added blip library
Jjm321814 Oct 29, 2025
8dfaab0
forgot to add my blip to the vector
Jjm321814 Oct 29, 2025
23c5909
Adding blips to cafmaker
Jjm321814 Oct 30, 2025
6ec65f7
Merge branch 'develop' into feature/AddingBlipToCAF
Nov 10, 2025
3812b04
added blips to cafmaker
Nov 10, 2025
f830082
Merge branch 'develop' into feature/AddingBlipToCAF
Nov 13, 2025
e4cc10e
mistake in the cmakelist
Nov 13, 2025
0c62419
Updating include
Nov 13, 2025
97b9db8
Fixing comments that aren't tabs
Nov 20, 2025
44e03a4
Fixing indentation
Jjm321814 Nov 20, 2025
a44f4c6
part of general tvector3 replacement
Jjm321814 Nov 29, 2025
b6b0f4f
Missed one cmake list update
Jjm321814 Nov 29, 2025
ddda71a
Adjusting fillBlip to account for removed variables
Jjm321814 Nov 30, 2025
05878a3
change to camelcase
Jjm321814 Nov 30, 2025
3b3e41b
Merge branch 'develop' into feature/AddingBlipToCAF
Dec 1, 2025
fe6e410
Removed old code
Jjm321814 Dec 15, 2025
19f6c92
Aligning fcl param code indentation
Jjm321814 Dec 15, 2025
bd6ecab
Changed for loop per suggestion
Jjm321814 Dec 15, 2025
271cf7b
Assorted updated per PR comments
Jjm321814 Dec 15, 2025
5062c12
Compiler issue
Jjm321814 Dec 15, 2025
221712e
Compiler issue
Jjm321814 Dec 15, 2025
41428d5
Merge branch 'develop' into feature/AddingBlipToCAF
Jan 5, 2026
6521093
Adjusting labels for sbnanaobj updates
Jjm321814 Jan 9, 2026
99c3c0e
Merge branch 'develop' into feature/AddingBlipToCAF
Jjm321814 Feb 10, 2026
f41b6b8
fix typo
Jjm321814 Feb 10, 2026
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
5 changes: 5 additions & 0 deletions sbncode/CAFMaker/CAFMakerParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,11 @@ namespace caf
"cvn"
};

Atom<std::string> fBlipTag {
Name("BlipTag"),
Comment("Provide a string to label the blip input"),
"blipreco"
};
};
}

Expand Down
9 changes: 9 additions & 0 deletions sbncode/CAFMaker/CAFMaker_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "sbncode/CAFMaker/FillExposure.h"
#include "sbncode/CAFMaker/FillTrigger.h"
#include "sbncode/CAFMaker/Utils.h"
#include "sbncode/CAFMaker/FillBlip.h"

// C/C++ includes
#include <fenv.h>
Expand Down Expand Up @@ -1928,6 +1929,13 @@ void CAFMaker::produce(art::Event& evt) noexcept {
}
}

//Fill blips. art::handle for blips and then call fill blips for each one. Make a vector to hold all of them. I handle for loop in Fill blip
art::Handle<std::vector<blip::Blip>> blipHandle;
std::vector<caf::SRBlip> srblips;
if(evt.getByLabel( fParams.fBlipTag(), blipHandle)) //fill SR blips
{
FillBlip( *blipHandle, srblips);
}
// collect the TPC slices
std::vector<art::Ptr<recob::Slice>> slices;
std::vector<std::string> slice_tag_suffixes;
Expand Down Expand Up @@ -2605,6 +2613,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
rec.sbnd_crt_veto = srsbndcrtveto;
rec.opflashes = srflashes;
rec.nopflashes = srflashes.size();
rec.blips = srblips;
rec.sbnd_frames = srsbndframeshiftinfo;
rec.sbnd_timings = srsbndtiminginfo;
rec.soft_trig = srsbndsofttrig;
Expand Down
1 change: 1 addition & 0 deletions sbncode/CAFMaker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ art_make_library( LIBRARY_NAME sbncode_CAFMaker
sbnobj::Common_Trigger
sbnobj::SBND_CRT
sbnobj::SBND_Timing
sbnobj::SBND_Blip
lardataalg::DetectorInfo
art::Framework_Services_System_TriggerNamesService_service
sbncode_Metadata_MetadataSBN_service
Expand Down
96 changes: 96 additions & 0 deletions sbncode/CAFMaker/FillBlip.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#include "sbncode/CAFMaker/FillBlip.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting in a separate file, FillReco is getting unwieldy.


namespace caf
{
void FillBlip( const std::vector<blip::Blip>& LAr_Blips, std::vector<caf::SRBlip>& CAF_Blips)
{
for(blip::Blip const& CurrentBlip: LAr_Blips)
{
caf::SRBlip NewBlip;
NewBlip.ID = CurrentBlip.ID;
NewBlip.isValid = CurrentBlip.isValid;
NewBlip.cryostat = CurrentBlip.Cryostat;
NewBlip.TPC = CurrentBlip.TPC;
NewBlip.nPlanes = CurrentBlip.NPlanes;
NewBlip.maxWireSpan = CurrentBlip.MaxWireSpan;
NewBlip.timeTick = CurrentBlip.TimeTick;
NewBlip.time = CurrentBlip.Time;
NewBlip.charge = CurrentBlip.Charge;
NewBlip.energy = CurrentBlip.Energy/1000.; //convert to GeV
NewBlip.energyESTAR = CurrentBlip.EnergyESTAR/1000.; //convert to GeV
NewBlip.energyPSTAR = CurrentBlip.EnergyPSTAR/1000.; //convert to GeV
NewBlip.proxTrkDist = CurrentBlip.ProxTrkDist;
NewBlip.proxTrkID = CurrentBlip.ProxTrkID;
NewBlip.inCylinder = CurrentBlip.inCylinder;
NewBlip.position.SetXYZ(CurrentBlip.Position.X(), CurrentBlip.Position.Y(), CurrentBlip.Position.Z());
NewBlip.sigmaYZ = CurrentBlip.SigmaYZ;
NewBlip.dX = CurrentBlip.dX;
NewBlip.dYZ = CurrentBlip.dYZ;
if(CurrentBlip.truth.ID >= 0 ) //MC Blip
{
FillMCTruthBlip( CurrentBlip.truth, NewBlip.truthBlip );
}
for(int iPlane=0; iPlane<int(blip::kNplanes); iPlane++)
{
FillBlipRelatedHitCluster( CurrentBlip.clusters[iPlane], NewBlip.clusters[iPlane] );
}
CAF_Blips.push_back(NewBlip);
}

}

void FillMCTruthBlip( blip::TrueBlip const & TrueLAr_Blip, caf::SRTrueBlip &TrueCAF_Blip )
{
TrueCAF_Blip.ID = TrueLAr_Blip.ID;
TrueCAF_Blip.cryostat = TrueLAr_Blip.Cryostat;
TrueCAF_Blip.TPC = TrueLAr_Blip.TPC;
TrueCAF_Blip.time = TrueLAr_Blip.Time;
TrueCAF_Blip.driftTime = TrueLAr_Blip.DriftTime;
TrueCAF_Blip.energy = TrueLAr_Blip.Energy;
TrueCAF_Blip.depElectrons = TrueLAr_Blip.DepElectrons;
TrueCAF_Blip.numElectrons = TrueLAr_Blip.NumElectrons;
TrueCAF_Blip.leadG4ID = TrueLAr_Blip.LeadG4ID;
TrueCAF_Blip.leadG4Index = TrueLAr_Blip.LeadG4Index;
TrueCAF_Blip.leadG4PDG = TrueLAr_Blip.LeadG4PDG;
TrueCAF_Blip.leadCharge = TrueLAr_Blip.LeadCharge;
TrueCAF_Blip.position.SetXYZ(TrueLAr_Blip.Position.X(), TrueLAr_Blip.Position.Y(), TrueLAr_Blip.Position.Z());
TrueCAF_Blip.energy = TrueCAF_Blip.energy/1000.; //convert to GeV
}

void FillBlipRelatedHitCluster(blip::HitClust const & LAr_HitClust, caf::SRBlipHitClust &CAF_HitClust)
{
CAF_HitClust.ID = LAr_HitClust.ID;
CAF_HitClust.isValid = LAr_HitClust.isValid;
CAF_HitClust.centerChan = LAr_HitClust.CenterChan;
CAF_HitClust.centerWire = LAr_HitClust.CenterWire;
CAF_HitClust.isTruthMatched = LAr_HitClust.isTruthMatched;
CAF_HitClust.isMatched = LAr_HitClust.isMatched;
CAF_HitClust.deadWireSep = LAr_HitClust.DeadWireSep;
CAF_HitClust.cryostat = LAr_HitClust.Cryostat;
CAF_HitClust.TPC = LAr_HitClust.TPC;
CAF_HitClust.plane = LAr_HitClust.Plane;
CAF_HitClust.nHits = LAr_HitClust.NHits;
CAF_HitClust.nWires = LAr_HitClust.NWires;
CAF_HitClust.ADCs = LAr_HitClust.ADCs;
CAF_HitClust.amplitude = LAr_HitClust.Amplitude;
CAF_HitClust.charge = LAr_HitClust.Charge;
CAF_HitClust.sigmaCharge = LAr_HitClust.SigmaCharge;
CAF_HitClust.timeTick = LAr_HitClust.TimeTick;
CAF_HitClust.time = LAr_HitClust.Time;
CAF_HitClust.startTime = LAr_HitClust.StartTime;
CAF_HitClust.endTime = LAr_HitClust.EndTime;
CAF_HitClust.timespan = LAr_HitClust.Timespan;
CAF_HitClust.RMS = LAr_HitClust.RMS;
CAF_HitClust.startWire = LAr_HitClust.StartWire;
CAF_HitClust.endWire = LAr_HitClust.EndWire;
CAF_HitClust.nPulseTrainHits = LAr_HitClust.NPulseTrainHits;
CAF_HitClust.goodnessOfFit = LAr_HitClust.GoodnessOfFit;
CAF_HitClust.blipID = LAr_HitClust.BlipID;
CAF_HitClust.edepID = LAr_HitClust.EdepID;
//These are sets that need to become vectors so we need to do some loops
for(auto HitID : LAr_HitClust.HitIDs) CAF_HitClust.hitIDs.push_back(HitID);
for(auto Wire : LAr_HitClust.Wires) CAF_HitClust.wires.push_back(Wire);
for(auto Chan : LAr_HitClust.Chans) CAF_HitClust.chans.push_back(Chan);
for(auto G4ID : LAr_HitClust.G4IDs) CAF_HitClust.G4IDs.push_back(G4ID);
}
}
22 changes: 22 additions & 0 deletions sbncode/CAFMaker/FillBlip.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

/**
* @file sbncode/CAFMaker/FillBlip.h
* @brief CAFMaker utilities for filling "blip" objects into CAF.
* @author Jacob McLaughlin (jmclaughlin2@illinoistech.edu)
*/
#ifndef CAF_FILLBLIP_H
#define CAF_FILLBLIP_H
#include "sbnanaobj/StandardRecord/SRBlip.h"
#include "sbnobj/SBND/Blip/BlipDataTypes.h"

#include <vector>

namespace caf
{

void FillBlip( const std::vector<blip::Blip>& LAr_Blips, std::vector<caf::SRBlip>& CAF_Blips);
void FillMCTruthBlip( blip::TrueBlip const & TrueLAr_Blip, caf::SRTrueBlip &TrueCAF_Blip );
void FillBlipRelatedHitCluster(blip::HitClust const & LAr_HitClust, caf::SRBlipHitClust &CAF_HitClust);
}

#endif