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 
37  KVSeqCollection fGrids;
38  TList fLastReadGrids;
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) const;
51 
52  const KVSeqCollection* GetGrids() const
53  {
54  return &fGrids;
55  }
57  {
58  return &fGrids;
59  }
60 
61  void SortGrids()
62  {
63  dynamic_cast<TList*>(fGrids.GetCollection())->Sort();
64  }
65 
66  void Clear(Option_t* opt = "") override;
67  Bool_t ReadAsciiFile(const Char_t* filename);
68  const TList* GetLastReadGrids() const
69  {
71  return &fLastReadGrids;
72  }
73  void AddLastReadGrids();
74 
75  Int_t WriteAsciiFile(const Char_t* filename, const TCollection* selection = 0);
76 
77  void Print(Option_t* /*opt*/ = "") const override
78  {
79  ls();
80  };
81  void ls(Option_t* /*opt*/ = "") const override
82  {
83  fGrids.ls();
84  }
85 
86  void StartViewer() const;
87 
88  void Modified()
89  {
90  Emit("Modified()");
91  }; // *SIGNAL*
92 
94  {
99 
100  return fGrids.GetSubListWithMethod(label, "GetIDTelescopeLabel");
101  };
103  void Initialize(Option_t* /*opt*/ = "");
104 
105  virtual bool IsSQLROOT() const
106  {
107  return false;
108  }
109  virtual void LoadGridsForRun(UInt_t) {}
110 
111  ClassDefOverride(KVIDGridManager, 0) //Handles a collection of identification grids
112 };
113 
115 R__EXTERN KVIDGridManager* gIDGridManager;
116 
117 #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:140
Base class for particle identification in a 2D map.
Definition: KVIDGraph.h:31
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 &)
KVIDGraph * GetGrid(const Char_t *name) const
Return pointer to grid with name "name".
void DeleteGrid(KVIDGraph *, Bool_t update=kTRUE)
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
const KVSeqCollection * GetGrids() const
virtual bool IsSQLROOT() const
void ls(Option_t *="") const override
void Initialize(Option_t *="")
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)