FEDRA emulsion software from the OPERA Collaboration
merge_Energy_Statistic_And_SytematicSources_Electron.C File Reference
#include <iomanip.h>
Include dependency graph for merge_Energy_Statistic_And_SytematicSources_Electron.C:

Functions

void merge_Energy_Statistic_And_SytematicSources_Electron ()
 

Function Documentation

◆ merge_Energy_Statistic_And_SytematicSources_Electron()

void merge_Energy_Statistic_And_SytematicSources_Electron ( )

ATTENTION: THE READION INPUT FILES MAY NOOOOOT CONTAIN NUMBERS WITHOUD DIGITS FOR THE VALUES: for example 2 -> has to be 2.0 !!!





The this output goes into: libShower_Energy_STATandSYS_Electron.txt

3 {
4 
5 
8 
9 // Bool_t LINEARERRORADDION=kTRUE;
10  Bool_t LINEARERRORADDION=kFALSE;
11 
12  Int_t plate;
13  Int_t dummy;
14  Int_t plateArray[13]={10,12,14,16,18,20,23,26,29,32,35,40,45};
15  Float_t dummyf;
16  Int_t plate_i;
17  Float_t sigmasysoutput;
18  Float_t sigmasysinput[12][13];
19  Float_t sigmasysoutput_tot[12][13];
20 
21  for (int i=0;i<13;i++) {
22  for (int j=0;j<12;j++) {
23  sigmasysoutput_tot[j][i]=0;
24  }
25  }
26 
27 // libShower_Energy_Statistics_Electron.txt
28 // libShower_Energy_Systematics_Electron.txt
29 
30 // libShower_Energy_Statistics_Electron.txt
31 // libShower_Energy_Systematics_Electron.txt
32 
33 
35  const char* name = "libShower_Energy_Statistics_Electron.txt";
36  pFile = fopen (name,"r");
37  for (int i=0;i<13;i++) {
38  plate_i=i;
39  cout << plate_i << "---------------------------------" << endl;
40  fscanf (pFile,"%d",&dummy);
41  for (int j=0;j<12;j++) {
42  fscanf (pFile," %f ", &dummyf); cout << dummyf<< " "; sigmasysinput[j][plate_i]=dummyf;
43  if (!LINEARERRORADDION) sigmasysoutput_tot[j][plate_i]+=dummyf*dummyf;
44  if (LINEARERRORADDION) sigmasysoutput_tot[j][plate_i]+=dummyf;
45  }
46  cout << endl;
47  }
48  fclose (pFile);
50 
52  const char* name = "libShower_Energy_Systematics_Electron.txt";
53  pFile = fopen (name,"r");
54  for (int i=0;i<13;i++) {
55  plate_i=i;
56  cout << plate_i << "---------------------------------" << endl;
57  fscanf (pFile,"%d",&dummy);
58  for (int j=0;j<12;j++) {
59  fscanf (pFile," %f ", &dummyf); cout << dummyf<< " "; sigmasysinput[j][plate_i]=dummyf;
60  if (!LINEARERRORADDION) sigmasysoutput_tot[j][plate_i]+=dummyf*dummyf;
61  if (LINEARERRORADDION) sigmasysoutput_tot[j][plate_i]+=dummyf;
62  }
63  cout << endl;
64  }
65  fclose (pFile);
67 
68 
69 
70  cout << endl << endl;
71 
72  for (int i=0;i<13;i++) {
73  cout << plateArray[i] << " ";
74  for (int j=0;j<12;j++) {
75  if (!LINEARERRORADDION) dummyf=TMath::Sqrt(sigmasysoutput_tot[j][i]);
76  if (LINEARERRORADDION) dummyf=sigmasysoutput_tot[j][i];
78  printf("%2.2f ",sigmasysoutput_tot[j][i]);
79  }
80  cout << endl;
81  }
82 
84 
85 }
Float_t sigmasysoutput_tot[12][13]
Definition: merge_Energy_SytematicSources_Electron.C:13
Int_t dummy
Definition: merge_Energy_SytematicSources_Electron.C:7
Int_t plate
Definition: merge_Energy_SytematicSources_Electron.C:1
Int_t plate_i
Definition: merge_Energy_SytematicSources_Electron.C:10
fclose(pFile)
pFile
Definition: merge_Energy_SytematicSources_Electron.C:25
Int_t plateArray[13]
Definition: merge_Energy_SytematicSources_Electron.C:8
Float_t sigmasysoutput
Definition: merge_Energy_SytematicSources_Electron.C:11
Float_t sigmasysinput[12][13]
Definition: merge_Energy_SytematicSources_Electron.C:12
Float_t dummyf
Definition: merge_Energy_SytematicSources_Electron.C:9
const char * name
Definition: merge_Energy_SytematicSources_Electron.C:24