18#include "trg/cdc/dataobjects/CDCTriggerHoughMLP.h"
19#include "trg/cdc/NeuroTrigger3DH.h"
24int main(
int argc,
const char* argv[])
27 std::cout <<
"Program requires the following 2 arguments:\n"
28 <<
" 1: mlp rootfile\n"
29 <<
" 2: output filename\n";
32 const std::string fileNameMLP = argv[1];
33 const std::string fileNameDAT = argv[2];
35 const CDCTrigger3DHMLP& mlp = CDCTrigger3DHMLP::loadMLPFromFile<CDCTrigger3DHMLP>(fileNameMLP,
"MLP");
39 neuroTrigger3DH.initialize();
40 neuroTrigger3DH.setMLP(mlp);
41 neuroTrigger3DH.createIntWeights();
43 std::ofstream weightStream(fileNameDAT);
46 weightStream << neuroParameters3DH.nInput <<
" ";
47 for (
const size_t hiddenNodes : neuroParameters3DH.nHidden) {
48 weightStream << hiddenNodes <<
" ";
50 weightStream << neuroParameters3DH.nOutput <<
"\n";
52 const std::vector<int32_t>& weights = neuroTrigger3DH.getIntWeights();
53 int32_t minIntWeight = 0, maxIntWeight = 0;
54 for (int32_t weight : weights) {
55 if (weight < minIntWeight) minIntWeight = weight;
56 if (weight > maxIntWeight) maxIntWeight = weight;
57 weightStream << weight <<
" ";
61 int fractionalWeightBits = neuroTrigger3DH.getFractionalWeightBits();
62 int weightBits = neuroTrigger3DH.getWeightBits();
63 std::cout <<
"Writing " << weights.size() <<
" weights.\n"
64 <<
"With a precision of " << weightBits <<
" bits, corresponding to " << fractionalWeightBits <<
" fractional bits.\n"
65 <<
"Max weight: " << maxIntWeight <<
", Min weight: " << minIntWeight <<
"\n";
Abstract base class for different kinds of events.