PixelPIDMaps.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file PixelPIDMaps.cxx
3 /// \brief PixelPIDMaps for Neutrino Event Reco with Deep Learning
4 /// \author mcgroh@iu.edu psihas@fnal.gov
5 ////////////////////////////////////////////////////////////////////////
6 
8 
9 namespace nerd
10 {
11  PixelPIDMaps::PixelPIDMaps(std::vector<std::vector<bool>> maskx,
12  std::vector<std::vector<bool>> masky,
13  std::vector<std::vector<float>> labelx,
14  std::vector<std::vector<float>> labely):
15  fMaskX(maskx),
16  fMaskY(masky),
17  fLabelX(labelx),
18  fLabelY(labely)
19  {}
20 
22  {
23  fMaskX.clear();
24  fMaskY.clear();
25  fLabelX.clear();
26  fLabelY.clear();
27  }
28 
30  {
31  if(view == geo::kY)
32  return fLabelY.size();
33  return fLabelX.size();
34  }
35 
36  std::vector<std::vector<bool>> PixelPIDMaps::GetViewMask(geo::View_t view)
37  {
38  if(view == geo::kY)
39  return fMaskY;
40  return fMaskX;
41  }
42 
43  std::vector<std::vector<float>> PixelPIDMaps::GetViewLabel(geo::View_t view)
44  {
45  if(view == geo::kY)
46  return fLabelY;
47  return fLabelX;
48  }
49 
51  {
52  bool same = true;
53 
54  for(unsigned int i = 0; i < fMaskX.size(); ++i){
55  for(unsigned int j = 0; j < fMaskX[0].size(); ++j){
56  if(fMaskX[i][j] != rhs.fMaskX[i][j]){
57  same = false;
58  std::cout<<"Difference in fMaskX at "<<i<<std::endl;
59  }
60  }
61  }
62 
63  for(unsigned int i = 0; i < fMaskY.size(); ++i){
64  for(unsigned int j = 0; j < fMaskY[0].size(); ++j){
65  if(fMaskY[i][j] != rhs.fMaskY[i][j]){
66  same = false;
67  std::cout<<"Difference in fMaskY at "<<i<<std::endl;
68  }
69  }
70  }
71 
72  for(unsigned int i = 0; i < fLabelX.size(); ++i){
73  for(unsigned int j = 0; j < fLabelX[0].size(); ++j){
74  if(fLabelX[i][j] != rhs.fLabelX[i][j]){
75  same = false;
76  std::cout<<"Difference in fLabelX at "<<i<<std::endl;
77  std::cout<<fLabelX[i][j]<<" vs "<<rhs.fLabelX[i][j]<<std::endl;
78  }
79  }
80  }
81 
82  for(unsigned int i = 0; i < fLabelY.size(); ++i){
83  for(unsigned int j = 0; j < fLabelY[0].size(); ++j){
84  if(fLabelY[i][j] != rhs.fLabelY[i][j]){
85  same = false;
86  std::cout<<"Difference in fLabelY at "<<i<<std::endl;
87  std::cout<<fLabelY[i][j]<<" vs "<<rhs.fLabelY[i][j]<<std::endl;
88  }
89  }
90  }
91 
92  return same;
93  }
94 }
95 
96 
std::vector< std::vector< bool > > fMaskX
Definition: PixelPIDMaps.h:31
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
std::vector< std::vector< bool > > GetViewMask(geo::View_t view)
Defines an enumeration for nerd classification.
Definition: NERDEvaluate.cxx:9
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
std::vector< std::vector< bool > > fMaskY
Definition: PixelPIDMaps.h:32
unsigned int NClusters(geo::View_t view)
std::vector< std::vector< float > > GetViewLabel(geo::View_t view)
std::vector< std::vector< float > > fLabelX
Definition: PixelPIDMaps.h:34
const double j
Definition: BetheBloch.cxx:29
OStream cout
Definition: OStream.cxx:6
std::vector< std::vector< float > > fLabelY
Definition: PixelPIDMaps.h:35
bool operator==(const PixelPIDMaps &rhs)
PixelPIDMaps for NERDprong.
PixelPIDMaps(std::vector< std::vector< bool >> maskx, std::vector< std::vector< bool >> masky, std::vector< std::vector< float >> labelx, std::vector< std::vector< float >> labely)