47 : fMaxNofTrainSamples(1500)
49 , fNofWrongLikeCorrect(0)
50 , fNofCorrectLikeWrong(0)
64 , fhAnnOutput_correct(nullptr)
65 , fhAnnOutput_wrong(nullptr)
66 , fhCumProb_correct(nullptr)
67 , fhCumProb_wrong(nullptr)
76 double PlaneAngle_last,
double ZPos, TVector3 Momentum1, TVector3 Momentum2)
79 TMath::Sqrt(Momentum1.X() * Momentum1.X() + Momentum1.Y() * Momentum1.Y() + Momentum1.Z() * Momentum1.Z());
81 TMath::Sqrt(Momentum2.X() * Momentum2.X() + Momentum2.Y() * Momentum2.Y() + Momentum2.Z() * Momentum2.Z());
100 if (
IM_correct.size() % 100 == 0 && IdForANN == 1)
126 TTree* simu =
new TTree(
"MonteCarlo",
"MontecarloData");
130 simu->Branch(
"x0", &
x[0],
"x0/D");
131 simu->Branch(
"x1", &
x[1],
"x1/D");
132 simu->Branch(
"x2", &
x[2],
"x2/D");
133 simu->Branch(
"x3", &
x[3],
"x3/D");
134 simu->Branch(
"x4", &
x[4],
"x4/D");
135 simu->Branch(
"x5", &
x[5],
"x5/D");
136 simu->Branch(
"xOut", &xOut,
"xOut/D");
138 for (
size_t i = 0; i <
IM_correct.size(); i++) {
146 if (
x[0] > 1.0)
x[0] = 1.0;
147 if (
x[1] > 1.0)
x[1] = 1.0;
148 if (
x[2] > 1.0)
x[2] = 1.0;
149 if (
x[3] > 1.0)
x[3] = 1.0;
150 if (
x[4] > 1.0)
x[4] = 1.0;
151 if (
x[5] > 1.0)
x[5] = 1.0;
157 for (
size_t i = 0; i <
IM_wrong.size(); i++) {
165 if (
x[0] > 1.0)
x[0] = 1.0;
166 if (
x[1] > 1.0)
x[1] = 1.0;
167 if (
x[2] > 1.0)
x[2] = 1.0;
168 if (
x[3] > 1.0)
x[3] = 1.0;
169 if (
x[4] > 1.0)
x[4] = 1.0;
170 if (
x[5] > 1.0)
x[5] = 1.0;
177 TMultiLayerPerceptron network(
"x0,x1,x2,x3,x4,x5:12:xOut", simu,
"Entry$+1");
178 network.Train(300,
"text,update=10");
179 network.DumpWeights(
"../../../analysis/conversion2/KresAnalysis_ann_photons_weights.txt");
186 for (
size_t i = 0; i <
IM_correct.size(); i++) {
194 if (params[0] > 1.0) params[0] = 1.0;
195 if (params[1] > 1.0) params[1] = 1.0;
196 if (params[2] > 1.0) params[2] = 1.0;
197 if (params[3] > 1.0) params[3] = 1.0;
198 if (params[4] > 1.0) params[4] = 1.0;
199 if (params[5] > 1.0) params[5] = 1.0;
201 Double_t netEval = network.Evaluate(0, params);
205 for (
size_t i = 0; i <
IM_wrong.size(); i++) {
213 if (params[0] > 1.0) params[0] = 1.0;
214 if (params[1] > 1.0) params[1] = 1.0;
215 if (params[2] > 1.0) params[2] = 1.0;
216 if (params[3] > 1.0) params[3] = 1.0;
217 if (params[4] > 1.0) params[4] = 1.0;
218 if (params[5] > 1.0) params[5] = 1.0;
220 Double_t netEval = network.Evaluate(0, params);
void Exec(int event, int IdForANN, double InvariantMass, double OpeningAngle, double PlaneAngle_last, double ZPos, TVector3 Momentum1, TVector3 Momentum2)