20 double XResolution,
double YResolution,
double ZResolution,
21 bool Cropped,
bool ProngOnly):
25 fLengthX(nbinsX*XResolution),
26 fLengthY(nbinsY*YResolution),
27 fLengthZ(nbinsZ*ZResolution),
37 art::FindManyP<recob::SpacePoint>
const& fmSPFromHits,
38 art::FindManyP<recob::Track>
const& fmtrkhit,
39 const std::vector<float> &vtx)
52 art::FindManyP<recob::SpacePoint>
const& fmSPFromHits,
53 art::FindManyP<recob::Track>
const& fmtrkhit,
55 const bool& ProngOnly)
57 std::cout<<
"create 3D pixel maps"<<
std::endl;
61 if (!fmSPFromHits.isValid())
return pm;
64 unsigned int nhits =
cluster.size();
65 for (
unsigned int ihit= 0; ihit< nhits; ++ihit) {
68 std::vector<art::Ptr<recob::SpacePoint> > sp = fmSPFromHits.at(ihit);
72 coordinates[0] = sp[0]->XYZ()[0];
73 coordinates[1] = sp[0]->XYZ()[1];
74 coordinates[2] = sp[0]->XYZ()[2];
75 if (coordinates[0] == -999)
continue;
78 std::vector<float> shifted_coordinates(3);
79 shifted_coordinates[0] = coordinates[0] - bound.
Center(0) + bound.
Length(0)/2;
80 shifted_coordinates[1] = coordinates[1] - bound.
Center(1) + bound.
Length(1)/2;
81 shifted_coordinates[2] = coordinates[2] - bound.
Center(2) + bound.
Length(2)/8;
88 int hit_prong_tag = -1;
89 if (fmtrkhit.isValid() && fmtrkhit.at(ihit).size()!=0) {
90 hit_prong_tag = fmtrkhit.at(ihit)[0]->ID();
93 pm.
AddHit(shifted_coordinates[0], shifted_coordinates[1], shifted_coordinates[2], correctedHitCharge, hit_prong_tag);
104 art::FindManyP<recob::SpacePoint>
const& fmSPFromHits,
105 art::FindManyP<recob::Shower>
const& fmshwhit,
106 const std::vector<float> &vtx)
119 art::FindManyP<recob::SpacePoint>
const& fmSPFromHits,
120 art::FindManyP<recob::Shower>
const& fmshwhit,
122 const bool& ProngOnly)
124 std::cout<<
"create 3D pixel maps, tag by Shower"<<
std::endl;
128 if (!fmSPFromHits.isValid())
return pm;
131 unsigned int nhits =
cluster.size();
132 for (
unsigned int ihit= 0; ihit< nhits; ++ihit) {
135 std::vector<art::Ptr<recob::SpacePoint> > sp = fmSPFromHits.at(ihit);
139 coordinates[0] = sp[0]->XYZ()[0];
140 coordinates[1] = sp[0]->XYZ()[1];
141 coordinates[2] = sp[0]->XYZ()[2];
142 if (coordinates[0] == -999)
continue;
145 std::vector<float> shifted_coordinates(3);
146 shifted_coordinates[0] = coordinates[0] - bound.
Center(0) + bound.
Length(0)/2;
147 shifted_coordinates[1] = coordinates[1] - bound.
Center(1) + bound.
Length(1)/2;
148 shifted_coordinates[2] = coordinates[2] - bound.
Center(2) + bound.
Length(2)/8;
155 int hit_prong_tag = -1;
156 if (fmshwhit.isValid() && fmshwhit.at(ihit).size()!=0) {
157 hit_prong_tag = fmshwhit.at(ihit)[0]->ID();
160 pm.
AddHit(shifted_coordinates[0], shifted_coordinates[1], shifted_coordinates[2], correctedHitCharge, hit_prong_tag);
172 const std::vector<float> &vtx)
176 vtx[0], vtx[1], vtx[2]);
183 os <<
"RegPixelMapProducer...... ";
float Center(const unsigned int &axis) const
RegCNNBoundary3D Define3DBoundary(detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::Hit > > const &cluster, const std::vector< float > &vtx)
Get boundaries for pixel map representation of cluster.
RegPixelMap3D Create3DMap(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::Hit > > const &cluster, art::FindManyP< recob::SpacePoint > const &fmSPFromHits, art::FindManyP< recob::Track > const &fmtrkhit, const std::vector< float > &vtx)
Producer algorithm for RegPixelMap3D, input to CVN neural net.
RegPixelMap3DProducer(int nbinsX, int nbinsY, int nbinsZ, double XResolution, double YResolution, double ZResolution, bool Cropped, bool ProngOnly)
double ElectronLifetime() const
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Cluster finding and building.
RegPixelMap3D Create3DMapGivenBoundaryBySP(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::Hit > > const &cluster, const RegCNNBoundary3D &bound, art::FindManyP< recob::SpacePoint > const &fmSPFromHits, art::FindManyP< recob::Track > const &fmtrkhit, const bool &Cropped, const bool &ProngOnly)
Collection of exceptions for Geometry system.
RegPixelMap3DProducer for RegCNN modified from PixelMapProducer.h.
Detector simulation of raw signals on wires.
Defines an enumeration for cellhit classification.
float PeakTime() const
Time of the signal peak, in tick units.
Contains all timing reference information for the detector.
void AddHit(float rel_x, float rel_y, float rel_z, float charge, int hit_prong_tag)
std::ostream & operator<<(std::ostream &os, const RegPixelMap3DProducer &p)
RegPixelMap3D, input to 3D CNN neural net.
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
double Length(const unsigned int &axis) const
QTextStream & endl(QTextStream &s)