45 throw std::invalid_argument(
"parameter is read only! (locked)");
55 bool isSet()
const {
return m_set;}
77 int to_intTiming(
const std::string& text)
const
79 if (text ==
"fastestpriority") {
return 0;}
80 else if (text ==
"fastest2d") {
return 1;}
81 else if (text ==
"etf") {
return 2;}
82 else if (text ==
"etf_or_fastestpriority") {
return 3;}
83 else if (text ==
"etf_or_fastest2d") {
return 4;}
84 else if (text ==
"etf_only") {
return 5;}
85 else if (text ==
"etfcc") {
return 6;}
86 else if (text ==
"etfhwin") {
return 7;}
87 else if (text ==
"etfcc_or_fastestpriority") {
return 8;}
88 else if (text ==
"min_etf_fastestpriority") {
return 9;}
89 else if (text ==
"min_etfcc_fastestpriority") {
return 10;}
92 const std::string to_strTiming(
const unsigned& i)
const
94 if (i == 0) {
return "fastestpriority";}
95 else if (i == 1) {
return "fastest2d";}
96 else if (i == 2) {
return "etf";}
97 else if (i == 3) {
return "etf_or_fastestpriority";}
98 else if (i == 4) {
return "etf_or_fastest2d";}
99 else if (i == 5) {
return "etf_only";}
100 else if (i == 6) {
return "etfcc";}
101 else if (i == 7) {
return "etfhwin";}
102 else if (i == 8) {
return "etfcc_or_fastestpriority";}
103 else if (i == 9) {
return "min_etf_fastestpriority";}
104 else if (i == 10) {
return "min_etfcc_fastestpriority";}
105 else {
return "invalid";}
128 std::vector<std::vector<X>> ret;
132 line.push_back((X) y);
142 std::vector<std::vector<X>> ret;
144 ret.push_back((X) x);
210 std::vector<std::vector<NNTParam<float>>>
nHidden;
231 std::vector<std::vector<NNTParam<float>>>
IDRanges;
241 std::vector<std::vector<NNTParam<X>>>
read2dArray(std::string keyx,
bool locked);
244 std::vector<NNTParam<X>>
read1dArray(std::string keyx,
bool locked);
Class to represent a complete set to describe a Neurotrigger.
NNTParam(const T &xvalue)
copy constructor
bool isLocked() const
check, if variable was already locked and is read only now
bool isSet() const
check, if variable was already initialized
bool m_locked
saves the "locked" state
void lock()
lock the variable, to make it read only
NNTParam operator()() const
return the value of the data type this wrapper class is holding
T operator=(const T t)
assignment operator, but checks first if the variable is already locked
NNTParam()
this is a typewrapper class for the parameters for the neurotrigger.
T m_value
holding the value
std::vector< NNTParam< unsigned short > > maxHitsPerSL
Maximum number of hits in a single super layer for all networks.
std::vector< std::vector< NNTParam< float > > > invptRangeUse
Charge / Pt region for which MLP is used in 1/GeV for all networks.
std::vector< std::vector< NNTParam< float > > > thetaRangeUse
Theta region for which MLP is used in degree for all networks.
NNTParam< unsigned > nMLP
Number of networks.
std::vector< NNTParam< unsigned long > > SLpatternMask
Super layer pattern mask for which MLP is trained for all networks.
std::vector< std::vector< NNTParam< float > > > nHidden
Number of nodes in each hidden layer for all networks or factor to multiply with number of inputs.
std::vector< std::vector< NNTParam< float > > > thetaRangeTrain
Theta region for which MLP is trained in degree for all networks.
bool checkarr(std::vector< std::vector< NNTParam< X > > > vec)
check, if a vector is already set.
NNTParam< unsigned > tMax
Maximal drift time, identical for all networks.
std::vector< NNTParam< X > > read1dArray(std::string keyx, bool locked)
fill the array from a given string that looks like: [1,2,3]
std::vector< NNTParam< unsigned long > > SLpattern
Super layer pattern for which MLP is trained for all networks.
std::string print2dArray(const std::string &name, std::vector< std::vector< NNTParam< X > > > vecvec)
this is a class for piping the output of a 2d array to a string with brackets
NNTParam< bool > rescaleTarget
flag to allow for target tracks lying out of the output range to be rescaled during training.
std::vector< std::vector< NNTParam< float > > > IDRanges
relative ID range of the relevant wire IDs of the track segments that are taken into consideration wh...
NNTParam< bool > multiplyHidden
If true, multiply nHidden with number of input nodes.
NNTParam< bool > targetTheta
train theta as output
NNTParam< unsigned > nOutput
number of output nodes
std::vector< std::vector< NNTParam< float > > > phiRangeUse
Phi region for which MLP is used in degree for all networks.
NNTParam< unsigned > ETOption
Determine, how the event time should be obtained.
NNTParam< bool > targetZ
train z as output
const std::string et_option() const
return the string variant ov the et option
NNTParam< bool > cutSum
only used in the idhist module.
std::vector< std::vector< NNTParam< X > > > read2dArray(std::string keyx, bool locked)
fill the array from a given string that looks like: [[1,2],[3, 4]]
std::vector< std::vector< NNTParam< float > > > invptRangeTrain
Charge / Pt region for which MLP is trained in 1/GeV for all networks.
std::vector< std::vector< NNTParam< float > > > phiRangeTrain
Phi region for which MLP is trained in degree for all networks.
void loadconfigtxt(const std::string &filename)
load the configuration from a file
std::vector< std::vector< X > > tcastvector(const std::vector< std::vector< NNTParam< X > > > vec) const
the parameters stored in the parameterset are not advanced enough to be vectors, they can only be sin...
void saveconfigtxt(const std::string &filename)
save the configuration to a file
std::string print1dArray(const std::string &name, std::vector< NNTParam< X > > vecvec)
this is a class for piping the output of a 1d array to a string with brackets
NNTParam< double > relevantCut
only used in the idhist module.
NNTParam< unsigned > nInput
Network parameters.
std::vector< NNTParam< unsigned > > precision
precision used for the hardware simulation
std::vector< std::vector< NNTParam< float > > > outputScale
Output scale for all networks.
Abstract base class for different kinds of events.