21 #include "larevt/CalibrationDBI/Interface/ChannelStatusProvider.h" 22 #include "larevt/CalibrationDBI/Interface/ChannelStatusService.h" 31 #include "cetlib/search_path.h" 32 #include "cetlib_except/exception.h" 35 #include "tensorflow/core/public/session.h" 44 #include <unordered_map> 55 if ((samples == 0) || inps.empty() || inps.front().empty() || inps.front().front().empty())
58 if ((samples == -1) || (samples > (int)inps.size())) { samples = inps.size(); }
60 std::vector<std::vector<float>> results;
61 for (
int i = 0; i < samples; ++i) {
62 results.push_back(
Run(inps[i]));
69 std::string fname_out;
70 cet::search_path sp(
"FW_SEARCH_PATH");
71 if (!sp.find_file(fileName, fname_out)) {
73 if (stat(fileName, &buffer) == 0) { fname_out = fileName; }
88 mf::LogInfo(
"KerasModelInterface") <<
"Keras model loaded.";
94 std::vector<std::vector<std::vector<float>>> inp3d;
95 inp3d.push_back(inp2d);
111 {
"cnn_output",
"_netout"});
114 mf::LogInfo(
"TfModelInterface") <<
"TF model loaded.";
122 if ((samples == 0) || inps.empty() || inps.front().empty() || inps.front().front().empty())
125 if ((samples == -1) || (samples > (
long long int)inps.size())) { samples = inps.size(); }
127 long long int rows = inps.front().size(), cols = inps.front().front().size();
129 std::vector<tensorflow::Tensor> _x;
131 tensorflow::Tensor(tensorflow::DT_FLOAT, tensorflow::TensorShape({samples, rows, cols, 1})));
132 auto input_map = _x[0].tensor<float, 4>();
133 for (
long long int s = 0; s < samples; ++s) {
134 const auto& sample = inps[s];
135 for (
long long int r = 0;
r < rows; ++
r) {
136 const auto& row = sample[
r];
137 for (
long long int c = 0; c < cols; ++c) {
138 input_map(s,
r, c, 0) = row[c];
149 long long int rows = inp2d.size(), cols = inp2d.front().size();
151 std::vector<tensorflow::Tensor> _x;
153 tensorflow::Tensor(tensorflow::DT_FLOAT, tensorflow::TensorShape({1, rows, cols, 1})));
154 auto input_map = _x[0].tensor<float, 4>();
155 for (
long long int r = 0;
r < rows; ++
r) {
156 const auto& row = inp2d[
r];
157 for (
long long int c = 0; c < cols; ++c) {
158 input_map(0,
r, c, 0) = row[c];
162 auto out = g->runx(_x);
166 return std::vector<float>();
174 :
img::DataProviderAlg(config)
176 , fPatchSizeW(config.PatchSizeW())
177 , fPatchSizeD(config.PatchSizeD())
178 , fCurrentWireIdx(99999)
179 , fCurrentScaledDrift(99999)
195 mf::LogError(
"PointIdAlg") <<
"File name extension not supported.";
198 if (!
fNNet) {
throw cet::exception(
"nnet::PointIdAlg") <<
"Loading model from file failed."; }
223 mf::LogError(
"PointIdAlg") <<
"Patch buffering failed.";
229 if (!out.empty()) { result = out[outIdx]; }
231 mf::LogError(
"PointIdAlg") <<
"Problem with applying model to input.";
241 std::vector<float> result;
244 mf::LogError(
"PointIdAlg") <<
"Patch buffering failed.";
250 if (result.empty()) {
mf::LogError(
"PointIdAlg") <<
"Problem with applying model to input."; }
258 std::vector<std::pair<unsigned int, float>> points)
const 260 if (points.empty() || !
fNNet) {
return std::vector<std::vector<float>>(); }
262 std::vector<std::vector<std::vector<float>>> inps(
264 for (
size_t i = 0; i < points.size(); ++i) {
265 unsigned int wire = points[i].first;
266 float drift = points[i].second;
268 throw cet::exception(
"PointIdAlg") <<
"Patch buffering failed" << std::endl;
284 if ((wire1 == wire2) && (sd1 == sd2))
return true;
287 if ((wire1 == wire2) && ((size_t)drift1 == (
size_t)drift2))
return true;
311 std::vector<float> flat;
312 if (patch.empty() || patch.front().empty()) {
317 flat.resize(patch.size() * patch.front().size());
319 for (
size_t w = 0, i = 0;
w < patch.size(); ++
w) {
320 auto const& wire = patch[
w];
321 for (
size_t d = 0;
d < wire.size(); ++
d, ++i) {
336 if ((wire >= marginW) && (wire <
fAlgView.
fNWires - marginW) && (scaledDrift >= marginD) &&
351 , fWireProducerLabel(config.WireLabel())
352 , fHitProducerLabel(config.HitLabel())
353 , fTrackModuleLabel(config.TrackLabel())
354 , fSimulationProducerLabel(config.SimulationLabel())
355 , fSimChannelProducerLabel(config.SimChannelLabel())
356 , fSaveVtxFlags(config.SaveVtxFlags())
357 , fAdcDelay(config.AdcDelayTicks())
358 , fEventsPerBin(100, 0)
380 w.resize(view.fNCachedDrifts);
386 w.resize(view.fNCachedDrifts);
394 std::vector<int>
const& pdgs,
397 if ((wireIdx >=
fWireDriftEdep.size()) || (edeps.size() != pdgs.size())) {
return false; }
408 size_t i0 = i * dstep;
409 size_t i1 = (i + 1) * dstep;
414 float max_edep = edeps[i0];
415 for (
size_t k = i0 + 1; k < i1; ++k) {
427 best_pdg |= type_flags;
439 const TLorentzVector& tvec,
440 unsigned int plane)
const 452 unsigned int tpc = tpcid.
TPC, cryo = tpcid.
Cryostat;
457 if (driftDir == 1) { dx *= -1; }
458 else if (driftDir != -1) {
459 throw cet::exception(
"nnet::TrainingDataAlg") <<
"drift direction is not X." << std::endl;
461 vtx.SetX(tvec.X() + dx);
471 <<
"Vertex projection out of wire planes, just skipping this vertex.";
474 mf::LogWarning(
"TrainingDataAlg") <<
"Vertex projection out of wire planes, skip MC vertex.";
482 const std::unordered_map<int, const simb::MCParticle*>& particleMap)
const 484 const float minElectronLength2 = 2.5 * 2.5;
485 const float maxDeltaLength2 = 0.15 * 0.15;
488 if (pdg != 11)
return false;
491 for (
size_t d = 0;
d < nSec; ++
d) {
492 auto d_search = particleMap.find(particle.
Daughter(
d));
493 if (d_search != particleMap.end()) {
494 auto const& daughter = *((*d_search).second);
495 int d_pdg =
abs(daughter.PdgCode());
496 if (d_pdg != 22) {
return false; }
500 float trkLength2 = 0;
501 auto const* p = &particle;
502 bool branching =
false;
505 auto m_search = particleMap.find(p->Mother());
506 if (m_search != particleMap.end()) {
507 p = (*m_search).second;
508 int m_pdg =
abs(p->PdgCode());
510 nSec = p->NumberDaughters();
512 for (
size_t d = 0;
d < nSec; ++
d) {
513 auto d_search = particleMap.find(p->Daughter(
d));
514 if (d_search != particleMap.end()) {
515 auto const& daughter = *((*d_search).second);
516 int d_pdg =
abs(daughter.PdgCode());
522 if (ne > 1) { branching =
true; }
531 return (trkLength2 > minElectronLength2);
536 const std::unordered_map<int, const simb::MCParticle*>& particleMap)
const 538 bool hasElectron =
false, hasNuMu =
false, hasNuE =
false;
542 if ((pdg == 13) && (particle.
EndProcess() ==
"FastScintillation" ||
546 for (
size_t d = 0;
d < nSec; ++
d) {
547 auto d_search = particleMap.find(particle.
Daughter(
d));
548 if (d_search != particleMap.end()) {
549 auto const& daughter = *((*d_search).second);
550 int d_pdg =
abs(daughter.PdgCode());
553 else if (d_pdg == 14)
555 else if (d_pdg == 12)
561 return (hasElectron && hasNuMu && hasNuE);
565 std::unordered_map<
size_t, std::unordered_map<int, int>>& wireToDriftToVtxFlags,
568 const std::unordered_map<int, const simb::MCParticle*>& particleMap,
569 unsigned int plane)
const 571 for (
auto const& p : particleMap) {
572 auto const& particle = *p.second;
574 double ekStart = 1000. * (particle.E() - particle.Mass());
575 double ekEnd = 1000. * (particle.EndE() - particle.Mass());
576 int pdg =
abs(particle.PdgCode());
582 if ((particle.EndProcess() ==
"conv") && (ekStart > 40.0))
603 if (ekStart > 50.0) {
604 if (particle.Mother() != 0) {
605 auto search = particleMap.find(particle.Mother());
606 if (search != particleMap.end()) {
607 auto const& mother = *((*search).second);
608 int m_pdg =
abs(mother.PdgCode());
609 unsigned int nSec = mother.NumberDaughters();
610 unsigned int nVisible = 0;
612 for (
size_t d = 0;
d < nSec; ++
d) {
613 auto d_search = particleMap.find(mother.Daughter(
d));
614 if (d_search != particleMap.end()) {
615 auto const& daughter = *((*d_search).second);
616 int d_pdg =
abs(daughter.PdgCode());
617 if (((d_pdg == 2212) || (d_pdg == 211) || (d_pdg == 321)) &&
618 (1000. * (daughter.E() - daughter.Mass()) > 50.0)) {
627 if (((m_pdg != pdg) && (m_pdg != 2112)) || ((m_pdg != 2112) && (nVisible > 0)) ||
628 ((m_pdg == 2112) && (nVisible > 1))) {
634 if (particle.EndProcess() ==
"FastScintillation")
636 unsigned int nSec = particle.NumberDaughters();
637 for (
size_t d = 0;
d < nSec; ++
d) {
638 auto d_search = particleMap.find(particle.Daughter(
d));
639 if (d_search != particleMap.end()) {
640 auto const& daughter = *((*d_search).second);
641 int d_pdg =
abs(daughter.PdgCode());
642 if ((pdg == 321) && (d_pdg == 13)) {
646 if ((pdg == 211) && (d_pdg == 13)) {
654 if ((particle.EndProcess() ==
"Decay") && (ekEnd > 200.0))
656 unsigned int nSec = particle.NumberDaughters();
657 for (
size_t d = 0;
d < nSec; ++
d) {
658 auto d_search = particleMap.find(particle.Daughter(
d));
659 if (d_search != particleMap.end()) {
660 auto const& daughter = *((*d_search).second);
661 int d_pdg =
abs(daughter.PdgCode());
662 if ((pdg == 321) && (d_pdg == 13)) {
666 if ((pdg == 211) && (d_pdg == 13)) {
682 auto wd =
getProjection(clockData, detProp, particle.Position(), plane);
684 if ((wd.TPC ==
TPC()) && (wd.Cryo ==
Cryo())) {
685 wireToDriftToVtxFlags[wd.Wire][wd.Drift] |= flagsStart;
689 auto wd =
getProjection(clockData, detProp, particle.EndPosition(), plane);
690 if ((wd.TPC ==
TPC()) && (wd.Cryo ==
Cryo())) {
691 wireToDriftToVtxFlags[wd.Wire][wd.Drift] |= flagsEnd;
696 if (pdg == 321 || pdg == 211 || pdg == 2212) {
699 if (thisTrajectoryProcessMap1.size()) {
700 for (
auto const& couple1 : thisTrajectoryProcessMap1) {
701 if ((truetraj.
KeyToProcess(couple1.second)).find(
"Elastic") != std::string::npos) {
702 auto wd =
getProjection(clockData, detProp, truetraj.
at(couple1.first).first, plane);
703 if ((wd.TPC ==
TPC()) && (wd.Cryo ==
Cryo())) {
707 if ((truetraj.
KeyToProcess(couple1.second)).find(
"Inelastic") != std::string::npos) {
708 auto wd =
getProjection(clockData, detProp, truetraj.
at(couple1.first).first, plane);
709 if ((wd.TPC ==
TPC()) && (wd.Cryo ==
Cryo())) {
729 std::vector<art::Ptr<recob::Wire>> Wirelist;
734 mf::LogError(
"TrainingDataAlg") <<
"Wire data not set.";
740 std::vector<art::Ptr<recob::Hit>> Hitlist;
746 std::vector<art::Ptr<recob::Track>> Tracklist;
754 for (
size_t widx = 0; widx < 240; ++widx) {
760 for (
size_t subwidx = 0; subwidx < Wirelist.size(); ++subwidx) {
761 if (widx + 240 == Wirelist[subwidx]->Channel()) {
762 labels_deposit = Wirelist[subwidx]->Signal();
778 for (
size_t iHit = 0; iHit < Hitlist.size(); ++iHit) {
780 if (Hitlist[iHit]->Channel() != widx + 240) {
continue; }
781 if (Hitlist[iHit]->View() != 1) {
continue; }
784 if (ass_trk_hits.at(iHit).size() == 0) {
continue; }
789 if (ass_trk_hits.at(iHit)[0]->Length() < 5) {
continue; }
795 for (
size_t jHit = 0; jHit < Hitlist.size(); ++jHit) {
796 if (jHit == iHit) {
continue; }
797 if (Hitlist[jHit]->View() != 1) {
continue; }
799 if (ass_trk_hits.at(jHit).size() == 0) {
continue; }
800 if (ass_trk_hits.at(jHit)[0]->ID() != ass_trk_hits.at(iHit)[0]->ID()) {
continue; }
802 double dist = sqrt((Hitlist[iHit]->Channel() - Hitlist[jHit]->Channel()) *
803 (Hitlist[iHit]->Channel() - Hitlist[jHit]->Channel()) +
804 (Hitlist[iHit]->PeakTime() - Hitlist[jHit]->PeakTime()) *
805 (Hitlist[iHit]->PeakTime() - Hitlist[jHit]->PeakTime()));
807 if (far_dist < dist) {
817 for (
size_t jHit = 0; jHit < Hitlist.size(); ++jHit) {
818 if (jHit == iHit or
int(jHit) == far_index) {
continue; }
819 if (Hitlist[jHit]->View() != 1) {
continue; }
821 if (ass_trk_hits.at(jHit).size() == 0) {
continue; }
822 if (ass_trk_hits.at(jHit)[0]->ID() != ass_trk_hits.at(iHit)[0]->ID()) {
continue; }
824 double dist = sqrt((Hitlist[far_index]->Channel() - Hitlist[jHit]->Channel()) *
825 (Hitlist[far_index]->Channel() - Hitlist[jHit]->Channel()) +
826 (Hitlist[far_index]->PeakTime() - Hitlist[jHit]->PeakTime()) *
827 (Hitlist[far_index]->PeakTime() - Hitlist[jHit]->PeakTime()));
829 if (other_dist < dist) {
836 double del_wire = double(Hitlist[other_end]->Channel() - Hitlist[far_index]->Channel());
837 double del_time = double(Hitlist[other_end]->PeakTime() - Hitlist[far_index]->PeakTime());
838 double hypo = sqrt(del_wire * del_wire + del_time * del_time);
840 if (hypo == 0) {
continue; }
842 double cosser = TMath::Abs(del_wire / hypo);
843 double norm_ang = TMath::ACos(cosser) * 2 / TMath::Pi();
857 labels_pdg[Hitlist[iHit]->PeakTime()] = 211;
878 mf::LogError(
"TrainingDataAlg") <<
"Wire data not set.";
883 mf::LogInfo(
"TrainingDataAlg") <<
"Skip MC simulation info.";
890 auto particleHandle =
893 auto simChannelHandle =
896 std::unordered_map<int, const simb::MCParticle*> particleMap;
897 for (
auto const& particle : *particleHandle) {
898 particleMap[particle.TrackId()] = &particle;
901 std::unordered_map<size_t, std::unordered_map<int, int>> wireToDriftToVtxFlags;
906 std::map<int, int> trackToPDG;
912 std::vector<int> labels_pdg(labels_deposit.size(), 0);
913 int labels_size = labels_deposit.size();
915 std::map<int, std::map<int, double>> timeToTrackToCharge;
916 for (
auto const& channel : *simChannelHandle) {
917 if (channel.Channel() != wireChannelNumber)
continue;
919 auto const& timeSlices = channel.TDCIDEMap();
920 for (
auto const& timeSlice : timeSlices) {
921 int time = timeSlice.first;
923 auto const& energyDeposits = timeSlice.second;
924 for (
auto const& energyDeposit : energyDeposits) {
926 int tid = energyDeposit.trackID;
932 auto search = particleMap.find(tid);
933 if (search == particleMap.end()) {
937 auto const& mother = *((*search).second);
938 int mPdg =
abs(mother.PdgCode());
939 if ((mPdg == 13) || (mPdg == 211) || (mPdg == 2212)) {
940 if (energyDeposit.numElectrons > 10)
945 auto search = particleMap.find(tid);
946 if (search == particleMap.end()) {
950 auto const& particle = *((*search).second);
951 pdg =
abs(particle.PdgCode());
953 if (particle.Process() ==
"primary") {
957 else if (pdg == 13) {
976 if (particle.Process() ==
"Decay") {
979 else if (particle.Process() ==
"muIoni") {
985 trackToPDG[energyDeposit.trackID] = pdg;
987 double energy = energyDeposit.numElectrons * electronsToGeV;
988 timeToTrackToCharge[time][energyDeposit.trackID] +=
energy;
996 for (
auto const& ttc : timeToTrackToCharge) {
997 float max_deposit = 0.0;
999 for (
auto const& tc : ttc.second) {
1001 if (tc.second > max_deposit) {
1002 max_deposit = tc.second;
1003 max_pdg = trackToPDG[tc.first];
1009 if (tick_idx < labels_size && tick_idx >= 0) {
1010 labels_deposit[tick_idx] = max_deposit;
1011 labels_pdg[tick_idx] = max_pdg & type_pdg_mask;
1015 for (
auto const& drift_flags : wireToDriftToVtxFlags[widx]) {
1016 int drift = drift_flags.first, flags = drift_flags.second;
1017 if ((drift >= 0) && (drift < labels_size)) { labels_pdg[drift] |= flags; }
1030 unsigned int& d1)
const 1034 float max_cut = 0.25 * max_e_cut;
1061 for (
size_t i = w0; i < w1; ++i)
1071 for (
size_t i = w0; i < w1; ++i)
1080 unsigned int margin = 20;
1081 if ((w1 - w0 > 8) && (d1 - d0 > 8)) {
bool isInsideFiducialRegion(unsigned int wire, float drift) const
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
Store parameters for running LArG4.
geo::GeometryCore const * fGeometry
static std::unique_ptr< Graph > create(const char *graph_file_name, const std::vector< std::string > &outputs={}, bool use_bundle=false, int ninputs=1, int noutputs=1)
bool setWireEdepsAndLabels(std::vector< float > const &edeps, std::vector< int > const &pdgs, size_t wireIdx)
Utilities related to art service access.
unsigned int fNCachedDrifts
bool isMuonDecaying(const simb::MCParticle &particle, const std::unordered_map< int, const simb::MCParticle * > &particleMap) const
std::vector< std::vector< float > > Run(std::vector< std::vector< std::vector< float >>> const &inps, int samples=-1) override
std::vector< std::vector< float > > fWireDriftPatch
bool setDataEventData(const art::Event &event, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, unsigned int plane, unsigned int tpc, unsigned int cryo)
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
art::InputTag fTrackModuleLabel
Declaration of signal hit object.
virtual DataProviderAlgView resizeView(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, size_t wires, size_t drifts)
const value_type & at(const size_type i) const
bool setEventData(const art::Event &event, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, unsigned int plane, unsigned int tpc, unsigned int cryo)
virtual void set_data(std::vector< std::vector< std::vector< float >>> const &)
bool bufferPatch(size_t wire, float drift, std::vector< std::vector< float >> &patch) const
The data type to uniquely identify a Plane.
bool isValid
Whether this ID points to a valid element.
std::string KeyToProcess(unsigned char const &key) const
constexpr auto abs(T v)
Returns the absolute value of the argument.
CryostatID_t Cryostat
Index of cryostat.
DataProviderAlg(const fhicl::ParameterSet &pset)
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
WireDrift getProjection(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TLorentzVector &tvec, unsigned int plane) const
double TPCTDC2Tick(double const tdc) const
Given electronics clock count [tdc] returns TPC time-tick.
std::vector< float > compute_output(keras::DataChunk *dc)
std::vector< std::string > fNNetOutputs
bool isCurrentPatch(unsigned int wire, float drift) const
int NumberDaughters() const
int Daughter(const int i) const
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
art::InputTag fWireProducerLabel
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
bool isElectronEnd(const simb::MCParticle &particle, const std::unordered_map< int, const simb::MCParticle * > &particleMap) const
std::vector< float > predictIdVector(unsigned int wire, float drift) const
calculate multi-class probabilities for [wire, drift] point
Collection of exceptions for Geometry system.
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
TPCID FindTPCAtPosition(Point_t const &point) const
Returns the ID of the TPC at specified location.
std::string EndProcess() const
fhicl::Sequence< std::string > NNetOutputs
unsigned int fNScaledDrifts
std::vector< raw::ChannelID_t > fWireChannels
virtual std::vector< float > Run(std::vector< std::vector< float >> const &inp2d)=0
std::vector< size_t > fEventsPerBin
double ConvertXToTicks(double X, int p, int t, int c) const
KerasModelInterface(const char *modelFileName)
Provides recob::Track data product.
void fill(const art::PtrVector< recob::Hit > &hits, int only_plane)
art::InputTag fSimChannelProducerLabel
bool findCrop(float max_e_cut, unsigned int &w0, unsigned int &w1, unsigned int &d0, unsigned int &d1) const
double DriftVelocity(double efield=0., double temperature=0.) const
cm/us
The data type to uniquely identify a TPC.
std::vector< float > Run(std::vector< std::vector< float >> const &inp2d) override
ProcessMap const & TrajectoryProcesses() const
Definition of data types for geometry description.
DataProviderAlgView fAlgView
std::vector< std::vector< int > > fWireDriftPdg
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
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)
WireID NearestWireID(Point_t const &point, PlaneID const &planeid) const
Returns the ID of wire closest to position in the specified TPC.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
fhicl::Atom< std::string > NNetModelFile
~TrainingDataAlg() override
TfModelInterface(const char *modelFileName)
std::vector< std::vector< float > > fWireDriftEdep
Contains all timing reference information for the detector.
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
std::string findFile(const char *fileName) const
short int DetectDriftDirection() const
Returns the expected drift direction based on geometry.
unsigned int Cryo() const
Pool sum of pixels in a patch around the wire/drift pixel.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
static float particleRange2(const simb::MCParticle &particle)
img::DataProviderAlgView resizeView(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, size_t wires, size_t drifts) override
object containing MC truth information necessary for making RawDigits and doing back tracking ...
size_t fCurrentScaledDrift
Exception thrown on invalid wire number.
Declaration of basic channel signal object.
nnet::ModelInterface * fNNet
art::InputTag fSimulationProducerLabel
std::string fNNetModelFilePath
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
TPCID_t TPC
Index of the TPC within its cryostat.
bool isSamePatch(unsigned int wire1, float drift1, unsigned int wire2, float drift2) const
test if two wire/drift coordinates point to the same patch
std::vector< std::vector< float > > predictIdVectors(std::vector< std::pair< unsigned int, float >> points) const
art::InputTag fHitProducerLabel
double GeVToElectrons() const
cet::coded_exception< error, detail::translate > exception
Event finding and building.
TrainingDataAlg(const fhicl::ParameterSet &pset)
float predictIdValue(unsigned int wire, float drift, size_t outIdx=0) const
calculate single-value prediction (2-class probability) for [wire, drift] point
PointIdAlg(const fhicl::ParameterSet &pset)
static std::vector< float > flattenData2D(std::vector< std::vector< float >> const &patch)