// Class: ReadMuon_Upstream_TMVA // Automatically generated by MethodBase::MakeClass // /* configuration options ===================================================== #GEN -*-*-*-*-*-*-*-*-*-*-*- general info -*-*-*-*-*-*-*-*-*-*-*- Method : MLP::Muon_Upstream_TMVA TMVA Release : 4.2.0 [262656] ROOT Release : 6.02/01 [393729] Creator : jonesc Date : Sun Feb 14 21:18:40 2016 Host : Linux lcgapp-slc6-physical1.cern.ch 2.6.32-431.29.2.el6.x86_64 #1 SMP Wed Sep 10 11:13:12 CEST 2014 x86_64 x86_64 x86_64 GNU/Linux Dir : /var/pcfst/r03/lhcb/jonesc/ANNPID/results/MC12/TrainMixture/TrainPhysTks-EvalPhysTks-ReweightRICH2/GhostAccFrac1.0/ProtonAccFrac1.0/KaonAccFrac1.0/TMVA-Run2-NoTkLikCDVelodEdx/MLP/Norm/ScaleF1.4/BP/NCycles750/CE/tanh/CVTest15/CVImp1e-16/NotUseRegulator/Muon/Upstream Training events: 2700000 Analysis type : [Classification] #OPT -*-*-*-*-*-*-*-*-*-*-*-*- options -*-*-*-*-*-*-*-*-*-*-*-*- # Set by User: NCycles: "750" [Number of training cycles] HiddenLayers: "23" [Specification of hidden layer architecture] NeuronType: "tanh" [Neuron activation function type] EstimatorType: "CE" [MSE (Mean Square Estimator) for Gaussian Likelihood or CE(Cross-Entropy) for Bernoulli Likelihood] V: "True" [Verbose output (short form of "VerbosityLevel" below - overrides the latter one)] VarTransform: "Norm" [List of variable transformations performed before training, e.g., "D_Background,P_Signal,G,N_AllClasses" for: "Decorrelation, PCA-transformation, Gaussianisation, Normalisation, each for the given class of events ('AllClasses' denotes all events of all classes, if no class indication is given, 'All' is assumed)"] H: "True" [Print method-specific help message] TrainingMethod: "BP" [Train with Back-Propagation (BP), BFGS Algorithm (BFGS), or Genetic Algorithm (GA - slower and worse)] EpochMonitoring: "True" [Provide epoch-wise monitoring plots according to TestRate (caution: causes big ROOT output file!)] ConvergenceImprove: "1.000000e-16" [Minimum improvement which counts as improvement (<0 means automatic convergence check is turned off)] ConvergenceTests: "15" [Number of steps (without improvement) required for convergence (<0 means automatic convergence check is turned off)] UseRegulator: "False" [Use regulator to avoid over-training] # Default: RandomSeed: "1" [Random seed for initial synapse weights (0 means unique seed for each run; default value '1')] NeuronInputType: "sum" [Neuron input function type] VerbosityLevel: "Verbose" [Verbosity level] CreateMVAPdfs: "False" [Create PDFs for classifier outputs (signal and background)] IgnoreNegWeightsInTraining: "False" [Events with negative weights are ignored in the training (but are included for testing and performance evaluation)] LearningRate: "2.000000e-02" [ANN learning rate parameter] DecayRate: "1.000000e-02" [Decay rate for learning parameter] TestRate: "10" [Test for overtraining performed at each #th epochs] Sampling: "1.000000e+00" [Only 'Sampling' (randomly selected) events are trained each epoch] SamplingEpoch: "1.000000e+00" [Sampling is used for the first 'SamplingEpoch' epochs, afterwards, all events are taken for training] SamplingImportance: "1.000000e+00" [ The sampling weights of events in epochs which successful (worse estimator than before) are multiplied with SamplingImportance, else they are divided.] SamplingTraining: "True" [The training sample is sampled] SamplingTesting: "False" [The testing sample is sampled] ResetStep: "50" [How often BFGS should reset history] Tau: "3.000000e+00" [LineSearch "size step"] BPMode: "sequential" [Back-propagation learning mode: sequential or batch] BatchSize: "-1" [Batch size: number of events/batch, only set if in Batch Mode, -1 for BatchSize=number_of_events] UpdateLimit: "10000" [Maximum times of regulator update] CalculateErrors: "False" [Calculates inverse Hessian matrix at the end of the training to be able to calculate the uncertainties of an MVA value] WeightRange: "1.000000e+00" [Take the events for the estimator calculations from small deviations from the desired value to large deviations only over the weight range] ## #VAR -*-*-*-*-*-*-*-*-*-*-*-* variables *-*-*-*-*-*-*-*-*-*-*-*- NVar 17 TrackP TrackP TrackP TrackP 'F' [147.869995117,4760267.5] TrackPt TrackPt TrackPt TrackPt 'F' [0.360198408365,978077.5] TrackChi2PerDof TrackChi2PerDof TrackChi2PerDof TrackChi2PerDof 'F' [0.0029748051893,2.99983906746] TrackNumDof TrackNumDof TrackNumDof TrackNumDof 'I' [4,28] TrackGhostProbability TrackGhostProbability TrackGhostProbability TrackGhostProbability 'F' [0.0391823016107,1] TrackFitVeloChi2 TrackFitVeloChi2 TrackFitVeloChi2 TrackFitVeloChi2 'F' [8.64220680796e-07,53.9077644348] TrackFitVeloNDoF TrackFitVeloNDoF TrackFitVeloNDoF TrackFitVeloNDoF 'I' [1,24] RichUsedR1Gas RichUsedR1Gas RichUsedR1Gas RichUsedR1Gas 'I' [0,1] RichAboveMuThres RichAboveMuThres RichAboveMuThres RichAboveMuThres 'I' [0,1] RichAboveKaThres RichAboveKaThres RichAboveKaThres RichAboveKaThres 'I' [0,1] RichDLLe RichDLLe RichDLLe RichDLLe 'F' [-999,118.707099915] RichDLLmu RichDLLmu RichDLLmu RichDLLmu 'F' [-999,81.0063018799] RichDLLk RichDLLk RichDLLk RichDLLk 'F' [-999,82.1451034546] RichDLLp RichDLLp RichDLLp RichDLLp 'F' [-999,92.269203186] RichDLLbt RichDLLbt RichDLLbt RichDLLbt 'F' [-999,50.5774993896] InAccBrem InAccBrem InAccBrem InAccBrem 'I' [0,1] BremPIDe BremPIDe BremPIDe BremPIDe 'F' [-999,4.79148387909] NSpec 0 ============================================================================ */ #include #include #include #include #ifndef IClassifierReader__def #define IClassifierReader__def class IClassifierReader { public: // constructor IClassifierReader() : fStatusIsClean( true ) {} virtual ~IClassifierReader() {} // return classifier response virtual double GetMvaValue( const std::vector& inputValues ) const = 0; // returns classifier status bool IsStatusClean() const { return fStatusIsClean; } protected: bool fStatusIsClean; }; #endif class ReadMuon_Upstream_TMVA : public IClassifierReader { public: // constructor ReadMuon_Upstream_TMVA( std::vector& theInputVars ) : IClassifierReader(), fClassName( "ReadMuon_Upstream_TMVA" ), fNvars( 17 ), fIsNormalised( false ) { // the training input variables const char* inputVars[] = { "TrackP", "TrackPt", "TrackChi2PerDof", "TrackNumDof", "TrackGhostProbability", "TrackFitVeloChi2", "TrackFitVeloNDoF", "RichUsedR1Gas", "RichAboveMuThres", "RichAboveKaThres", "RichDLLe", "RichDLLmu", "RichDLLk", "RichDLLp", "RichDLLbt", "InAccBrem", "BremPIDe" }; // sanity checks if (theInputVars.size() <= 0) { std::cout << "Problem in class \"" << fClassName << "\": empty input vector" << std::endl; fStatusIsClean = false; } if (theInputVars.size() != fNvars) { std::cout << "Problem in class \"" << fClassName << "\": mismatch in number of input values: " << theInputVars.size() << " != " << fNvars << std::endl; fStatusIsClean = false; } // validate input variables for (size_t ivar = 0; ivar < theInputVars.size(); ivar++) { if (theInputVars[ivar] != inputVars[ivar]) { std::cout << "Problem in class \"" << fClassName << "\": mismatch in input variable names" << std::endl << " for variable [" << ivar << "]: " << theInputVars[ivar].c_str() << " != " << inputVars[ivar] << std::endl; fStatusIsClean = false; } } // initialize min and max vectors (for normalisation) fVmin[0] = -1; fVmax[0] = 0.99999988079071; fVmin[1] = -1; fVmax[1] = 1; fVmin[2] = -1; fVmax[2] = 1; fVmin[3] = -1; fVmax[3] = 1; fVmin[4] = -1; fVmax[4] = 1; fVmin[5] = -1; fVmax[5] = 1; fVmin[6] = -1; fVmax[6] = 1; fVmin[7] = -1; fVmax[7] = 1; fVmin[8] = -1; fVmax[8] = 1; fVmin[9] = -1; fVmax[9] = 1; fVmin[10] = -1; fVmax[10] = 1; fVmin[11] = -1; fVmax[11] = 1; fVmin[12] = -1; fVmax[12] = 1; fVmin[13] = -1; fVmax[13] = 1; fVmin[14] = -1; fVmax[14] = 1; fVmin[15] = -1; fVmax[15] = 1; fVmin[16] = -1; fVmax[16] = 1; // initialize input variable types fType[0] = 'F'; fType[1] = 'F'; fType[2] = 'F'; fType[3] = 'I'; fType[4] = 'F'; fType[5] = 'F'; fType[6] = 'I'; fType[7] = 'I'; fType[8] = 'I'; fType[9] = 'I'; fType[10] = 'F'; fType[11] = 'F'; fType[12] = 'F'; fType[13] = 'F'; fType[14] = 'F'; fType[15] = 'I'; fType[16] = 'F'; // initialize constants Initialize(); // initialize transformation InitTransform(); } // destructor virtual ~ReadMuon_Upstream_TMVA() { Clear(); // method-specific } // the classifier response // "inputValues" is a vector of input values in the same order as the // variables given to the constructor double GetMvaValue( const std::vector& inputValues ) const; private: // method-specific destructor void Clear(); // input variable transformation double fMin_1[3][17]; double fMax_1[3][17]; void InitTransform_1(); void Transform_1( std::vector & iv, int sigOrBgd ) const; void InitTransform(); void Transform( std::vector & iv, int sigOrBgd ) const; // common member variables const char* fClassName; const size_t fNvars; size_t GetNvar() const { return fNvars; } char GetType( int ivar ) const { return fType[ivar]; } // normalisation of input variables const bool fIsNormalised; bool IsNormalised() const { return fIsNormalised; } double fVmin[17]; double fVmax[17]; double NormVariable( double x, double xmin, double xmax ) const { // normalise to output range: [-1, 1] return 2*(x - xmin)/(xmax - xmin) - 1.0; } // type of input variable: 'F' or 'I' char fType[17]; // initialize internal variables void Initialize(); double GetMvaValue__( const std::vector& inputValues ) const; // private members (method specific) double ActivationFnc(double x) const; double OutputActivationFnc(double x) const; int fLayers; int fLayerSize[3]; double fWeightMatrix0to1[24][18]; // weight matrix from layer 0 to 1 double fWeightMatrix1to2[1][24]; // weight matrix from layer 1 to 2 double * fWeights[3]; }; inline void ReadMuon_Upstream_TMVA::Initialize() { // build network structure fLayers = 3; fLayerSize[0] = 18; fWeights[0] = new double[18]; fLayerSize[1] = 24; fWeights[1] = new double[24]; fLayerSize[2] = 1; fWeights[2] = new double[1]; // weight matrix from layer 0 to 1 fWeightMatrix0to1[0][0] = 0.244989481914475; fWeightMatrix0to1[1][0] = 0.874448229694306; fWeightMatrix0to1[2][0] = 1.38313617492155; fWeightMatrix0to1[3][0] = 1.0517761022967; fWeightMatrix0to1[4][0] = -1.83296389705428; fWeightMatrix0to1[5][0] = -1.47796153015424; fWeightMatrix0to1[6][0] = -1.28263808043805; fWeightMatrix0to1[7][0] = 3.49216327164366; fWeightMatrix0to1[8][0] = -3.14720276410529; fWeightMatrix0to1[9][0] = -1.60650654976444; fWeightMatrix0to1[10][0] = -1.61682363779506; fWeightMatrix0to1[11][0] = -1.30465683744968; fWeightMatrix0to1[12][0] = -1.48769640337997; fWeightMatrix0to1[13][0] = -2.98517054597874; fWeightMatrix0to1[14][0] = -1.24899137893061; fWeightMatrix0to1[15][0] = 1.40168687413715; fWeightMatrix0to1[16][0] = -0.372393509096365; fWeightMatrix0to1[17][0] = 5.35177973222751; fWeightMatrix0to1[18][0] = 0.190706538879641; fWeightMatrix0to1[19][0] = 1.32553937011935; fWeightMatrix0to1[20][0] = -0.342594172855269; fWeightMatrix0to1[21][0] = -0.586563662838781; fWeightMatrix0to1[22][0] = 0.568506265213808; fWeightMatrix0to1[0][1] = 0.488229769929191; fWeightMatrix0to1[1][1] = -2.27608047139458; fWeightMatrix0to1[2][1] = 0.399565040478419; fWeightMatrix0to1[3][1] = 1.13726474149853; fWeightMatrix0to1[4][1] = -0.705959592507616; fWeightMatrix0to1[5][1] = -2.16112292450399; fWeightMatrix0to1[6][1] = -0.920859814487536; fWeightMatrix0to1[7][1] = 2.53051881957956; fWeightMatrix0to1[8][1] = 1.34025266390396; fWeightMatrix0to1[9][1] = -0.960411032629201; fWeightMatrix0to1[10][1] = -0.0670178699181236; fWeightMatrix0to1[11][1] = -1.29910346690573; fWeightMatrix0to1[12][1] = -0.457520086079895; fWeightMatrix0to1[13][1] = -9.87969494875232; fWeightMatrix0to1[14][1] = 1.51008900453445; fWeightMatrix0to1[15][1] = -1.50646104509841; fWeightMatrix0to1[16][1] = 1.74020907225919; fWeightMatrix0to1[17][1] = 2.94808387679386; fWeightMatrix0to1[18][1] = 1.25131254529865; fWeightMatrix0to1[19][1] = 1.99202139241922; fWeightMatrix0to1[20][1] = 1.43411214758751; fWeightMatrix0to1[21][1] = -0.452273103835363; fWeightMatrix0to1[22][1] = -1.67675566417884; fWeightMatrix0to1[0][2] = -1.40602182397856; fWeightMatrix0to1[1][2] = 0.389332200347427; fWeightMatrix0to1[2][2] = 0.354811732550465; fWeightMatrix0to1[3][2] = -0.736951791656656; fWeightMatrix0to1[4][2] = 0.84969110754138; fWeightMatrix0to1[5][2] = 1.17033484858152; fWeightMatrix0to1[6][2] = -0.531481146451535; fWeightMatrix0to1[7][2] = 0.931392135848459; fWeightMatrix0to1[8][2] = -0.429642724471257; fWeightMatrix0to1[9][2] = -0.556440214261878; fWeightMatrix0to1[10][2] = -0.171517945308911; fWeightMatrix0to1[11][2] = -1.27613760653792; fWeightMatrix0to1[12][2] = -0.257914188975795; fWeightMatrix0to1[13][2] = 0.834294817135757; fWeightMatrix0to1[14][2] = -2.14673037499173; fWeightMatrix0to1[15][2] = 1.78669586083659; fWeightMatrix0to1[16][2] = 0.0539975352080512; fWeightMatrix0to1[17][2] = -0.43437660746868; fWeightMatrix0to1[18][2] = 0.988252473911513; fWeightMatrix0to1[19][2] = 0.49240322314976; fWeightMatrix0to1[20][2] = -0.432564467206837; fWeightMatrix0to1[21][2] = 0.267536386878701; fWeightMatrix0to1[22][2] = 1.38270678162476; fWeightMatrix0to1[0][3] = -1.16492964391325; fWeightMatrix0to1[1][3] = -0.752676550780757; fWeightMatrix0to1[2][3] = -1.68999364961043; fWeightMatrix0to1[3][3] = 0.407124060824389; fWeightMatrix0to1[4][3] = 1.66033609209231; fWeightMatrix0to1[5][3] = 1.57024549076536; fWeightMatrix0to1[6][3] = 0.225956944365021; fWeightMatrix0to1[7][3] = -3.26933949052606; fWeightMatrix0to1[8][3] = -1.27916515116941; fWeightMatrix0to1[9][3] = 0.286283182235918; fWeightMatrix0to1[10][3] = 0.772136604169184; fWeightMatrix0to1[11][3] = 3.83908751584658; fWeightMatrix0to1[12][3] = 0.275139464318072; fWeightMatrix0to1[13][3] = -2.25103759375373; fWeightMatrix0to1[14][3] = 0.675856274841318; fWeightMatrix0to1[15][3] = 2.4769228232503; fWeightMatrix0to1[16][3] = -0.451812158320088; fWeightMatrix0to1[17][3] = -0.14114375433715; fWeightMatrix0to1[18][3] = -8.95793988177157; fWeightMatrix0to1[19][3] = -2.7383291253865; fWeightMatrix0to1[20][3] = -3.11942615586748; fWeightMatrix0to1[21][3] = -1.19901040274343; fWeightMatrix0to1[22][3] = -0.685003316111522; fWeightMatrix0to1[0][4] = -0.0925445766174831; fWeightMatrix0to1[1][4] = -2.38441214133178; fWeightMatrix0to1[2][4] = -1.08446972935262; fWeightMatrix0to1[3][4] = 0.937971266202386; fWeightMatrix0to1[4][4] = -0.410406880998883; fWeightMatrix0to1[5][4] = -1.51289048427998; fWeightMatrix0to1[6][4] = -0.0904982738085325; fWeightMatrix0to1[7][4] = 0.303320085340236; fWeightMatrix0to1[8][4] = -0.562728343870466; fWeightMatrix0to1[9][4] = -1.23914720801276; fWeightMatrix0to1[10][4] = 3.58975365141833; fWeightMatrix0to1[11][4] = 0.882230680496901; fWeightMatrix0to1[12][4] = -1.29310412204585; fWeightMatrix0to1[13][4] = -0.00128294813199075; fWeightMatrix0to1[14][4] = -0.361238159480879; fWeightMatrix0to1[15][4] = -6.45694319172512; fWeightMatrix0to1[16][4] = -1.05196638942365; fWeightMatrix0to1[17][4] = 0.0894606253098195; fWeightMatrix0to1[18][4] = -0.898063223529613; fWeightMatrix0to1[19][4] = -0.472858882836221; fWeightMatrix0to1[20][4] = -0.398967903467085; fWeightMatrix0to1[21][4] = -1.25457281932817; fWeightMatrix0to1[22][4] = -6.28256836239795; fWeightMatrix0to1[0][5] = 1.34577553470209; fWeightMatrix0to1[1][5] = 0.391208626811658; fWeightMatrix0to1[2][5] = -0.0484206184716904; fWeightMatrix0to1[3][5] = 2.05280481751306; fWeightMatrix0to1[4][5] = -0.927838461575244; fWeightMatrix0to1[5][5] = -1.67510902000771; fWeightMatrix0to1[6][5] = 1.4843106505408; fWeightMatrix0to1[7][5] = -1.52650337993578; fWeightMatrix0to1[8][5] = 0.77986484693064; fWeightMatrix0to1[9][5] = 0.0631119615547677; fWeightMatrix0to1[10][5] = -2.35771619147753; fWeightMatrix0to1[11][5] = 0.981348815501889; fWeightMatrix0to1[12][5] = -0.743317465273468; fWeightMatrix0to1[13][5] = -1.03625411047825; fWeightMatrix0to1[14][5] = -0.033691807384336; fWeightMatrix0to1[15][5] = 0.81856679623822; fWeightMatrix0to1[16][5] = -1.88349345428587; fWeightMatrix0to1[17][5] = 0.901133471079557; fWeightMatrix0to1[18][5] = -1.89524723205625; fWeightMatrix0to1[19][5] = -0.0680475570688771; fWeightMatrix0to1[20][5] = 1.04161909559556; fWeightMatrix0to1[21][5] = 0.310109238766228; fWeightMatrix0to1[22][5] = -1.1278510994836; fWeightMatrix0to1[0][6] = 0.560596062595105; fWeightMatrix0to1[1][6] = 1.20758889195733; fWeightMatrix0to1[2][6] = 1.29692003360075; fWeightMatrix0to1[3][6] = 0.877021060309484; fWeightMatrix0to1[4][6] = -1.5768920843833; fWeightMatrix0to1[5][6] = -0.241508659508907; fWeightMatrix0to1[6][6] = -3.4496492303189; fWeightMatrix0to1[7][6] = 3.56479869030619; fWeightMatrix0to1[8][6] = 2.47255163906022; fWeightMatrix0to1[9][6] = -1.20053243321714; fWeightMatrix0to1[10][6] = -0.274207115186606; fWeightMatrix0to1[11][6] = 1.46394706374216; fWeightMatrix0to1[12][6] = -0.937375143199851; fWeightMatrix0to1[13][6] = 3.3943014136044; fWeightMatrix0to1[14][6] = 2.92273618240914; fWeightMatrix0to1[15][6] = -5.11388214585491; fWeightMatrix0to1[16][6] = -1.02590938862662; fWeightMatrix0to1[17][6] = -1.98421424882237; fWeightMatrix0to1[18][6] = 8.08759882153117; fWeightMatrix0to1[19][6] = 0.570892207121029; fWeightMatrix0to1[20][6] = 0.60932100487824; fWeightMatrix0to1[21][6] = -3.64828482519748; fWeightMatrix0to1[22][6] = -0.824715783204332; fWeightMatrix0to1[0][7] = 0.435359558992225; fWeightMatrix0to1[1][7] = 0.406511424275023; fWeightMatrix0to1[2][7] = 0.35052920404454; fWeightMatrix0to1[3][7] = 0.85536159316041; fWeightMatrix0to1[4][7] = -1.0674047550498; fWeightMatrix0to1[5][7] = -0.356682767218189; fWeightMatrix0to1[6][7] = 1.64787421796941; fWeightMatrix0to1[7][7] = -1.60783436436311; fWeightMatrix0to1[8][7] = -0.395823336339166; fWeightMatrix0to1[9][7] = 1.504171506276; fWeightMatrix0to1[10][7] = 1.82758882059565; fWeightMatrix0to1[11][7] = 0.973678014021143; fWeightMatrix0to1[12][7] = 1.71227105021553; fWeightMatrix0to1[13][7] = 7.32383998945785; fWeightMatrix0to1[14][7] = -1.94723253312614; fWeightMatrix0to1[15][7] = 1.12180889229594; fWeightMatrix0to1[16][7] = -0.314306872826543; fWeightMatrix0to1[17][7] = 0.595435322681733; fWeightMatrix0to1[18][7] = -3.84772127033761; fWeightMatrix0to1[19][7] = -1.21000172526472; fWeightMatrix0to1[20][7] = 1.1022514777644; fWeightMatrix0to1[21][7] = 0.948326228900653; fWeightMatrix0to1[22][7] = -3.66128129940591; fWeightMatrix0to1[0][8] = 0.0966889130974267; fWeightMatrix0to1[1][8] = -0.312051793431083; fWeightMatrix0to1[2][8] = 0.0145338082065628; fWeightMatrix0to1[3][8] = 1.62054019330798; fWeightMatrix0to1[4][8] = -0.041480310791145; fWeightMatrix0to1[5][8] = -0.243413044142375; fWeightMatrix0to1[6][8] = 0.841906941917422; fWeightMatrix0to1[7][8] = 1.06210639763008; fWeightMatrix0to1[8][8] = 1.78877560641083; fWeightMatrix0to1[9][8] = 0.64987521098937; fWeightMatrix0to1[10][8] = 0.893041742178888; fWeightMatrix0to1[11][8] = 0.628663304853316; fWeightMatrix0to1[12][8] = -2.5567946178904; fWeightMatrix0to1[13][8] = 0.969946253695918; fWeightMatrix0to1[14][8] = 0.788285286034256; fWeightMatrix0to1[15][8] = -0.618012040863253; fWeightMatrix0to1[16][8] = 0.142886213387531; fWeightMatrix0to1[17][8] = 0.422726992158159; fWeightMatrix0to1[18][8] = -0.126686838275324; fWeightMatrix0to1[19][8] = -1.30338550153802; fWeightMatrix0to1[20][8] = 0.684448189839774; fWeightMatrix0to1[21][8] = -0.756506973579288; fWeightMatrix0to1[22][8] = -0.133379573113485; fWeightMatrix0to1[0][9] = -0.328474242422476; fWeightMatrix0to1[1][9] = 2.24377246437924; fWeightMatrix0to1[2][9] = -0.121592849737637; fWeightMatrix0to1[3][9] = 0.283267819772705; fWeightMatrix0to1[4][9] = 0.218225398091845; fWeightMatrix0to1[5][9] = -1.69975199274072; fWeightMatrix0to1[6][9] = 0.151665587413652; fWeightMatrix0to1[7][9] = 0.341344090365607; fWeightMatrix0to1[8][9] = 2.19397287721957; fWeightMatrix0to1[9][9] = 0.213395158611295; fWeightMatrix0to1[10][9] = 0.0971310635152815; fWeightMatrix0to1[11][9] = 2.65631648335377; fWeightMatrix0to1[12][9] = -1.73871647047617; fWeightMatrix0to1[13][9] = -1.85304805482518; fWeightMatrix0to1[14][9] = 1.18708353409841; fWeightMatrix0to1[15][9] = -0.235433173027077; fWeightMatrix0to1[16][9] = -0.137070929727129; fWeightMatrix0to1[17][9] = 1.8458849795536; fWeightMatrix0to1[18][9] = -0.324267145959048; fWeightMatrix0to1[19][9] = 0.444269346773561; fWeightMatrix0to1[20][9] = 0.254316233562712; fWeightMatrix0to1[21][9] = -1.57174940834405; fWeightMatrix0to1[22][9] = -0.439047263214365; fWeightMatrix0to1[0][10] = 1.08585398810175; fWeightMatrix0to1[1][10] = 0.235521019664211; fWeightMatrix0to1[2][10] = 1.17725378772447; fWeightMatrix0to1[3][10] = -1.48436236941736; fWeightMatrix0to1[4][10] = 1.33356184491937; fWeightMatrix0to1[5][10] = -2.6379819063537; fWeightMatrix0to1[6][10] = 4.28837997500613; fWeightMatrix0to1[7][10] = 0.963894596735704; fWeightMatrix0to1[8][10] = -5.74853128165458; fWeightMatrix0to1[9][10] = -1.47624074662924; fWeightMatrix0to1[10][10] = -0.656464543088445; fWeightMatrix0to1[11][10] = 1.67960819781137; fWeightMatrix0to1[12][10] = -2.81665369260378; fWeightMatrix0to1[13][10] = -0.966419642113822; fWeightMatrix0to1[14][10] = -2.313707376138; fWeightMatrix0to1[15][10] = 0.448383457570206; fWeightMatrix0to1[16][10] = -3.53362459070903; fWeightMatrix0to1[17][10] = -1.80476531221011; fWeightMatrix0to1[18][10] = 12.8877811154798; fWeightMatrix0to1[19][10] = -0.454535985456344; fWeightMatrix0to1[20][10] = -0.658017689013653; fWeightMatrix0to1[21][10] = -3.9691151704079; fWeightMatrix0to1[22][10] = -2.69160548268383; fWeightMatrix0to1[0][11] = 1.96254906325845; fWeightMatrix0to1[1][11] = 1.15342064016929; fWeightMatrix0to1[2][11] = -1.42190934358333; fWeightMatrix0to1[3][11] = -1.61675969560162; fWeightMatrix0to1[4][11] = -0.523359923816087; fWeightMatrix0to1[5][11] = -0.938615116165376; fWeightMatrix0to1[6][11] = -5.19730738885548; fWeightMatrix0to1[7][11] = 5.70929029555094; fWeightMatrix0to1[8][11] = 18.6637216980691; fWeightMatrix0to1[9][11] = 1.73589163518953; fWeightMatrix0to1[10][11] = 0.420729096746103; fWeightMatrix0to1[11][11] = -3.64548616320225; fWeightMatrix0to1[12][11] = 0.0674554724374688; fWeightMatrix0to1[13][11] = -40.7485694819346; fWeightMatrix0to1[14][11] = 1.35994016279228; fWeightMatrix0to1[15][11] = 1.67567248086578; fWeightMatrix0to1[16][11] = 3.1839791599903; fWeightMatrix0to1[17][11] = -0.469718177917349; fWeightMatrix0to1[18][11] = -2.04787124724502; fWeightMatrix0to1[19][11] = 1.65689504569963; fWeightMatrix0to1[20][11] = 0.183356250511631; fWeightMatrix0to1[21][11] = -0.360006135075919; fWeightMatrix0to1[22][11] = -0.0616456125564342; fWeightMatrix0to1[0][12] = 1.25839032522625; fWeightMatrix0to1[1][12] = 1.21948621947374; fWeightMatrix0to1[2][12] = 0.64456361453735; fWeightMatrix0to1[3][12] = -0.363291914746779; fWeightMatrix0to1[4][12] = -0.0253230830742043; fWeightMatrix0to1[5][12] = 0.569643300800989; fWeightMatrix0to1[6][12] = -3.17705269081416; fWeightMatrix0to1[7][12] = -0.86005480596552; fWeightMatrix0to1[8][12] = -8.10954387465909; fWeightMatrix0to1[9][12] = -1.52834337103635; fWeightMatrix0to1[10][12] = -0.805806863199847; fWeightMatrix0to1[11][12] = 3.25667771234493; fWeightMatrix0to1[12][12] = -1.07161705580468; fWeightMatrix0to1[13][12] = 9.71419943550061; fWeightMatrix0to1[14][12] = -1.31624119410617; fWeightMatrix0to1[15][12] = 1.44035206792541; fWeightMatrix0to1[16][12] = -1.93974184073119; fWeightMatrix0to1[17][12] = 1.98060980466223; fWeightMatrix0to1[18][12] = -0.41729837075608; fWeightMatrix0to1[19][12] = -1.17218960789479; fWeightMatrix0to1[20][12] = 0.209388047766741; fWeightMatrix0to1[21][12] = 0.732029474088782; fWeightMatrix0to1[22][12] = -1.47215601671719; fWeightMatrix0to1[0][13] = -1.71594274738877; fWeightMatrix0to1[1][13] = -1.44418418233067; fWeightMatrix0to1[2][13] = -1.22628660666057; fWeightMatrix0to1[3][13] = 1.97585838421486; fWeightMatrix0to1[4][13] = -0.786749288652862; fWeightMatrix0to1[5][13] = 1.32680869817227; fWeightMatrix0to1[6][13] = -2.89801348787582; fWeightMatrix0to1[7][13] = -1.3799328393743; fWeightMatrix0to1[8][13] = -7.22284968203508; fWeightMatrix0to1[9][13] = -1.13963213811317; fWeightMatrix0to1[10][13] = -0.689956599871835; fWeightMatrix0to1[11][13] = 2.08338654066907; fWeightMatrix0to1[12][13] = -0.612296680726264; fWeightMatrix0to1[13][13] = 4.29744450858119; fWeightMatrix0to1[14][13] = 1.99976878515141; fWeightMatrix0to1[15][13] = 0.62155756048383; fWeightMatrix0to1[16][13] = -1.37065829251392; fWeightMatrix0to1[17][13] = 3.60578593480167; fWeightMatrix0to1[18][13] = -2.93874161885713; fWeightMatrix0to1[19][13] = 2.04325057881127; fWeightMatrix0to1[20][13] = 0.904349551033933; fWeightMatrix0to1[21][13] = -0.927781562105676; fWeightMatrix0to1[22][13] = -0.22198129871638; fWeightMatrix0to1[0][14] = 0.0602737151535976; fWeightMatrix0to1[1][14] = -1.54351509915332; fWeightMatrix0to1[2][14] = 0.221497440144748; fWeightMatrix0to1[3][14] = 2.14318828986301; fWeightMatrix0to1[4][14] = 1.34187105237237; fWeightMatrix0to1[5][14] = 2.46410394153755; fWeightMatrix0to1[6][14] = -4.53686253830898; fWeightMatrix0to1[7][14] = 2.30631516963125; fWeightMatrix0to1[8][14] = -3.07993625446669; fWeightMatrix0to1[9][14] = 0.490064667267918; fWeightMatrix0to1[10][14] = -0.973188421445234; fWeightMatrix0to1[11][14] = -2.72188462634261; fWeightMatrix0to1[12][14] = 0.741014076215717; fWeightMatrix0to1[13][14] = -1.97290627629634; fWeightMatrix0to1[14][14] = 0.566475514426868; fWeightMatrix0to1[15][14] = 1.38931219139215; fWeightMatrix0to1[16][14] = 0.377182632876438; fWeightMatrix0to1[17][14] = 0.91159106498764; fWeightMatrix0to1[18][14] = -2.44537401669034; fWeightMatrix0to1[19][14] = 1.21579709383612; fWeightMatrix0to1[20][14] = 2.01425533766108; fWeightMatrix0to1[21][14] = -1.41607618932875; fWeightMatrix0to1[22][14] = 1.08889820403784; fWeightMatrix0to1[0][15] = -1.73410222587871; fWeightMatrix0to1[1][15] = -0.198099634398144; fWeightMatrix0to1[2][15] = 0.796281113038215; fWeightMatrix0to1[3][15] = 1.31494447508711; fWeightMatrix0to1[4][15] = -1.69226967432139; fWeightMatrix0to1[5][15] = 0.882045984027084; fWeightMatrix0to1[6][15] = 2.27383433994217; fWeightMatrix0to1[7][15] = 0.204747887166914; fWeightMatrix0to1[8][15] = -0.261309332322236; fWeightMatrix0to1[9][15] = -1.03360915187737; fWeightMatrix0to1[10][15] = -0.644925053657176; fWeightMatrix0to1[11][15] = -3.08855165837783; fWeightMatrix0to1[12][15] = 1.12517545831508; fWeightMatrix0to1[13][15] = -0.31389433660618; fWeightMatrix0to1[14][15] = -1.26131599677583; fWeightMatrix0to1[15][15] = -0.128563175718803; fWeightMatrix0to1[16][15] = -1.07733305329109; fWeightMatrix0to1[17][15] = -0.699244960731257; fWeightMatrix0to1[18][15] = -1.86212112427763; fWeightMatrix0to1[19][15] = 1.02504802129045; fWeightMatrix0to1[20][15] = -0.0130948746398971; fWeightMatrix0to1[21][15] = -2.07755584126932; fWeightMatrix0to1[22][15] = -1.10741815470312; fWeightMatrix0to1[0][16] = -1.31828124913395; fWeightMatrix0to1[1][16] = -1.23654585696842; fWeightMatrix0to1[2][16] = 1.91186125781285; fWeightMatrix0to1[3][16] = -0.332018749576598; fWeightMatrix0to1[4][16] = -1.89368491997434; fWeightMatrix0to1[5][16] = 1.62410312832613; fWeightMatrix0to1[6][16] = 1.35167215361738; fWeightMatrix0to1[7][16] = -0.271986217596589; fWeightMatrix0to1[8][16] = -0.376210627136404; fWeightMatrix0to1[9][16] = 1.2621124184979; fWeightMatrix0to1[10][16] = 2.5260639699721; fWeightMatrix0to1[11][16] = -0.690670945029486; fWeightMatrix0to1[12][16] = -0.896979721608027; fWeightMatrix0to1[13][16] = 0.251812797758918; fWeightMatrix0to1[14][16] = -1.84866343181791; fWeightMatrix0to1[15][16] = -0.078865369866031; fWeightMatrix0to1[16][16] = 1.42229898446016; fWeightMatrix0to1[17][16] = 0.644685347125266; fWeightMatrix0to1[18][16] = 2.01283246226724; fWeightMatrix0to1[19][16] = 0.834144592170824; fWeightMatrix0to1[20][16] = 2.95844901970591; fWeightMatrix0to1[21][16] = -1.77126434681971; fWeightMatrix0to1[22][16] = 1.07980711145242; fWeightMatrix0to1[0][17] = 0.563627175419958; fWeightMatrix0to1[1][17] = -1.10949686451097; fWeightMatrix0to1[2][17] = -0.811723135363808; fWeightMatrix0to1[3][17] = -1.21316844263761; fWeightMatrix0to1[4][17] = 0.358408490899248; fWeightMatrix0to1[5][17] = 0.718378391239858; fWeightMatrix0to1[6][17] = 1.62173229009483; fWeightMatrix0to1[7][17] = 0.916088730402042; fWeightMatrix0to1[8][17] = 1.34187641884272; fWeightMatrix0to1[9][17] = 2.71388033538564; fWeightMatrix0to1[10][17] = 1.92876783162; fWeightMatrix0to1[11][17] = 1.20086388981697; fWeightMatrix0to1[12][17] = -0.999058496066462; fWeightMatrix0to1[13][17] = 7.07258752528711; fWeightMatrix0to1[14][17] = -1.8611342046879; fWeightMatrix0to1[15][17] = 0.972570084795037; fWeightMatrix0to1[16][17] = 1.39721983723612; fWeightMatrix0to1[17][17] = -0.30116110767061; fWeightMatrix0to1[18][17] = -1.1424994709338; fWeightMatrix0to1[19][17] = 0.0705342430065301; fWeightMatrix0to1[20][17] = -1.40359050268719; fWeightMatrix0to1[21][17] = 0.0979135357005276; fWeightMatrix0to1[22][17] = -1.74008344257472; // weight matrix from layer 1 to 2 fWeightMatrix1to2[0][0] = 0.779369212195572; fWeightMatrix1to2[0][1] = -0.631826953100918; fWeightMatrix1to2[0][2] = 0.548691921626531; fWeightMatrix1to2[0][3] = 0.794001882533455; fWeightMatrix1to2[0][4] = 0.292934718766082; fWeightMatrix1to2[0][5] = -0.852557248679726; fWeightMatrix1to2[0][6] = -0.632435202565993; fWeightMatrix1to2[0][7] = 1.2184343036958; fWeightMatrix1to2[0][8] = 0.913246516980352; fWeightMatrix1to2[0][9] = -3.2476599151103; fWeightMatrix1to2[0][10] = -2.38723931451322; fWeightMatrix1to2[0][11] = -0.898687566217733; fWeightMatrix1to2[0][12] = 0.19850750726783; fWeightMatrix1to2[0][13] = -2.0372676713917; fWeightMatrix1to2[0][14] = -0.660946837038426; fWeightMatrix1to2[0][15] = 0.512381638185685; fWeightMatrix1to2[0][16] = 0.264741058502796; fWeightMatrix1to2[0][17] = -2.49346487349965; fWeightMatrix1to2[0][18] = -2.8177293651934; fWeightMatrix1to2[0][19] = 0.799432168043835; fWeightMatrix1to2[0][20] = 0.854460728918596; fWeightMatrix1to2[0][21] = 0.866999571555397; fWeightMatrix1to2[0][22] = 0.858047185405463; fWeightMatrix1to2[0][23] = -2.34710571759226; } inline double ReadMuon_Upstream_TMVA::GetMvaValue__( const std::vector& inputValues ) const { if (inputValues.size() != (unsigned int)fLayerSize[0]-1) { std::cout << "Input vector needs to be of size " << fLayerSize[0]-1 << std::endl; return 0; } for (int l=0; l& inputValues ) const { // classifier response value double retval = 0; // classifier response, sanity check first if (!IsStatusClean()) { std::cout << "Problem in class \"" << fClassName << "\": cannot return classifier response" << " because status is dirty" << std::endl; retval = 0; } else { if (IsNormalised()) { // normalise variables std::vector iV; iV.reserve(inputValues.size()); int ivar = 0; for (std::vector::const_iterator varIt = inputValues.begin(); varIt != inputValues.end(); varIt++, ivar++) { iV.push_back(NormVariable( *varIt, fVmin[ivar], fVmax[ivar] )); } Transform( iV, -1 ); retval = GetMvaValue__( iV ); } else { std::vector iV; int ivar = 0; for (std::vector::const_iterator varIt = inputValues.begin(); varIt != inputValues.end(); varIt++, ivar++) { iV.push_back(*varIt); } Transform( iV, -1 ); retval = GetMvaValue__( iV ); } } return retval; } //_______________________________________________________________________ inline void ReadMuon_Upstream_TMVA::InitTransform_1() { // Normalization transformation, initialisation fMin_1[0][0] = 147.869995117; fMax_1[0][0] = 4760267.5; fMin_1[1][0] = 357.589996338; fMax_1[1][0] = 1688065.25; fMin_1[2][0] = 147.869995117; fMax_1[2][0] = 4760267.5; fMin_1[0][1] = 0.360198408365; fMax_1[0][1] = 978077.5; fMin_1[1][1] = 13.0398874283; fMax_1[1][1] = 155210.734375; fMin_1[2][1] = 0.360198408365; fMax_1[2][1] = 978077.5; fMin_1[0][2] = 0.0029748051893; fMax_1[0][2] = 2.99983906746; fMin_1[1][2] = 0.0195931866765; fMax_1[1][2] = 2.97740983963; fMin_1[2][2] = 0.0029748051893; fMax_1[2][2] = 2.99983906746; fMin_1[0][3] = 4; fMax_1[0][3] = 28; fMin_1[1][3] = 4; fMax_1[1][3] = 24; fMin_1[2][3] = 4; fMax_1[2][3] = 28; fMin_1[0][4] = 0.0391823016107; fMax_1[0][4] = 1; fMin_1[1][4] = 0.0664176717401; fMax_1[1][4] = 1; fMin_1[2][4] = 0.0391823016107; fMax_1[2][4] = 1; fMin_1[0][5] = 8.64220680796e-07; fMax_1[0][5] = 53.9077644348; fMin_1[1][5] = 0.00235333410092; fMax_1[1][5] = 40.3156471252; fMin_1[2][5] = 8.64220680796e-07; fMax_1[2][5] = 53.9077644348; fMin_1[0][6] = 1; fMax_1[0][6] = 24; fMin_1[1][6] = 1; fMax_1[1][6] = 20; fMin_1[2][6] = 1; fMax_1[2][6] = 24; fMin_1[0][7] = 0; fMax_1[0][7] = 1; fMin_1[1][7] = 0; fMax_1[1][7] = 1; fMin_1[2][7] = 0; fMax_1[2][7] = 1; fMin_1[0][8] = 0; fMax_1[0][8] = 1; fMin_1[1][8] = 0; fMax_1[1][8] = 1; fMin_1[2][8] = 0; fMax_1[2][8] = 1; fMin_1[0][9] = 0; fMax_1[0][9] = 1; fMin_1[1][9] = 0; fMax_1[1][9] = 1; fMin_1[2][9] = 0; fMax_1[2][9] = 1; fMin_1[0][10] = -999; fMax_1[0][10] = 118.707099915; fMin_1[1][10] = -999; fMax_1[1][10] = 69.1707000732; fMin_1[2][10] = -999; fMax_1[2][10] = 118.707099915; fMin_1[0][11] = -999; fMax_1[0][11] = 81.0063018799; fMin_1[1][11] = -999; fMax_1[1][11] = 76.2277984619; fMin_1[2][11] = -999; fMax_1[2][11] = 81.0063018799; fMin_1[0][12] = -999; fMax_1[0][12] = 82.1451034546; fMin_1[1][12] = -999; fMax_1[1][12] = 47.6445999146; fMin_1[2][12] = -999; fMax_1[2][12] = 82.1451034546; fMin_1[0][13] = -999; fMax_1[0][13] = 92.269203186; fMin_1[1][13] = -999; fMax_1[1][13] = 32.6091003418; fMin_1[2][13] = -999; fMax_1[2][13] = 92.269203186; fMin_1[0][14] = -999; fMax_1[0][14] = 50.5774993896; fMin_1[1][14] = -999; fMax_1[1][14] = 39.8195991516; fMin_1[2][14] = -999; fMax_1[2][14] = 50.5774993896; fMin_1[0][15] = 0; fMax_1[0][15] = 1; fMin_1[1][15] = 0; fMax_1[1][15] = 1; fMin_1[2][15] = 0; fMax_1[2][15] = 1; fMin_1[0][16] = -999; fMax_1[0][16] = 4.79148387909; fMin_1[1][16] = -999; fMax_1[1][16] = 4.31975746155; fMin_1[2][16] = -999; fMax_1[2][16] = 4.79148387909; } //_______________________________________________________________________ inline void ReadMuon_Upstream_TMVA::Transform_1( std::vector& iv, int cls) const { // Normalization transformation if (cls < 0 || cls > 2) { if (2 > 1 ) cls = 2; else cls = 2; } const int nVar = 17; // get indices of used variables // define the indices of the variables which are transformed by this transformation static std::vector indicesGet; static std::vector indicesPut; if ( indicesGet.empty() ) { indicesGet.reserve(fNvars); indicesGet.push_back( 0); indicesGet.push_back( 1); indicesGet.push_back( 2); indicesGet.push_back( 3); indicesGet.push_back( 4); indicesGet.push_back( 5); indicesGet.push_back( 6); indicesGet.push_back( 7); indicesGet.push_back( 8); indicesGet.push_back( 9); indicesGet.push_back( 10); indicesGet.push_back( 11); indicesGet.push_back( 12); indicesGet.push_back( 13); indicesGet.push_back( 14); indicesGet.push_back( 15); indicesGet.push_back( 16); } if ( indicesPut.empty() ) { indicesPut.reserve(fNvars); indicesPut.push_back( 0); indicesPut.push_back( 1); indicesPut.push_back( 2); indicesPut.push_back( 3); indicesPut.push_back( 4); indicesPut.push_back( 5); indicesPut.push_back( 6); indicesPut.push_back( 7); indicesPut.push_back( 8); indicesPut.push_back( 9); indicesPut.push_back( 10); indicesPut.push_back( 11); indicesPut.push_back( 12); indicesPut.push_back( 13); indicesPut.push_back( 14); indicesPut.push_back( 15); indicesPut.push_back( 16); } static std::vector dv; dv.resize(nVar); for (int ivar=0; ivar& iv, int sigOrBgd ) const { Transform_1( iv, sigOrBgd ); }