RegCNNBoundary3D.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file RegCNNBoundary3D.cxx
3 /// \brief RegCNNBoundary3D for 3D RegCNN PixelMap modified from CVNBoundary.cxx
4 /// \author Wenjie Wu - wenjieww@uci.edu
5 ////////////////////////////////////////////////////////////////////////
6 
7 #include <iostream>
8 #include <ostream>
9 #include <utility>
10 
12 
14 
15 namespace cnn
16 {
17 
18  RegCNNBoundary3D::RegCNNBoundary3D(const int& nbinsX, // # of wires of pixel map
19  const int& nbinsY, // # of TDC of pixel map
20  const int& nbinsZ, // # of TDC of pixel map
21  const double& x_length, // # of Wire merging
22  const double& y_length, // # of TDC merging
23  const double& z_length, // # of TDC merging
24  const float& center_X,
25  const float& center_Y,
26  const float& center_Z):
27  fStartBin{0, 0, 0},
28  fStopBin{nbinsX, nbinsY, nbinsZ},
29  fStart{0, 0, 0},
30  fStop{x_length, y_length, z_length},
31  fCenter{center_X, center_Y, center_Z}
32  {
33  }
34 
35  bool RegCNNBoundary3D::IsWithin(const float& rel_x, const float& rel_y, const float& rel_z)
36  {
37  bool inX = (rel_x >= fStart[0]) && (rel_x < fStop[0]);
38  bool inY = (rel_y >= fStart[1]) && (rel_y < fStop[1]);
39  bool inZ = (rel_z >= fStart[2]) && (rel_z < fStop[2]);
40 
41  return inX && inY && inZ;
42  }
43 
44  std::ostream& operator<<(std::ostream& os, const RegCNNBoundary3D& b)
45  {
46  os<<"RegCNNBoundary3D actual pixel map coverage (in cm)\n"
47  <<b.Length(0)<<", "<<b.Length(1)<<b.Length(2)<<"\n"
48  <<"Actual pixel size\n"
49  <<b.NBins(0)<<", "<<b.NBins(1)<<", "<<b.NBins(2)<<"\n";
50 
51  return os;
52  }
53 }
double fStop[3]
Maximum wire, inclusive.
int fStopBin[3]
Maximum TDC in each view, inclusive.
bool IsWithin(const float &rel_x, const float &rel_y, const float &rel_z)
int NBins(const unsigned int &axis) const
RegCNNBoundary3D for 3D RegCNN PixelMap modified from CVNBoundary.h.
Defines an enumeration for cellhit classification.
double fStart[3]
Minimum wire, inclusive.
std::ostream & operator<<(std::ostream &os, const RegPixelMap3DProducer &p)
static bool * b
Definition: config.cpp:1043
double Length(const unsigned int &axis) const