diff --git a/sbncode/CAFMaker/CAFMakerParams.h b/sbncode/CAFMaker/CAFMakerParams.h index 0250e740f..6843b4ad9 100644 --- a/sbncode/CAFMaker/CAFMakerParams.h +++ b/sbncode/CAFMaker/CAFMakerParams.h @@ -635,6 +635,11 @@ namespace caf "cvn" }; + Atom fBlipTag { + Name("BlipTag"), + Comment("Provide a string to label the blip input"), + "blipreco" + }; }; } diff --git a/sbncode/CAFMaker/CAFMaker_module.cc b/sbncode/CAFMaker/CAFMaker_module.cc index 9f2c01590..46c1d475c 100644 --- a/sbncode/CAFMaker/CAFMaker_module.cc +++ b/sbncode/CAFMaker/CAFMaker_module.cc @@ -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 @@ -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> blipHandle; + std::vector srblips; + if(evt.getByLabel( fParams.fBlipTag(), blipHandle)) //fill SR blips + { + FillBlip( *blipHandle, srblips); + } // collect the TPC slices std::vector> slices; std::vector slice_tag_suffixes; @@ -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; diff --git a/sbncode/CAFMaker/CMakeLists.txt b/sbncode/CAFMaker/CMakeLists.txt index 5dd4f2a8f..7ffa9eb93 100644 --- a/sbncode/CAFMaker/CMakeLists.txt +++ b/sbncode/CAFMaker/CMakeLists.txt @@ -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 diff --git a/sbncode/CAFMaker/FillBlip.cxx b/sbncode/CAFMaker/FillBlip.cxx new file mode 100644 index 000000000..b6c86422b --- /dev/null +++ b/sbncode/CAFMaker/FillBlip.cxx @@ -0,0 +1,96 @@ +#include "sbncode/CAFMaker/FillBlip.h" + +namespace caf +{ + void FillBlip( const std::vector& LAr_Blips, std::vector& 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 + +namespace caf +{ + + void FillBlip( const std::vector& LAr_Blips, std::vector& CAF_Blips); + void FillMCTruthBlip( blip::TrueBlip const & TrueLAr_Blip, caf::SRBlipTrueBlip &TrueCAF_Blip ); + void FillBlipRealtedHitCluster(blip::HitClust const & LAr_HitClust, caf::SRBlipHitClust &CAF_HitClust); +} + +#endif