RegCNNNumuHandler.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file RegCNNNumuHandler.cxx
3 /// \brief RegCNNNumuHandler for numu energy estimation
4 /// \author Wenjie Wu - wenjieww@uci.edu
5 ////////////////////////////////////////////////////////////////////////
6 
7 #include <iostream>
8 #include <string>
9 #include "cetlib/getenv.h"
10 
13 
15 
16 #include "TH2D.h"
17 #include "TCanvas.h"
18 
19 namespace cnn
20 {
22  fTFHandlerContained (pset.get<fhicl::ParameterSet> ("TFNetHandlerContained")),
23  fTFHandlerExiting (pset.get<fhicl::ParameterSet> ("TFNetHandlerExiting"))
24  {
25  }
26 
27  std::vector<float> RegCNNNumuHandler::Predict(const RegPixelMap& pm, bool fLongestTrackContained)
28  {
29  std::vector<float> cnnResults;
30  if (fLongestTrackContained) {
31  cnnResults = fTFHandlerContained.Predict(pm);
32  } else {
33  cnnResults = fTFHandlerExiting.Predict(pm);
34  }
35 
36  //std::cout << "Number of CNN result vectors " << cnnResults.size() << " with " << cnnResults[0].size() << " categories" << std::endl;
37 
38  //std::cout << "summary: ";
39  //for(auto const v : cnnResults[0]){
40  // std::cout << v << ", ";
41  //}
42  //std::cout << std::endl;
43 
44  return cnnResults;
45  }
46 } // end namespace cnn
47 
48 ////////////////////////////////////////////////////////////////////////
RegPixelMap, basic input to CNN neural net.
Definition: RegPixelMap.h:22
RegCNNNumuHandler(const fhicl::ParameterSet &pset)
Constructor which takes a pset with DeployProto and ModelFile fields.
std::vector< float > Predict(const RegPixelMap &pm)
Return prediction arrays for RegPixelMap.
std::vector< float > Predict(const RegPixelMap &pm, bool fLongestTrackContained)
Return prediction arrays for RegPixelMap.
cnn::TFRegNetHandler fTFHandlerExiting
RegCNNNumuHandler for numu energy estimation.
Defines an enumeration for cellhit classification.
auto const & get(AssnsNode< L, R, D > const &r)
Definition: AssnsNode.h:115
cnn::TFRegNetHandler fTFHandlerContained