LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
PixelMap.h
Go to the documentation of this file.
1 
7 #ifndef LCVN_PIXELMAP_H
8 #define LCVN_PIXELMAP_H
9 
10 #include <ostream>
11 #include <vector>
12 
13 #include "TH2F.h"
16 
17 namespace lcvn {
18 
20  class PixelMap {
21  public:
22  PixelMap(unsigned int nWire, unsigned int nTdc, const Boundary& bound);
23  PixelMap() { fTotHits = 0; };
24 
26  unsigned int NWire() const { return fNWire; };
27 
29  unsigned int NTdc() const { return fNTdc; };
30 
32  unsigned int NPixel() const { return fPE.size(); };
33 
35  Boundary Bound() const { return fBound; };
36 
38  unsigned int NInput() const { return NPixel(); };
39 
40  void FillInputVector(float* input) const;
41 
44  void Add(const unsigned int& wire,
45  const double& tdc,
46  const unsigned int& view,
47  const double& pe);
48 
50  unsigned int GlobalToIndex(const unsigned int& wire,
51  const double& tdc,
52  const unsigned int& view);
53 
55  unsigned int LocalToIndex(const unsigned int& wire, const unsigned int& tdc) const;
56 
58  unsigned int GlobalToIndexSingle(const unsigned int& wire,
59  const double& tdc,
60  const unsigned int& view);
61 
62  void SetTotHits(unsigned int tothits) { fTotHits = tothits; }
63  unsigned int GetTotHits() { return fTotHits; }
66  void Print() const;
67 
69  TH2F* ToTH2() const;
70  TH2F* ToLabTH2() const;
71  TH2F* SingleViewToTH2(const unsigned int& view) const;
72 
73  std::vector<float> fPE;
74  std::vector<float> fPEX;
75  std::vector<float> fPEY;
76  std::vector<float> fPEZ;
77  std::vector<double> fPur;
78  std::vector<double> fPurX;
79  std::vector<double> fPurY;
80  std::vector<double> fPurZ;
81  std::vector<HitType> fLab;
82  std::vector<HitType> fLabX;
83  std::vector<HitType> fLabY;
84  std::vector<HitType> fLabZ;
85 
86  private:
87  unsigned int fNWire;
88  unsigned int fNTdc;
89  unsigned int fTotHits;
90 
91  Boundary fBound; //< Boundary of pixel map
92  };
93 
94  std::ostream& operator<<(std::ostream& os, const PixelMap& m);
95 
96 }
97 
98 #endif // CVN_PIXELMAP_H
unsigned int GlobalToIndex(const unsigned int &wire, const double &tdc, const unsigned int &view)
Take global wire, tdc (detector) and return index in fPE vector.
Definition: PixelMap.cxx:73
unsigned int GetTotHits()
Definition: PixelMap.h:63
TH2F * ToLabTH2() const
Definition: PixelMap.cxx:167
void FillInputVector(float *input) const
Definition: PixelMap.cxx:34
std::vector< float > fPE
Vector of PE measurements for pixels.
Definition: PixelMap.h:73
std::vector< HitType > fLab
Vector of Truth labels for pixels.
Definition: PixelMap.h:81
std::vector< double > fPurY
Vector of Y purity for pixels.
Definition: PixelMap.h:79
void SetTotHits(unsigned int tothits)
Definition: PixelMap.h:62
PixelMap, basic input to CVN neural net.
Definition: PixelMap.h:20
Utility class for truth labels.
std::vector< double > fPurX
Vector of X purity for pixels.
Definition: PixelMap.h:78
TH2F * ToTH2() const
Return the pixel map as a 2D histogram for visualization.
Definition: PixelMap.cxx:151
std::vector< double > fPur
Vector of purity for pixels.
Definition: PixelMap.h:77
unsigned int LocalToIndex(const unsigned int &wire, const unsigned int &tdc) const
Take local wire, tdc (within map) and return index in fPE vector.
Definition: PixelMap.cxx:94
std::vector< float > fPEX
Vector of X PE measurements for pixels.
Definition: PixelMap.h:74
unsigned int NWire() const
Length in wires.
Definition: PixelMap.h:26
std::vector< HitType > fLabX
Vector of X Truth labels for pixels.
Definition: PixelMap.h:82
void Print() const
Definition: PixelMap.cxx:124
std::vector< float > fPEZ
Vector of Y PE measurements for pixels.
Definition: PixelMap.h:76
std::ostream & operator<<(std::ostream &os, const Boundary &b)
Definition: Boundary.cxx:47
std::vector< HitType > fLabZ
Vector of Y Truth labels for pixels.
Definition: PixelMap.h:84
std::vector< double > fPurZ
Vector of Y purity for pixels.
Definition: PixelMap.h:80
unsigned int fTotHits
Number of hits that make up the pixel map.
Definition: PixelMap.h:89
TH2F * SingleViewToTH2(const unsigned int &view) const
Definition: PixelMap.cxx:183
void Add(const unsigned int &wire, const double &tdc, const unsigned int &view, const double &pe)
Definition: PixelMap.cxx:44
Boundary Bound() const
Map boundary.
Definition: PixelMap.h:35
unsigned int NTdc() const
Width in tdcs.
Definition: PixelMap.h:29
unsigned int fNWire
Number of wires, length of pixel map.
Definition: PixelMap.h:87
Boundary fBound
Definition: PixelMap.h:91
unsigned int GlobalToIndexSingle(const unsigned int &wire, const double &tdc, const unsigned int &view)
Take global wire, tdc (detector) and return index in fPE vector.
Definition: PixelMap.cxx:102
unsigned int NInput() const
Number of inputs for the neural net.
Definition: PixelMap.h:38
Boundary for CVN PixelMap.
std::vector< float > fPEY
Vector of Y PE measurements for pixels.
Definition: PixelMap.h:75
unsigned int fNTdc
Number of tdcs, width of pixel map.
Definition: PixelMap.h:88
unsigned int NPixel() const
Total number of pixels in map.
Definition: PixelMap.h:32
std::vector< HitType > fLabY
Vector of Y Truth labels for pixels.
Definition: PixelMap.h:83