LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
nnet::TrainingDataAlg Class Reference

#include "PointIdAlg.h"

Inheritance diagram for nnet::TrainingDataAlg:
img::DataProviderAlg

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
}
 
enum  EDownscaleMode { kMax = 1, kMaxMean = 2, kMean = 3 }
 

Public Member Functions

 TrainingDataAlg (const fhicl::ParameterSet &pset)
 
 TrainingDataAlg (const Config &config)
 
 ~TrainingDataAlg (void) override
 
void reconfigure (const Config &config)
 
bool saveSimInfo () const
 
bool setEventData (const art::Event &event, unsigned int plane, unsigned int tpc, unsigned int cryo)
 
bool setDataEventData (const art::Event &event, 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 (void) const
 
std::vector< float > const & wireEdep (size_t widx) const
 
std::vector< int > const & wirePdg (size_t widx) const
 
bool setWireDriftData (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 (void) const
 
size_t getAdcArea (void) const
 
float poolMax (int wire, int drift, size_t r=0) const
 Pool max value in a patch around the wire/drift pixel. More...
 
float poolSum (int wire, int drift, size_t r=0) const
 Pool sum of pixels in a patch around the wire/drift pixel. More...
 
unsigned int Cryo (void) const
 
unsigned int TPC (void) const
 
unsigned int Plane (void) const
 
unsigned int NWires (void) const
 
unsigned int NScaledDrifts (void) const
 
unsigned int NCachedDrifts (void) const
 
unsigned int DriftWindow (void) const
 
float ZeroLevel (void) const
 Level of zero ADC after scaling. More...
 
double LifetimeCorrection (double tick) const
 

Protected Member Functions

void resizeView (size_t wires, size_t drifts) override
 
void downscaleMax (std::vector< float > &dst, std::vector< float > const &adc, size_t tick0) const
 
void downscaleMaxMean (std::vector< float > &dst, std::vector< float > const &adc, size_t tick0) const
 
void downscaleMean (std::vector< float > &dst, std::vector< float > const &adc, size_t tick0) const
 
void downscale (std::vector< float > &dst, std::vector< float > const &adc, size_t tick0) const
 
size_t getDriftIndex (float drift) const
 
bool setWireData (std::vector< float > const &adc, size_t wireIdx)
 
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

unsigned int fCryo
 
unsigned int fTPC
 
unsigned int fPlane
 
unsigned int fNWires
 
unsigned int fNDrifts
 
unsigned int fNScaledDrifts
 
unsigned int fNCachedDrifts
 
std::vector< raw::ChannelID_tfWireChannels
 
std::vector< std::vector< float > > fWireDriftData
 
std::vector< float > fLifetimeCorrFactors
 
EDownscaleMode fDownscaleMode
 
size_t fDriftWindow
 
bool fDownscaleFullView
 
float fDriftWindowInv
 
calo::CalorimetryAlg fCalorimetryAlg
 
geo::GeometryCore const * fGeometry
 
detinfo::DetectorProperties const * fDetProp
 

Private Member Functions

WireDrift getProjection (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, 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
 
bool fSaveVtxFlags
 
bool fSaveSimInfo
 
unsigned int fAdcDelay
 
std::vector< size_t > fEventsPerBin
 

Detailed Description

Definition at line 187 of file PointIdAlg.h.

Member Enumeration Documentation

Enumerator
kMax 
kMaxMean 
kMean 

Definition at line 49 of file DataProviderAlg.h.

Enumerator
kNone 
kPdgMask 
kTypeMask 
kVtxMask 

Definition at line 191 of file PointIdAlg.h.

192  {
193  kNone = 0,
194  kPdgMask = 0x00000FFF, // pdg code mask
195  kTypeMask = 0x0000F000, // track type mask
196  kVtxMask = 0xFFFF0000 // vertex flags
197  };
Enumerator
kDelta 
kMichel 
kPriEl 
kPriMu 

Definition at line 199 of file PointIdAlg.h.

200  {
201  kDelta = 0x1000, // delta electron
202  kMichel = 0x2000, // Michel electron
203  kPriEl = 0x4000, // primary electron
204  kPriMu = 0x8000 // primary muon
205  };
Enumerator
kNuNC 
kNuCC 
kNuPri 
kNuE 
kNuMu 
kNuTau 
kHadr 
kPi0 
kDecay 
kConv 
kElectronEnd 

Definition at line 207 of file PointIdAlg.h.

208  {
209  kNuNC = 0x0010000, kNuCC = 0x0020000, kNuPri = 0x0040000, // nu interaction type
210  kNuE = 0x0100000, kNuMu = 0x0200000, kNuTau = 0x0400000, // nu flavor
211  kHadr = 0x1000000, // hadronic inelastic scattering
212  kPi0 = 0x2000000, // pi0 produced in this vertex
213  kDecay = 0x4000000, // point of particle decay
214  kConv = 0x8000000, // gamma conversion
215  kElectronEnd = 0x10000000 // clear end of an electron
216  };

Constructor & Destructor Documentation

nnet::TrainingDataAlg::TrainingDataAlg ( const fhicl::ParameterSet pset)
inline

Definition at line 254 of file PointIdAlg.h.

254  :
256  {}
TrainingDataAlg(const fhicl::ParameterSet &pset)
Definition: PointIdAlg.h:254
nnet::TrainingDataAlg::TrainingDataAlg ( const Config config)

Definition at line 343 of file PointIdAlg.cxx.

References fSaveSimInfo, fSimulationProducerLabel, and art::InputTag::label().

343  : img::DataProviderAlg(config),
344  fEdepTot(0),
345  fWireProducerLabel(config.WireLabel()),
346  fHitProducerLabel(config.HitLabel()),
347  fTrackModuleLabel(config.TrackLabel()),
348  fSimulationProducerLabel(config.SimulationLabel()),
349  fSaveVtxFlags(config.SaveVtxFlags()),
350  fAdcDelay(config.AdcDelayTicks()),
351  fEventsPerBin(100, 0)
352 {
354 }
unsigned int fAdcDelay
Definition: PointIdAlg.h:331
art::InputTag fTrackModuleLabel
Definition: PointIdAlg.h:326
art::InputTag fWireProducerLabel
Definition: PointIdAlg.h:324
std::vector< size_t > fEventsPerBin
Definition: PointIdAlg.h:333
art::InputTag fSimulationProducerLabel
Definition: PointIdAlg.h:327
std::string const & label() const noexcept
Definition: InputTag.h:55
art::InputTag fHitProducerLabel
Definition: PointIdAlg.h:325
nnet::TrainingDataAlg::~TrainingDataAlg ( void  )
override

Definition at line 357 of file PointIdAlg.cxx.

358 {
359 }

Member Function Documentation

void nnet::TrainingDataAlg::collectVtxFlags ( std::unordered_map< size_t, std::unordered_map< int, int > > &  wireToDriftToVtxFlags,
const std::unordered_map< int, const simb::MCParticle * > &  particleMap,
unsigned int  plane 
) const
private

Definition at line 553 of file PointIdAlg.cxx.

References d, img::DataProviderAlg::fCryo, img::DataProviderAlg::fTPC, getProjection(), isElectronEnd(), isMuonDecaying(), kConv, kDecay, kElectronEnd, kHadr, kNone, kNuPri, and kPi0.

Referenced by setEventData().

557 {
558  for (auto const & p : particleMap)
559  {
560  auto const & particle = *p.second;
561 
562  double ekStart = 1000. * (particle.E() - particle.Mass());
563  double ekEnd = 1000. * (particle.EndE() - particle.Mass());
564 
565  int pdg = abs(particle.PdgCode());
566  int flagsStart = nnet::TrainingDataAlg::kNone;
567  int flagsEnd = nnet::TrainingDataAlg::kNone;
568 
569  switch (pdg)
570  {
571  case 22: // gamma
572  if ((particle.EndProcess() == "conv") &&
573  (ekStart > 40.0)) // conversion, gamma > 40MeV
574  {
575  //std::cout << "---> gamma conversion at " << ekStart << std::endl;
576  flagsEnd = nnet::TrainingDataAlg::kConv;
577  }
578  break;
579 
580  case 11: // e+/-
581  if (isElectronEnd(particle, particleMap))
582  {
584  }
585  break;
586 
587 
588  case 13: // mu+/-
589  if (isMuonDecaying(particle, particleMap))
590  {
591  //std::cout << "---> mu decay to electron" << std::endl;
593  }
594  break;
595 
596  case 111: // pi0
597  //std::cout << "---> pi0" << std::endl;
598  flagsStart = nnet::TrainingDataAlg::kPi0;
599  break;
600 
601  case 321: // K+/-
602  case 211: // pi+/-
603  case 2212: // proton
604  if (ekStart > 50.0)
605  {
606  if (particle.Mother() != 0)
607  {
608  auto search = particleMap.find(particle.Mother());
609  if (search != particleMap.end())
610  {
611  auto const & mother = *((*search).second);
612  int m_pdg = abs(mother.PdgCode());
613  unsigned int nSec = mother.NumberDaughters();
614  unsigned int nVisible = 0;
615  if (nSec > 1)
616  {
617  for (size_t d = 0; d < nSec; ++d)
618  {
619  auto d_search = particleMap.find(mother.Daughter(d));
620  if (d_search != particleMap.end())
621  {
622  auto const & daughter = *((*d_search).second);
623  int d_pdg = abs(daughter.PdgCode());
624  if (((d_pdg == 2212) || (d_pdg == 211) || (d_pdg == 321)) &&
625  (1000. * (daughter.E() - daughter.Mass()) > 50.0))
626  {
627  ++nVisible;
628  }
629  }
630  }
631  }
632  // hadron with Ek > 50MeV (so well visible) and
633  // produced by another hadron (but not neutron, so not single track from nothing) or
634  // at least secondary hadrons with Ek > 50MeV (so this is a good kink or V-like)
635  if (((m_pdg != pdg) && (m_pdg != 2112)) || ((m_pdg != 2112) && (nVisible > 0)) || ((m_pdg == 2112) && (nVisible > 1)))
636  {
637  // std::cout << "---> hadron at " << ekStart
638  // << ", pdg: " << pdg << ", mother pdg: " << m_pdg
639  // << ", vis.daughters: " << nVisible << std::endl;
640  flagsStart = nnet::TrainingDataAlg::kHadr;
641  }
642  }
643  // else std::cout << "---> mother not found for tid: " << particle.Mother() << std::endl;
644  }
645 
646  if (particle.EndProcess() == "FastScintillation") // potential decay at rest
647  {
648  unsigned int nSec = particle.NumberDaughters();
649  for (size_t d = 0; d < nSec; ++d)
650  {
651  auto d_search = particleMap.find(particle.Daughter(d));
652  if (d_search != particleMap.end())
653  {
654  auto const & daughter = *((*d_search).second);
655  int d_pdg = abs(daughter.PdgCode());
656  if ((pdg == 321) && (d_pdg == 13))
657  {
658  //std::cout << "---> K decay to mu" << std::endl;
660  break;
661  }
662  if ((pdg == 211) && (d_pdg == 13))
663  {
664  //std::cout << "---> pi decay to mu" << std::endl;
666  break;
667  }
668  }
669  }
670  }
671 
672  if ((particle.EndProcess() == "Decay") && (ekEnd > 200.0)) // decay in flight
673  {
674  unsigned int nSec = particle.NumberDaughters();
675  for (size_t d = 0; d < nSec; ++d)
676  {
677  auto d_search = particleMap.find(particle.Daughter(d));
678  if (d_search != particleMap.end())
679  {
680  auto const & daughter = *((*d_search).second);
681  int d_pdg = abs(daughter.PdgCode());
682  if ((pdg == 321) && (d_pdg == 13))
683  {
684  //std::cout << "---> in-flight K decay to mu" << std::endl;
685  flagsEnd = nnet::TrainingDataAlg::kHadr;
686  break;
687  }
688  if ((pdg == 211) && (d_pdg == 13))
689  {
690  //std::cout << "---> in-flight pi decay to mu" << std::endl;
691  flagsEnd = nnet::TrainingDataAlg::kHadr;
692  break;
693  }
694  }
695  }
696  }
697  }
698  break;
699 
700  default: continue;
701  }
702 
703  if (particle.Process() == "primary")
704  {
705  flagsStart |= nnet::TrainingDataAlg::kNuPri;
706  }
707 
708 
709  if (flagsStart != nnet::TrainingDataAlg::kNone)
710  {
711  auto wd = getProjection(particle.Position(), plane);
712 
713  if ((wd.TPC == (int)fTPC) && (wd.Cryo == (int)fCryo))
714  {
715  wireToDriftToVtxFlags[wd.Wire][wd.Drift] |= flagsStart;
716  // std::cout << "---> flagsStart:" << flagsStart << " plane:" << plane << " wire:" << wd.Wire << " drift:" << wd.Drift << std::endl;
717  }
718  // else std::cout << "---> not in current TPC" << std::endl;
719  }
720  if (flagsEnd != nnet::TrainingDataAlg::kNone)
721  {
722  auto wd = getProjection(particle.EndPosition(), plane);
723  if ((wd.TPC == (int)fTPC) && (wd.Cryo == (int)fCryo))
724  {
725  //if (flagsEnd == nnet::TrainingDataAlg::kElectronEnd) { std::cout << "---> clear electron endpoint" << std::endl; }
726  wireToDriftToVtxFlags[wd.Wire][wd.Drift] |= flagsEnd;
727  //if (flagsEnd == nnet::TrainingDataAlg::kElectronEnd)
728  // std::cout << "---> flagsEnd:" << flagsEnd << " plane:" << plane << " wire:" << wd.Wire << " drift:" << wd.Drift << std::endl;
729  }
730  // else std::cout << "---> not in current TPC" << std::endl;
731  }
732 
733  //if (ekStart > 30.0)
734  //{
735  // std::cout << particle.PdgCode() << ", " << ekStart << ": "
736  // << particle.Process() << " --> " << particle.EndProcess()
737  // << " " << ekEnd << std::endl;
738  //}
739  }
740 }
bool isMuonDecaying(const simb::MCParticle &particle, const std::unordered_map< int, const simb::MCParticle * > &particleMap) const
Definition: PointIdAlg.cxx:527
bool isElectronEnd(const simb::MCParticle &particle, const std::unordered_map< int, const simb::MCParticle * > &particleMap) const
Definition: PointIdAlg.cxx:468
Float_t d
Definition: plot.C:237
WireDrift getProjection(const TLorentzVector &tvec, unsigned int plane) const
Definition: PointIdAlg.cxx:427
unsigned int img::DataProviderAlg::Cryo ( void  ) const
inlineinherited

Definition at line 157 of file DataProviderAlg.h.

References img::DataProviderAlg::fCryo.

157 { return fCryo; }
void img::DataProviderAlg::downscale ( std::vector< float > &  dst,
std::vector< float > const &  adc,
size_t  tick0 
) const
inlineprotectedinherited

Definition at line 189 of file DataProviderAlg.h.

References img::DataProviderAlg::downscaleMax(), img::DataProviderAlg::downscaleMaxMean(), img::DataProviderAlg::downscaleMean(), img::DataProviderAlg::kMax, img::DataProviderAlg::kMaxMean, and img::DataProviderAlg::kMean.

Referenced by img::DataProviderAlg::patchFromOriginalView(), and img::DataProviderAlg::setWireData().

190  {
191  switch (fDownscaleMode)
192  {
193  case img::DataProviderAlg::kMean: downscaleMean(dst, adc, tick0); break;
194  case img::DataProviderAlg::kMaxMean: downscaleMaxMean(dst, adc, tick0); break;
195  case img::DataProviderAlg::kMax: downscaleMax(dst, adc, tick0); break;
196  default:throw cet::exception("img::DataProviderAlg") << "Downscale mode not supported." << std::endl; break;
197  }
198  }
void downscaleMaxMean(std::vector< float > &dst, std::vector< float > const &adc, size_t tick0) const
void downscaleMax(std::vector< float > &dst, std::vector< float > const &adc, size_t tick0) const
EDownscaleMode fDownscaleMode
void downscaleMean(std::vector< float > &dst, std::vector< float > const &adc, size_t tick0) const
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void img::DataProviderAlg::downscaleMax ( std::vector< float > &  dst,
std::vector< float > const &  adc,
size_t  tick0 
) const
protectedinherited

Definition at line 182 of file DataProviderAlg.cxx.

References img::DataProviderAlg::fDriftWindow, img::DataProviderAlg::fLifetimeCorrFactors, and img::DataProviderAlg::scaleAdcSamples().

Referenced by img::DataProviderAlg::downscale().

183 {
184  size_t kStop = dst.size();
185  if (adc.size() < kStop) { kStop = adc.size(); }
186  for (size_t i = 0, k0 = 0; i < kStop; ++i, k0 += fDriftWindow)
187  {
188  size_t k1 = k0 + fDriftWindow;
189 
190  float max_adc = adc[k0] * fLifetimeCorrFactors[k0 + tick0];
191  for (size_t k = k0 + 1; k < k1; ++k)
192  {
193  float ak = adc[k] * fLifetimeCorrFactors[k + tick0];
194  if (ak > max_adc) max_adc = ak;
195  }
196 
197  dst[i] = max_adc;
198  }
199  scaleAdcSamples(dst);
200 }
std::vector< float > fLifetimeCorrFactors
void scaleAdcSamples(std::vector< float > &values) const
void img::DataProviderAlg::downscaleMaxMean ( std::vector< float > &  dst,
std::vector< float > const &  adc,
size_t  tick0 
) const
protectedinherited

Definition at line 202 of file DataProviderAlg.cxx.

References img::DataProviderAlg::fDriftWindow, img::DataProviderAlg::fLifetimeCorrFactors, n, and img::DataProviderAlg::scaleAdcSamples().

Referenced by img::DataProviderAlg::downscale().

203 {
204  size_t kStop = dst.size();
205  if (adc.size() < kStop) { kStop = adc.size(); }
206  for (size_t i = 0, k0 = 0; i < kStop; ++i, k0 += fDriftWindow)
207  {
208  size_t k1 = k0 + fDriftWindow;
209 
210  size_t max_idx = k0;
211  float max_adc = adc[k0] * fLifetimeCorrFactors[k0 + tick0];
212  for (size_t k = k0 + 1; k < k1; ++k)
213  {
214  float ak = adc[k] * fLifetimeCorrFactors[k + tick0];
215  if (ak > max_adc) { max_adc = ak; max_idx = k; }
216  }
217 
218  size_t n = 1;
219  if (max_idx > 0) { max_adc += adc[max_idx - 1] * fLifetimeCorrFactors[max_idx - 1 + tick0]; n++; }
220  if (max_idx + 1 < adc.size()) { max_adc += adc[max_idx + 1] * fLifetimeCorrFactors[max_idx + 1 + tick0]; n++; }
221 
222  dst[i] = max_adc / n;
223  }
224  scaleAdcSamples(dst);
225 }
std::vector< float > fLifetimeCorrFactors
void scaleAdcSamples(std::vector< float > &values) const
Char_t n[5]
void img::DataProviderAlg::downscaleMean ( std::vector< float > &  dst,
std::vector< float > const &  adc,
size_t  tick0 
) const
protectedinherited

Definition at line 227 of file DataProviderAlg.cxx.

References img::DataProviderAlg::fDriftWindow, img::DataProviderAlg::fDriftWindowInv, img::DataProviderAlg::fLifetimeCorrFactors, and img::DataProviderAlg::scaleAdcSamples().

Referenced by img::DataProviderAlg::downscale().

228 {
229  size_t kStop = dst.size();
230  if (adc.size() < kStop) { kStop = adc.size(); }
231  for (size_t i = 0, k0 = 0; i < kStop; ++i, k0 += fDriftWindow)
232  {
233  size_t k1 = k0 + fDriftWindow;
234 
235  float sum_adc = 0;
236  for (size_t k = k0; k < k1; ++k)
237  {
238  sum_adc += adc[k] * fLifetimeCorrFactors[k + tick0];
239  }
240  dst[i] = sum_adc * fDriftWindowInv;
241  }
242  scaleAdcSamples(dst);
243 }
std::vector< float > fLifetimeCorrFactors
void scaleAdcSamples(std::vector< float > &values) const
unsigned int img::DataProviderAlg::DriftWindow ( void  ) const
inlineinherited

Definition at line 164 of file DataProviderAlg.h.

References img::DataProviderAlg::fDriftWindow.

164 { return fDriftWindow; }
bool nnet::TrainingDataAlg::findCrop ( float  max_e_cut,
unsigned int &  w0,
unsigned int &  w1,
unsigned int &  d0,
unsigned int &  d1 
) const

Definition at line 1063 of file PointIdAlg.cxx.

References d, and fWireDriftEdep.

1064 {
1065  if (fWireDriftEdep.empty() || fWireDriftEdep.front().empty()) return false;
1066 
1067  float max_cut = 0.25 * max_e_cut;
1068 
1069  w0 = 0;
1070  float cut = 0;
1071  while (w0 < fWireDriftEdep.size())
1072  {
1073  for (auto const d : fWireDriftEdep[w0]) cut += d;
1074  if (cut < max_cut) w0++;
1075  else break;
1076  }
1077  w1 = fWireDriftEdep.size() - 1;
1078  cut = 0;
1079  while (w1 > w0)
1080  {
1081  for (auto const d : fWireDriftEdep[w1]) cut += d;
1082  if (cut < max_cut) w1--;
1083  else break;
1084  }
1085  w1++;
1086 
1087  d0 = 0;
1088  cut = 0;
1089  while (d0 < fWireDriftEdep.front().size())
1090  {
1091  for (size_t i = w0; i < w1; ++i) cut += fWireDriftEdep[i][d0];
1092  if (cut < max_cut) d0++;
1093  else break;
1094  }
1095  d1 = fWireDriftEdep.front().size() - 1;
1096  cut = 0;
1097  while (d1 > d0)
1098  {
1099  for (size_t i = w0; i < w1; ++i) cut += fWireDriftEdep[i][d1];
1100  if (cut < max_cut) d1--;
1101  else break;
1102  }
1103  d1++;
1104 
1105  unsigned int margin = 20;
1106  if ((w1 - w0 > 8) && (d1 - d0 > 8))
1107  {
1108  if (w0 < margin) w0 = 0;
1109  else w0 -= margin;
1110 
1111  if (w1 > fWireDriftEdep.size() - margin) w1 = fWireDriftEdep.size();
1112  else w1 += margin;
1113 
1114  if (d0 < margin) d0 = 0;
1115  else d0 -= margin;
1116 
1117  if (d1 > fWireDriftEdep.front().size() - margin) d1 = fWireDriftEdep.front().size();
1118  else d1 += margin;
1119 
1120  return true;
1121  }
1122  else return false;
1123 }
Float_t d
Definition: plot.C:237
std::vector< std::vector< float > > fWireDriftEdep
Definition: PointIdAlg.h:321
size_t img::DataProviderAlg::getAdcArea ( void  ) const
inlineinherited
double img::DataProviderAlg::getAdcSum ( void  ) const
inlineinherited

Definition at line 148 of file DataProviderAlg.h.

References img::DataProviderAlg::fAdcSumOverThr.

148 { return fAdcSumOverThr; }
size_t img::DataProviderAlg::getDriftIndex ( float  drift) const
inlineprotectedinherited
double nnet::TrainingDataAlg::getEdepTot ( void  ) const
inline

Definition at line 275 of file PointIdAlg.h.

275 { return fEdepTot; } // [GeV]
std::vector< std::vector<float> > img::DataProviderAlg::getPatch ( size_t  wire,
float  drift,
size_t  patchSizeW,
size_t  patchSizeD 
) const
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 114 of file DataProviderAlg.h.

References img::DataProviderAlg::fDownscaleFullView, img::DataProviderAlg::patchFromDownsampledView(), and img::DataProviderAlg::patchFromOriginalView().

115  {
116  bool ok = false;
117  std::vector< std::vector<float> > patch;
118  if (fDownscaleFullView)
119  {
120  ok = patchFromDownsampledView(wire, drift, patchSizeW, patchSizeD, patch);
121  }
122  else
123  {
124  ok = patchFromOriginalView(wire, drift, patchSizeW, patchSizeD, patch);
125  }
126 
127  if (ok) return patch;
128  else
129  {
130  throw cet::exception("img::DataProviderAlg") << "Patch filling failed." << std::endl;
131  }
132  }
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
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
float img::DataProviderAlg::getPixelOrZero ( int  wire,
int  drift 
) const
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 136 of file DataProviderAlg.h.

References img::DataProviderAlg::fNCachedDrifts, img::DataProviderAlg::fWireDriftData, and img::DataProviderAlg::getDriftIndex().

137  {
138  size_t didx = getDriftIndex(drift), widx = (size_t)wire;
139 
140  if ((widx < fWireDriftData.size()) &&
141  (didx < fNCachedDrifts))
142  {
143  return fWireDriftData[widx][didx];
144  }
145  else { return 0; }
146  }
std::vector< std::vector< float > > fWireDriftData
unsigned int fNCachedDrifts
size_t getDriftIndex(float drift) const
nnet::TrainingDataAlg::WireDrift nnet::TrainingDataAlg::getProjection ( const TLorentzVector &  tvec,
unsigned int  plane 
) const
private

Definition at line 427 of file PointIdAlg.cxx.

References detinfo::DetectorProperties::ConvertXToTicks(), geo::CryostatID::Cryostat, geo::TPCGeo::DetectDriftDirection(), e, img::DataProviderAlg::fDetProp, img::DataProviderAlg::fGeometry, geo::GeometryCore::FindTPCAtPosition(), geo::CryostatID::isValid, geo::GeometryCore::NearestWire(), geo::TPCID::TPC, geo::GeometryCore::TPC(), and nnet::TrainingDataAlg::WireDrift::Wire.

Referenced by collectVtxFlags().

428 {
429  auto const* detprop = lar::providerFrom<detinfo::DetectorPropertiesService>();
431  wd.Wire = 0; wd.Drift = 0; wd.TPC = -1; wd.Cryo = -1;
432 
433  try
434  {
435  double vtx[3] = {tvec.X(), tvec.Y(), tvec.Z()};
437  {
438  geo::TPCID tpcid = fGeometry->FindTPCAtPosition(vtx);
439  unsigned int tpc = tpcid.TPC, cryo = tpcid.Cryostat;
440 
441  // correct for the time offset
442  float dx = tvec.T() * 1.e-3 * detprop->DriftVelocity();
443  int driftDir = fGeometry->TPC(tpcid).DetectDriftDirection();
444  if (driftDir == 1) { dx *= -1; }
445  else if (driftDir != -1)
446  {
447  throw cet::exception("nnet::TrainingDataAlg") << "drift direction is not X." << std::endl;
448  }
449  vtx[0] = tvec.X() + dx;
450 
451  wd.Wire = fGeometry->NearestWire(vtx, plane, tpc, cryo);
452  wd.Drift = fDetProp->ConvertXToTicks(vtx[0], plane, tpc, cryo);
453  wd.TPC = tpc; wd.Cryo = cryo;
454  }
455  }
456  catch (const geo::InvalidWireIDError & e)
457  {
458  mf::LogWarning("TrainingDataAlg") << "Vertex projection out of wire planes, just skipping this vertex.";
459  }
460  catch (...)
461  {
462  mf::LogWarning("TrainingDataAlg") << "Vertex projection out of wire planes, skip MC vertex.";
463  }
464  return wd;
465 }
geo::GeometryCore const * fGeometry
bool isValid
Whether this ID points to a valid element.
Definition: geo_types.h:129
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:130
virtual double ConvertXToTicks(double X, int p, int t, int c) const =0
geo::TPCID FindTPCAtPosition(double const worldLoc[3]) const
Returns the ID of the TPC at specified location.
detinfo::DetectorProperties const * fDetProp
geo::WireID::WireID_t NearestWire(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the index of wire closest to position in the specified TPC.
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
short int DetectDriftDirection() const
Returns the expected drift direction based on geometry.
Definition: TPCGeo.cxx:181
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
Exception thrown on invalid wire number (e.g. NearestWireID())
Definition: Exceptions.h:158
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:203
Float_t e
Definition: plot.C:34
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
bool nnet::TrainingDataAlg::isElectronEnd ( const simb::MCParticle particle,
const std::unordered_map< int, const simb::MCParticle * > &  particleMap 
) const
private

Definition at line 468 of file PointIdAlg.cxx.

References d, simb::MCParticle::Daughter(), simb::MCParticle::NumberDaughters(), particleRange2(), and simb::MCParticle::PdgCode().

Referenced by collectVtxFlags().

470 {
471  const float minElectronLength2 = 2.5*2.5;
472  const float maxDeltaLength2 = 0.15*0.15;
473 
474  int pdg = abs(particle.PdgCode());
475  if (pdg != 11) return false; // should be applied only to electrons
476 
477  size_t nSec = particle.NumberDaughters();
478  for (size_t d = 0; d < nSec; ++d)
479  {
480  auto d_search = particleMap.find(particle.Daughter(d));
481  if (d_search != particleMap.end())
482  {
483  auto const & daughter = *((*d_search).second);
484  int d_pdg = abs(daughter.PdgCode());
485  if (d_pdg != 22) { return false; } // not the end of the shower
486  }
487  }
488 
489  float trkLength2 = 0;
490  auto const * p = &particle;
491  bool branching = false;
492  while (!branching)
493  {
494  trkLength2 += particleRange2(*p);
495  auto m_search = particleMap.find(p->Mother());
496  if (m_search != particleMap.end())
497  {
498  p = (*m_search).second;
499  int m_pdg = abs(p->PdgCode());
500  if (m_pdg == 11)
501  {
502  nSec = p->NumberDaughters();
503  size_t ne = 0;
504  for (size_t d = 0; d < nSec; ++d)
505  {
506  auto d_search = particleMap.find(p->Daughter(d));
507  if (d_search != particleMap.end())
508  {
509  auto const & daughter = *((*d_search).second);
510  int d_pdg = abs(daughter.PdgCode());
511  if (d_pdg == 11)
512  {
513  if (particleRange2(daughter) > maxDeltaLength2) { ne++; }
514  }
515  }
516  }
517  if (ne > 1) { branching = true; }
518  }
519  else break;
520  }
521  else break;
522  }
523 
524  return (trkLength2 > minElectronLength2);
525 }
int PdgCode() const
Definition: MCParticle.h:216
int NumberDaughters() const
Definition: MCParticle.h:221
int Daughter(const int i) const
Definition: MCParticle.cxx:112
Float_t d
Definition: plot.C:237
static float particleRange2(const simb::MCParticle &particle)
Definition: PointIdAlg.h:305
bool nnet::TrainingDataAlg::isMuonDecaying ( const simb::MCParticle particle,
const std::unordered_map< int, const simb::MCParticle * > &  particleMap 
) const
private

Definition at line 527 of file PointIdAlg.cxx.

References d, simb::MCParticle::Daughter(), simb::MCParticle::EndProcess(), simb::MCParticle::NumberDaughters(), and simb::MCParticle::PdgCode().

Referenced by collectVtxFlags(), and setEventData().

529 {
530  bool hasElectron = false, hasNuMu = false, hasNuE = false;
531 
532  int pdg = abs(particle.PdgCode());
533  if ((pdg == 13) && (particle.EndProcess() == "FastScintillation")) // potential muon decay at rest
534  {
535  unsigned int nSec = particle.NumberDaughters();
536  for (size_t d = 0; d < nSec; ++d)
537  {
538  auto d_search = particleMap.find(particle.Daughter(d));
539  if (d_search != particleMap.end())
540  {
541  auto const & daughter = *((*d_search).second);
542  int d_pdg = abs(daughter.PdgCode());
543  if (d_pdg == 11) hasElectron = true;
544  else if (d_pdg == 14) hasNuMu = true;
545  else if (d_pdg == 12) hasNuE = true;
546  }
547  }
548  }
549 
550  return (hasElectron && hasNuMu && hasNuE);
551 }
int PdgCode() const
Definition: MCParticle.h:216
int NumberDaughters() const
Definition: MCParticle.h:221
int Daughter(const int i) const
Definition: MCParticle.cxx:112
std::string EndProcess() const
Definition: MCParticle.h:220
Float_t d
Definition: plot.C:237
double img::DataProviderAlg::LifetimeCorrection ( double  tick) const
inlineinherited

Definition at line 169 of file DataProviderAlg.h.

References img::DataProviderAlg::fCalorimetryAlg, and calo::CalorimetryAlg::LifetimeCorrection().

169 { return fCalorimetryAlg.LifetimeCorrection(tick); }
calo::CalorimetryAlg fCalorimetryAlg
double LifetimeCorrection(double time, double T0=0) const
unsigned int img::DataProviderAlg::NCachedDrifts ( void  ) const
inlineinherited

Definition at line 163 of file DataProviderAlg.h.

References img::DataProviderAlg::fNCachedDrifts.

163 { return fNCachedDrifts; }
unsigned int fNCachedDrifts
unsigned int img::DataProviderAlg::NScaledDrifts ( void  ) const
inlineinherited

Definition at line 162 of file DataProviderAlg.h.

References img::DataProviderAlg::fNScaledDrifts.

162 { return fNScaledDrifts; }
unsigned int fNScaledDrifts
unsigned int img::DataProviderAlg::NWires ( void  ) const
inlineinherited

Definition at line 161 of file DataProviderAlg.h.

References img::DataProviderAlg::fNWires.

161 { return fNWires; }
static float nnet::TrainingDataAlg::particleRange2 ( const simb::MCParticle particle)
inlinestaticprivate

Definition at line 305 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().

306  {
307  float dx = particle.EndX() - particle.Vx();
308  float dy = particle.EndY() - particle.Vy();
309  float dz = particle.EndZ() - particle.Vz();
310  return dx*dx + dy*dy + dz*dz;
311  }
double EndZ() const
Definition: MCParticle.h:232
double EndY() const
Definition: MCParticle.h:231
double Vx(const int i=0) const
Definition: MCParticle.h:225
double Vz(const int i=0) const
Definition: MCParticle.h:227
double EndX() const
Definition: MCParticle.h:230
double Vy(const int i=0) const
Definition: MCParticle.h:226
bool img::DataProviderAlg::patchFromDownsampledView ( size_t  wire,
float  drift,
size_t  size_w,
size_t  size_d,
std::vector< std::vector< float > > &  patch 
) const
protectedinherited

Definition at line 400 of file DataProviderAlg.cxx.

References d, img::DataProviderAlg::fAdcZero, img::DataProviderAlg::fDriftWindow, trkf::fill(), img::DataProviderAlg::fWireDriftData, and w.

Referenced by img::DataProviderAlg::getDriftIndex(), and img::DataProviderAlg::getPatch().

402 {
403  int halfSizeW = size_w / 2;
404  int halfSizeD = size_d / 2;
405 
406  int w0 = wire - halfSizeW;
407  int w1 = wire + halfSizeW;
408 
409  size_t sd = (size_t)(drift / fDriftWindow);
410  int d0 = sd - halfSizeD;
411  int d1 = sd + halfSizeD;
412 
413  int wsize = fWireDriftData.size();
414  for (int w = w0, wpatch = 0; w < w1; ++w, ++wpatch)
415  {
416  auto & dst = patch[wpatch];
417  if ((w >= 0) && (w < wsize))
418  {
419  auto & src = fWireDriftData[w];
420  int dsize = src.size();
421  for (int d = d0, dpatch = 0; d < d1; ++d, ++dpatch)
422  {
423  if ((d >= 0) && (d < dsize))
424  {
425  dst[dpatch] = src[d];
426  }
427  else
428  {
429  dst[dpatch] = fAdcZero;
430  }
431  }
432  }
433  else
434  {
435  std::fill(dst.begin(), dst.end(), fAdcZero);
436  }
437  }
438 
439  return true;
440 }
std::vector< std::vector< float > > fWireDriftData
Float_t d
Definition: plot.C:237
void fill(const art::PtrVector< recob::Hit > &hits, int only_plane)
Float_t w
Definition: plot.C:23
bool img::DataProviderAlg::patchFromOriginalView ( size_t  wire,
float  drift,
size_t  size_w,
size_t  size_d,
std::vector< std::vector< float > > &  patch 
) const
protectedinherited

Definition at line 442 of file DataProviderAlg.cxx.

References d, img::DataProviderAlg::downscale(), img::DataProviderAlg::fAdcZero, img::DataProviderAlg::fDriftWindow, trkf::fill(), img::DataProviderAlg::fWireDriftData, tmp, and w.

Referenced by img::DataProviderAlg::getDriftIndex(), and img::DataProviderAlg::getPatch().

444 {
445  int dsize = fDriftWindow * size_d;
446  int halfSizeW = size_w / 2;
447  int halfSizeD = dsize / 2;
448 
449  int w0 = wire - halfSizeW;
450  int w1 = wire + halfSizeW;
451 
452  int d0 = drift - halfSizeD;
453  int d1 = drift + halfSizeD;
454 
455  std::vector<float> tmp(dsize);
456  int wsize = fWireDriftData.size();
457  for (int w = w0, wpatch = 0; w < w1; ++w, ++wpatch)
458  {
459  if ((w >= 0) && (w < wsize))
460  {
461  auto & src = fWireDriftData[w];
462  int src_size = src.size();
463  for (int d = d0, dpatch = 0; d < d1; ++d, ++dpatch)
464  {
465  if ((d >= 0) && (d < src_size))
466  {
467  tmp[dpatch] = src[d];
468  }
469  else
470  {
471  tmp[dpatch] = fAdcZero;
472  }
473  }
474  }
475  else
476  {
477  std::fill(tmp.begin(), tmp.end(), fAdcZero);
478  }
479 
480  downscale(patch[wpatch], tmp, d0);
481  }
482 
483  return true;
484 }
std::vector< std::vector< float > > fWireDriftData
Float_t tmp
Definition: plot.C:37
Float_t d
Definition: plot.C:237
void fill(const art::PtrVector< recob::Hit > &hits, int only_plane)
void downscale(std::vector< float > &dst, std::vector< float > const &adc, size_t tick0) const
Float_t w
Definition: plot.C:23
unsigned int img::DataProviderAlg::Plane ( void  ) const
inlineinherited
float img::DataProviderAlg::poolMax ( int  wire,
int  drift,
size_t  r = 0 
) const
inherited

Pool max value in a patch around the wire/drift pixel.

Definition at line 133 of file DataProviderAlg.cxx.

References col, d, img::DataProviderAlg::fDownscaleFullView, img::DataProviderAlg::fDriftWindow, img::DataProviderAlg::fNCachedDrifts, img::DataProviderAlg::fNWires, img::DataProviderAlg::fWireDriftData, img::DataProviderAlg::getDriftIndex(), and w.

Referenced by img::DataProviderAlg::getAdcArea(), pma::ProjectionMatchingAlg::validate_on_adc(), and pma::ProjectionMatchingAlg::validate_on_adc_test().

134 {
135  size_t rw = r, rd = r;
136  if (!fDownscaleFullView) { rd *= fDriftWindow; }
137 
138  size_t didx = getDriftIndex(drift);
139  int d0 = didx - rd; if (d0 < 0) { d0 = 0; }
140  int d1 = didx + rd; if (d1 >= (int)fNCachedDrifts) { d1 = fNCachedDrifts - 1; }
141 
142  int w0 = wire - rw; if (w0 < 0) { w0 = 0; }
143  int w1 = wire + rw; if (w1 >= (int)fNWires) { w1 = fNWires - 1; }
144 
145  float adc, max_adc = 0;
146  for (int w = w0; w <= w1; ++w)
147  {
148  auto const * col = fWireDriftData[w].data();
149  for (int d = d0; d <= d1; ++d)
150  {
151  adc = col[d]; if (adc > max_adc) { max_adc = adc; }
152  }
153  }
154 
155  return max_adc;
156 }
std::vector< std::vector< float > > fWireDriftData
unsigned int fNCachedDrifts
Int_t col[ntarg]
Definition: Style.C:29
Float_t d
Definition: plot.C:237
Float_t w
Definition: plot.C:23
size_t getDriftIndex(float drift) const
float img::DataProviderAlg::poolSum ( int  wire,
int  drift,
size_t  r = 0 
) const
inherited

Pool sum of pixels in a patch around the wire/drift pixel.

Definition at line 159 of file DataProviderAlg.cxx.

References col, d, img::DataProviderAlg::fDownscaleFullView, img::DataProviderAlg::fDriftWindow, img::DataProviderAlg::fNCachedDrifts, img::DataProviderAlg::fNWires, img::DataProviderAlg::fWireDriftData, img::DataProviderAlg::getDriftIndex(), and w.

Referenced by img::DataProviderAlg::getAdcArea().

160 {
161  size_t rw = r, rd = r;
162  if (!fDownscaleFullView) { rd *= fDriftWindow; }
163 
164  size_t didx = getDriftIndex(drift);
165  int d0 = didx - rd; if (d0 < 0) { d0 = 0; }
166  int d1 = didx + rd; if (d1 >= (int)fNCachedDrifts) { d1 = fNCachedDrifts - 1; }
167 
168  int w0 = wire - rw; if (w0 < 0) { w0 = 0; }
169  int w1 = wire + rw; if (w1 >= (int)fNWires) { w1 = fNWires - 1; }
170 
171  float sum = 0;
172  for (int w = w0; w <= w1; ++w)
173  {
174  auto const * col = fWireDriftData[w].data();
175  for (int d = d0; d <= d1; ++d) { sum += col[d]; }
176  }
177 
178  return sum;
179 }
std::vector< std::vector< float > > fWireDriftData
unsigned int fNCachedDrifts
Int_t col[ntarg]
Definition: Style.C:29
Float_t d
Definition: plot.C:237
Float_t w
Definition: plot.C:23
size_t getDriftIndex(float drift) const
void nnet::TrainingDataAlg::reconfigure ( const Config config)
void nnet::TrainingDataAlg::resizeView ( size_t  wires,
size_t  drifts 
)
overrideprotectedvirtual

Reimplemented from img::DataProviderAlg.

Definition at line 362 of file PointIdAlg.cxx.

References trkf::fill(), img::DataProviderAlg::fNCachedDrifts, fWireDriftEdep, fWireDriftPdg, img::DataProviderAlg::resizeView(), and w.

363 {
364  img::DataProviderAlg::resizeView(wires, drifts);
365 
366  fWireDriftEdep.resize(wires);
367  for (auto & w : fWireDriftEdep)
368  {
369  w.resize(fNCachedDrifts);
370  std::fill(w.begin(), w.end(), 0.0F);
371  }
372 
373  fWireDriftPdg.resize(wires);
374  for (auto & w : fWireDriftPdg)
375  {
376  w.resize(fNCachedDrifts);
377  std::fill(w.begin(), w.end(), 0);
378  }
379 }
virtual void resizeView(size_t wires, size_t drifts)
std::vector< std::vector< int > > fWireDriftPdg
Definition: PointIdAlg.h:322
unsigned int fNCachedDrifts
void fill(const art::PtrVector< recob::Hit > &hits, int only_plane)
std::vector< std::vector< float > > fWireDriftEdep
Definition: PointIdAlg.h:321
Float_t w
Definition: plot.C:23
bool nnet::TrainingDataAlg::saveSimInfo ( ) const
inline

Definition at line 264 of file PointIdAlg.h.

264 { return fSaveSimInfo; }
bool nnet::TrainingDataAlg::setDataEventData ( const art::Event event,
unsigned int  plane,
unsigned int  tpc,
unsigned int  cryo 
)

Definition at line 743 of file PointIdAlg.cxx.

References fEventsPerBin, fHitProducerLabel, art::fill_ptr_vector(), img::DataProviderAlg::fNDrifts, fTrackModuleLabel, fWireProducerLabel, art::DataViewImpl::getByLabel(), img::DataProviderAlg::setWireDriftData(), and setWireEdepsAndLabels().

745 {
746 
748  std::vector< art::Ptr<recob::Wire> > Wirelist;
749 
750  if(event.getByLabel(fWireProducerLabel, wireHandle))
751  art::fill_ptr_vector(Wirelist, wireHandle);
752 
753  if(!setWireDriftData(*wireHandle, plane, tpc, cryo)) {
754  mf::LogError("TrainingDataAlg") << "Wire data not set.";
755  return false;
756  }
757 
758  // Hit info
760  std::vector< art::Ptr<recob::Hit> > Hitlist;
761 
762  if(event.getByLabel(fHitProducerLabel, HitHandle))
763  art::fill_ptr_vector(Hitlist, HitHandle);
764 
765  // Track info
767  std::vector< art::Ptr<recob::Track> > Tracklist;
768 
769  if(event.getByLabel(fTrackModuleLabel, TrackHandle))
770  art::fill_ptr_vector(Tracklist, TrackHandle);
771 
772  art::FindManyP<recob::Track> ass_trk_hits(HitHandle, event, fTrackModuleLabel);
773 
774  // Loop over wires (sorry about hard coded value) to fill in 1) pdg and 2) charge depo
775  for (size_t widx = 0; widx < 240; ++widx) {
776 
777  std::vector< float > labels_deposit(fNDrifts, 0); // full-drift-length buffers
778  std::vector< int > labels_pdg(fNDrifts, 0);
779 
780  // First, the charge depo
781  for(size_t subwidx = 0; subwidx < Wirelist.size(); ++subwidx) {
782  if(widx+240 == Wirelist[subwidx]->Channel()) {
783  labels_deposit = Wirelist[subwidx]->Signal();
784  break;
785  }
786  }
787 
788  // Second, the pdg code
789  // This code finds the angle of the track and records
790  // events based on its angle to try to get an isometric sample
791  // instead of just a bunch of straight tracks
792 
793  // Meta code:
794  // For each hit:
795  // find farthest hit from point
796  // then find farthest hit from THAT one
797  // should be start and end of track, then just use trig
798 
799  for(size_t iHit = 0; iHit < Hitlist.size(); ++iHit) {
800 
801  if(Hitlist[iHit]->Channel() != widx+240) { continue; }
802  if(Hitlist[iHit]->View() != 1) { continue; }
803 
804  // Make sure there is a track association
805  if(ass_trk_hits.at(iHit).size() == 0) { continue; }
806 
807  // Not sure about this
808  // Cutting on length to not just get a bunch of shower stubs
809  // Might add a lot of bias though
810  if(ass_trk_hits.at(iHit)[0]->Length() < 5) { continue; }
811 
812  // Search for farest hit from this one
813  int far_index = 0;
814  double far_dist = 0;
815 
816  for(size_t jHit = 0; jHit < Hitlist.size(); ++jHit) {
817  if(jHit == iHit) { continue; }
818  if(Hitlist[jHit]->View() != 1) { continue; }
819 
820  if(ass_trk_hits.at(jHit).size() == 0) { continue; }
821  if(ass_trk_hits.at(jHit)[0]->ID() !=
822  ass_trk_hits.at(iHit)[0]->ID()) { continue; }
823 
824  double dist = sqrt((Hitlist[iHit]->Channel()-Hitlist[jHit]->Channel()) *
825  (Hitlist[iHit]->Channel()-Hitlist[jHit]->Channel()) +
826  (Hitlist[iHit]->PeakTime()-Hitlist[jHit]->PeakTime()) *
827  (Hitlist[iHit]->PeakTime()-Hitlist[jHit]->PeakTime()));
828 
829  if(far_dist < dist){
830  far_dist = dist;
831  far_index = jHit;
832  }
833  }
834 
835  // Search for the other end of the track
836  int other_end = 0;
837  int other_dist = 0;
838 
839  for(size_t jHit = 0; jHit < Hitlist.size(); ++jHit) {
840  if(jHit == iHit or int(jHit) == far_index) { continue; }
841  if(Hitlist[jHit]->View() != 1) { continue; }
842 
843  if(ass_trk_hits.at(jHit).size() == 0) { continue; }
844  if(ass_trk_hits.at(jHit)[0]->ID() !=
845  ass_trk_hits.at(iHit)[0]->ID()) { continue; }
846 
847  double dist = sqrt((Hitlist[far_index]->Channel()-Hitlist[jHit]->Channel()) *
848  (Hitlist[far_index]->Channel()-Hitlist[jHit]->Channel()) +
849  (Hitlist[far_index]->PeakTime()-Hitlist[jHit]->PeakTime()) *
850  (Hitlist[far_index]->PeakTime()-Hitlist[jHit]->PeakTime()));
851 
852  if(other_dist < dist){
853  other_dist = dist;
854  other_end = jHit;
855  }
856  }
857 
858  // We have the end points now
859  double del_wire = double(Hitlist[other_end]->Channel() - Hitlist[far_index]->Channel());
860  double del_time = double(Hitlist[other_end]->PeakTime() - Hitlist[far_index]->PeakTime());
861  double hypo = sqrt(del_wire * del_wire + del_time * del_time);
862 
863  if(hypo == 0) { continue; } // Should never happen, but doing it anyway
864 
865  double cosser = TMath::Abs(del_wire / hypo);
866  double norm_ang = TMath::ACos(cosser) * 2 / TMath::Pi();
867 
868  // Using fEventsPerBin to keep track of number of hits per angle (normalized to 0 to 1)
869 
870  int binner = int(norm_ang * fEventsPerBin.size());
871  if(binner >= (int)fEventsPerBin.size()) { binner = fEventsPerBin.size() - 1; } // Dealing with rounding errors
872 
873  // So we should get a total of 5000 * 100 = 50,000 if we use the whole set
874  if(fEventsPerBin[binner] > 5000) { continue; }
875  fEventsPerBin[binner]++;
876 
877  // If survives everything, saves the pdg
878  labels_pdg[Hitlist[iHit]->PeakTime()] = 211; // Same as pion for now
879 
880  }
881 
882  setWireEdepsAndLabels(labels_deposit, labels_pdg, widx);
883 
884  } // for each Wire
885 
886  /*
887  for(size_t i = 0; i < fEventsPerBin.size(); i ++) {
888  std::cout << i << ") " << fEventsPerBin[i] << " - ";
889  }
890  */
891 
892  return true;
893 
894 }
bool setWireEdepsAndLabels(std::vector< float > const &edeps, std::vector< int > const &pdgs, size_t wireIdx)
Definition: PointIdAlg.cxx:382
art::InputTag fTrackModuleLabel
Definition: PointIdAlg.h:326
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
bool setWireDriftData(const std::vector< recob::Wire > &wires, unsigned int plane, unsigned int tpc, unsigned int cryo)
art::InputTag fWireProducerLabel
Definition: PointIdAlg.h:324
std::vector< size_t > fEventsPerBin
Definition: PointIdAlg.h:333
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
art::InputTag fHitProducerLabel
Definition: PointIdAlg.h:325
bool nnet::TrainingDataAlg::setEventData ( const art::Event event,
unsigned int  plane,
unsigned int  tpc,
unsigned int  cryo 
)

Definition at line 896 of file PointIdAlg.cxx.

References collectVtxFlags(), energy, fAdcDelay, fEdepTot, img::DataProviderAlg::fNDrifts, img::DataProviderAlg::fNWires, fSaveSimInfo, fSaveVtxFlags, fSimulationProducerLabel, img::DataProviderAlg::fWireChannels, fWireProducerLabel, sim::LArG4Parameters::GeVToElectrons(), raw::InvalidChannelID, isMuonDecaying(), art::Event::isRealData(), kDelta, kMichel, kPdgMask, kPriEl, kPriMu, kTypeMask, img::DataProviderAlg::setWireDriftData(), and setWireEdepsAndLabels().

898 {
900  = event.getValidHandle< std::vector<recob::Wire> >(fWireProducerLabel);
901 
902  if (!setWireDriftData(*wireHandle, plane, tpc, cryo))
903  {
904  mf::LogError("TrainingDataAlg") << "Wire data not set.";
905  return false;
906  }
907 
908  if (!fSaveSimInfo || event.isRealData())
909  {
910  mf::LogInfo("TrainingDataAlg") << "Skip MC simulation info.";
911  return true;
912  }
913 
915  double electronsToGeV = 1. / larParameters->GeVToElectrons();
916 
917  auto particleHandle = event.getValidHandle< std::vector<simb::MCParticle> >(fSimulationProducerLabel);
918 
919  auto simChannelHandle = event.getValidHandle< std::vector<sim::SimChannel> >(fSimulationProducerLabel);
920 
921  std::unordered_map< int, const simb::MCParticle* > particleMap;
922  for (auto const & particle : *particleHandle)
923  {
924  particleMap[particle.TrackId()] = &particle;
925  }
926 
927  std::unordered_map< size_t, std::unordered_map< int, int > > wireToDriftToVtxFlags;
928  if (fSaveVtxFlags) collectVtxFlags(wireToDriftToVtxFlags, particleMap, plane);
929 
930  fEdepTot = 0;
931 
932  std::map< int, int > trackToPDG;
933  for (size_t widx = 0; widx < fNWires; ++widx)
934  {
935  auto wireChannelNumber = fWireChannels[widx];
936  if (wireChannelNumber == raw::InvalidChannelID) continue;
937 
938  std::vector< float > labels_deposit(fNDrifts, 0); // full-drift-length buffers,
939  std::vector< int > labels_pdg(labels_deposit.size(), 0); // both of the same size,
940  int labels_size = labels_deposit.size(); // cached as int for comparisons below
941 
942  std::map< int, std::map< int, double > > timeToTrackToCharge;
943  for (auto const & channel : *simChannelHandle)
944  {
945  if (channel.Channel() != wireChannelNumber) continue;
946 
947  auto const & timeSlices = channel.TDCIDEMap();
948  for (auto const & timeSlice : timeSlices)
949  {
950  int time = timeSlice.first;
951 
952  auto const & energyDeposits = timeSlice.second;
953  for (auto const & energyDeposit : energyDeposits)
954  {
955  int pdg = 0;
956  int tid = energyDeposit.trackID;
957  if (tid < 0) // negative tid means it is EM activity, and -tid is the mother
958  {
959  pdg = 11; tid = -tid;
960 
961  auto search = particleMap.find(tid);
962  if (search == particleMap.end())
963  {
964  mf::LogWarning("TrainingDataAlg") << "PARTICLE NOT FOUND";
965  continue;
966  }
967  auto const & mother = *((*search).second); // mother particle of this EM
968  int mPdg = abs(mother.PdgCode());
969  if ((mPdg == 13) || (mPdg == 211) || (mPdg == 2212))
970  {
971  if (energyDeposit.numElectrons > 10) pdg |= nnet::TrainingDataAlg::kDelta; // tag delta ray
972  }
973  }
974  else
975  {
976  auto search = particleMap.find(tid);
977  if (search == particleMap.end())
978  {
979  mf::LogWarning("TrainingDataAlg") << "PARTICLE NOT FOUND";
980  continue;
981  }
982  auto const & particle = *((*search).second);
983  pdg = abs(particle.PdgCode());
984 
985  if (particle.Process() == "primary")
986  {
987  if (pdg == 11)
988  {
989  pdg |= nnet::TrainingDataAlg::kPriEl; // tag primary
990  }
991  else if (pdg == 13)
992  {
993  pdg |= nnet::TrainingDataAlg::kPriMu; // tag primary
994  }
995  }
996 
997  auto msearch = particleMap.find(particle.Mother());
998  if (msearch != particleMap.end())
999  {
1000  auto const & mother = *((*msearch).second);
1001  if (pdg == 11) // electron, check if it is Michel
1002  {
1003  if (nnet::TrainingDataAlg::isMuonDecaying(mother, particleMap))
1004  {
1005  pdg |= nnet::TrainingDataAlg::kMichel; // tag Michel
1006  }
1007  }
1008  }
1009  }
1010 
1011  trackToPDG[energyDeposit.trackID] = pdg;
1012 
1013  double energy = energyDeposit.numElectrons * electronsToGeV;
1014  timeToTrackToCharge[time][energyDeposit.trackID] += energy;
1015  fEdepTot += energy;
1016 
1017  } // loop over energy deposits
1018  } // loop over time slices
1019  } // for each SimChannel
1020 
1022  for (auto const & ttc : timeToTrackToCharge)
1023  {
1024  float max_deposit = 0.0;
1025  int max_pdg = 0;
1026  for (auto const & tc : ttc.second) {
1027 
1028  if( tc.second > max_deposit )
1029  {
1030  max_deposit = tc.second;
1031  max_pdg = trackToPDG[tc.first];
1032  }
1033  }
1034 
1035  if (ttc.first < labels_size)
1036  {
1037  int tick_idx = ttc.first + fAdcDelay;
1038  if (tick_idx < labels_size)
1039  {
1040  labels_deposit[tick_idx] = max_deposit;
1041  labels_pdg[tick_idx] = max_pdg & type_pdg_mask;
1042  }
1043  }
1044  }
1045 
1046  for (auto const & drift_flags : wireToDriftToVtxFlags[widx])
1047  {
1048  int drift = drift_flags.first, flags = drift_flags.second;
1049  if ((drift >= 0) && (drift < labels_size))
1050  {
1051  labels_pdg[drift] |= flags;
1052  }
1053  }
1054 
1055  setWireEdepsAndLabels(labels_deposit, labels_pdg, widx);
1056 
1057  } // for each Wire
1058 
1059  return true;
1060 }
void collectVtxFlags(std::unordered_map< size_t, std::unordered_map< int, int > > &wireToDriftToVtxFlags, const std::unordered_map< int, const simb::MCParticle * > &particleMap, unsigned int plane) const
Definition: PointIdAlg.cxx:553
bool setWireEdepsAndLabels(std::vector< float > const &edeps, std::vector< int > const &pdgs, size_t wireIdx)
Definition: PointIdAlg.cxx:382
std::vector< raw::ChannelID_t > fWireChannels
bool isMuonDecaying(const simb::MCParticle &particle, const std::unordered_map< int, const simb::MCParticle * > &particleMap) const
Definition: PointIdAlg.cxx:527
unsigned int fAdcDelay
Definition: PointIdAlg.h:331
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
bool isRealData() const
Definition: Event.h:83
bool setWireDriftData(const std::vector< recob::Wire > &wires, unsigned int plane, unsigned int tpc, unsigned int cryo)
art::InputTag fWireProducerLabel
Definition: PointIdAlg.h:324
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:31
double energy
Definition: plottest35.C:25
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
art::InputTag fSimulationProducerLabel
Definition: PointIdAlg.h:327
double GeVToElectrons() const
bool img::DataProviderAlg::setWireData ( std::vector< float > const &  adc,
size_t  wireIdx 
)
protectedinherited

Definition at line 245 of file DataProviderAlg.cxx.

References img::DataProviderAlg::downscale(), img::DataProviderAlg::fDownscaleFullView, and img::DataProviderAlg::fWireDriftData.

Referenced by img::DataProviderAlg::getDriftIndex(), and img::DataProviderAlg::setWireDriftData().

246 {
247  if (wireIdx >= fWireDriftData.size()) return false;
248  auto & wData = fWireDriftData[wireIdx];
249 
250  if (fDownscaleFullView)
251  {
252  if (!adc.empty()) { downscale(wData, adc, 0); }
253  else { return false; }
254  }
255  else
256  {
257  if (adc.empty()) { return false; }
258  else if (adc.size() <= wData.size()) { std::copy(adc.begin(), adc.end(), wData.begin()); }
259  else { std::copy(adc.begin(), adc.begin()+wData.size(), wData.begin()); }
260  }
261  return true;
262 }
std::vector< std::vector< float > > fWireDriftData
void downscale(std::vector< float > &dst, std::vector< float > const &adc, size_t tick0) const
bool img::DataProviderAlg::setWireDriftData ( const std::vector< recob::Wire > &  wires,
unsigned int  plane,
unsigned int  tpc,
unsigned int  cryo 
)
inherited

Definition at line 265 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::fCryo, img::DataProviderAlg::fDetProp, img::DataProviderAlg::fGeometry, img::DataProviderAlg::fPlane, img::DataProviderAlg::fTPC, img::DataProviderAlg::fWireChannels, detinfo::DetectorProperties::NumberTimeSamples(), geo::GeometryCore::Nwires(), img::DataProviderAlg::Plane(), img::DataProviderAlg::resizeView(), and img::DataProviderAlg::setWireData().

Referenced by img::DataProviderAlg::DataProviderAlg(), setDataEventData(), and setEventData().

267 {
268  mf::LogInfo("DataProviderAlg") << "Create image for cryo:"
269  << cryo << " tpc:" << tpc << " plane:" << plane;
270 
271  fCryo = cryo; fTPC = tpc; fPlane = plane;
272 
273  fAdcSumOverThr = 0;
274  fAdcAreaOverThr = 0;
275 
276  size_t nwires = fGeometry->Nwires(plane, tpc, cryo);
277  size_t ndrifts = fDetProp->NumberTimeSamples();
278 
279  resizeView(nwires, ndrifts);
280 
281  auto const & channelStatus = art::ServiceHandle< lariov::ChannelStatusService >()->GetProvider();
282 
283  bool allWrong = true;
284  for (auto const & wire : wires)
285  {
286  auto wireChannelNumber = wire.Channel();
287  if (!channelStatus.IsGood(wireChannelNumber)) { continue; }
288 
289  size_t w_idx = 0;
290  for (auto const& id : fGeometry->ChannelToWire(wireChannelNumber))
291  {
292  if ((id.Plane == plane) && (id.TPC == tpc) && (id.Cryostat == cryo))
293  {
294  w_idx = id.Wire;
295 
296  auto adc = wire.Signal();
297  if (adc.size() < ndrifts)
298  {
299  mf::LogWarning("DataProviderAlg") << "Wire ADC vector size lower than NumberTimeSamples.";
300  continue; // not critical, maybe other wires are OK, so continue
301  }
302 
303  if (!setWireData(adc, w_idx))
304  {
305  mf::LogWarning("DataProviderAlg") << "Wire data not set.";
306  continue; // also not critical, try to set other wires
307  }
308 
309  for (auto v : adc) { if (v >= fAdcSumThr) { fAdcSumOverThr += v; fAdcAreaOverThr++; } }
310 
311  fWireChannels[w_idx] = wireChannelNumber;
312  allWrong = false;
313  }
314  }
315  }
316  if (allWrong)
317  {
318  mf::LogError("DataProviderAlg") << "Wires data not set in the cryo:"
319  << cryo << " tpc:" << tpc << " plane:" << plane;
320  return false;
321  }
322 
323  applyBlur();
324  addWhiteNoise();
326 
327  return true;
328 }
virtual void resizeView(size_t wires, size_t drifts)
geo::GeometryCore const * fGeometry
std::vector< raw::ChannelID_t > fWireChannels
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
unsigned int Nwires(unsigned int p, unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wires in the specified plane.
bool setWireData(std::vector< float > const &adc, size_t wireIdx)
detinfo::DetectorProperties const * fDetProp
virtual unsigned int NumberTimeSamples() const =0
unsigned int Plane(void) const
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
bool nnet::TrainingDataAlg::setWireEdepsAndLabels ( std::vector< float > const &  edeps,
std::vector< int > const &  pdgs,
size_t  wireIdx 
)
private

Definition at line 382 of file PointIdAlg.cxx.

References img::DataProviderAlg::fDownscaleFullView, img::DataProviderAlg::fDriftWindow, img::DataProviderAlg::fNCachedDrifts, fSaveVtxFlags, fWireDriftEdep, fWireDriftPdg, kPdgMask, kTypeMask, and kVtxMask.

Referenced by setDataEventData(), and setEventData().

384 {
385  if ((wireIdx >= fWireDriftEdep.size()) || (edeps.size() != pdgs.size())) { return false; }
386 
387  size_t dstep = 1;
388  if (fDownscaleFullView) { dstep = fDriftWindow; }
389 
390  if (edeps.size() / dstep > fNCachedDrifts) { return false; }
391 
392  auto & wEdep = fWireDriftEdep[wireIdx];
393  auto & wPdg = fWireDriftPdg[wireIdx];
394 
395  for (size_t i = 0; i < fNCachedDrifts; ++i)
396  {
397  size_t i0 = i * dstep;
398  size_t i1 = (i + 1) * dstep;
399 
400  int best_pdg = pdgs[i0] & nnet::TrainingDataAlg::kPdgMask;
401  int vtx_flags = pdgs[i0] & nnet::TrainingDataAlg::kVtxMask;
402  int type_flags = pdgs[i0] & nnet::TrainingDataAlg::kTypeMask;
403  float max_edep = edeps[i0];
404  for (size_t k = i0 + 1; k < i1; ++k)
405  {
406  float ek = edeps[k];
407  if (ek > max_edep)
408  {
409  max_edep = ek;
410  best_pdg = pdgs[k] & nnet::TrainingDataAlg::kPdgMask; // remember best matching pdg
411  }
412  type_flags |= pdgs[k] & nnet::TrainingDataAlg::kTypeMask; // accumulate track type flags
413  vtx_flags |= pdgs[k] & nnet::TrainingDataAlg::kVtxMask; // accumulate all vtx flags
414  }
415 
416  wEdep[i] = max_edep;
417 
418  best_pdg |= type_flags;
419  if (fSaveVtxFlags) best_pdg |= vtx_flags;
420  wPdg[i] = best_pdg;
421  }
422 
423  return true;
424 }
std::vector< std::vector< int > > fWireDriftPdg
Definition: PointIdAlg.h:322
unsigned int fNCachedDrifts
std::vector< std::vector< float > > fWireDriftEdep
Definition: PointIdAlg.h:321
unsigned int img::DataProviderAlg::TPC ( void  ) const
inlineinherited

Definition at line 158 of file DataProviderAlg.h.

References img::DataProviderAlg::fTPC.

158 { return fTPC; }
std::vector<float> const& img::DataProviderAlg::wireData ( size_t  widx) const
inlineinherited

Definition at line 109 of file DataProviderAlg.h.

References img::DataProviderAlg::fWireDriftData.

109 { return fWireDriftData[widx]; }
std::vector< std::vector< float > > fWireDriftData
std::vector<float> const& nnet::TrainingDataAlg::wireEdep ( size_t  widx) const
inline

Definition at line 276 of file PointIdAlg.h.

276 { return fWireDriftEdep[widx]; }
std::vector< std::vector< float > > fWireDriftEdep
Definition: PointIdAlg.h:321
std::vector<int> const& nnet::TrainingDataAlg::wirePdg ( size_t  widx) const
inline

Definition at line 277 of file PointIdAlg.h.

277 { return fWireDriftPdg[widx]; }
std::vector< std::vector< int > > fWireDriftPdg
Definition: PointIdAlg.h:322
float img::DataProviderAlg::ZeroLevel ( void  ) const
inlineinherited

Level of zero ADC after scaling.

Definition at line 167 of file DataProviderAlg.h.

References img::DataProviderAlg::fAdcZero.

167 { return fAdcZero; }

Member Data Documentation

unsigned int nnet::TrainingDataAlg::fAdcDelay
private

Definition at line 331 of file PointIdAlg.h.

Referenced by setEventData().

calo::CalorimetryAlg img::DataProviderAlg::fCalorimetryAlg
protectedinherited
unsigned int img::DataProviderAlg::fCryo
protectedinherited
detinfo::DetectorProperties const* img::DataProviderAlg::fDetProp
protectedinherited

Definition at line 218 of file DataProviderAlg.h.

Referenced by getProjection(), and img::DataProviderAlg::setWireDriftData().

EDownscaleMode img::DataProviderAlg::fDownscaleMode
protectedinherited

Definition at line 179 of file DataProviderAlg.h.

Referenced by img::DataProviderAlg::DataProviderAlg().

float img::DataProviderAlg::fDriftWindowInv
protectedinherited
double nnet::TrainingDataAlg::fEdepTot
private

Definition at line 320 of file PointIdAlg.h.

Referenced by setEventData().

std::vector<size_t> nnet::TrainingDataAlg::fEventsPerBin
private

Definition at line 333 of file PointIdAlg.h.

Referenced by setDataEventData().

geo::GeometryCore const* img::DataProviderAlg::fGeometry
protectedinherited
art::InputTag nnet::TrainingDataAlg::fHitProducerLabel
private

Definition at line 325 of file PointIdAlg.h.

Referenced by setDataEventData().

std::vector<float> img::DataProviderAlg::fLifetimeCorrFactors
protectedinherited
unsigned int img::DataProviderAlg::fNDrifts
protectedinherited
unsigned int img::DataProviderAlg::fNScaledDrifts
protectedinherited
unsigned int img::DataProviderAlg::fPlane
protectedinherited
bool nnet::TrainingDataAlg::fSaveSimInfo
private

Definition at line 329 of file PointIdAlg.h.

Referenced by setEventData(), and TrainingDataAlg().

bool nnet::TrainingDataAlg::fSaveVtxFlags
private

Definition at line 328 of file PointIdAlg.h.

Referenced by setEventData(), and setWireEdepsAndLabels().

art::InputTag nnet::TrainingDataAlg::fSimulationProducerLabel
private

Definition at line 327 of file PointIdAlg.h.

Referenced by setEventData(), and TrainingDataAlg().

unsigned int img::DataProviderAlg::fTPC
protectedinherited
art::InputTag nnet::TrainingDataAlg::fTrackModuleLabel
private

Definition at line 326 of file PointIdAlg.h.

Referenced by setDataEventData().

std::vector< raw::ChannelID_t > img::DataProviderAlg::fWireChannels
protectedinherited
std::vector< std::vector<float> > nnet::TrainingDataAlg::fWireDriftEdep
private

Definition at line 321 of file PointIdAlg.h.

Referenced by findCrop(), resizeView(), and setWireEdepsAndLabels().

std::vector< std::vector<int> > nnet::TrainingDataAlg::fWireDriftPdg
private

Definition at line 322 of file PointIdAlg.h.

Referenced by resizeView(), and setWireEdepsAndLabels().

art::InputTag nnet::TrainingDataAlg::fWireProducerLabel
private

Definition at line 324 of file PointIdAlg.h.

Referenced by setDataEventData(), and setEventData().


The documentation for this class was generated from the following files: