KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVIDZAFromZGrid.h
Go to the documentation of this file.
1 
4 #ifndef __KVIDZAFROMZGRID_H
5 #define __KVIDZAFROMZGRID_H
6 
7 #include "KVIDZAGrid.h"
8 #include "KVList.h"
10 
11 
12 class interval;
13 class interval_set;
14 
76 class KVIDZAFromZGrid : public KVIDZAGrid {
77 
78 public:
79  enum PIDType {
82  kIntType
83  };
84 
85 protected:
90 
93 
94  int is_inside(double pid) const;
95 
96 public:
98  virtual ~KVIDZAFromZGrid();
99 
100  void Copy(TObject& obj) const;
101 
102  virtual void ReadFromAsciiFile(std::ifstream& gridfile);
103  virtual void WriteToAsciiFile(std::ofstream& gridfile);
104 
105  virtual void Identify(Double_t x, Double_t y, KVIdentificationResult*) const;
106  virtual double DeduceAfromPID(KVIdentificationResult* idr) const;
107  void LoadPIDRanges();
108  void ResetPIDRanges();
109  void ReloadPIDRanges();
110  interval_set* GetIntervalSet(int zint) const;
112  {
113  return &fTables;
114  }
115 
116  void PrintPIDLimits();
117  void ClearPIDIntervals();
118  void ExportToGrid();
119 
120  void Initialize();
121 
123  {
131 
132  return (fPIDRange || fTables.GetEntries()) && !fIgnoreMassID;
133  }
134  void SetOnlyZId(Bool_t /*yes*/ = kTRUE)
135  {
141 
143  }
144 
145  ClassDef(KVIDZAFromZGrid, 1) //Compute Z and A only from Z lines...
146 };
147 
148 
149 
150 class interval: public TNamed {
151 public:
152  int fType;
153  int fZ;
154  int fA;
155 
156  double fPID;
157  double fPIDMin;
158  double fPIDmax;
159 
160  interval(int zz, int aa, double pid, double pidmin = -1., double pidmax = -1.)
161  {
162  fZ = zz;
163  fA = aa;
164  fPID = pid;
165  fPIDMin = pidmin;
166  fPIDmax = pidmax;
167  SetName(Form("%d_%d", zz, aa));
168  }
169  bool is_inside(double pid)
170  {
172  if (pid > fPIDMin && pid < fPIDmax) return kTRUE;
173  return kFALSE;
174  }
175  bool is_left_of(double pid)
176  {
178  return (fPIDmax < pid);
179  }
180  bool is_right_of(double pid)
181  {
183  return (fPIDMin > pid);
184  }
185 
186  int GetA()
187  {
188  return fA;
189  }
190  int GetZ()
191  {
192  return fZ;
193  }
194  double GetPID()
195  {
196  return fPID;
197  }
198  double GetPIDmin()
199  {
200  return fPIDMin;
201  }
202  double GetPIDmax()
203  {
204  return fPIDmax;
205  }
206 
207  void SetA(int aa)
208  {
209  fA = aa;
210  }
211  void SetZ(int zz)
212  {
213  fZ = zz;
214  }
215  void SetPID(double pid)
216  {
217  fPID = pid;
218  }
219  void SetPIDmin(double pidmin)
220  {
221  fPIDMin = pidmin;
222  }
223  void SetPIDmax(double pidmax)
224  {
225  fPIDmax = pidmax;
226  }
227 
228 
229  ClassDef(interval, 1) //
230 };
231 
232 class interval_set: public TNamed {
233 public:
234  int fType;
235  int fZ;
239 
240  int GetZ()
241  {
242  return fZ;
243  }
244  int GetNPID()
245  {
246  return fIntervals.GetSize();
247  }
249  {
250  return &fIntervals;
251  }
253 
254  interval_set(int zz, int type);
255  void add(int aa, double pid, double pidmin = -1., double pidmax = -1.);
256  double eval(KVIdentificationResult* idr);
257  bool is_inside(double pid);
258  bool is_above(double pid);
259 
260  ClassDef(interval_set, 1) //
261 };
262 
263 
264 
265 
266 
267 #endif
int Int_t
const Bool_t kFALSE
bool Bool_t
double Double_t
const Bool_t kTRUE
#define ClassDef(name, id)
char * Form(const char *fmt,...)
virtual void SetOnlyZId(Bool_t yes=kTRUE)
Definition: KVIDGraph.cpp:1484
Hybrid identification grid.
Bool_t fHasMassIDRegion
set to true if grid has a limited region for mass identification, indicated by an info "MassID"
interval_set * GetIntervalSet(int zint) const
virtual void WriteToAsciiFile(std::ofstream &gridfile)
void SetOnlyZId(Bool_t=kTRUE)
Bool_t HasMassIDCapability() const
void Copy(TObject &obj) const
virtual double DeduceAfromPID(KVIdentificationResult *idr) const
virtual void ReadFromAsciiFile(std::ifstream &gridfile)
KVList * GetIntervalSets()
virtual ~KVIDZAFromZGrid()
Destructor.
int is_inside(double pid) const
virtual void Identify(Double_t x, Double_t y, KVIdentificationResult *) const
Identification grid with lines corresponding to different nuclear isotopes (KVIDZALine)
Definition: KVIDZAGrid.h:65
Full result of one attempted particle identification.
Extended TList class which owns its objects by default.
Definition: KVList.h:27
virtual Int_t GetSize() const
virtual Int_t GetEntries() const
virtual void SetName(const char *name)
TString GetListOfMasses()
bool is_inside(double pid)
bool is_above(double pid)
void add(int aa, double pid, double pidmin=-1., double pidmax=-1.)
double eval(KVIdentificationResult *idr)
interval_set(int zz, int type)
KVList * GetIntervals()
bool is_right_of(double pid)
double GetPID()
bool is_left_of(double pid)
double GetPIDmin()
void SetPID(double pid)
double fPIDmax
void SetZ(int zz)
void SetPIDmin(double pidmin)
double fPIDMin
void SetA(int aa)
interval(int zz, int aa, double pid, double pidmin=-1., double pidmax=-1.)
double GetPIDmax()
void SetPIDmax(double pidmax)
bool is_inside(double pid)