LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
LArTrainingData.cxx
Go to the documentation of this file.
1 // \file LArTrainingData.h
5 // \author radovic -- a.radovic@gmail.com
6 
7 //#include "art/Framework/Services/Registry/ServiceHandle.h"
8 
10 
11 namespace lcvn {
12 
14  : fNuEnergy(0.)
15  , fLepEnergy(0.)
16  , fLepAngle(0.)
17  , fEventWeight(1)
18  , fRecoNueEnergy(0.)
19  , fRecoNumuEnergy(0.)
20  , fRecoNutauEnergy(0.)
21  , fUseTopology(false)
22  , fNuPDG(0)
23  , fNProton(-1)
24  , fNPion(-1)
25  , fNPizero(-1)
26  , fNNeutron(-1)
27  , fTopologyType(-1)
28  , fTopologyTypeAlt(-1)
29  {}
30 
31  void TDNuInfo::SetTruthInfo(float nuEnergy, float lepEnergy, float lepAngle, float weight)
32  {
33 
34  fNuEnergy = nuEnergy;
35  fLepEnergy = lepEnergy;
36  fLepAngle = lepAngle;
38  }
39 
40  void TDNuInfo::SetRecoInfo(float nueEnergy, float numuEnergy, float nutauEnergy)
41  {
42 
43  fRecoNueEnergy = nueEnergy;
44  fRecoNumuEnergy = numuEnergy;
45  fRecoNutauEnergy = nutauEnergy;
46  }
47 
49  int nproton,
50  int npion,
51  int npizero,
52  int nneutron,
53  int toptype,
54  int toptypealt)
55  {
56 
57  fUseTopology = true;
58 
59  fNuPDG = pdg;
60  fNProton = nproton;
61  fNPion = npion;
62  fNPizero = npizero;
63  fNNeutron = nneutron;
64 
65  fTopologyType = toptype;
66  fTopologyTypeAlt = toptypealt;
67  }
68 
69  std::ostream& operator<<(std::ostream& os, const TDNuInfo& td)
70  {
71  // keep this order because the keras python scripts depend on this
72  os << td.fNuEnergy << std::endl;
73  os << td.fLepEnergy << std::endl;
74  os << td.fRecoNueEnergy << std::endl;
75  os << td.fRecoNumuEnergy << std::endl;
76  os << td.fRecoNutauEnergy << std::endl;
77  os << td.fEventWeight << std::endl;
78 
79  os << td.fNuPDG << std::endl;
80  os << td.fNProton << std::endl;
81  os << td.fNPion << std::endl;
82  os << td.fNPizero << std::endl;
83  os << td.fNNeutron << std::endl;
84 
85  os << td.fTopologyType << std::endl;
86  os << td.fTopologyTypeAlt << std::endl;
87  os << td.fLepAngle << std::endl;
88 
89  return os;
90  }
91 
92  //----------------------------------------------------------------------
93 
94  template <class T>
96  const PixelMap& pMap,
97  const T info)
98  : fInt(interaction), fPMap(pMap), fInfo(info)
99  {}
100 
101  template <class T>
102  void LArTrainingData<T>::FillOutputVector(float* output) const
103  {
104  for (unsigned int i = 0; i < kNIntType; ++i)
105  output[i] = 0;
106 
107  output[fInt] = 1;
108  }
109 
110  template class LArTrainingData<lcvn::TDNuInfo>;
111 } // end namespace lcvn
float fNuEnergy
True energy of neutrino event.
float fEventWeight
The event weight (norm * oscProb)
float fRecoNumuEnergy
Reconstructed energy under numu hypothesis.
float fRecoNueEnergy
Reconstructed energy under nue hypothesis.
friend std::ostream & operator<<(std::ostream &os, const TDNuInfo &td)
float fLepAngle
True angle of outgoing lepton wrt neutrino.
float fRecoNutauEnergy
Reconstructed energy under nutau hypothesis.
PixelMap, basic input to CVN neural net.
Definition: PixelMap.h:20
Utility class for truth labels.
void SetTopologyInformation(int pdg, int nproton, int npion, int npizero, int nneutron, int toptype, int toptypealt)
void FillOutputVector(float *output) const
void SetRecoInfo(float nueEnergy, float numuEnergy, float nutauEnergy)
double weight
Definition: plottest35.C:25
The TrainingData objects contains a PixelMap and the output class type, and any other bit that goes i...
void SetTruthInfo(float nuEnergy, float lepEnergy, float lepAngle, float weight)
Number of interaction types, used like a vector size.
InteractionType fInt
Class of the event.
float fLepEnergy
True energy of outgoing lepton.