EventImageData.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////////////////////
2 // Class: EventImageData
3 //
4 // Author: P.Plonski, R.Sulej (Robert.Sulej@cern.ch), D.Stefan (Dorota.Stefan@cern.ch), May 2016
5 // Stripped from SPMultiTpcDump by Leigh Whitehead (leigh.howard.whitehead@cern.ch)
6 //
7 // Produces "global image" of events in multi-tpc detector, could be FD workspace or ProtoDUNE (SP).
8 // Projections of ADC are saved to 1-byte / pixel (TH1C) format, int-size (TH2I) projection of PDG
9 // truth and float-size (TH2F) projection of true charge deposits can be saved as well. We use this
10 // to dump deconvoluted ADC images for preparation of various classifiers and CNN based pattern reco.
11 //
12 // Moved from larreco/RecoAlg/ImagePatternAlgs since it became specific to DUNE geometries.
13 //
14 //////////////////////////////////////////////////////////////////////////////////////////////////////
15 
16 #ifndef EVENTIMAGEDATA_HH
17 #define EVENTIMAGEDATA_HH
18 
21 
22 // C++ Includes
23 #include <vector>
24 
25 namespace nnet
26 {
27 
28  class EventImageData // full image for one plane
29  {
30  public:
31  EventImageData(size_t w, size_t d, bool saveDep);
32 
33  void addTpc(const TrainingDataAlg & dataAlg, size_t gw, bool flipw, size_t gd, bool flipd);
34  bool findCrop(size_t max_area_cut, unsigned int & w0, unsigned int & w1, unsigned int & d0, unsigned int & d1) const;
35 
36  const std::vector< std::vector<float> > & adcData(void) const { return fAdc; }
37  const std::vector<float> & wireAdc(size_t widx) const { return fAdc[widx]; }
38 
39  const std::vector< std::vector<float> > & depData(void) const { return fDeposit; }
40  const std::vector<float> & wireDep(size_t widx) const { return fDeposit[widx]; }
41 
42  const std::vector< std::vector<int> > & pdgData(void) const { return fPdg; }
43  const std::vector<int> & wirePdg(size_t widx) const { return fPdg[widx]; }
44 
45  void setProjXY(const TrainingDataAlg & dataAlg, float x, float y, size_t gw, bool flipw, size_t gd, bool flipd);
46  float getProjX(void) const { return fProjX; }
47  float getProjY(void) const { return fProjY; }
48 
49  int getVtxX(void) const { return fVtxX; }
50  int getVtxY(void) const { return fVtxY; }
51 
52  private:
53  std::vector< std::vector<float> > fAdc, fDeposit;
54  std::vector< std::vector<int> > fPdg;
55  int fVtxX, fVtxY;
56  float fProjX, fProjY;
57  bool fSaveDep;
58  };
59 
60 }
61 
62 #endif
63 
std::vector< std::vector< float > > fAdc
int getVtxY(void) const
const std::vector< float > & wireDep(size_t widx) const
float getProjX(void) const
int getVtxX(void) const
float getProjY(void) const
bool findCrop(size_t max_area_cut, unsigned int &w0, unsigned int &w1, unsigned int &d0, unsigned int &d1) const
std::vector< std::vector< float > > fDeposit
std::vector< std::vector< int > > fPdg
EventImageData(size_t w, size_t d, bool saveDep)
const std::vector< std::vector< int > > & pdgData(void) const
const std::vector< int > & wirePdg(size_t widx) const
void setProjXY(const TrainingDataAlg &dataAlg, float x, float y, size_t gw, bool flipw, size_t gd, bool flipd)
const std::vector< std::vector< float > > & depData(void) const
Implementation of the Projection Matching Algorithm.
void addTpc(const TrainingDataAlg &dataAlg, size_t gw, bool flipw, size_t gd, bool flipd)
list x
Definition: train.py:276
const std::vector< std::vector< float > > & adcData(void) const
const std::vector< float > & wireAdc(size_t widx) const