PixelMap.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file PixelMap.h
3 /// \brief PixelMap for CVN
4 /// \author Dominick Rocco - rocco@physics.umn.edu
5 ////////////////////////////////////////////////////////////////////////
6 
7 #include <cassert>
8 #include <iostream>
9 #include "CVN/func/PixelMap.h"
10 
11 namespace cvn
12 {
13 
14  //..................................................................
15  PixelMap::PixelMap(unsigned int nPlane, unsigned int nCell,
16  const Boundary& bound,
17  bool PEOnly):
18  fNPlane(nPlane),
19  fNCell(nCell),
20  fOccupiedPixels(0),
21  fOccupiedPixelsX(0),
22  fOccupiedPixelsY(0),
23  fPE(nPlane*nCell),
24  fPEX (((nPlane/2)+(nPlane%2))*nCell),
25  fPEY (((nPlane/2)+(nPlane%2))*nCell),
26  fPur (PEOnly ? 0 : nPlane*nCell),
27  fPurX(PEOnly ? 0 : ((nPlane/2)+(nPlane%2))*nCell),
28  fPurY(PEOnly ? 0 : ((nPlane/2)+(nPlane%2))*nCell),
29  fLab (PEOnly ? 0 : nPlane*nCell),
30  fLabX(PEOnly ? 0 : ((nPlane/2)+(nPlane%2))*nCell),
31  fLabY(PEOnly ? 0 : ((nPlane/2)+(nPlane%2))*nCell),
32  fT (PEOnly ? 0 : nPlane*nCell),
33  fTX (PEOnly ? 0 : ((nPlane/2)+(nPlane%2))*nCell),
34  fTY (PEOnly ? 0 : ((nPlane/2)+(nPlane%2))*nCell),
35  fObj (PEOnly ? 0 : nPlane*nCell),
36  fObjX(PEOnly ? 0 : ((nPlane/2)+(nPlane%2))*nCell),
37  fObjY(PEOnly ? 0 : ((nPlane/2)+(nPlane%2))*nCell),
38  fNu (PEOnly ? 0 : nPlane*nCell),
39  fNuX (PEOnly ? 0 : ((nPlane/2)+(nPlane%2))*nCell),
40  fNuY (PEOnly ? 0 : ((nPlane/2)+(nPlane%2))*nCell),
41  fVie (PEOnly ? 0 : nPlane*nCell),
42  fVieX(PEOnly ? 0 : ((nPlane/2)+(nPlane%2))*nCell),
43  fVieY(PEOnly ? 0 : ((nPlane/2)+(nPlane%2))*nCell),
44  fHit (PEOnly ? 0 : nPlane*nCell),
45  fHitX(PEOnly ? 0 : ((nPlane/2)+(nPlane%2))*nCell),
46  fHitY(PEOnly ? 0 : ((nPlane/2)+(nPlane%2))*nCell),
47  fBound(bound),
48  fPEOnly(PEOnly)
49  {}
50 
51  //..................................................................
52  void PixelMap::FillInputVector(float* input) const
53  {
54  unsigned int i = 0;
55 
56  for(const auto& pe:fPE){
57  input[i] = pe;
58  ++i;
59  }
60 
61  }
62 
63 
64  //..................................................................
65  void PixelMap::Add(const unsigned int& plane, const unsigned int& cell,
66  const float& pe, unsigned int& view, unsigned int& hitID,
67  const float& time, const HitType label = kEmptyHit,
68  const double purity = 0.0, const int object = 0,
69  const int nuIdx = 0)
70  {
71  const float scale = 2100.0; // From Dom's Devs Repo Rev 527
72 
73  if( fBound.IsWithin(plane, cell,view) ){
75  unsigned int pmIndex = GlobalToIndex(plane,cell,view);
76  fPE[pmIndex] += pe/scale;
77 
78  if(!fPEOnly){
79  fT[pmIndex] = time;
80  fNu[pmIndex] = nuIdx;
81  fVie[pmIndex] = view;
82  fHit[pmIndex] = hitID;
83  fLab[pmIndex] = label;
84  fPur[pmIndex] = purity;
85  fObj[pmIndex] = object;
86  }
87 
88  unsigned int pmIdxS = GlobalToIndexSingle(plane,cell,view);
89 
90  if( view == 0 ){ // XZ-view
92  fPEX[pmIdxS] += pe/scale;
93  if(!fPEOnly){
94  fTX[pmIdxS] = time;
95  fNuX[pmIdxS] = nuIdx;
96  fVieX[pmIdxS] = view;
97  fHitX[pmIdxS] = hitID;
98  fLabX[pmIdxS] = label;
99  fPurX[pmIdxS] = purity;
100  fObjX[pmIdxS] = object;
101  }
102  }
103 
104  else{ // YZ-view
106  fPEY[pmIdxS] += pe/scale;
107  if(!fPEOnly){
108  fTY[pmIdxS] = time;
109  fNuY[pmIdxS] = nuIdx;
110  fVieY[pmIdxS] = view;
111  fHitY[pmIdxS] = hitID;
112  fLabY[pmIdxS] = label;
113  fPurY[pmIdxS] = purity;
114  fObjY[pmIdxS] = object;
115  }
116  }
117  }
118  }
119 
120  //..................................................................
121  unsigned int PixelMap::GlobalToIndex(const unsigned int& plane,
122  const unsigned int& cell,
123  const unsigned int& view )
124  {
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  }
135 
136  //..................................................................
137  unsigned int PixelMap::LocalToIndex(const unsigned int& plane,
138  const unsigned int& cell) const
139  {
140  unsigned int index = plane * fNCell + cell % fNCell;
141 
142  assert(index < fPE.size());
143  return index;
144  }
145 
146  //..................................................................
147  unsigned int PixelMap::GlobalToIndexSingle(const unsigned int& plane,
148  const unsigned int& cell,
149  const unsigned int& view)
150  {
151 
152  unsigned int internalPlane = ((plane - fBound.FirstPlane())/2);
153 
154  unsigned int internalCell = cell - fBound.FirstCell(view);
155 
156  unsigned int index = internalPlane * fNCell + internalCell % fNCell;
157 
158  assert(index < fPEX.size());
159 
160  return index;
161  }
162 
163  //..................................................................
165  {
166 
167  // Start by doing even planes
168  for(unsigned int iCell = 0; iCell < fNCell; ++iCell){
169  for(unsigned int iPlane = 0; iPlane < fNPlane; iPlane += 2){
170  unsigned int index = LocalToIndex(iPlane, iCell);
171 
172  if( fPE[index] > 0) std::cout << "*";
173  else std::cout << " ";
174  }
175  std::cout << std::endl;
176  }
177  // Then do odd planes
178  for(unsigned int iCell = 0; iCell < fNCell; ++iCell){
179  for(unsigned int iPlane = 1; iPlane < fNPlane; iPlane += 2){
180  unsigned int index = LocalToIndex(iPlane, iCell);
181 
182  if( fPE[index] > 0) std::cout << "*";
183  else std::cout << " ";
184  }
185  std::cout << std::endl;
186  }
187 
188  }
189 
190 
191  //..................................................................
192  void PixelMap::ToFile(std::ofstream & ofs, int batch, bool hits) const
193  {
194  const std::vector<float> *pPEXY;
195 
196  if (hits) {
197  for (unsigned int view = 0; view < 2; view++) {
198  if (view == 0) pPEXY = (&fPEX);
199  else pPEXY = (&fPEY);
200  unsigned int index = 0;
201  char cells[fNCell];
202 
203  for(unsigned int iPlane = 0; iPlane < NPlanePerView(); ++iPlane){
204  for(unsigned int iCell = 0; iCell < fNCell; ++iCell){
205  cells[iCell] = ConvertHitsToChar( (*pPEXY)[index] );
206  ++index; //unsigned int index = plane * fNCell + cell % fNCell;
207  }
208  ofs << batch << " " << view << " " << iPlane << ":";
209  ofs.write(cells, fNCell);
210  ofs << std::endl;
211  }
212  }
213  }
214  else {
215  bool useGeV = true;
216  for (unsigned int view = 0; view < 2; view++) {
217  if (view == 0) pPEXY = (&fPEX);
218  else pPEXY = (&fPEY);
219  unsigned int index = 0;
220  char cells[fNCell];
221 
222  for(unsigned int iPlane = 0; iPlane < NPlanePerView(); ++iPlane){
223  for(unsigned int iCell = 0; iCell < fNCell; ++iCell){
224  cells[iCell] = ConvertToChar( (*pPEXY)[index], useGeV);
225  ++index;
226  }
227  ofs << batch << " " << view << " " << iPlane << ":";
228  ofs.write(cells, fNCell);
229  ofs << std::endl;
230  }
231  }
232  }
233  }
234 
235  //..................................................................
236  TH2F* PixelMap::ToTH2(TString name) const
237  {
238 
239  // Create a histogram, use twice as many cells to distinguish views
240  TH2F* hist = new TH2F(name, ";Plane;Cell", fNPlane, 0, fNPlane,
241  fNCell*2, 0, fNCell*2);
242 
243  for(unsigned int iPlane = 0; iPlane < fNPlane; ++iPlane){
244  for(unsigned int iCell = 0; iCell < fNCell; ++iCell){
245  // Add 1 to in each bin to skip underflow
246  // view 0 is XZ, view 1 is YZ. Preserve EventDisplay convention of having XZ image on top, YZ below
247  hist->SetBinContent(iPlane+1,
248  iCell + fNCell*((iPlane+fBound.FirstView()+1)%2) + 1,
249  fPE[LocalToIndex(iPlane, iCell)]);
250  }
251  }
252  return hist;
253  }
254 
255 
256 
257  //..................................................................
258  TH2F* PixelMap::ToLabTH2(TString name) const
259  {
260 
261  // Create a histogram, use twice as many cells to distinguish views
262  TH2F* hist = new TH2F(name, ";Plane;Cell", fNPlane, 0, fNPlane,
263  fNCell*2, 0, fNCell*2);
264 
265  for(unsigned int iPlane = 0; iPlane < fNPlane; ++iPlane){
266  for(unsigned int iCell = 0; iCell < fNCell; ++iCell){
267 
268  float pe = fPE[LocalToIndex(iPlane, iCell)];
269  float lab = (float)fLab[LocalToIndex(iPlane, iCell)];
270  // Draw label 0 as non-empty bin
271  if(pe > 0 && lab < 1) lab = 0.1;
272 
273  // Add 1 to in each bin to skip underflow
274  // view 0 is XZ, view 1 is YZ. Preserve EventDisplay convention of having XZ image on top, YZ below
275  hist->SetBinContent(iPlane+1,
276  iCell + fNCell*((iPlane+fBound.FirstView()+1)%2) + 1,
277  lab);
278 
279  }
280  }
281  return hist;
282  }
283 
284  //..................................................................
285  TH2F* PixelMap::ToObjTH2(TString name) const
286  {
287 
288  // Create a histogram, use twice as many cells to distinguish views
289  TH2F* hist = new TH2F(name, ";Plane;Cell", fNPlane, 0, fNPlane,
290  fNCell*2, 0, fNCell*2);
291 
292  for(unsigned int iPlane = 0; iPlane < fNPlane; ++iPlane){
293  for(unsigned int iCell = 0; iCell < fNCell; ++iCell){
294 
295  //float pe = fPE[LocalToIndex(iPlane, iCell)];
296  int obj = fObj[LocalToIndex(iPlane, iCell)];
297  // Draw label 0 as non-empty bin
298  //if(pe > 0 && obj < 1) obj = 0.1;
299 
300  // Add 1 to in each bin to skip underflow
301  // view 0 is XZ, view 1 is YZ. Preserve EventDisplay convention of having XZ image on top, YZ below
302  hist->SetBinContent(iPlane+1,
303  iCell + fNCell*((iPlane+fBound.FirstView()+1)%2) + 1,
304  obj);
305 
306  }
307  }
308  return hist;
309  }
310 
311  //..................................................................
312  TH2F* PixelMap::SingleViewToTH2(const unsigned int& view, TString name) const
313  {
314 
315  TH2F* hist = new TH2F(name, ";Plane;Cell", (fNPlane/2)+(fNPlane%2),
316  0, (fNPlane/2)+(fNPlane%2), fNCell, 0, fNCell);
317 
318  for(unsigned int iPlane = 0; iPlane < ((fNPlane/2)+(fNPlane%2)); ++iPlane){
319  for(unsigned int iCell = 0; iCell < fNCell; ++iCell){
320 
321  double pe = (view == 0) ? fPEX[LocalToIndex(iPlane, iCell)] : fPEY[LocalToIndex(iPlane, iCell)];
322 
323  // Add 1 to in each bin to skip underflow
324  hist->SetBinContent(iPlane+1, iCell+1, pe);
325  }
326  }
327  return hist;
328  }
329 
330  //..................................................................
331  TH2F* PixelMap::SingleViewToLabTH2(const unsigned int& view,
332  TString name,
333  bool time = false) const
334  {
335 
336  TH2F* hist = new TH2F(name, ";Plane;Cell", (fNPlane/2)+(fNPlane%2),
337  0, (fNPlane/2)+(fNPlane%2), fNCell, 0, fNCell);
338 
339  for(unsigned int iPlane = 0; iPlane < ((fNPlane/2)+(fNPlane%2)); ++iPlane){
340  for(unsigned int iCell = 0; iCell < fNCell; ++iCell){
341  double t = (view == 0) ? fTX[LocalToIndex(iPlane, iCell)] : fTY[LocalToIndex(iPlane, iCell)];
342  double pe = (view == 0) ? fPEX[LocalToIndex(iPlane, iCell)] : fPEY[LocalToIndex(iPlane, iCell)];
343  double lab = (view == 0) ? fLabX[LocalToIndex(iPlane, iCell)] : fLabY[LocalToIndex(iPlane, iCell)];
344 
345  // Draw label 0 as non-empty bin
346  if(pe > 0 && lab < 1) lab = 0.1;
347 
348  double value = ( time ) ? t : lab;
349 
350  // Add 1 to in each bin to skip underflow
351  hist->SetBinContent(iPlane+1, iCell+1, value);
352 
353  }
354  }
355  return hist;
356  }
357 
358  //..................................................................
359  TH2F* PixelMap::SingleViewToObjTH2(const unsigned int& view,
360  TString name,
361  bool nuID = false) const
362  {
363 
364  TH2F* hist = new TH2F(name, ";Plane;Cell", (fNPlane/2)+(fNPlane%2),
365  0, (fNPlane/2)+(fNPlane%2), fNCell, 0, fNCell);
366 
367  for(unsigned int iPlane = 0; iPlane < ((fNPlane/2)+(fNPlane%2)); ++iPlane){
368  for(unsigned int iCell = 0; iCell < fNCell; ++iCell){
369  double pe = (view == 0) ? fPEX[LocalToIndex(iPlane, iCell)] : fPEY[LocalToIndex(iPlane, iCell)];
370  double nu = (view == 0) ? fNuX[LocalToIndex(iPlane, iCell)] : fNuY[LocalToIndex(iPlane, iCell)];
371  double obj = (view == 0) ? fObjX[LocalToIndex(iPlane, iCell)] : fObjY[LocalToIndex(iPlane, iCell)];
372 
373  // Draw label 0 as non-empty bin
374  if ( pe > 0 && nu == 0 ) nu = 0.1;
375 
376  double value = ( nuID ) ? nu : obj;
377 
378  // Add 1 to in each bin to skip underflow
379  hist->SetBinContent(iPlane+1, iCell+1, value);
380 
381  }
382  }
383  return hist;
384  }
385 
386  //..................................................................
387  std::ostream& operator<<(std::ostream& os, const PixelMap& m)
388  {
389  os << "PixelMap with " << m.NPixel() << " pixels, "
390  << m.NPlane() << " planes"
391  << " by " << m.NCell() << " cells" ;
392  return os;
393  }
394 
395  //..................................................................
396  unsigned char PixelMap::ConvertToChar(float n, bool useGeV) const
397  {
398 
399  float peCorrChunk;
400  // This value is 2.0 / (PE/GeV)
401  if (useGeV) peCorrChunk = 1.322e-4 / 255.0;
402  else peCorrChunk = 2.0/255.0;
403 
404  float truncateCorr = ceil(n/peCorrChunk);
405  if (truncateCorr > 255) return (unsigned char)255;
406  else return (unsigned char)truncateCorr;
407  }
408 
409  //..................................................................
410  unsigned char PixelMap::ConvertHitsToChar(float n) const
411  {
412  if (n > 0) return (unsigned char)1;
413  else return (unsigned char)0;
414  }
415 
416  //..................................................................
417  std::vector<unsigned char> PixelMap::PixelMapToObjVector(bool useLabels) const
418  {
419  int channels(2), planes(0), cells(0);
420  planes = fNPlane/2;
421  cells = fNCell;
422  std::vector<unsigned char> pixels(channels*planes*cells);
423 
424  if(fPEOnly) return pixels;
425 
426  for (int iChan = 0; iChan < channels; ++iChan)
427  {
428  for (int iPlane = 0; iPlane < planes; ++iPlane)
429  {
430  for (int iCell = 0; iCell < cells; ++iCell)
431  {
432  int i = iCell + cells*(iPlane + planes*iChan);
433  unsigned char lab = (iChan == 0) ?
434  fLabX.at(iCell + cells*iPlane) :
435  fLabY.at(iCell + cells*iPlane);
436  unsigned char obj = (iChan == 0) ?
437  fObjX.at(iCell + cells*iPlane) :
438  fObjY.at(iCell + cells*iPlane);
439 
440  unsigned char pix = (useLabels) ? lab : obj;
441  pixels[i] = pix;
442  }
443  }
444  }
445  return pixels;
446 
447  }
448 
449  std::vector<unsigned char> PixelMap::PixelMapToVector(bool useGeV) const
450  {
451  int channels(2), planes(0), cells(0);
452  planes = fNPlane/2;
453  cells = fNCell;
454  std::vector<unsigned char> pixels(channels*planes*cells);
455  for (int iChan = 0; iChan < channels; ++iChan)
456  {
457  for (int iPlane = 0; iPlane < planes; ++iPlane)
458  {
459  for (int iCell = 0; iCell < cells; ++iCell)
460  {
461  int i = iCell + cells*(iPlane + planes*iChan);
462  float val = (iChan == 0) ?
463  fPEX.at(iCell + cells*iPlane) :
464  fPEY.at(iCell + cells*iPlane);
465 
466  unsigned char pix = ConvertToChar(val, useGeV);
467  pixels[i] = pix;
468  }
469  }
470  }
471  return pixels;
472 
473  }
474 
475 
476  unsigned int PixelMap::PixelMapToVectors(std::vector<unsigned int>* planes,
477  std::vector<unsigned int>* cells,
478  std::vector<unsigned int>* chan,
479  std::vector<unsigned char>* values,
480  bool useGeV) const
481 
482  {
483  int channels(2), nplanes(0), ncells(0);
484  nplanes = fNPlane/2;
485  ncells = fNCell;
486  unsigned int entries = 0;
487  for (int iChan = 0; iChan < channels; ++iChan)
488  {
489  for (int iPlane = 0; iPlane < nplanes; ++iPlane)
490  {
491  for (int iCell = 0; iCell < ncells; ++iCell)
492  {
493  float val = (iChan == 0) ?
494  fPEX.at(iCell + ncells*iPlane) :
495  fPEY.at(iCell + ncells*iPlane);
496  if (val == 0) continue;
497  unsigned char pix = ConvertToChar(val, useGeV);
498  values->push_back(pix);
499  planes->push_back(iPlane);
500  cells->push_back(iCell);
501  chan->push_back(iChan);
502  entries++;
503  }
504  }
505  }
506  return entries;
507 
508  }
509 
510 }
int FirstCell(const unsigned int &view) const
Definition: Boundary.h:44
const XML_Char * name
Definition: expat.h:151
unsigned int fOccupiedPixelsX
Number of non-zero entries in pixel map. Counted when the Add function is called. ...
Definition: PixelMap.h:124
std::vector< unsigned char > PixelMapToObjVector(bool useLabels) const
Definition: PixelMap.cxx:417
TH2F * SingleViewToTH2(const unsigned int &view, TString name) const
Definition: PixelMap.cxx:312
std::vector< float > fT
Vector of Time of hits.
Definition: PixelMap.h:136
bool fPEOnly
Definition: PixelMap.h:155
enum cvn::HType HitType
std::vector< float > fPEY
Vector of Y PE measurements for pixels.
Definition: PixelMap.h:129
unsigned int NPixel() const
Total number of pixels in map.
Definition: PixelMap.h:40
void Print()
Definition: PixelMap.cxx:164
unsigned int fOccupiedPixels
Number of non-zero entries in pixel map. Counted when the Add function is called. ...
Definition: PixelMap.h:123
unsigned int NPlane() const
Length in planes.
Definition: PixelMap.h:31
std::ostream & operator<<(std::ostream &os, const PixelMapProducer &p)
unsigned int fNPlane
Number of planes, length of pixel map.
Definition: PixelMap.h:117
std::vector< int > fObjX
Vector of X Particle Idx of hits.
Definition: PixelMap.h:140
void FillInputVector(float *input) const
Definition: PixelMap.cxx:52
void Add(const unsigned int &plane, const unsigned int &cell, const float &pe, unsigned int &view, unsigned int &hitID, const float &time, const HitType label, const double purity, const int object, const int nuIdx)
Definition: PixelMap.cxx:65
std::vector< unsigned int > fVieX
Vector of X hit view.
Definition: PixelMap.h:147
unsigned int FirstView() const
Definition: Boundary.h:46
std::vector< int > fObjY
Vector of Y Particle Idx of hits.
Definition: PixelMap.h:141
PixelMap for CVN.
Defines an enumeration for prong classification.
::xsd::cxx::tree::time< char, simple_type > time
Definition: Database.h:194
unsigned char ConvertHitsToChar(float n) const
Definition: PixelMap.cxx:410
std::vector< int > fNu
Vector of Nu Index of hits.
Definition: PixelMap.h:142
const char * label
TH2F * ToLabTH2(TString name) const
Definition: PixelMap.cxx:258
std::vector< float > fPE
Vector of PE measurements for pixels.
Definition: PixelMap.h:127
Definition: novas.h:112
unsigned int PixelMapToVectors(std::vector< unsigned int > *planes, std::vector< unsigned int > *cells, std::vector< unsigned int > *chan, std::vector< unsigned char > *values, bool useGeV) const
Definition: PixelMap.cxx:476
TH2F * ToTH2(TString name) const
Definition: PixelMap.cxx:236
Double_t scale
Definition: plot.C:25
std::map< ToFCounter, std::vector< unsigned int > > channels
void hits()
Definition: readHits.C:15
std::vector< HitType > fLabY
Vector of Y Truth labels for pixels.
Definition: PixelMap.h:135
std::vector< unsigned int > fHit
Vector of hit IDs.
Definition: PixelMap.h:149
std::vector< unsigned int > fHitY
Vector of Y hit IDs.
Definition: PixelMap.h:151
const XML_Char int const XML_Char * value
Definition: expat.h:331
std::vector< unsigned char > PixelMapToVector(bool useGeV) const
Definition: PixelMap.cxx:449
std::vector< int > fObj
Vector of Particle Idx of hits.
Definition: PixelMap.h:139
std::vector< float > fPEX
Vector of X PE measurements for pixels.
Definition: PixelMap.h:128
std::vector< unsigned int > fVie
Vector of hit view.
Definition: PixelMap.h:146
unsigned int fOccupiedPixelsY
Number of non-zero entries in pixel map. Counted when the Add function is called. ...
Definition: PixelMap.h:125
std::vector< unsigned int > fVieY
Vector of Y hit view.
Definition: PixelMap.h:148
TH2F * ToObjTH2(TString name) const
Definition: PixelMap.cxx:285
unsigned int NPlanePerView() const
Length in planes per view.
Definition: PixelMap.h:34
TH2F * SingleViewToObjTH2(const unsigned int &view, TString name, bool nuID) const
Definition: PixelMap.cxx:359
unsigned int fNCell
Number of cells, width of pixel map.
Definition: PixelMap.h:118
std::vector< float > fTX
Vector of X Time of hits.
Definition: PixelMap.h:137
void ToFile(std::ofstream &ofs, int batch, bool hits=false) const
Return the pixel map as a 2D histogram for visualization.
Definition: PixelMap.cxx:192
OStream cout
Definition: OStream.cxx:6
unsigned int LocalToIndex(const unsigned int &plane, const unsigned int &cell) const
Take local plane, cell (within map) and return index in fPE vector.
Definition: PixelMap.cxx:137
int nplanes
Definition: geom.C:145
unsigned char ConvertToChar(float n, bool useGeV) const
Definition: PixelMap.cxx:396
std::vector< float > fTY
Vector of Y Time of hits.
Definition: PixelMap.h:138
std::vector< int > fNuX
Vector of X Nu Index of hits.
Definition: PixelMap.h:143
PixelMap, basic input to CVN neural net.
Definition: PixelMap.h:23
std::vector< double > fPurY
Vector of Y purity for pixels.
Definition: PixelMap.h:132
std::vector< unsigned int > fHitX
Vector of X hit IDs.
Definition: PixelMap.h:150
assert(nhit_max >=nhit_nbins)
std::vector< HitType > fLabX
Vector of X Truth labels for pixels.
Definition: PixelMap.h:134
int ncells
Definition: geom.C:124
unsigned int GlobalToIndexSingle(const unsigned int &plane, const unsigned int &cell, const unsigned int &view)
Take global plane, cell (detector) and return index in fPE vector.
Definition: PixelMap.cxx:147
unsigned int GlobalToIndex(const unsigned int &plane, const unsigned int &cell, const unsigned int &view)
Take global plane, cell (detector) and return index in fPE vector.
Definition: PixelMap.cxx:121
TH2F * SingleViewToLabTH2(const unsigned int &view, TString name, bool time) const
Definition: PixelMap.cxx:331
std::vector< HitType > fLab
Vector of Truth labels for pixels.
Definition: PixelMap.h:133
Boundary fBound
Definition: PixelMap.h:153
std::vector< int > fNuY
Vector of Y Nu Index of hits.
Definition: PixelMap.h:144
bool IsWithin(const unsigned int &plane, const unsigned int &cell, const unsigned int &view=0)
Definition: Boundary.cxx:40
int FirstPlane() const
Definition: Boundary.h:42
fvar< T > ceil(const fvar< T > &x)
Definition: ceil.hpp:11
std::vector< double > fPur
Vector of purity for pixels.
Definition: PixelMap.h:130
std::vector< double > fPurX
Vector of X purity for pixels.
Definition: PixelMap.h:131
unsigned int NCell() const
Width in cells.
Definition: PixelMap.h:37