2 // 1. number of azymuthal sectors (it's better not to go under 8 or over 40)
3 // 2. the ROOT file to read (WITHOUT exstension)
5 // 4. if specified a string, a fstream named like the argument is opened and
6 // the elapsed CPU time is stored (not useful)
8 // the macro will save a file named, for example "galice_<nsecs>.root"
9 // containing may AliITSneuralTrack objects
11 void AliITSNeuralRecognition
13 const char* rfile = "its_recpoints_v1.root")
16 Double_t CONVERT = TMath::Pi() / 180.0;
17 //cout << "Reading file " << rfile << " and saving in " << wfile << endl;
19 // ==================================
20 // ==== VERTEX READING ==============
21 // ==================================
23 // If a "its_vertex.txt" file is provided,
24 // the vertex position is read from it.
25 fstream f_vert("its_vertex.txt", ios::in);
26 Double_t Vx, Vy, Vz, dummy;
27 f_vert >> dummy >> Vx >> Vy >> Vz;
28 if (fabs(Vx) < 0.05) Vx = 0.0;
29 if (fabs(Vy) < 0.05) Vy = 0.0;
30 cout << "Vertex position (x, y, z): " << Vx << ' ' << Vy << ' ' << Vz << endl;
33 // ==================================
34 // ==== CURVATURE CUT DEFINITION ====
35 // ==================================
37 // These values define the curvature cuts for all steps
39 // For a greater clarity, the cuts are indicated in units
40 // of transverse momentum (GeV/c) but these value have no
41 // exact physical meaning, but are useful to understand
42 // well what means a choice in the value of a certain
43 // curvature constraint
44 // NOTE: be careful to make sure that the 'ncuts' variable
45 // have the same value of the dimension of the allocated arrays
52 cut = new Double_t[6];
53 cut[ 0] = 2.0 * 0.0003;
54 cut[ 1] = 2.0 * 0.0006;
55 cut[ 2] = 2.0 * 0.0009;
56 cut[ 3] = 2.0 * 0.0010;
57 cut[ 4] = 2.0 * 0.0012;
58 cut[ 5] = 2.0 * 0.0015;
61 // ==========================
62 // ==== OTHER PARAMETERS ====
63 // ==========================
65 Double_t helix_min[5] = { 0.000, 0.000, 0.000, 0.00, 0.0 };
66 Double_t helix_max[5] = { 0.0215, 0.0215, 0.0206, 0.75, 0.1 };
68 Double_t theta2D_min[5] = { 0.0, 0.0, 0.0, 0.0, 0.0 };
69 Double_t theta2D_max[5] = { 1.0, 0.7, 0.8, 3.0, 30.0 };
71 Double_t theta3D_min[5] = { 0.0, 0.0, 0.0, 0.0, 0.0 };
72 Double_t theta3D_max[5] = { 1.2, 1.2, 2.0, 5.0, 5.0 };
74 Double_t temp = 1.0; // temperature parameter
75 Double_t var = 0.00001; // stabilization threshold
77 Double_t exp = 20.0; // straight-line excitator
78 Double_t gtoc = 6.0; // gain/cost contribution ratio
80 Double_t min = 0.4; // minimum in random activation initialization
81 Double_t max = 0.6; // maximum in random activation initialization
82 Double_t actmin = 0.55; // activation threshold for binary map conversion
85 // =========================
86 // ==== NEURAL TRACKING ====
87 // =========================
89 AliITSNeuralTracker *ANN = new AliITSNeuralTracker();
91 ANN->SetVertex(Vx, Vy, Vz);
93 ANN->SetCurvatureCuts(ncuts, cut);
94 ANN->SetTemperature(temp);
95 ANN->SetVariationLimit(var);
96 ANN->SetGainToCostRatio(gtoc);
97 ANN->SetWeightExponent(exp);
98 ANN->SetInitInterval(min, max);
99 ANN->SetActThreshold(actmin);
101 ANN->SetPolarInterval(45.0);
102 ANN->SetThetaCuts2D(theta2D_min, theta2D_max);
103 ANN->SetThetaCuts3D(theta3D_min, theta3D_max);
104 ANN->SetHelixMatchCuts(helix_min, helix_max);
106 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(rfile);
107 if (!file) file = new TFile("its_recpoints_v1.root");
109 points = (TTree*)file->Get("TreeP");
111 cerr << "No points found!!!" << endl;
115 cout << "Storing points..." << endl;
116 ANN->CreateArrayStructure(nsecs);
117 if (!ANN->ArrangePoints(points)) {
118 cout << "Problems occurred while storing points. Aborted" << endl;
124 cout << "Matching points..." << endl;
125 ANN->StoreAbsoluteMatches();
126 //ANN->PrintMatches(0);
128 TCanvas *c = 0;//new TCanvas("c", "c", 0, 0, 500, 500);
129 //c->Range(-50, -50, 50, 50);
132 ANN->NeuralTracking("its_chains.root", c);