]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/EveBase/AliEveCosmicRayFitter.h
Update master to aliroot
[u/mrichter/AliRoot.git] / EVE / EveBase / AliEveCosmicRayFitter.h
CommitLineData
e7aa1ed8 1// $Id$
2// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4/**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
9
10#ifndef ALIEVE_CosmicRayFitter_H
11#define ALIEVE_CosmicRayFitter_H
12
13#include <TEvePointSet.h>
14#include <map>
15
63845220 16class TEveTrackList;
17
e7aa1ed8 18class TGraphErrors;
19class TGraph;
20class TGraph2DErrors;
21class TGraph2D;
22class TLinearFitter;
e7aa1ed8 23
3dc80ba2 24
e7aa1ed8 25class AliEveCosmicRayFitter : public TEvePointSet
26{
4b456ebb 27public:
28 AliEveCosmicRayFitter(const Text_t* name = "CosmicRayFitter", Int_t n_points=0);
29 virtual ~AliEveCosmicRayFitter();
63845220 30
3dc80ba2 31 void AddFitPoint(Int_t); // slot for PointSelected() signal
e7aa1ed8 32
4b456ebb 33 virtual void Start();
34 virtual void Stop();
35 virtual void FitTrack();
63845220 36 virtual void Reset(Int_t n_points=0, Int_t n_int_ids=0);
e7aa1ed8 37
63845220 38 Bool_t GetConnected() { return fConnected; }
3dc80ba2 39
63845220 40 void DrawDebugGraph();
3dc80ba2 41
63845220 42 virtual void DestroyElements(); // *MENU*
43 static Double_t Distance3D(Double_t x, Double_t y, Double_t z, Double_t *p);
44 static void SumDistance3D(Int_t &, Double_t *, Double_t & sum, Double_t * par, Int_t );
3dc80ba2 45
46private:
47 AliEveCosmicRayFitter(const AliEveCosmicRayFitter&); // Not implemented
48 AliEveCosmicRayFitter& operator=(const AliEveCosmicRayFitter&); // Not implemented
49
4b456ebb 50protected:
e7aa1ed8 51 struct Point_t
52 {
53 // inner structure to check duplicates
54 TEvePointSet *fPS; // selected pointset
55 Int_t fIdx; // location in the point set array
56
63845220 57 Point_t(TEvePointSet* ps=0, Int_t i=0): fPS(ps), fIdx(i){}
e7aa1ed8 58 Point_t(const Point_t& p) : fPS(p.fPS), fIdx(p.fIdx) {}
59
60 Point_t& operator=(const Point_t& p) {
61 fPS = p.fPS; fIdx = p.fIdx; return *this;
62 }
63
64 bool operator<(const Point_t& o) const {
65 if (fPS != o.fPS) return fPS < o.fPS;
66 return fIdx < o.fIdx;
67 }
68 };
69
4b456ebb 70 typedef std::map<Point_t, Int_t> PointMap_t; // Map of registered points.
e7aa1ed8 71
3dc80ba2 72 TLinearFitter* fLineFitter1; // 2D straight line fitter
73 TLinearFitter* fLineFitter2; // 2D straight line fitter
e7aa1ed8 74
3dc80ba2 75 Bool_t fConnected; // object connected to pointset Ctrl-shift signal
e7aa1ed8 76
63845220 77 PointMap_t fSPMap; // map of selected points from different PointSet
e7aa1ed8 78
63845220 79 TEveTrackList* fTrackList; // list of tracks removed in the destructor
3dc80ba2 80
81 TGraph *fGraphPicked1; // graph of selected points debug info
82 TGraphErrors *fGraphLinear1; // graph of fitted points for debug info
83 TGraph *fGraphPicked2; // graph of selected points debug info
84 TGraphErrors *fGraphLinear2; // graph of fitted points for debug info
e7aa1ed8 85
86 ClassDef(AliEveCosmicRayFitter, 0); // Interface to TEvePointSet allowing 3D straight linear fit.
4b456ebb 87};
e7aa1ed8 88
89#endif