1f26c323 |
1 | #ifndef AliITSneuralTracker_h |
2 | #define AliITSneuralTracker_h |
3 | |
4 | class TObjArray; |
5 | class AliITSneuron; |
6 | class AliITSneuralTrack; |
7 | class AliITSglobalRecPoint; |
8 | |
9 | /////////////////////////////////////////////////////////////////////// |
10 | // |
11 | // AliITSneuralTracker: |
12 | // |
13 | // neural network MFT algorithm |
14 | // for track finding in ITS stand alone |
15 | // according to the Denby-Peterson model with adaptments to the |
16 | // ALICE multiplicity |
17 | // |
18 | /////////////////////////////////////////////////////////////////////// |
19 | |
20 | class AliITSneuralTracker : public TObject { |
21 | |
22 | public: |
23 | |
24 | // constructors & destructor |
25 | AliITSneuralTracker(); |
26 | AliITSneuralTracker(Int_t nsecs, Int_t nc, Double_t *c, Double_t theta); |
27 | virtual ~AliITSneuralTracker(); |
28 | |
29 | // file reading and points array population |
30 | Int_t ReadFile(const Text_t *fname, Int_t evnum); |
31 | |
32 | // setters for working parameters (NOT cuts) |
33 | void SetDiff(Double_t a) {fDiff=a;} // helix adaptment parameter |
34 | void SetExponent(Double_t a) {fExp = a;} // exponent which selects the high excitory values |
35 | void SetGainToCostRatio(Double_t a) {fRatio = a;} // ratio between the gain and cost contributions |
36 | void SetTemperature(Double_t a) {fTemp = a;} // temperature parameter in activation function |
37 | void SetVariationLimit(Double_t a) {fVar = a;} // stability threshold |
38 | void SetInitLimits(Double_t a, Double_t b) // intervals for initial random activations |
39 | {fMin = (a<=b) ? a : b; fMax = (a<=b)? b : a;} |
40 | void SetVertex(Double_t x, Double_t y, Double_t z) // estimated vertex position |
41 | { fVPos[0] = x; fVPos[1] = y; fVPos[2] = z;} |
42 | |
43 | // neuron managin methods |
44 | Bool_t SetEdge(AliITSneuron *n, AliITSglobalRecPoint *p, const char what); // sets the neuron's edges |
45 | Bool_t CalcParams(AliITSneuron *n); // calculation of helix parameters for the neuron |
46 | |
47 | // neural tracking (the argument is the ROOT file to store results) |
48 | void Go(const char* filesave, Bool_t flag = kFALSE); |
49 | |
50 | private: |
51 | |
52 | // These methods are private to prevent the users to use them in incorrect sequences |
53 | |
54 | // neuron management methods (not to be used publically) |
55 | Bool_t ResetNeuron(AliITSneuron *n); // resets all neuron's fields like in the constructor |
56 | Int_t CountExits (AliITSneuron *n); // counter for # of neurons going into n's tail |
57 | Int_t CountEnters(AliITSneuron *n); // counter for # of neurons startins from n's head |
58 | Double_t Angle(AliITSneuron *n, AliITSneuron *m); // angle between two neural segments |
59 | Double_t Weight(AliITSneuron *n, AliITSneuron *m); // synaptic weight between two neural segments |
60 | |
61 | // neural network work-flow |
62 | Int_t Initialize(Int_t snum, Int_t cnum, Bool_t flag = kFALSE); |
63 | // resets (or creates) neurons array for a new neural tracking |
64 | Bool_t Update(); // updates the neurons and checks if stabilization has occurred |
65 | Int_t Save(); // saves the found tracks after stabilization |
66 | void DoSector(Int_t sect, Bool_t flag); // complete work on a single sector |
67 | |
68 | Int_t fCurvNum; // # of curvature cut steps |
69 | Double_t *fCurvCut; //! value of all curvature cuts |
70 | |
71 | Int_t fSectorNum; // no. of azymuthal sectors |
72 | Double_t fSectorWidth; // width of an azymuthal sector |
73 | |
74 | Double_t fVPos[3]; // estimated vertex coords |
75 | |
76 | Double_t fMin; // min initial random activations |
77 | Double_t fMax; // max initial random activations |
78 | Double_t fThetaCut; // polar angle cut |
79 | Int_t fThetaNum; // size of theta sectionement |
80 | Double_t fTemp; // logistic function parameter |
81 | Double_t fVar; // stability threshold (for mean rel. activations) |
82 | Double_t fRatio; // ratio between inhibitory and excitory contributions |
83 | Double_t fExp; // alignment weight |
84 | Double_t fDiff; // max allowed difference between TanL exstimations from the two neuron edges |
85 | |
86 | TObjArray ***fPoints[6]; //! Collection of recpoints (sectioned in azym. secs) |
87 | TObjArray *fNeurons[6]; //! Collection of neurons |
88 | TObjArray *fTracks; //! Collection of tracks |
89 | |
90 | ClassDef(AliITSneuralTracker, 1) |
91 | }; |
92 | |
93 | |
94 | //////////////////////////////////////////////////////////////////////////////// |
95 | |
96 | |
97 | class AliITSneuron : public TObject { |
98 | |
99 | friend class AliITSneuralTracker; |
100 | |
101 | public: |
102 | |
103 | AliITSneuron(); |
104 | virtual ~AliITSneuron(); |
105 | |
106 | Bool_t ContainsID(Int_t ID) |
107 | { return (fInner->HasID(ID) && fOuter->HasID(ID)); } |
108 | |
109 | private: |
110 | |
111 | Double_t fActivation; // Activation value |
112 | |
113 | Double_t fCurv; // curvature [= 1 / R] |
114 | Double_t fCX; // curvature centre (X) in changed RF |
115 | Double_t fCY; // curvature centre (X) in changed RF |
116 | Double_t fTanL; // tan(dip angle) = C / freq |
117 | Double_t fPhase; // 'phase' parameter |
118 | Double_t fDiff; // difference between tan(lambda) estimated by the two different points |
119 | Double_t fLength; // segment length |
120 | |
121 | AliITSneuron *fNext; // best outgoing unit |
122 | AliITSneuron *fPrev; // best incoming unit |
123 | |
124 | AliITSglobalRecPoint *fInner; // inner point |
125 | AliITSglobalRecPoint *fOuter; // outer point |
126 | }; |
127 | |
128 | |
129 | #endif |