Public Member Functions | Public Attributes | List of all members
cvn::RegPixelMap Class Reference

RegPixelMap, basic input to CVN neural net. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/CVN/func/RegPixelMap.h"

Public Member Functions

 RegPixelMap (unsigned int nPlane, unsigned int nCell, const Boundary &bound)
 
 RegPixelMap (unsigned int nPlane, unsigned int nCell, unsigned int vtxPlane, unsigned int vtxXCell, unsigned int vtxYCell, const Boundary &bound)
 
 RegPixelMap ()
 
unsigned int NPlane () const
 Length in planes. More...
 
unsigned int NCell () const
 Width in cells. More...
 
unsigned int NPixel () const
 Total number of pixels in map. More...
 
Boundary Bound () const
 Map boundary. More...
 
unsigned int NInput () const
 Number of inputs for the neural net. More...
 
void FillInputVector (float *input) const
 
void Add (const unsigned int &plane, const unsigned int &cell, const float &pe, const HitType label, const double purity)
 
void Add (const unsigned int plane, const unsigned int cell, const int view, const float pe, const HitType label, const double purity)
 
unsigned int GlobalToIndex (const unsigned int &plane, const unsigned int &cell)
 Take global plane, cell (detector) and return index in fPE vector. More...
 
unsigned int LocalToIndex (const unsigned int &plane, const unsigned int &cell) const
 Take local plane, cell (within map) and return index in fPE vector. More...
 
unsigned int GlobalToIndexSingle (const unsigned int &plane, const unsigned int &cell)
 Take global plane, cell (detector) and return index in fPE vector. More...
 
void Print ()
 
TH2F * ToTH2 (TString name) const
 Return the pixel map as a 2D histogram for visualization. More...
 
TH2F * ToLabTH2 (TString name) const
 
TH2F * SingleViewToTH2 (const unsigned int &view, TString name) const
 
TH2F * SingleViewToLabTH2 (const unsigned int &view, TString name) const
 

Public Attributes

unsigned int fNPlane
 Number of planes, length of pixel map. More...
 
unsigned int fNCell
 Number of cells, width of pixel map. More...
 
unsigned int fVtxPlane
 
unsigned int fVtxXCell
 
unsigned int fVtxYCell
 
std::vector< float > fPE
 Vector of PE measurements for pixels. More...
 
std::vector< float > fPEX
 Vector of X PE measurements for pixels. More...
 
std::vector< float > fPEY
 Vector of Y PE measurements for pixels. More...
 
std::vector< double > fPur
 Vector of purity for pixels. More...
 
std::vector< double > fPurX
 Vector of X purity for pixels. More...
 
std::vector< double > fPurY
 Vector of Y purity for pixels. More...
 
std::vector< HitTypefLab
 Vector of Truth labels for pixels. More...
 
std::vector< HitTypefLabX
 Vector of X Truth labels for pixels. More...
 
std::vector< HitTypefLabY
 Vector of Y Truth labels for pixels. More...
 
Boundary fBound
 

Detailed Description

RegPixelMap, basic input to CVN neural net.

Definition at line 22 of file RegPixelMap.h.

Constructor & Destructor Documentation

cvn::RegPixelMap::RegPixelMap ( unsigned int  nPlane,
unsigned int  nCell,
const Boundary bound 
)

Definition at line 14 of file RegPixelMap.cxx.

15  :
16  fNPlane(nPlane),
17  fNCell(nCell),
18  fPE(nPlane*nCell),
19  fPEX(nPlane*nCell),
20  fPEY(nPlane*nCell),
21  fPur(nPlane*nCell),
22  fPurX(nPlane*nCell),
23  fPurY(nPlane*nCell),
24  fLab(nPlane*nCell),
25  fLabX(nPlane*nCell),
26  fLabY(nPlane*nCell),
27  fBound(bound)
28  {}
std::vector< HitType > fLabY
Vector of Y Truth labels for pixels.
Definition: RegPixelMap.h:90
Boundary fBound
Definition: RegPixelMap.h:92
std::vector< double > fPurX
Vector of X purity for pixels.
Definition: RegPixelMap.h:86
unsigned int fNPlane
Number of planes, length of pixel map.
Definition: RegPixelMap.h:76
std::vector< float > fPEX
Vector of X PE measurements for pixels.
Definition: RegPixelMap.h:83
std::vector< HitType > fLabX
Vector of X Truth labels for pixels.
Definition: RegPixelMap.h:89
std::vector< double > fPur
Vector of purity for pixels.
Definition: RegPixelMap.h:85
unsigned int fNCell
Number of cells, width of pixel map.
Definition: RegPixelMap.h:77
std::vector< HitType > fLab
Vector of Truth labels for pixels.
Definition: RegPixelMap.h:88
std::vector< float > fPEY
Vector of Y PE measurements for pixels.
Definition: RegPixelMap.h:84
std::vector< float > fPE
Vector of PE measurements for pixels.
Definition: RegPixelMap.h:82
std::vector< double > fPurY
Vector of Y purity for pixels.
Definition: RegPixelMap.h:87
cvn::RegPixelMap::RegPixelMap ( unsigned int  nPlane,
unsigned int  nCell,
unsigned int  vtxPlane,
unsigned int  vtxXCell,
unsigned int  vtxYCell,
const Boundary bound 
)

Definition at line 31 of file RegPixelMap.cxx.

33  :
34  fNPlane(nPlane),
35  fNCell(nCell),
36  fVtxPlane(vtxPlane),
37  fVtxXCell(vtxXCell),
38  fVtxYCell(vtxYCell),
39  fPE(nPlane*nCell),
40  fPEX(nPlane*nCell),
41  fPEY(nPlane*nCell),
42  fPur(nPlane*nCell),
43  fPurX(nPlane*nCell),
44  fPurY(nPlane*nCell),
45  fLab(nPlane*nCell),
46  fLabX(nPlane*nCell),
47  fLabY(nPlane*nCell),
48  fBound(bound)
49  {}
std::vector< HitType > fLabY
Vector of Y Truth labels for pixels.
Definition: RegPixelMap.h:90
Boundary fBound
Definition: RegPixelMap.h:92
std::vector< double > fPurX
Vector of X purity for pixels.
Definition: RegPixelMap.h:86
unsigned int fNPlane
Number of planes, length of pixel map.
Definition: RegPixelMap.h:76
std::vector< float > fPEX
Vector of X PE measurements for pixels.
Definition: RegPixelMap.h:83
std::vector< HitType > fLabX
Vector of X Truth labels for pixels.
Definition: RegPixelMap.h:89
std::vector< double > fPur
Vector of purity for pixels.
Definition: RegPixelMap.h:85
unsigned int fNCell
Number of cells, width of pixel map.
Definition: RegPixelMap.h:77
unsigned int fVtxYCell
Definition: RegPixelMap.h:80
std::vector< HitType > fLab
Vector of Truth labels for pixels.
Definition: RegPixelMap.h:88
std::vector< float > fPEY
Vector of Y PE measurements for pixels.
Definition: RegPixelMap.h:84
unsigned int fVtxPlane
Definition: RegPixelMap.h:78
std::vector< float > fPE
Vector of PE measurements for pixels.
Definition: RegPixelMap.h:82
unsigned int fVtxXCell
Definition: RegPixelMap.h:79
std::vector< double > fPurY
Vector of Y purity for pixels.
Definition: RegPixelMap.h:87
cvn::RegPixelMap::RegPixelMap ( )
inline

Definition at line 27 of file RegPixelMap.h.

27 {};

Member Function Documentation

void cvn::RegPixelMap::Add ( const unsigned int plane,
const unsigned int cell,
const float &  pe,
const HitType  label = kEmptyHit,
const double  purity = 0.0 
)

Add a hit to the map if it is contained within the plane, cell rcvne Could be expanded later to add to overflow accordingly.

Definition at line 65 of file RegPixelMap.cxx.

References fBound, fLab, fLabX, fLabY, fPE, fPEX, fPEY, fPur, fPurX, fPurY, GlobalToIndex(), GlobalToIndexSingle(), cvn::Boundary::IsWithin(), label, plotConfusion::purity(), and POTSpillRate::view.

Referenced by cvn::RegPixelMapProducer::CreateMapGivenBoundary(), cvn::RegPixelMapProducer::CreateMapGivenShowerVertex(), cvn::RegPixelMapProducer::CreateMapGivenVertex(), and NInput().

67  {
68  unsigned int view = plane % 2;
69  if(fBound.IsWithin(plane, cell)){
70  fPE[GlobalToIndex(plane,cell)] += pe/2100.;
73  if(view==0){
74  fPEX[GlobalToIndexSingle(plane,cell)] += pe/2100.;//Why +=?
77  }
78  else{
79  fPEY[GlobalToIndexSingle(plane,cell)] += pe/2100.;
82  }
83  }
84  }
std::vector< HitType > fLabY
Vector of Y Truth labels for pixels.
Definition: RegPixelMap.h:90
Boundary fBound
Definition: RegPixelMap.h:92
std::vector< double > fPurX
Vector of X purity for pixels.
Definition: RegPixelMap.h:86
unsigned int GlobalToIndex(const unsigned int &plane, const unsigned int &cell)
Take global plane, cell (detector) and return index in fPE vector.
std::vector< float > fPEX
Vector of X PE measurements for pixels.
Definition: RegPixelMap.h:83
std::vector< HitType > fLabX
Vector of X Truth labels for pixels.
Definition: RegPixelMap.h:89
std::vector< double > fPur
Vector of purity for pixels.
Definition: RegPixelMap.h:85
const char * label
unsigned int GlobalToIndexSingle(const unsigned int &plane, const unsigned int &cell)
Take global plane, cell (detector) and return index in fPE vector.
std::vector< HitType > fLab
Vector of Truth labels for pixels.
Definition: RegPixelMap.h:88
std::vector< float > fPEY
Vector of Y PE measurements for pixels.
Definition: RegPixelMap.h:84
std::vector< float > fPE
Vector of PE measurements for pixels.
Definition: RegPixelMap.h:82
std::vector< double > fPurY
Vector of Y purity for pixels.
Definition: RegPixelMap.h:87
bool IsWithin(const unsigned int &plane, const unsigned int &cell, const unsigned int &view=0)
Definition: Boundary.cxx:40
void cvn::RegPixelMap::Add ( const unsigned int  plane,
const unsigned int  cell,
const int  view,
const float  pe,
const HitType  label = kEmptyHit,
const double  purity = 0.0 
)

Definition at line 86 of file RegPixelMap.cxx.

References fBound, fLab, fLabX, fLabY, fPE, fPEX, fPEY, fPur, fPurX, fPurY, fVtxPlane, fVtxXCell, fVtxYCell, GlobalToIndex(), GlobalToIndexSingle(), allTimeWatchdog::index, makeTrainCVSamples::int, cvn::Boundary::IsWithin(), label, and plotConfusion::purity().

88  {
89  if(fBound.IsWithin(plane, cell)){
90  fPE[GlobalToIndex(plane,cell)] += pe/2100.;
93  }
94  int localplaneid = plane - (int)fVtxPlane;
95  if(view==0){
96  int localcellid = cell - (int)fVtxXCell;
97  if(localplaneid>=-30&&localplaneid<=120&&localcellid>=-70&&localcellid<=70){
98  int index = 141*(localplaneid+30) + (localcellid+70);
99  if(index>=0&&index<(int)fPEX.size()){
100 // std::cout<<"in PixelMap, view, localplane, localcell, plane, cell, index, pe*50 "<<view<<" "<<localplaneid<<" "<<localcellid<<" "<<(localplaneid+30)/2<<" "<<localcellid+70<<" "<<index<<" "<<pe*50<<std::endl;
101  fPEX[index] = pe;
102  fLabX[index] = label;
103  fPurX[index] = purity;
104  }
105  }
106  }
107  if(view==1) {
108  int localcellid = cell - (int)fVtxYCell;
109  if(localplaneid>=-30&&localplaneid<=120&&localcellid>=-70&&localcellid<=70){
110  int index = 141*(localplaneid+30) + (localcellid+70);
111  if(index>=0&&index<(int)fPEY.size()){
112 // std::cout<<"in PixelMap, view, plane, cell, index, pe*50 "<<view<<" "<<localplaneid<<" "<<localcellid<<" "<<(localplaneid+30-1)/2<<" "<<localcellid+70<<" "<<index<<" "<<pe*50<<std::endl;
113  fPEY[index] = pe;
114  fLabY[index] = label;
115  fPurY[index] = purity;
116  }
117  }
118  }
119  }
std::vector< HitType > fLabY
Vector of Y Truth labels for pixels.
Definition: RegPixelMap.h:90
Boundary fBound
Definition: RegPixelMap.h:92
std::vector< double > fPurX
Vector of X purity for pixels.
Definition: RegPixelMap.h:86
unsigned int GlobalToIndex(const unsigned int &plane, const unsigned int &cell)
Take global plane, cell (detector) and return index in fPE vector.
std::vector< float > fPEX
Vector of X PE measurements for pixels.
Definition: RegPixelMap.h:83
std::vector< HitType > fLabX
Vector of X Truth labels for pixels.
Definition: RegPixelMap.h:89
std::vector< double > fPur
Vector of purity for pixels.
Definition: RegPixelMap.h:85
const char * label
unsigned int GlobalToIndexSingle(const unsigned int &plane, const unsigned int &cell)
Take global plane, cell (detector) and return index in fPE vector.
unsigned int fVtxYCell
Definition: RegPixelMap.h:80
std::vector< HitType > fLab
Vector of Truth labels for pixels.
Definition: RegPixelMap.h:88
std::vector< float > fPEY
Vector of Y PE measurements for pixels.
Definition: RegPixelMap.h:84
unsigned int fVtxPlane
Definition: RegPixelMap.h:78
std::vector< float > fPE
Vector of PE measurements for pixels.
Definition: RegPixelMap.h:82
unsigned int fVtxXCell
Definition: RegPixelMap.h:79
std::vector< double > fPurY
Vector of Y purity for pixels.
Definition: RegPixelMap.h:87
bool IsWithin(const unsigned int &plane, const unsigned int &cell, const unsigned int &view=0)
Definition: Boundary.cxx:40
Boundary cvn::RegPixelMap::Bound ( ) const
inline

Map boundary.

Definition at line 39 of file RegPixelMap.h.

References fBound.

Referenced by cvn::RegCVNMapper::produce().

39 {return fBound;};
Boundary fBound
Definition: RegPixelMap.h:92
void cvn::RegPixelMap::FillInputVector ( float *  input) const

Definition at line 53 of file RegPixelMap.cxx.

References fPE, and MECModelEnuComparisons::i.

Referenced by NInput().

54  {
55  unsigned int i = 0;
56 
57  for(const auto& pe:fPE){
58  input[i] = pe;
59  ++i;
60  }
61 
62  }
std::vector< float > fPE
Vector of PE measurements for pixels.
Definition: RegPixelMap.h:82
unsigned int cvn::RegPixelMap::GlobalToIndex ( const unsigned int plane,
const unsigned int cell 
)

Take global plane, cell (detector) and return index in fPE vector.

Definition at line 121 of file RegPixelMap.cxx.

References ana::assert(), fBound, cvn::Boundary::FirstCell(), cvn::Boundary::FirstPlane(), fNCell, fPE, allTimeWatchdog::index, and POTSpillRate::view.

Referenced by Add(), and NInput().

123  {
124  unsigned int view = plane % 2;
125 
126  unsigned int internalPlane = plane - fBound.FirstPlane();
127  unsigned int internalCell = cell - fBound.FirstCell(view);
128 
129  unsigned int index = internalPlane * fNCell + internalCell % fNCell;
130 
131  assert(index < fPE.size());
132 
133  return index;
134  }
int FirstCell(const unsigned int &view) const
Definition: Boundary.h:44
Boundary fBound
Definition: RegPixelMap.h:92
unsigned int fNCell
Number of cells, width of pixel map.
Definition: RegPixelMap.h:77
std::vector< float > fPE
Vector of PE measurements for pixels.
Definition: RegPixelMap.h:82
assert(nhit_max >=nhit_nbins)
int FirstPlane() const
Definition: Boundary.h:42
unsigned int cvn::RegPixelMap::GlobalToIndexSingle ( const unsigned int plane,
const unsigned int cell 
)

Take global plane, cell (detector) and return index in fPE vector.

Definition at line 145 of file RegPixelMap.cxx.

References ana::assert(), fBound, cvn::Boundary::FirstCell(), cvn::Boundary::FirstPlane(), fNCell, fPEX, allTimeWatchdog::index, and POTSpillRate::view.

Referenced by Add(), and NInput().

147  {
148  unsigned int view = plane % 2;
149 
150 // unsigned int internalPlane = ((plane - fBound.FirstPlane())/2);//from standard Pixelmap
151  unsigned int internalPlane = ((plane - fBound.FirstPlane()));
152 
153  unsigned int internalCell = cell - fBound.FirstCell(view);
154 
155  unsigned int index = internalPlane * fNCell + internalCell % fNCell;
156 
157  assert(index < fPEX.size());
158 
159  return index;
160  }
int FirstCell(const unsigned int &view) const
Definition: Boundary.h:44
Boundary fBound
Definition: RegPixelMap.h:92
std::vector< float > fPEX
Vector of X PE measurements for pixels.
Definition: RegPixelMap.h:83
unsigned int fNCell
Number of cells, width of pixel map.
Definition: RegPixelMap.h:77
assert(nhit_max >=nhit_nbins)
int FirstPlane() const
Definition: Boundary.h:42
unsigned int cvn::RegPixelMap::LocalToIndex ( const unsigned int plane,
const unsigned int cell 
) const

Take local plane, cell (within map) and return index in fPE vector.

Definition at line 136 of file RegPixelMap.cxx.

References ana::assert(), fNCell, fPE, and allTimeWatchdog::index.

Referenced by NInput(), Print(), SingleViewToLabTH2(), SingleViewToTH2(), ToLabTH2(), and ToTH2().

138  {
139  unsigned int index = plane * fNCell + cell % fNCell;
140 
141  assert(index < fPE.size());
142  return index;
143  }
unsigned int fNCell
Number of cells, width of pixel map.
Definition: RegPixelMap.h:77
std::vector< float > fPE
Vector of PE measurements for pixels.
Definition: RegPixelMap.h:82
assert(nhit_max >=nhit_nbins)
unsigned int cvn::RegPixelMap::NCell ( ) const
inline

Width in cells.

Definition at line 33 of file RegPixelMap.h.

References fNCell.

Referenced by cvn::operator<<().

33 {return fNCell;};
unsigned int fNCell
Number of cells, width of pixel map.
Definition: RegPixelMap.h:77
unsigned int cvn::RegPixelMap::NInput ( ) const
inline

Number of inputs for the neural net.

Definition at line 42 of file RegPixelMap.h.

References Add(), getBrightness::cell, FillInputVector(), GlobalToIndex(), GlobalToIndexSingle(), label, LocalToIndex(), NPixel(), NDAPDHVSetting::plane, Print(), plotConfusion::purity(), SingleViewToLabTH2(), SingleViewToTH2(), ToLabTH2(), ToTH2(), and POTSpillRate::view.

42 {return NPixel();};
unsigned int NPixel() const
Total number of pixels in map.
Definition: RegPixelMap.h:36
unsigned int cvn::RegPixelMap::NPixel ( ) const
inline

Total number of pixels in map.

Definition at line 36 of file RegPixelMap.h.

References fPE.

Referenced by NInput(), and cvn::operator<<().

36 {return fPE.size();};
std::vector< float > fPE
Vector of PE measurements for pixels.
Definition: RegPixelMap.h:82
unsigned int cvn::RegPixelMap::NPlane ( ) const
inline

Length in planes.

Definition at line 30 of file RegPixelMap.h.

References fNPlane.

Referenced by cvn::operator<<().

30 {return fNPlane;};
unsigned int fNPlane
Number of planes, length of pixel map.
Definition: RegPixelMap.h:76
void cvn::RegPixelMap::Print ( )

Draw pixel map to the screen. This is pretty hokey and the aspect ratio is totally unrealistic.

Definition at line 164 of file RegPixelMap.cxx.

References om::cout, allTimeWatchdog::endl, fNCell, fNPlane, fPE, allTimeWatchdog::index, and LocalToIndex().

Referenced by NInput().

165  {
166 
167  // Start by doing even planes
168  for(unsigned int iCell = 0; iCell < fNCell; ++iCell)
169  {
170  for(unsigned int iPlane = 0; iPlane < fNPlane; iPlane += 2)
171  {
172  unsigned int index = LocalToIndex(iPlane, iCell);
173  if( fPE[index] > 0)
174  {
175  std::cout << "*";
176  }
177  else
178  {
179  std::cout << " ";
180  }
181 
182  }
183  std::cout << std::endl;
184  }
185  // Then do odd planes
186  for(unsigned int iCell = 0; iCell < fNCell; ++iCell)
187  {
188  for(unsigned int iPlane = 1; iPlane < fNPlane; iPlane += 2)
189  {
190  unsigned int index = LocalToIndex(iPlane, iCell);
191  if( fPE[index] > 0)
192  {
193  std::cout << "*";
194  }
195  else
196  {
197  std::cout << " ";
198  }
199 
200  }
201  std::cout << std::endl;
202  }
203 
204  }
unsigned int fNPlane
Number of planes, length of pixel map.
Definition: RegPixelMap.h:76
unsigned int fNCell
Number of cells, width of pixel map.
Definition: RegPixelMap.h:77
unsigned int LocalToIndex(const unsigned int &plane, const unsigned int &cell) const
Take local plane, cell (within map) and return index in fPE vector.
OStream cout
Definition: OStream.cxx:6
std::vector< float > fPE
Vector of PE measurements for pixels.
Definition: RegPixelMap.h:82
TH2F * cvn::RegPixelMap::SingleViewToLabTH2 ( const unsigned int view,
TString  name 
) const

Definition at line 274 of file RegPixelMap.cxx.

References fLabX, fLabY, fNCell, fNPlane, fPEX, fPEY, analysePickle::hist, and LocalToIndex().

Referenced by NInput().

275  {
276 
277  TH2F* hist = new TH2F(name, ";Plane;Cell", (fNPlane/2)+(fNPlane%2),
278  0, (fNPlane/2)+(fNPlane%2), fNCell, 0, fNCell);
279 
280  for(unsigned int iPlane = 0; iPlane < ((fNPlane/2)+(fNPlane%2)); ++iPlane)
281  {
282  for(unsigned int iCell = 0; iCell < fNCell; ++iCell)
283  {
284  double pe = (view == 0) ? fPEX[LocalToIndex(iPlane, iCell)] : fPEY[LocalToIndex(iPlane, iCell)];
285  double lab = (view == 0) ? fLabX[LocalToIndex(iPlane, iCell)] : fLabY[LocalToIndex(iPlane, iCell)];
286 
287  // Draw label 0 as non-empty bin
288  if ( pe > 0 && lab < 1 ) lab = 0.1;
289 
290  // Add 1 to in each bin to skip underflow
291  hist->SetBinContent(iPlane+1, iCell+1, lab);
292 
293  }
294  }
295  return hist;
296  }
std::vector< HitType > fLabY
Vector of Y Truth labels for pixels.
Definition: RegPixelMap.h:90
const XML_Char * name
Definition: expat.h:151
unsigned int fNPlane
Number of planes, length of pixel map.
Definition: RegPixelMap.h:76
std::vector< float > fPEX
Vector of X PE measurements for pixels.
Definition: RegPixelMap.h:83
std::vector< HitType > fLabX
Vector of X Truth labels for pixels.
Definition: RegPixelMap.h:89
unsigned int fNCell
Number of cells, width of pixel map.
Definition: RegPixelMap.h:77
unsigned int LocalToIndex(const unsigned int &plane, const unsigned int &cell) const
Take local plane, cell (within map) and return index in fPE vector.
std::vector< float > fPEY
Vector of Y PE measurements for pixels.
Definition: RegPixelMap.h:84
TH2F * cvn::RegPixelMap::SingleViewToTH2 ( const unsigned int view,
TString  name 
) const

Definition at line 253 of file RegPixelMap.cxx.

References fNCell, fNPlane, fPEX, fPEY, analysePickle::hist, and LocalToIndex().

Referenced by NInput().

254  {
255 
256  TH2F* hist = new TH2F(name, ";Plane;Cell", (fNPlane/2)+(fNPlane%2),
257  0, (fNPlane/2)+(fNPlane%2), fNCell, 0, fNCell);
258 
259  for(unsigned int iPlane = 0; iPlane < ((fNPlane/2)+(fNPlane%2)); ++iPlane)
260  {
261  for(unsigned int iCell = 0; iCell < fNCell; ++iCell)
262  {
263 
264  double pe = (view == 0) ? fPEX[LocalToIndex(iPlane, iCell)] : fPEY[LocalToIndex(iPlane, iCell)];
265 
266  // Add 1 to in each bin to skip underflow
267  hist->SetBinContent(iPlane+1, iCell+1, pe);
268 
269  }
270  }
271  return hist;
272  }
const XML_Char * name
Definition: expat.h:151
unsigned int fNPlane
Number of planes, length of pixel map.
Definition: RegPixelMap.h:76
std::vector< float > fPEX
Vector of X PE measurements for pixels.
Definition: RegPixelMap.h:83
unsigned int fNCell
Number of cells, width of pixel map.
Definition: RegPixelMap.h:77
unsigned int LocalToIndex(const unsigned int &plane, const unsigned int &cell) const
Take local plane, cell (within map) and return index in fPE vector.
std::vector< float > fPEY
Vector of Y PE measurements for pixels.
Definition: RegPixelMap.h:84
TH2F * cvn::RegPixelMap::ToLabTH2 ( TString  name) const

Definition at line 228 of file RegPixelMap.cxx.

References fLab, check_time_usage::float, fNCell, fNPlane, fPE, analysePickle::hist, and LocalToIndex().

Referenced by NInput().

229  {
230 
231  // Create a histogram, use twice as many cells to distinguish views
232  TH2F* hist = new TH2F(name, ";Plane;Cell", fNPlane, 0, fNPlane,
233  fNCell*2, 0, fNCell*2);
234 
235  for(unsigned int iPlane = 0; iPlane < fNPlane; ++iPlane)
236  {
237  for(unsigned int iCell = 0; iCell < fNCell; ++iCell)
238  {
239 
240  float pe = fPE[LocalToIndex(iPlane, iCell)];
241  float lab = (float)fLab[LocalToIndex(iPlane, iCell)];
242  // Draw label 0 as non-empty bin
243  if ( pe > 0 && lab < 1 ) lab = 0.1;
244 
245  // Add 1 to in each bin to skip underflow
246  hist->SetBinContent(iPlane+1, iCell + fNCell*(iPlane%2) + 1, lab);
247 
248  }
249  }
250  return hist;
251  }
const XML_Char * name
Definition: expat.h:151
unsigned int fNPlane
Number of planes, length of pixel map.
Definition: RegPixelMap.h:76
unsigned int fNCell
Number of cells, width of pixel map.
Definition: RegPixelMap.h:77
std::vector< HitType > fLab
Vector of Truth labels for pixels.
Definition: RegPixelMap.h:88
unsigned int LocalToIndex(const unsigned int &plane, const unsigned int &cell) const
Take local plane, cell (within map) and return index in fPE vector.
std::vector< float > fPE
Vector of PE measurements for pixels.
Definition: RegPixelMap.h:82
TH2F * cvn::RegPixelMap::ToTH2 ( TString  name) const

Return the pixel map as a 2D histogram for visualization.

Definition at line 206 of file RegPixelMap.cxx.

References fNCell, fNPlane, fPE, analysePickle::hist, and LocalToIndex().

Referenced by NInput().

207  {
208 
209  // Create a histogram, use twice as many cells to distinguish views
210  TH2F* hist = new TH2F(name, ";Plane;Cell", fNPlane, 0, fNPlane,
211  fNCell*2, 0, fNCell*2);
212  // TH2F* hist = new TH2F("RegPixelMap", ";Plane;Cell", fNPlane, 0, fNPlane,
213  // fNCell*2, 0, fNCell*2);
214 
215  for(unsigned int iPlane = 0; iPlane < fNPlane; ++iPlane)
216  {
217  for(unsigned int iCell = 0; iCell < fNCell; ++iCell)
218  {
219  // Add 1 to in each bin to skip underflow
220  hist->SetBinContent(iPlane+1, iCell + fNCell*(iPlane%2) + 1,
221  fPE[LocalToIndex(iPlane, iCell)]);
222 
223  }
224  }
225  return hist;
226  }
const XML_Char * name
Definition: expat.h:151
unsigned int fNPlane
Number of planes, length of pixel map.
Definition: RegPixelMap.h:76
unsigned int fNCell
Number of cells, width of pixel map.
Definition: RegPixelMap.h:77
unsigned int LocalToIndex(const unsigned int &plane, const unsigned int &cell) const
Take local plane, cell (within map) and return index in fPE vector.
std::vector< float > fPE
Vector of PE measurements for pixels.
Definition: RegPixelMap.h:82

Member Data Documentation

Boundary cvn::RegPixelMap::fBound

Definition at line 92 of file RegPixelMap.h.

Referenced by Add(), Bound(), GlobalToIndex(), and GlobalToIndexSingle().

std::vector<HitType> cvn::RegPixelMap::fLab

Vector of Truth labels for pixels.

Definition at line 88 of file RegPixelMap.h.

Referenced by Add(), and ToLabTH2().

std::vector<HitType> cvn::RegPixelMap::fLabX

Vector of X Truth labels for pixels.

Definition at line 89 of file RegPixelMap.h.

Referenced by Add(), and SingleViewToLabTH2().

std::vector<HitType> cvn::RegPixelMap::fLabY

Vector of Y Truth labels for pixels.

Definition at line 90 of file RegPixelMap.h.

Referenced by Add(), and SingleViewToLabTH2().

unsigned int cvn::RegPixelMap::fNCell
unsigned int cvn::RegPixelMap::fNPlane

Number of planes, length of pixel map.

Definition at line 76 of file RegPixelMap.h.

Referenced by cvn::RegCVNImageUtils::ConvertPixelMapToImageVectorF(), NPlane(), Print(), SingleViewToLabTH2(), SingleViewToTH2(), ToLabTH2(), and ToTH2().

std::vector<float> cvn::RegPixelMap::fPE

Vector of PE measurements for pixels.

Definition at line 82 of file RegPixelMap.h.

Referenced by Add(), FillInputVector(), GlobalToIndex(), LocalToIndex(), NPixel(), Print(), ToLabTH2(), and ToTH2().

std::vector<float> cvn::RegPixelMap::fPEX

Vector of X PE measurements for pixels.

Definition at line 83 of file RegPixelMap.h.

Referenced by Add(), cvn::RegCVNImageUtils::ConvertPixelMapToImageVectorF(), GlobalToIndexSingle(), SingleViewToLabTH2(), and SingleViewToTH2().

std::vector<float> cvn::RegPixelMap::fPEY

Vector of Y PE measurements for pixels.

Definition at line 84 of file RegPixelMap.h.

Referenced by Add(), cvn::RegCVNImageUtils::ConvertPixelMapToImageVectorF(), SingleViewToLabTH2(), and SingleViewToTH2().

std::vector<double> cvn::RegPixelMap::fPur

Vector of purity for pixels.

Definition at line 85 of file RegPixelMap.h.

Referenced by Add().

std::vector<double> cvn::RegPixelMap::fPurX

Vector of X purity for pixels.

Definition at line 86 of file RegPixelMap.h.

Referenced by Add().

std::vector<double> cvn::RegPixelMap::fPurY

Vector of Y purity for pixels.

Definition at line 87 of file RegPixelMap.h.

Referenced by Add().

unsigned int cvn::RegPixelMap::fVtxPlane

Definition at line 78 of file RegPixelMap.h.

Referenced by Add().

unsigned int cvn::RegPixelMap::fVtxXCell

Definition at line 79 of file RegPixelMap.h.

Referenced by Add().

unsigned int cvn::RegPixelMap::fVtxYCell

Definition at line 80 of file RegPixelMap.h.

Referenced by Add().


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