]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSNeuralTracker.h
Bug fix - the dep energy should be divided by the MIP energy to form the counts
[u/mrichter/AliRoot.git] / ITS / AliITSNeuralTracker.h
index 1d5aa969b321109718b7a2b1938194d267c5479a..1ea82428b18d88d6948c8ce5a08eab3f4a5440b8 100644 (file)
@@ -1,9 +1,3 @@
-#ifndef ALIITSNNEURALTRACKER_H
-#define ALIITSNNEURALTRACKER_H
-
-class TObjArray;
-class TCanvas;
-
 ///////////////////////////////////////////////////////////////////////
 //
 // AliITSneuralTracker:
@@ -15,11 +9,21 @@ class TCanvas;
 //
 ///////////////////////////////////////////////////////////////////////
 
+#ifndef ALIITSNEURALTRACKER_H
+#define ALIITSNEURALTRACKER_H
+
+class TObjArray;
+class TCanvas;
+
+#include <TTree.h>
+
+#include "AliITSNeuralPoint.h"
+
 class AliITSNeuralTracker : public TObject {
 
 public:
 
-                AliITSNeuralTracker();
+       AliITSNeuralTracker();
        virtual ~AliITSNeuralTracker();
 
        // ******************************************************************************
@@ -30,35 +34,36 @@ public:
        // ******************************************************************************
        class AliITSNode : public AliITSNeuralPoint {
        public:
-               AliITSNode() 
-                       {fInnerOf = fOuterOf = fMatches = 0; fNext = fPrev = 0;}
-                       
-               AliITSNode(AliITSNeuralPoint *p, Bool_t init = kTRUE) // declared inline
-                       : AliITSNeuralPoint(p)
-                       {
-                               fInnerOf = fOuterOf = fMatches = 0;
-                               fNext = fPrev = 0;
-                               if (init) {
-                                       fInnerOf = new TObjArray;
-                                       fOuterOf = new TObjArray;
-                                       fMatches = new TObjArray;
-                               }
-                       }
-                       
+               AliITSNode():fPosInTree(0),fInnerOf(0),fOuterOf(0),fMatches(0),fNext(0),fPrev(0){}
+               
+               AliITSNode(AliITSNeuralPoint *p, Bool_t init = kTRUE): AliITSNeuralPoint(p),fPosInTree(0),fInnerOf(0),fOuterOf(0),fMatches(0),fNext(0),fPrev(0) {
+                       if (init) { fInnerOf = new TObjArray; fOuterOf = new TObjArray; fMatches = new TObjArray;}}
                AliITSNode(AliITSRecPoint *p, AliITSgeomMatrix *gm)
-                       : AliITSNeuralPoint(p,gm) 
-                       {fInnerOf = fOuterOf = fMatches = 0; fNext = fPrev = 0;}
+                       : AliITSNeuralPoint(p,gm),fPosInTree(0),fInnerOf(0),fOuterOf(0),fMatches(0),fNext(0),fPrev(0) {}
 
                virtual  ~AliITSNode() 
                        {fInnerOf = fOuterOf = fMatches = 0; fNext = fPrev = 0;}
-
+                       
+       
+               
                Double_t  ThetaDeg()                    {return GetTheta()*180.0/TMath::Pi();}
 
-               Int_t     GetSector(Double_t sec_width) {return (Int_t)(GetPhi()/sec_width);}
+               Int_t     GetSector(Double_t secwidth) const {return (Int_t)(GetPhi()/secwidth);}
                Int_t     GetThetaCell()                {return (Int_t)(ThetaDeg());}
                
-               Int_t        fPosInTree;
-
+               Int_t&     PosInTree() {return fPosInTree;}
+               
+               TObjArray*&  InnerOf() {return fInnerOf;}
+               TObjArray*&  OuterOf() {return fOuterOf;}
+               TObjArray*&  Matches() {return fMatches;}
+               
+               AliITSNode*& Next() {return fNext;}
+               AliITSNode*& Prev() {return fPrev;}
+               
+       private:
+               AliITSNode(const AliITSNode &t);
+               AliITSNode& operator=(const AliITSNode& t);
+               Int_t        fPosInTree;  // position in tree of converted points
                TObjArray   *fInnerOf; //!
                TObjArray   *fOuterOf; //! 
                TObjArray   *fMatches; //!
@@ -79,11 +84,25 @@ public:
        // ******************************************************************************
        class AliITSneuron : public TObject {
        public:
-                           AliITSneuron():fUsed(0),fActivation(0.),fInner(0),fOuter(0),fGain(0) { }
+               AliITSneuron():fUsed(0),fActivation(0.),fInner(0),fOuter(0),fGain(0) { }
+               
                virtual    ~AliITSneuron() {fInner=fOuter=0;fGain=0;}
+               
+               
 
                Double_t    Weight(AliITSneuron *n);
-               void        Add2Gain(AliITSneuron *n, Double_t mult_const, Double_t exponent);
+               void        Add2Gain(AliITSneuron *n, Double_t multconst, Double_t exponent);
+               
+               Int_t&       Used() {return fUsed;}
+               Double_t&    Activation() {return fActivation;}
+               AliITSNode*& Inner() {return fInner;}
+               AliITSNode*& Outer() {return fOuter;}
+               TObjArray*&  Gain()  {return fGain;}
+               
+       private:
+
+               AliITSneuron(const AliITSneuron &t); 
+               AliITSneuron& operator=(const AliITSneuron& t);
 
                Int_t             fUsed;        //  utility flag
                Double_t          fActivation;  //  Activation value
@@ -104,8 +123,18 @@ public:
        // ******************************************************************************
        class AliITSlink : public TObject {
        public:
-                        AliITSlink() : fWeight(0.), fLinked(0) { }
+               AliITSlink() : fWeight(0.), fLinked(0) { }
+               
                virtual ~AliITSlink()   {fLinked = 0;}
+                               
+               
+               Double_t& Weight() {return fWeight;}
+               AliITSneuron*& Linked() {return fLinked;}
+               
+       private:
+               
+               AliITSlink(const AliITSlink &t);
+               AliITSlink& operator=(const AliITSlink& t);
 
                Double_t      fWeight;  //  Weight value
                AliITSneuron *fLinked;  //! the connected neuron
@@ -134,30 +163,33 @@ public:
        // Points array arrangement & control
 
        void     CreateArrayStructure(Int_t nsecs);
-       Int_t    ArrangePoints(TTree *pts_tree);
+       Int_t    ArrangePoints(TTree *ptstree);
        void     StoreAbsoluteMatches();
-       Bool_t   PassCurvCut(AliITSNode *p1, AliITSNode *p2, Int_t curv_idx, Double_t vx, Double_t vy, Double_t vz);
-       Int_t    PassAllCuts(AliITSNode *p1, AliITSNode *p2, Int_t curv_idx, Double_t vx, Double_t vy, Double_t vz);
+       Bool_t   PassCurvCut(AliITSNode *p1, AliITSNode *p2, Int_t curvidx, Double_t vx, Double_t vy, Double_t vz);
+       Int_t    PassAllCuts(AliITSNode *p1, AliITSNode *p2, Int_t curvidx, Double_t vx, Double_t vy, Double_t vz);
        void     PrintPoints();
        void     PrintMatches(Bool_t stop = kTRUE);
 
        // Neural tracker work-flow
 
        void     NeuralTracking(const char* filesave, TCanvas*& display);
-       void     Display(TCanvas*& canvas);
+       void     Display(TCanvas*& canvas) const;
        void     ResetNodes(Int_t isector);
        Int_t    CreateNeurons(Int_t sector, Int_t curv);  // create neurons
-       Int_t    LinkNeurons();                // create neural connections
+       Int_t    LinkNeurons() const;          // create neural connections
        Double_t Activate(AliITSneuron* &n);   // calculates the new neural activation
        Bool_t   Update();                     // an updating cycle
        void     CleanNetwork();               // removes deactivated units and resolves competitions
-       Int_t    Save(Int_t sector_idx);       // save found tracks for # sector
-       TTree*   GetChains()                   {return fChains;}
+       Int_t    Save(Int_t sectoridx);        // save found tracks for # sector
+       TTree*   GetChains() const             {return fChains;}
        void     WriteChains()                 {fChains->Write();}
 
 private:
 
-       Bool_t       CheckOccupation(); 
+       AliITSNeuralTracker(const AliITSNeuralTracker &n);
+       AliITSNeuralTracker& operator=(const AliITSNeuralTracker& t);
+
+       Bool_t       CheckOccupation() const; 
 
        Int_t        fSectorNum;            //  number of azymuthal sectors
        Double_t     fSectorWidth;          //  width of an azymuthal sector (in RADIANS) [used internally]