Public Member Functions | Private Attributes | List of all members
cnn::RegPixelMap3DProducer Class Reference

Producer algorithm for RegPixelMap3D, input to CVN neural net. More...

#include <RegPixelMap3DProducer.h>

Public Member Functions

 RegPixelMap3DProducer (int nbinsX, int nbinsY, int nbinsZ, double XResolution, double YResolution, double ZResolution, bool Cropped, bool ProngOnly)
 
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. More...
 
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)
 
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)
 
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::Shower > const &fmshwkhit, const std::vector< float > &vtx)
 
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::Shower > const &fmshwhit, const bool &Cropped, const bool &ProngOnly)
 

Private Attributes

int fNBinsX
 
int fNBinsY
 
int fNBinsZ
 
double fLengthX
 
double fLengthY
 
double fLengthZ
 
bool fCropped
 
bool fProngOnly
 
art::ServiceHandle< geo::Geometrygeom
 

Detailed Description

Producer algorithm for RegPixelMap3D, input to CVN neural net.

Definition at line 46 of file RegPixelMap3DProducer.h.

Constructor & Destructor Documentation

cnn::RegPixelMap3DProducer::RegPixelMap3DProducer ( int  nbinsX,
int  nbinsY,
int  nbinsZ,
double  XResolution,
double  YResolution,
double  ZResolution,
bool  Cropped,
bool  ProngOnly 
)

Definition at line 19 of file RegPixelMap3DProducer.cxx.

21  :
22  fNBinsX(nbinsX),
23  fNBinsY(nbinsY),
24  fNBinsZ(nbinsZ),
25  fLengthX(nbinsX*XResolution),
26  fLengthY(nbinsY*YResolution),
27  fLengthZ(nbinsZ*ZResolution),
28  fCropped(Cropped),
29  fProngOnly(ProngOnly)
30  {
31  }

Member Function Documentation

RegPixelMap3D cnn::RegPixelMap3DProducer::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 
)

Definition at line 34 of file RegPixelMap3DProducer.cxx.

40  {
41 
42  RegCNNBoundary3D bound = Define3DBoundary(detProp, cluster, vtx);
43 
44  return Create3DMapGivenBoundaryBySP(clockData, detProp, cluster, bound, fmSPFromHits, fmtrkhit, fCropped, fProngOnly);
45  }
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 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)
RegPixelMap3D cnn::RegPixelMap3DProducer::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::Shower > const &  fmshwkhit,
const std::vector< float > &  vtx 
)

Definition at line 101 of file RegPixelMap3DProducer.cxx.

107  {
108 
109  RegCNNBoundary3D bound = Define3DBoundary(detProp, cluster, vtx);
110 
111  return Create3DMapGivenBoundaryBySP(clockData, detProp, cluster, bound, fmSPFromHits, fmshwhit, fCropped, fProngOnly);
112  }
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 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)
RegPixelMap3D cnn::RegPixelMap3DProducer::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 
)

Definition at line 48 of file RegPixelMap3DProducer.cxx.

56  {
57  std::cout<<"create 3D pixel maps"<<std::endl;
58 
59  RegPixelMap3D pm(bound, Cropped, ProngOnly);
60 
61  if (!fmSPFromHits.isValid()) return pm;
62 
63  // Loop over hit
64  unsigned int nhits = cluster.size();
65  for (unsigned int ihit= 0; ihit< nhits; ++ihit) {
66  // Get hit
67  art::Ptr<recob::Hit> hit = cluster.at(ihit);
68  std::vector<art::Ptr<recob::SpacePoint> > sp = fmSPFromHits.at(ihit);
69 
70  std::vector<float> coordinates(3);
71  if (!sp.empty()) {
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;
76  }
77 
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;
82  //std::cout<<"HELLO ===> "<<shifted_coordinates[0];
83  //std::cout<<", "<<shifted_coordinates[1];
84  //std::cout<<", "<<shifted_coordinates[2]<<std::endl;
85 
86  float correctedHitCharge = (hit->Integral()*TMath::Exp((sampling_rate(clockData)*hit->PeakTime()) / (detProp.ElectronLifetime()*1.e3) ) );
87 
88  int hit_prong_tag = -1;
89  if (fmtrkhit.isValid() && fmtrkhit.at(ihit).size()!=0) {
90  hit_prong_tag = fmtrkhit.at(ihit)[0]->ID();
91  }
92 
93  pm.AddHit(shifted_coordinates[0], shifted_coordinates[1], shifted_coordinates[2], correctedHitCharge, hit_prong_tag);
94  }
95 
96  pm.Finish();
97 
98  return pm;
99  }
coordinates
Definition: geo_types.h:121
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:224
Detector simulation of raw signals on wires.
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:218
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
QTextStream & endl(QTextStream &s)
RegPixelMap3D cnn::RegPixelMap3DProducer::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::Shower > const &  fmshwhit,
const bool Cropped,
const bool ProngOnly 
)

Definition at line 115 of file RegPixelMap3DProducer.cxx.

123  {
124  std::cout<<"create 3D pixel maps, tag by Shower"<<std::endl;
125 
126  RegPixelMap3D pm(bound, Cropped, ProngOnly);
127 
128  if (!fmSPFromHits.isValid()) return pm;
129 
130  // Loop over hit
131  unsigned int nhits = cluster.size();
132  for (unsigned int ihit= 0; ihit< nhits; ++ihit) {
133  // Get hit
134  art::Ptr<recob::Hit> hit = cluster.at(ihit);
135  std::vector<art::Ptr<recob::SpacePoint> > sp = fmSPFromHits.at(ihit);
136 
137  std::vector<float> coordinates(3);
138  if (!sp.empty()) {
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;
143  }
144 
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;
149  //std::cout<<"HELLO ===> "<<shifted_coordinates[0];
150  //std::cout<<", "<<shifted_coordinates[1];
151  //std::cout<<", "<<shifted_coordinates[2]<<std::endl;
152 
153  float correctedHitCharge = (hit->Integral()*TMath::Exp((sampling_rate(clockData)*hit->PeakTime()) / (detProp.ElectronLifetime()*1.e3) ) );
154 
155  int hit_prong_tag = -1;
156  if (fmshwhit.isValid() && fmshwhit.at(ihit).size()!=0) {
157  hit_prong_tag = fmshwhit.at(ihit)[0]->ID();
158  }
159 
160  pm.AddHit(shifted_coordinates[0], shifted_coordinates[1], shifted_coordinates[2], correctedHitCharge, hit_prong_tag);
161  }
162 
163  pm.Finish();
164 
165  return pm;
166  }
coordinates
Definition: geo_types.h:121
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:224
Detector simulation of raw signals on wires.
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:218
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
QTextStream & endl(QTextStream &s)
RegCNNBoundary3D cnn::RegPixelMap3DProducer::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.

Definition at line 170 of file RegPixelMap3DProducer.cxx.

173  {
174  RegCNNBoundary3D bound(fNBinsX, fNBinsY, fNBinsZ,
176  vtx[0], vtx[1], vtx[2]);
177 
178  return bound;
179  }

Member Data Documentation

bool cnn::RegPixelMap3DProducer::fCropped
private

Definition at line 100 of file RegPixelMap3DProducer.h.

double cnn::RegPixelMap3DProducer::fLengthX
private

Definition at line 97 of file RegPixelMap3DProducer.h.

double cnn::RegPixelMap3DProducer::fLengthY
private

Definition at line 98 of file RegPixelMap3DProducer.h.

double cnn::RegPixelMap3DProducer::fLengthZ
private

Definition at line 99 of file RegPixelMap3DProducer.h.

int cnn::RegPixelMap3DProducer::fNBinsX
private

Definition at line 94 of file RegPixelMap3DProducer.h.

int cnn::RegPixelMap3DProducer::fNBinsY
private

Definition at line 95 of file RegPixelMap3DProducer.h.

int cnn::RegPixelMap3DProducer::fNBinsZ
private

Definition at line 96 of file RegPixelMap3DProducer.h.

bool cnn::RegPixelMap3DProducer::fProngOnly
private

Definition at line 101 of file RegPixelMap3DProducer.h.

art::ServiceHandle<geo::Geometry> cnn::RegPixelMap3DProducer::geom
private

Definition at line 103 of file RegPixelMap3DProducer.h.


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