8 #ifndef CDCTRIGGERMLP_H
9 #define CDCTRIGGERMLP_H
12 #include <framework/logging/Logger.h>
31 unsigned short targets,
32 std::vector<float>& outputscale,
33 std::vector<float>& phirange,
34 std::vector<float>& invptrange,
35 std::vector<float>& thetarange,
36 unsigned short maxHits,
37 unsigned long pattern,
38 unsigned long patternMask,
41 const std::string& etoption);
76 B2WARNING(
"Use of this flag is deprecated! Use get_et_option() instead!");
91 bool isRelevant(
float relId,
unsigned iSL)
const;
95 float scaleId(
double relId,
unsigned iSL)
const;
97 std::vector<float>
scaleTarget(std::vector<float> target)
const;
99 std::vector<float>
unscaleTarget(std::vector<float> target)
const;
Class to keep all parameters of an expert MLP for the neuro trigger.
unsigned nWeightsCal() const
calculate number of weights from number of nodes
std::vector< float > thetaRange
Theta region in radian for which this expert is trained.
~CDCTriggerMLP()
destructor, empty because we don't allocate memory anywhere.
unsigned short tMax
Maximal drift time (for scaling), hits with larger values are ignored.
bool inPhiRange(float phi) const
check whether given phi value is in sector
bool inThetaRange(float theta) const
check whether given theta value is in sector
std::vector< unsigned short > nNodes
Number of nodes in each layer, not including bias nodes.
std::vector< float > unscaleTarget(std::vector< float > target) const
scale target value from [-1, 1] to outputScale
CDCTriggerMLP()
default constructor.
bool isTrained() const
check if weights are default values or set by some trainer
std::string get_et_option() const
Returns way of obtaining the event time.
unsigned long getSLpatternMask() const
get bitmask for super layer pattern
unsigned long getSLpatternUnmasked() const
get raw super layer pattern
std::vector< float > scaleTarget(std::vector< float > target) const
scale target value from outputScale to [-1, 1]
bool getT0fromHits() const
get flag for event time definition
std::vector< float > outputScale
Output[i] of the MLP is scaled from [-1, 1] to [outputScale[2i], outputScale[2i+1]].
bool inPtRange(float pt) const
check whether given pt value is in sector
unsigned short getTMax() const
get maximal drift time
std::vector< float > relevantID
Hits must be within ID region around 2D track to be used as input.
unsigned long SLpatternMask
Bitmask for comparing the super layer pattern.
float scaleId(double relId, unsigned iSL) const
scale relative TS ID from relevant range to approximately [-1, 1] (to facilitate the FPGA implementat...
bool isRelevant(float relId, unsigned iSL) const
check whether given relative TS ID is in relevant range
unsigned short targetVars
output variables: 1: z, 2: theta, 3: (z, theta)
std::vector< float > weights
Weights of the network.
unsigned nLayers() const
get number of layers
unsigned short maxHitsPerSL
Maximum number of inputs for a single super layer.
std::string et_option
Returns way of obtaining the event time.
std::vector< float > phiRange
Phi region in radian for which this expert is trained.
std::vector< float > getIDRange(unsigned iSL) const
get relevant ID range for given super layer
bool inInvptRange(float invpt) const
check whether given 1/pt value is in sector
unsigned long getSLpattern() const
get super layer pattern
bool T0fromHits
DEPRECATED!! If true, the event time will be determined from hits within relevantID region,...
unsigned nWeights() const
get number of weights from length of weights vector
ClassDef(CDCTriggerMLP, 7)
Needed to make the ROOT object storable.
bool trained
Indicator whether the weights are just default values or have been set by some trainer (set to true w...
unsigned short getMaxHitsPerSL() const
get maximum hit number for a single super layer
int thetaIndex() const
get target index for theta (-1 if no output is trained for theta)
std::vector< float > invptRange
Charge / Pt region in 1/GeV for which this expert is trained.
int zIndex() const
get target index for z (-1 if no output is trained for z)
std::vector< float > getWeights() const
get weights vector
unsigned long SLpattern
Super layer pattern for which this expert is trained.
unsigned nNodesLayer(unsigned iLayer) const
get number of nodes in a layer
The trainer module for the neural networks of the CDC trigger.
Abstract base class for different kinds of events.