LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "PointIdAlg.h"
Classes | |
struct | Config |
struct | WireDrift |
Public Types | |
enum | EMask { kNone = 0, kPdgMask = 0x00000FFF, kTypeMask = 0x0000F000, kVtxMask = 0xFFFF0000 } |
enum | ETrkType { kDelta = 0x1000, kMichel = 0x2000, kPriEl = 0x4000, kPriMu = 0x8000 } |
enum | EVtxId { kNuNC = 0x0010000, kNuCC = 0x0020000, kNuPri = 0x0040000, kNuE = 0x0100000, kNuMu = 0x0200000, kNuTau = 0x0400000, kHadr = 0x1000000, kPi0 = 0x2000000, kDecay = 0x4000000, kConv = 0x8000000, kElectronEnd = 0x10000000, kElastic = 0x20000000, kInelastic = 0x40000000 } |
enum | EDownscaleMode { kMax = 1, kMaxMean = 2, kMean = 3 } |
Public Member Functions | |
TrainingDataAlg (const fhicl::ParameterSet &pset) | |
TrainingDataAlg (const Config &config) | |
~TrainingDataAlg () override | |
void | reconfigure (const Config &config) |
bool | saveSimInfo () const |
bool | setEventData (const art::Event &event, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, unsigned int plane, unsigned int tpc, unsigned int cryo) |
bool | setDataEventData (const art::Event &event, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, unsigned int plane, unsigned int tpc, unsigned int cryo) |
bool | findCrop (float max_e_cut, unsigned int &w0, unsigned int &w1, unsigned int &d0, unsigned int &d1) const |
double | getEdepTot () const |
std::vector< float > const & | wireEdep (size_t widx) const |
std::vector< int > const & | wirePdg (size_t widx) const |
bool | setWireDriftData (const detinfo::DetectorClocksData &clock_data, const detinfo::DetectorPropertiesData &det_prop, const std::vector< recob::Wire > &wires, unsigned int plane, unsigned int tpc, unsigned int cryo) |
std::vector< float > const & | wireData (size_t widx) const |
std::vector< std::vector< float > > | getPatch (size_t wire, float drift, size_t patchSizeW, size_t patchSizeD) const |
float | getPixelOrZero (int wire, int drift) const |
double | getAdcSum () const |
size_t | getAdcArea () const |
float | poolMax (int wire, int drift, size_t r=0) const |
Pool max value in a patch around the wire/drift pixel. More... | |
unsigned int | Cryo () const |
Pool sum of pixels in a patch around the wire/drift pixel. More... | |
unsigned int | TPC () const |
unsigned int | Plane () const |
unsigned int | NWires () const |
unsigned int | NScaledDrifts () const |
unsigned int | NCachedDrifts () const |
unsigned int | DriftWindow () const |
float | ZeroLevel () const |
Level of zero ADC after scaling. More... | |
double | LifetimeCorrection (detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double tick) const |
Protected Member Functions | |
img::DataProviderAlgView | resizeView (detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, size_t wires, size_t drifts) override |
std::vector< float > | downscaleMax (std::size_t dst_size, std::vector< float > const &adc, size_t tick0) const |
std::vector< float > | downscaleMaxMean (std::size_t dst_size, std::vector< float > const &adc, size_t tick0) const |
std::vector< float > | downscaleMean (std::size_t dst_size, std::vector< float > const &adc, size_t tick0) const |
std::vector< float > | downscale (std::size_t dst_size, std::vector< float > const &adc, size_t tick0) const |
size_t | getDriftIndex (float drift) const |
std::optional< std::vector< float > > | setWireData (std::vector< float > const &adc, size_t wireIdx) const |
bool | patchFromDownsampledView (size_t wire, float drift, size_t size_w, size_t size_d, std::vector< std::vector< float >> &patch) const |
bool | patchFromOriginalView (size_t wire, float drift, size_t size_w, size_t size_d, std::vector< std::vector< float >> &patch) const |
Protected Attributes | |
DataProviderAlgView | fAlgView |
EDownscaleMode | fDownscaleMode |
size_t | fDriftWindow |
bool | fDownscaleFullView |
float | fDriftWindowInv |
calo::CalorimetryAlg | fCalorimetryAlg |
geo::GeometryCore const * | fGeometry |
Private Member Functions | |
WireDrift | getProjection (detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TLorentzVector &tvec, unsigned int plane) const |
bool | setWireEdepsAndLabels (std::vector< float > const &edeps, std::vector< int > const &pdgs, size_t wireIdx) |
void | collectVtxFlags (std::unordered_map< size_t, std::unordered_map< int, int >> &wireToDriftToVtxFlags, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const std::unordered_map< int, const simb::MCParticle * > &particleMap, unsigned int plane) const |
bool | isElectronEnd (const simb::MCParticle &particle, const std::unordered_map< int, const simb::MCParticle * > &particleMap) const |
bool | isMuonDecaying (const simb::MCParticle &particle, const std::unordered_map< int, const simb::MCParticle * > &particleMap) const |
Static Private Member Functions | |
static float | particleRange2 (const simb::MCParticle &particle) |
Private Attributes | |
double | fEdepTot |
std::vector< std::vector< float > > | fWireDriftEdep |
std::vector< std::vector< int > > | fWireDriftPdg |
art::InputTag | fWireProducerLabel |
art::InputTag | fHitProducerLabel |
art::InputTag | fTrackModuleLabel |
art::InputTag | fSimulationProducerLabel |
art::InputTag | fSimChannelProducerLabel |
bool | fSaveVtxFlags |
bool | fSaveSimInfo |
unsigned int | fAdcDelay |
std::vector< size_t > | fEventsPerBin |
Definition at line 196 of file PointIdAlg.h.
|
inherited |
Enumerator | |
---|---|
kMax | |
kMaxMean | |
kMean |
Definition at line 64 of file DataProviderAlg.h.
Enumerator | |
---|---|
kNone | |
kPdgMask | |
kTypeMask | |
kVtxMask |
Definition at line 198 of file PointIdAlg.h.
Enumerator | |
---|---|
kDelta | |
kMichel | |
kPriEl | |
kPriMu |
Definition at line 205 of file PointIdAlg.h.
Enumerator | |
---|---|
kNuNC | |
kNuCC | |
kNuPri | |
kNuE | |
kNuMu | |
kNuTau | |
kHadr | |
kPi0 | |
kDecay | |
kConv | |
kElectronEnd | |
kElastic | |
kInelastic |
Definition at line 212 of file PointIdAlg.h.
|
inline |
Definition at line 252 of file PointIdAlg.h.
nnet::TrainingDataAlg::TrainingDataAlg | ( | const Config & | config | ) |
Definition at line 348 of file PointIdAlg.cxx.
References fSaveSimInfo, fSimChannelProducerLabel, fSimulationProducerLabel, art::InputTag::label(), and ~TrainingDataAlg().
|
overridedefault |
Referenced by TrainingDataAlg().
|
private |
Definition at line 564 of file PointIdAlg.cxx.
References util::abs(), simb::MCTrajectory::at(), img::DataProviderAlg::Cryo(), d, getProjection(), isElectronEnd(), isMuonDecaying(), kConv, kDecay, kElastic, kElectronEnd, simb::MCTrajectory::KeyToProcess(), kHadr, kInelastic, kNone, kNuPri, kPi0, img::DataProviderAlg::TPC(), and simb::MCTrajectory::TrajectoryProcesses().
Referenced by setEventData().
|
inlineinherited |
Pool sum of pixels in a patch around the wire/drift pixel.
Definition at line 161 of file DataProviderAlg.h.
Referenced by collectVtxFlags().
|
inlineprotectedinherited |
Definition at line 198 of file DataProviderAlg.h.
References img::DataProviderAlg::kMax, img::DataProviderAlg::kMaxMean, and img::DataProviderAlg::kMean.
Referenced by img::DataProviderAlg::patchFromOriginalView(), and img::DataProviderAlg::setWireData().
|
protectedinherited |
Definition at line 196 of file DataProviderAlg.cxx.
References img::DataProviderAlg::fAlgView, img::DataProviderAlg::fDriftWindow, img::DataProviderAlgView::fLifetimeCorrFactors, and img::DataProviderAlg::scaleAdcSamples().
|
protectedinherited |
Definition at line 217 of file DataProviderAlg.cxx.
References img::DataProviderAlg::fAlgView, img::DataProviderAlg::fDriftWindow, img::DataProviderAlgView::fLifetimeCorrFactors, n, and img::DataProviderAlg::scaleAdcSamples().
|
protectedinherited |
Definition at line 252 of file DataProviderAlg.cxx.
References img::DataProviderAlg::fAlgView, img::DataProviderAlg::fDriftWindow, img::DataProviderAlg::fDriftWindowInv, img::DataProviderAlgView::fLifetimeCorrFactors, and img::DataProviderAlg::scaleAdcSamples().
|
inlineinherited |
Definition at line 168 of file DataProviderAlg.h.
bool nnet::TrainingDataAlg::findCrop | ( | float | max_e_cut, |
unsigned int & | w0, | ||
unsigned int & | w1, | ||
unsigned int & | d0, | ||
unsigned int & | d1 | ||
) | const |
Definition at line 1026 of file PointIdAlg.cxx.
References d, and fWireDriftEdep.
Referenced by nnet::PointIdTrainingData::analyze().
|
inlineinherited |
|
inlineinherited |
Definition at line 152 of file DataProviderAlg.h.
|
inlineprotectedinherited |
Definition at line 210 of file DataProviderAlg.h.
References lar::dump::vector().
Referenced by img::DataProviderAlg::poolMax().
|
inline |
Definition at line 286 of file PointIdAlg.h.
|
inlineinherited |
Return patch of data centered on the wire and drift, witht the size in (downscaled) pixels givent with patchSizeW and patchSizeD. Pad with the zero-level calue if patch extends beyond the event projection.
Definition at line 122 of file DataProviderAlg.h.
|
inlineinherited |
Return value from the ADC buffer, or zero if coordinates are out of the view; will scale the drift according to the downscale settings.
Definition at line 142 of file DataProviderAlg.h.
|
private |
Definition at line 436 of file PointIdAlg.cxx.
References detinfo::DetectorPropertiesData::ConvertXToTicks(), nnet::TrainingDataAlg::WireDrift::Cryo, geo::CryostatID::Cryostat, geo::TPCGeo::DetectDriftDirection(), nnet::TrainingDataAlg::WireDrift::Drift, detinfo::DetectorPropertiesData::DriftVelocity(), e, img::DataProviderAlg::fGeometry, geo::GeometryCore::FindTPCAtPosition(), geo::CryostatID::isValid, geo::GeometryCore::NearestWireID(), nnet::TrainingDataAlg::WireDrift::TPC, geo::TPCID::TPC, geo::GeometryCore::TPC(), and nnet::TrainingDataAlg::WireDrift::Wire.
Referenced by collectVtxFlags().
|
private |
Definition at line 480 of file PointIdAlg.cxx.
References util::abs(), d, simb::MCParticle::Daughter(), simb::MCParticle::NumberDaughters(), particleRange2(), and simb::MCParticle::PdgCode().
Referenced by collectVtxFlags().
|
private |
Definition at line 534 of file PointIdAlg.cxx.
References util::abs(), d, simb::MCParticle::Daughter(), simb::MCParticle::EndProcess(), simb::MCParticle::NumberDaughters(), and simb::MCParticle::PdgCode().
Referenced by collectVtxFlags().
|
inlineinherited |
Definition at line 173 of file DataProviderAlg.h.
|
inlineinherited |
Definition at line 167 of file DataProviderAlg.h.
|
inlineinherited |
Definition at line 166 of file DataProviderAlg.h.
Referenced by nnet::PointIdTrainingData::analyze().
|
inlineinherited |
Definition at line 165 of file DataProviderAlg.h.
Referenced by nnet::PointIdTrainingData::analyze().
|
inlinestaticprivate |
Definition at line 321 of file PointIdAlg.h.
References simb::MCParticle::EndX(), simb::MCParticle::EndY(), simb::MCParticle::EndZ(), simb::MCParticle::Vx(), simb::MCParticle::Vy(), and simb::MCParticle::Vz().
Referenced by isElectronEnd().
|
protectedinherited |
Definition at line 439 of file DataProviderAlg.cxx.
References d, img::DataProviderAlg::fAdcZero, img::DataProviderAlg::fAlgView, img::DataProviderAlg::fDriftWindow, trkf::fill(), img::DataProviderAlgView::fWireDriftData, and w.
|
protectedinherited |
Definition at line 476 of file DataProviderAlg.cxx.
References d, img::DataProviderAlg::downscale(), img::DataProviderAlg::fAdcZero, img::DataProviderAlg::fAlgView, img::DataProviderAlg::fDriftWindow, trkf::fill(), img::DataProviderAlgView::fWireDriftData, util::size(), tmp, and w.
|
inlineinherited |
Definition at line 163 of file DataProviderAlg.h.
Referenced by img::DataProviderAlg::setWireDriftData(), pma::ProjectionMatchingAlg::validate_on_adc(), and pma::ProjectionMatchingAlg::validate_on_adc_test().
|
inherited |
Pool max value in a patch around the wire/drift pixel.
Definition at line 145 of file DataProviderAlg.cxx.
References col, d, img::DataProviderAlg::fAlgView, img::DataProviderAlg::fDownscaleFullView, img::DataProviderAlg::fDriftWindow, img::DataProviderAlgView::fNCachedDrifts, img::DataProviderAlgView::fNWires, img::DataProviderAlgView::fWireDriftData, img::DataProviderAlg::getDriftIndex(), r, and w.
Referenced by pma::ProjectionMatchingAlg::validate_on_adc(), and pma::ProjectionMatchingAlg::validate_on_adc_test().
void nnet::TrainingDataAlg::reconfigure | ( | const Config & | config | ) |
|
overrideprotectedvirtual |
Reimplemented from img::DataProviderAlg.
Definition at line 370 of file PointIdAlg.cxx.
References trkf::fill(), fWireDriftEdep, fWireDriftPdg, img::DataProviderAlg::resizeView(), and w.
|
inline |
bool nnet::TrainingDataAlg::setDataEventData | ( | const art::Event & | event, |
detinfo::DetectorClocksData const & | clockData, | ||
detinfo::DetectorPropertiesData const & | detProp, | ||
unsigned int | plane, | ||
unsigned int | tpc, | ||
unsigned int | cryo | ||
) |
Definition at line 720 of file PointIdAlg.cxx.
References larg4::dist(), img::DataProviderAlg::fAlgView, fEventsPerBin, fHitProducerLabel, art::fill_ptr_vector(), img::DataProviderAlgView::fNDrifts, fTrackModuleLabel, fWireProducerLabel, art::ProductRetriever::getByLabel(), img::DataProviderAlg::setWireDriftData(), and setWireEdepsAndLabels().
bool nnet::TrainingDataAlg::setEventData | ( | const art::Event & | event, |
detinfo::DetectorClocksData const & | clockData, | ||
detinfo::DetectorPropertiesData const & | detProp, | ||
unsigned int | plane, | ||
unsigned int | tpc, | ||
unsigned int | cryo | ||
) |
Definition at line 867 of file PointIdAlg.cxx.
References util::abs(), collectVtxFlags(), energy, fAdcDelay, img::DataProviderAlg::fAlgView, fEdepTot, img::DataProviderAlgView::fNDrifts, img::DataProviderAlgView::fNWires, fSaveSimInfo, fSaveVtxFlags, fSimChannelProducerLabel, fSimulationProducerLabel, img::DataProviderAlgView::fWireChannels, fWireProducerLabel, sim::LArG4Parameters::GeVToElectrons(), raw::InvalidChannelID, art::Event::isRealData(), kDelta, kMichel, kPdgMask, kPriEl, kPriMu, kTypeMask, img::DataProviderAlg::setWireDriftData(), setWireEdepsAndLabels(), and detinfo::DetectorClocksData::TPCTDC2Tick().
Referenced by nnet::PointIdTrainingData::analyze().
|
protectedinherited |
Definition at line 273 of file DataProviderAlg.cxx.
References img::DataProviderAlg::downscale(), img::DataProviderAlg::fAlgView, img::DataProviderAlg::fDownscaleFullView, and img::DataProviderAlgView::fWireDriftData.
Referenced by img::DataProviderAlg::setWireDriftData().
|
inherited |
Definition at line 289 of file DataProviderAlg.cxx.
References img::DataProviderAlg::addCoherentNoise(), img::DataProviderAlg::addWhiteNoise(), img::DataProviderAlg::applyBlur(), geo::GeometryCore::ChannelToWire(), img::DataProviderAlg::fAdcAreaOverThr, img::DataProviderAlg::fAdcSumOverThr, img::DataProviderAlg::fAdcSumThr, img::DataProviderAlg::fAlgView, img::DataProviderAlg::fCryo, img::DataProviderAlg::fGeometry, img::DataProviderAlg::fPlane, img::DataProviderAlg::fTPC, img::DataProviderAlgView::fWireChannels, img::DataProviderAlgView::fWireDriftData, detinfo::DetectorPropertiesData::NumberTimeSamples(), geo::GeometryCore::Nwires(), img::DataProviderAlg::Plane(), img::DataProviderAlg::resizeView(), and img::DataProviderAlg::setWireData().
Referenced by nnet::ParticleDecayId::DetectDecay(), nnet::EmTrackClusterId2out::produce(), nnet::EmTrackClusterId::produce(), nnet::EmTrackMichelId::produce(), setDataEventData(), and setEventData().
|
private |
Definition at line 393 of file PointIdAlg.cxx.
References img::DataProviderAlg::fAlgView, img::DataProviderAlg::fDownscaleFullView, img::DataProviderAlg::fDriftWindow, img::DataProviderAlgView::fNCachedDrifts, fSaveVtxFlags, fWireDriftEdep, fWireDriftPdg, kPdgMask, kTypeMask, and kVtxMask.
Referenced by setDataEventData(), and setEventData().
|
inlineinherited |
|
inlineinherited |
Definition at line 117 of file DataProviderAlg.h.
Referenced by nnet::PointIdTrainingData::analyze().
|
inline |
Definition at line 287 of file PointIdAlg.h.
Referenced by nnet::PointIdTrainingData::analyze().
|
inline |
Definition at line 288 of file PointIdAlg.h.
Referenced by nnet::PointIdTrainingData::analyze().
|
inlineinherited |
|
private |
Definition at line 346 of file PointIdAlg.h.
Referenced by setEventData().
|
protectedinherited |
Definition at line 181 of file DataProviderAlg.h.
Referenced by img::DataProviderAlg::addCoherentNoise(), img::DataProviderAlg::addWhiteNoise(), img::DataProviderAlg::applyBlur(), img::DataProviderAlg::downscaleMax(), img::DataProviderAlg::downscaleMaxMean(), img::DataProviderAlg::downscaleMean(), nnet::PointIdAlg::isInsideFiducialRegion(), img::DataProviderAlg::patchFromDownsampledView(), img::DataProviderAlg::patchFromOriginalView(), img::DataProviderAlg::poolMax(), setDataEventData(), setEventData(), img::DataProviderAlg::setWireData(), img::DataProviderAlg::setWireDriftData(), and setWireEdepsAndLabels().
|
protectedinherited |
Definition at line 238 of file DataProviderAlg.h.
Referenced by img::DataProviderAlg::DataProviderAlg(), and img::DataProviderAlg::resizeView().
|
protectedinherited |
Definition at line 186 of file DataProviderAlg.h.
Referenced by img::DataProviderAlg::addCoherentNoise(), img::DataProviderAlg::addWhiteNoise(), img::DataProviderAlg::DataProviderAlg(), nnet::PointIdAlg::isCurrentPatch(), nnet::PointIdAlg::isSamePatch(), img::DataProviderAlg::poolMax(), img::DataProviderAlg::resizeView(), img::DataProviderAlg::setWireData(), and setWireEdepsAndLabels().
|
protectedinherited |
Definition at line 182 of file DataProviderAlg.h.
Referenced by img::DataProviderAlg::DataProviderAlg().
|
protectedinherited |
Definition at line 185 of file DataProviderAlg.h.
Referenced by img::DataProviderAlg::addCoherentNoise(), img::DataProviderAlg::addWhiteNoise(), img::DataProviderAlg::DataProviderAlg(), img::DataProviderAlg::downscaleMax(), img::DataProviderAlg::downscaleMaxMean(), img::DataProviderAlg::downscaleMean(), nnet::PointIdAlg::isCurrentPatch(), nnet::PointIdAlg::isInsideFiducialRegion(), nnet::PointIdAlg::isSamePatch(), img::DataProviderAlg::patchFromDownsampledView(), img::DataProviderAlg::patchFromOriginalView(), img::DataProviderAlg::poolMax(), img::DataProviderAlg::resizeView(), and setWireEdepsAndLabels().
|
protectedinherited |
Definition at line 187 of file DataProviderAlg.h.
Referenced by img::DataProviderAlg::DataProviderAlg(), and img::DataProviderAlg::downscaleMean().
|
private |
Definition at line 334 of file PointIdAlg.h.
Referenced by setEventData().
|
private |
Definition at line 348 of file PointIdAlg.h.
Referenced by setDataEventData().
|
protectedinherited |
Definition at line 241 of file DataProviderAlg.h.
Referenced by img::DataProviderAlg::DataProviderAlg(), getProjection(), and img::DataProviderAlg::setWireDriftData().
|
private |
Definition at line 339 of file PointIdAlg.h.
Referenced by setDataEventData().
|
private |
Definition at line 344 of file PointIdAlg.h.
Referenced by setEventData(), and TrainingDataAlg().
|
private |
Definition at line 343 of file PointIdAlg.h.
Referenced by setEventData(), and setWireEdepsAndLabels().
|
private |
Definition at line 342 of file PointIdAlg.h.
Referenced by setEventData(), and TrainingDataAlg().
|
private |
Definition at line 341 of file PointIdAlg.h.
Referenced by setEventData(), and TrainingDataAlg().
|
private |
Definition at line 340 of file PointIdAlg.h.
Referenced by setDataEventData().
|
private |
Definition at line 335 of file PointIdAlg.h.
Referenced by findCrop(), resizeView(), and setWireEdepsAndLabels().
|
private |
Definition at line 336 of file PointIdAlg.h.
Referenced by resizeView(), and setWireEdepsAndLabels().
|
private |
Definition at line 338 of file PointIdAlg.h.
Referenced by setDataEventData(), and setEventData().