GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4ListCond.h
Go to the documentation of this file.
1 // $Id: TGo4ListCond.h 3184 2021-04-26 12:57:56Z adamczew $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #ifndef TGO4LISTCOND_H
15 #define TGO4LISTCOND_H
16 
17 #include "TGo4Condition.h"
18 #include <vector>
19 
26 {
27 public:
28  TGo4ListCond();
29  TGo4ListCond(const char * name, const char * title = "Go4 list condition");
30  TGo4ListCond(const char * name, const char * title, const Int_t num, const Int_t * values);
31  TGo4ListCond(const char * name, const char * title, const Int_t start, const Int_t stop, const Int_t step = 1);
32  virtual ~TGo4ListCond();
33 
35  virtual void SetValues(const Int_t num, const Int_t * values);
36  virtual void SetValues(const Int_t start, const Int_t stop, const Int_t step);
37 
38  using TGo4Condition::Test;
39  //virtual Bool_t Test(Int_t value);
40  virtual Bool_t Test(Double_t value);
41 
42 
43  void PrintCondition(Bool_t full = kFALSE);
44  void PrintValues();
45 
46  Bool_t UpdateFrom(TGo4Condition *cond, Bool_t counts);
47 
48  UInt_t GetNumValues() const { return fxValues.size(); }
49  Int_t GetValue(UInt_t ix) const { return ix < fxValues.size() ? fxValues[ix] : 0; }
50 
51  void SetValue(UInt_t ix, Int_t val)
52  {
53  if(ix>=fxValues.size()) fxValues.resize(ix);
54  fxValues[ix]=val;
55  }
56  void InsertValue(UInt_t ix, Int_t val)
57  {
58  fxValues.insert(fxValues.begin()+ix,val);
59  }
60  void RemoveValue(UInt_t ix){fxValues.erase(fxValues.begin() +ix);}
61 
62  void Resize(size_t newsize){fxValues.resize(newsize);}
63 
65  virtual Double_t GetXLow();
66 
68  virtual Double_t GetXUp();
69 
71  virtual Double_t GetYLow();
72 
74  virtual Double_t GetYUp();
75 
79  /* virtual TGo4ConditionPainter* CreatePainter();*/
80 
81 private:
82 
83  std::vector<Int_t> fxValues;
84 
85 // /** number of values in list: todo: use vector here?*/
86 // Int_t fiNum;
87 // /** array with values to test: todo: use vector here?*/
88 // Int_t * fiValues;
89 
91 };
92 
93 #endif // TGO4LISTCOND_H
void RemoveValue(UInt_t ix)
Definition: TGo4ListCond.h:60
virtual Double_t GetXLow()
void InsertValue(UInt_t ix, Int_t val)
Definition: TGo4ListCond.h:56
ClassDef(TGo4ListCond, 1)
virtual ~TGo4ListCond()
virtual void SetValues()
Definition: TGo4Condition.h:93
Bool_t UpdateFrom(TGo4Condition *cond, Bool_t counts)
virtual Double_t GetYLow()
Int_t GetValue(UInt_t ix) const
Definition: TGo4ListCond.h:49
void SetValue(UInt_t ix, Int_t val)
Definition: TGo4ListCond.h:51
virtual Bool_t Test()
virtual Double_t GetXUp()
std::vector< Int_t > fxValues
Definition: TGo4ListCond.h:83
void Resize(size_t newsize)
Definition: TGo4ListCond.h:62
void PrintValues()
UInt_t GetNumValues() const
Definition: TGo4ListCond.h:48
void PrintCondition(Bool_t full=kFALSE)
virtual Double_t GetYUp()