12#include <framework/logging/Logger.h>
23 friend class CDCTriggerNeuroTrainerModule;
32 unsigned short targets,
33 std::vector<float>& outputscale,
34 std::vector<float>& phirangeUse,
35 std::vector<float>& invptrangeUse,
36 std::vector<float>& thetarangeUse,
37 std::vector<float>& phirangeTrain,
38 std::vector<float>& invptrangeTrain,
39 std::vector<float>& thetarangeTrain,
40 unsigned short maxHits,
41 unsigned long pattern,
42 unsigned long patternMask,
44 const std::string& etoption);
80 std::vector<float> getRelID()
const {
return relevantID;}
101 bool isRelevant(
float relId,
unsigned iSL)
const;
105 float scaleId(
double relId,
unsigned iSL)
const;
107 std::vector<float>
scaleTarget(std::vector<float> target)
const;
109 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
~CDCTriggerMLP()
destructor, empty because we don't allocate memory anywhere.
unsigned short tMax
Maximal drift time (for scaling), hits with larger values are ignored.
std::vector< unsigned short > nNodes
Number of nodes in each layer, not including bias nodes.
void setRelID(std::vector< float > relid)
set and get total relevant ID range
std::vector< float > phiRangeUse
Phi region in radian for which this expert is used.
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.
std::vector< float > invptRangeTrain
Charge / Pt region in 1/GeV for which this expert is trained.
unsigned long getSLpatternMask() const
get bitmask for super layer pattern
unsigned long getSLpatternUnmasked() const
get raw super layer pattern
ClassDef(CDCTriggerMLP, 11)
Needed to make the ROOT object storable.
std::vector< float > scaleTarget(std::vector< float > target) const
scale target value from outputScale to [-1, 1]
std::vector< float > outputScale
Output[i] of the MLP is scaled from [-1, 1] to [outputScale[2i], outputScale[2i+1]].
unsigned short getTMax() const
get maximal drift time
bool inThetaRangeTrain(float theta) const
check whether given theta value is in training sector
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.
std::vector< float > thetaRangeUse
Theta region in radian for which this expert is trained.
bool inPtRangeTrain(float pt) const
check whether given pt value is in training sector
float scaleId(double relId, unsigned iSL) const
scale relative TS ID from relevant range to approximately [-1, 1] (to facilitate the FPGA implementat...
bool inInvptRangeUse(float invpt) const
check whether given 1/pt value is in sector
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.
bool inPhiRangeUse(float phi) const
check whether given phi value is in sector
void setWeights(std::vector< float > xweights)
set weights vector
unsigned nLayers() const
get number of layers
std::vector< float > phiRangeTrain
Phi region in radian for which this expert is used.
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 > thetaRangeTrain
Theta region in radian for which this expert is trained.
std::vector< float > invptRangeUse
Charge / Pt region in 1/GeV for which this expert is used.
bool inInvptRangeTrain(float invpt) const
check whether given 1/pt value is in training sector
std::vector< float > getIDRange(unsigned iSL) const
get relevant ID range for given super layer
bool inThetaRangeUse(float theta) const
check whether given theta value is in sector
bool inPtRangeUse(float pt) const
check whether given pt value is in sector
unsigned long getSLpattern() const
get super layer pattern
unsigned nWeights() const
get number of weights from length of weights vector
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
std::vector< float > getWeights() const
get weights vector
int thetaIndex() const
get target index for theta (-1 if no output is trained for theta)
int zIndex() const
get target index for z (-1 if no output is trained for z)
unsigned long SLpattern
Super layer pattern for which this expert is trained.
bool inPhiRangeTrain(float phi) const
check whether given phi value is in training sector
unsigned nNodesLayer(unsigned iLayer) const
get number of nodes in a layer
Class to represent the CDC Neurotrigger.
Abstract base class for different kinds of events.