KaliVeda
Toolkit for HIC analysis
KVIDGridManager.h
1 /***************************************************************************
2  KVIDGridManager.h - description
3  -------------------
4  begin : Jan 27 2005
5  copyright : (C) 2005 by J.D. Frankland
6  email : frankland@ganil.fr
7 
8 $Id: KVIDGridManager.h,v 1.11 2009/03/03 14:27:15 franklan Exp $
9 ***************************************************************************/
10 
11 #ifndef KVIDGridManager_H
12 #define KVIDGridManager_H
13 
14 #include "KVSeqCollection.h"
15 #include "KVIDGraph.h"
16 #include "RQ_OBJECT.h"
17 
29 class KVIDGridManager: public KVBase {
30 
31  RQ_OBJECT("KVIDGridManager")
32 
33  friend class KVIDGraph;
34 
35 private:
36 
39 
40 protected:
41 
42  void AddGrid(KVIDGraph*);
43 
44 public:
45 
46  KVIDGridManager(Bool_t owns_grids = kFALSE);
47  virtual ~ KVIDGridManager();
48 
49  void DeleteGrid(KVIDGraph*, Bool_t update = kTRUE);
50  KVIDGraph* GetGrid(const Char_t* name);
51 
53  {
54  return &fGrids;
55  }
56 
57  void SortGrids()
58  {
59  dynamic_cast<TList*>(fGrids.GetCollection())->Sort();
60  }
61 
62  void Clear(Option_t* opt = "") override;
63  Bool_t ReadAsciiFile(const Char_t* filename);
64  const TList* GetLastReadGrids() const
65  {
67  return &fLastReadGrids;
68  }
69  void AddLastReadGrids();
70 
71  Int_t WriteAsciiFile(const Char_t* filename, const TCollection* selection = 0);
72 
73  void Print(Option_t* /*opt*/ = "") const override
74  {
75  ls();
76  };
77  void ls(Option_t* /*opt*/ = "") const override
78  {
79  fGrids.ls();
80  }
81 
82  void StartViewer() const;
83 
84  void Modified()
85  {
86  Emit("Modified()");
87  }; // *SIGNAL*
88 
90  {
95 
96  return fGrids.GetSubListWithMethod(label, "GetIDTelescopeLabel");
97  };
99  void Initialize(Option_t* /*opt*/ = "");
100 
101  virtual bool IsSQLROOT() const
102  {
103  return false;
104  }
105  virtual void LoadGridsForRun(UInt_t) {}
106 
107  ClassDefOverride(KVIDGridManager, 0) //Handles a collection of identification grids
108 };
109 
111 R__EXTERN KVIDGridManager* gIDGridManager;
112 
113 #endif
int Int_t
unsigned int UInt_t
#define R__EXTERN
#define RQ_OBJECT(sender_class)
bool Bool_t
char Char_t
const char Option_t
#define ClassDefOverride(name, id)
Base class for KaliVeda framework.
Definition: KVBase.h:139
Base class for particle identification in a 2D map.
Definition: KVIDGraph.h:32
Handles a stock of identification grids to be used by one or more identification telescopes.
void Print(Option_t *="") const override
void Clear(Option_t *opt="") override
Delete all grids and empty list, ready to start anew.
void GetListOfIDTelescopeLabels(KVString &)
void DeleteGrid(KVIDGraph *, Bool_t update=kTRUE)
KVSeqCollection fGrids
collection of all ID graphs handled by manager
Int_t WriteAsciiFile(const Char_t *filename, const TCollection *selection=0)
virtual void LoadGridsForRun(UInt_t)
KVSeqCollection * GetGridsForIDTelescope(const Char_t *label)
KVSeqCollection * GetGrids()
void AddLastReadGrids()
Add all grids read the last time ReadAsciiFile() was called to the grid manager.
Bool_t ReadAsciiFile(const Char_t *filename)
void StartViewer() const
Opens GUI for managing grids.
const TList * GetLastReadGrids() const
TList fLastReadGrids
list of grids created by last call to ReadAsciiFile
KVIDGraph * GetGrid(const Char_t *name)
Return pointer to grid with name "name".
virtual bool IsSQLROOT() const
void ls(Option_t *="") const override
void Initialize(Option_t *="")
void AddGrid(KVIDGraph *)
Add a grid to the collection.
KaliVeda extensions to ROOT collection classes.
KVSeqCollection * GetSubListWithMethod(const Char_t *retvalue, const Char_t *method) const
TSeqCollection * GetCollection() const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:73
void ls(Option_t *option="") const override
RVec< T > Sort(const RVec< T > &v)