71 cout <<
"EdbShowAlgID_E_G_Simple::Execute()"<<endl;
73 cout <<
"EdbShowAlgID_E_G_Simple::Execute() eRecoShowerArrayN==0"<<endl;
80 TTree *ANNTree =
new TTree(
"ANNTree",
"ANNTree");
81 ANNTree->SetDirectory(0);
84 ANNTree->Branch(
"inANN", inANN,
"inANN[70]/F");
86 TMultiLayerPerceptron *ANN_MLP;
87 TMultiLayerPerceptron *ANN_MLP_ARRAY[15];
90 int NrOfANNInputNeurons=12;
92 int n_ANN_Neurons_FJ[15];
93 n_ANN_Neurons_FJ[0]=6+10;
94 n_ANN_Neurons_FJ[1]=6+12;
95 n_ANN_Neurons_FJ[2]=6+14;
96 n_ANN_Neurons_FJ[3]=6+16;
97 n_ANN_Neurons_FJ[4]=6+18;
98 n_ANN_Neurons_FJ[5]=6+20;
99 n_ANN_Neurons_FJ[6]=6+23;
100 n_ANN_Neurons_FJ[7]=6+26;
101 n_ANN_Neurons_FJ[8]=6+29;
102 n_ANN_Neurons_FJ[9]=6+32;
103 n_ANN_Neurons_FJ[10]=6+35;
104 n_ANN_Neurons_FJ[11]=6+40;
105 n_ANN_Neurons_FJ[12]=6+45;
106 n_ANN_Neurons_FJ[13]=6+50;
107 n_ANN_Neurons_FJ[14]=6+57;
110 for (
int k=0; k<15; k++) {
112 NrOfANNInputNeurons=n_ANN_Neurons_FJ[k];
113 for (Int_t i=1; i<NrOfANNInputNeurons; ++i) layout +=
"@inANN["+TString(Form(
"%d",i))+
"],";
114 layout +=
"@inANN["+TString(Form(
"%d",NrOfANNInputNeurons))+
"]:"+TString(Form(
"%d",NrOfANNInputNeurons+1))+
":"+TString(Form(
"%d",NrOfANNInputNeurons));
118 ANN_MLP_ARRAY[k] =
new TMultiLayerPerceptron(layout,ANNTree,
"",
"");
119 ANN_MLP=ANN_MLP_ARRAY[k];
121 cout <<
"=== DEBUG === ANN_MLP->GetStructure() : " << ANN_MLP->GetStructure() << endl;
122 TString ANN_LAYOUT=ANN_MLP_ARRAY[k]->GetStructure();
128 for (
int ll=0; ll<15; ll++) ANN_MLP_ARRAY[ll]->
LoadWeights(
"/home/meisel/Software/ANN_MEGA_ID/weigths_ID_E_GAMMA.txt");
129 cout <<
"/home/meisel/Software/ANN_MEGA_ID/weigths_ID_E_GAMMA.txt" << endl;
148 TH1F* hist_E =
new TH1F(
"hist_E",
"hist_E",100,0,10);
161 cout <<
"shower->Npl() " << shower->
Npl() << endl;
162 int check_Npl= shower->
Npl();
163 int check_Npl_index=0;
164 if (check_Npl<=10) check_Npl_index=0;
165 if (check_Npl>=11 && check_Npl<=12) check_Npl_index=1;
166 if (check_Npl>=13 && check_Npl<=14) check_Npl_index=2;
167 if (check_Npl>=15 && check_Npl<=16) check_Npl_index=3;
168 if (check_Npl>=17 && check_Npl<=18) check_Npl_index=4;
169 if (check_Npl>=19 && check_Npl<=20) check_Npl_index=5;
170 if (check_Npl>=21 && check_Npl<=23) check_Npl_index=6;
171 if (check_Npl>=24 && check_Npl<=26) check_Npl_index=7;
172 if (check_Npl>=27 && check_Npl<=29) check_Npl_index=8;
173 if (check_Npl>=30 && check_Npl<=32) check_Npl_index=9;
174 if (check_Npl>=33 && check_Npl<=35) check_Npl_index=10;
175 cout <<
"check_Npl_index " << check_Npl_index << endl;
188 if (check_Npl>20) check_Npl_index=9;
189 if (check_Npl<=20) check_Npl_index=5;
190 if (check_Npl<=10) check_Npl_index=0;
195 cout <<
" =========================== check_Npl_index= " << check_Npl_index <<
" ; !!! ======================="<<endl;
197 NrOfANNInputNeurons=n_ANN_Neurons_FJ[check_Npl_index];
198 ANN_MLP=ANN_MLP_ARRAY[check_Npl_index];
199 cout <<
"Using the following layout: " << ANN_MLP->GetStructure() << endl;
206 inANN[2]=eShowAlgE_Para_FJ.
nseg;
211 for (
int ii=0; ii<57; ii++) {
212 cout << setw(3) << eShowAlgE_Para_FJ.
longprofile[ii];
221 Double_t EnergyCalibration_Offset=0.8;
222 Double_t EnergyCalibration_Slope=0.94;
225 EnergyCalibration_Offset=0.0;
226 EnergyCalibration_Slope=1.0;
229 for (Int_t j=1; j<=NrOfANNInputNeurons; ++j) {
231 cout <<
"=== DEBUG === : j params[j-1]=inANN[j] " << j<<
" " <<
params[j-1] << endl;
233 val=(ANN_MLP->Evaluate(0,
params));
234 cout <<
"DEBUG: i, val (=mlp1->Evaluate(0,params)) ======================= real energy " << i <<
" " << val <<
" == " << inANN[0] << endl;
236 if ( ::isnan(val) ) cout <<
" val is NAN " << endl;
239 val=(val-EnergyCalibration_Offset)/EnergyCalibration_Slope;
240 cout <<
"---- With Correctiono factor val=(val-EnergyCalibration_Offset)/EnergyCalibration_Slope: " << EnergyCalibration_Offset <<
" " << EnergyCalibration_Slope <<
" " << val<< endl;
245 Double_t sigma=0.83*TMath::Sqrt(val)-0.45;
247 cout <<
"Estimated Energy = " << val <<
" +- " << sigma <<
"..." << endl;
Int_t eParaName
Definition: EdbShowAlgID_E_G_Simple.h:39
Definition: EdbShowerP.h:28
void Print()
-— EXPERIMENTAL STATUS —
Definition: EdbShowerP.cxx:2333
Int_t Npl() const
Definition: EdbShowerP.h:409
void BuildParametrisation_FJ()
Definition: EdbShowerP.cxx:1235
void PrintParametrisation_FJ()
Definition: EdbShowerP.cxx:2392
Para_FJ GetPara_FJ() const
Definition: EdbShowerP.h:551
Definition: EdbShowerP.h:143
Float_t BT_deltaT_rms
Definition: EdbShowerP.h:150
Int_t nseg
Definition: EdbShowerP.h:146
Float_t BT_deltaR_rms
Definition: EdbShowerP.h:148
Float_t BT_deltaR_mean
Definition: EdbShowerP.h:147
Int_t longprofile[57]
Definition: EdbShowerP.h:151
Float_t ShowerAxisAngle
Definition: EdbShowerP.h:145
Float_t BT_deltaT_mean
Definition: EdbShowerP.h:149
mlp LoadWeights("testweights.txt")
Double_t params[3]
Definition: testBGReduction_By_ANN.C:84