#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-01-21/ShowerLID/SPIDAlg.h"
Public Member Functions | |
SPIDAlg (fhicl::ParameterSet const &pset, NuEEnergyAlg *fNuEEnergyAlgIn, int pidType) | |
Algorithm name with ENu. More... | |
SPIDAlg (const SPIDAlg &orig) | |
virtual | ~SPIDAlg () |
void | Initialize () |
Initialize the MVA algorithm. The parameter detectorID is an int corresponding to the detector definitions in novadaq::cnv : novadaq::cnv::kFARDET, novadaq::cnv::kNDOS, novadaq::cnv::kNEARDET. More... | |
double | CalcMVAResult (slid::ShowerPID &showerspid) |
Calculate value of predictors for MVA Algorithm using candidate rb::Shower. A pointer to the object of ParticleIDAlg is also passed so that expensive calculations may not need to be done again if this particular shower is already loaded. More... | |
std::string | Name () |
std::string | Description () |
void | InitializeTrainingTree () |
Initialize tree to be used for training the algorithms. More... | |
void | DefineTrainingTree () |
Define mapping of branches to class fields for tree to be used for training the algorithms. More... | |
void | FillTrainingTree (const slid::ShowerPID &showerspid) |
Fill tree to be used for training the algorithms. More... | |
Private Attributes | |
std::string | fAlgorithmName |
FCL Parameters for LIDAlg. More... | |
NuEEnergyAlg * | fNuEEnergyAlg |
NuE energy calculations object. More... | |
int | fPIDType |
If true, the ANN is computed with event energy as an input variable. More... | |
const std::string | fMVAMethod = "TMlpANN" |
const std::string | fName = fMVAMethod + "NoNuE" |
const std::string | fDescription = "TMVA ANN algorithm TMlpANN with no nu(E)" |
Name of algorithm. More... | |
std::string | fLibPath |
Location of weight files. Set from FCL file. More... | |
bool | fUseTMVATraining |
Use TMVA training or RecoJMShower training. More... | |
TMultiLayerPerceptron * | fMlp |
FCL parameters for Nue energy calculation algorithm. More... | |
TMVA::Reader * | fReader |
TMVA reader object used to store MVA model. More... | |
TMVAClassification_TMlpANN_WithENu * | fTMVAModuleTMlpANNWithENu |
TMVAClassification_TMlpANN_NoENu * | fTMVAModuleTMlpANNNoENu |
int | fType |
event classification answer: 1 = signal, 0 = background More... | |
slid::ShowerPID * | fShowerPID |
float | fVtxgev |
float | fShE |
float | fNueRecEnergy |
|
explicit |
Algorithm name with ENu.
Definition at line 16 of file SPIDAlg.cxx.
References util::EnvExpansion(), fAlgorithmName, fLibPath, fUseTMVATraining, fhicl::ParameterSet::get(), Initialize(), and string.
|
explicit |
Definition at line 34 of file SPIDAlg.cxx.
|
virtual |
Definition at line 38 of file SPIDAlg.cxx.
double slid::SPIDAlg::CalcMVAResult | ( | slid::ShowerPID & | showerspid | ) |
Calculate value of predictors for MVA Algorithm using candidate rb::Shower. A pointer to the object of ParticleIDAlg is also passed so that expensive calculations may not need to be done again if this particular shower is already loaded.
Definition at line 247 of file SPIDAlg.cxx.
References slid::ShowerLID::CosTheta(), slid::ShowerPID::Dedx0(), slid::ShowerPID::Dedx1(), slid::ShowerPID::Dedx2(), slid::ShowerPID::Dedx3(), slid::ShowerLID::EGLLL(), slid::ShowerLID::EGLLT(), slid::ShowerLID::EMuLLL(), slid::ShowerLID::EMuLLT(), slid::ShowerLID::ENLLL(), slid::ShowerLID::ENLLT(), slid::ShowerLID::EPi0LLL(), slid::ShowerLID::EPi0LLT(), slid::ShowerLID::EPiLLL(), slid::ShowerLID::EPiLLT(), slid::ShowerLID::EPLLL(), slid::ShowerLID::EPLLT(), fMlp, fPIDType, fTMVAModuleTMlpANNNoENu, fTMVAModuleTMlpANNWithENu, fUseTMVATraining, slid::ShowerLID::Gap(), MECModelEnuComparisons::i, std::isnan(), slid::ShowerLID::NueEnergy(), slid::ShowerLID::Pi0mass(), slid::ShowerLID::ShowerEFrac(), TMVAClassification_TMlpANN_WithENu::Value(), TMVAClassification_TMlpANN_NoENu::Value(), and slid::ShowerLID::VertexEnergy().
Referenced by slid::SPIDBuilder::produce().
void slid::SPIDAlg::DefineTrainingTree | ( | ) |
Define mapping of branches to class fields for tree to be used for training the algorithms.
Definition at line 424 of file SPIDAlg.cxx.
Referenced by Description().
|
inline |
Definition at line 61 of file SPIDAlg.h.
References DefineTrainingTree(), fDescription, FillTrainingTree(), and InitializeTrainingTree().
void slid::SPIDAlg::FillTrainingTree | ( | const slid::ShowerPID & | showerspid | ) |
Fill tree to be used for training the algorithms.
Definition at line 419 of file SPIDAlg.cxx.
Referenced by Description().
void slid::SPIDAlg::Initialize | ( | ) |
Initialize the MVA algorithm. The parameter detectorID is an int corresponding to the detector definitions in novadaq::cnv : novadaq::cnv::kFARDET, novadaq::cnv::kNDOS, novadaq::cnv::kNEARDET.
Definition at line 48 of file SPIDAlg.cxx.
References om::cout, geo::GeometryBase::DetId(), allTimeWatchdog::endl, slid::ShowerLID::fEGLLL, slid::ShowerLID::fEGLLT, slid::ShowerLID::fEMuLLL, slid::ShowerLID::fEMuLLT, slid::ShowerLID::fENLLL, slid::ShowerLID::fENLLT, slid::ShowerLID::fEPi0LLL, slid::ShowerLID::fEPi0LLT, slid::ShowerLID::fEPiLLL, slid::ShowerLID::fEPiLLT, slid::ShowerLID::fEPLLL, slid::ShowerLID::fEPLLT, slid::ShowerLID::fGap, fLibPath, fMlp, fMVAMethod, slid::ShowerLID::fNueEnergy, slid::ShowerLID::fPi0mass, fPIDType, fReader, fShowerPID, slid::ShowerLID::fShwEFrac, fType, fUseTMVATraining, slid::ShowerLID::fVtxE, geom(), novadaq::cnv::kFARDET, novadaq::cnv::kNDOS, novadaq::cnv::kNEARDET, demo0::length, and string.
Referenced by SPIDAlg().
void slid::SPIDAlg::InitializeTrainingTree | ( | ) |
Initialize tree to be used for training the algorithms.
Definition at line 501 of file SPIDAlg.cxx.
Referenced by Description().
|
inline |
|
private |
|
private |
|
private |
Location of weight files. Set from FCL file.
Definition at line 95 of file SPIDAlg.h.
Referenced by Initialize(), and SPIDAlg().
|
private |
FCL parameters for Nue energy calculation algorithm.
Definition at line 105 of file SPIDAlg.h.
Referenced by CalcMVAResult(), Initialize(), and ~SPIDAlg().
|
private |
Definition at line 87 of file SPIDAlg.h.
Referenced by Initialize().
|
private |
|
private |
|
private |
If true, the ANN is computed with event energy as an input variable.
Definition at line 85 of file SPIDAlg.h.
Referenced by CalcMVAResult(), and Initialize().
|
private |
TMVA reader object used to store MVA model.
Definition at line 109 of file SPIDAlg.h.
Referenced by Initialize(), and ~SPIDAlg().
|
private |
Definition at line 124 of file SPIDAlg.h.
Referenced by Initialize().
|
private |
Definition at line 115 of file SPIDAlg.h.
Referenced by CalcMVAResult().
|
private |
XML weights file, but there seems to be a bug in TMVA that the module simply does not work when loading from the weights for the TMlPANN algorithm. Needs to be investigated further.
Definition at line 114 of file SPIDAlg.h.
Referenced by CalcMVAResult().
|
private |
event classification answer: 1 = signal, 0 = background
Definition at line 119 of file SPIDAlg.h.
Referenced by Initialize().
|
private |
Use TMVA training or RecoJMShower training.
Definition at line 98 of file SPIDAlg.h.
Referenced by CalcMVAResult(), Initialize(), and SPIDAlg().