KaliVeda  1.13/01
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"
9 #include "KVUniqueNameList.h"
10 #include "KVIdentificationResult.h"
11 #include "KVMultiGaussIsotopeFit.h"
12 
13 
14 class interval;
15 class interval_set;
16 
78 class KVIDZAFromZGrid : public KVIDZAGrid {
79 
80 public:
81  enum PIDType {
84  kIntType
85  };
86 
87 protected:
93 
96 
97  int is_inside(double pid) const;
98 
99 public:
100  KVIDZAFromZGrid();
101  ROOT_COPY_CTOR(KVIDZAFromZGrid, KVIDZAGrid)
102  ROOT_COPY_ASSIGN_OP(KVIDZAFromZGrid)
103 
104  void Copy(TObject& obj) const;
105 
106  virtual void ReadFromAsciiFile(std::ifstream& gridfile);
107  virtual void WriteToAsciiFile(std::ofstream& gridfile);
108 
109  virtual void Identify(Double_t x, Double_t y, KVIdentificationResult*) const;
110  virtual double DeduceAfromPID(KVIdentificationResult* idr) const;
111  void LoadPIDRanges();
112  void ResetPIDRanges();
113  void ReloadPIDRanges();
114  interval_set* GetIntervalSet(int zint) const;
116  {
117  return &fTables;
118  }
119 
120  void PrintPIDLimits();
121  void ClearPIDIntervals();
122  void ExportToGrid();
123 
124  void Initialize();
125 
127  {
135 
136  return (fPIDRange || fTables.GetEntries()) && !fIgnoreMassID;
137  }
138  void SetOnlyZId(Bool_t /*yes*/ = kTRUE)
139  {
145 
147  }
148 
151  {
152  return (KVMultiGaussIsotopeFit*)fFits.FindObject(Form("MultiGaussIsotopeFit_Z=%d", z));
153  }
154 
155  ClassDef(KVIDZAFromZGrid, 1) //Compute Z and A only from Z lines...
156 };
157 
158 
159 
160 class interval: public TNamed {
161  int fType;
162  int fZ;
163  int fA;
164 
165  double fPID;
166  double fPIDMin;
167  double fPIDmax;
168 
169 public:
170  void Copy(TObject& o) const
171  {
172  TNamed::Copy(o);
173  interval& i = dynamic_cast<interval&>(o);
174  i.fType = fType;
175  i.fZ = fZ;
176  i.fA = fA;
177  i.fPID = fPID;
178  i.fPIDMin = fPIDMin;
179  i.fPIDmax = fPIDmax;
180  }
181  ROOT_DEF_CTOR(interval, TNamed)
182  ROOT_COPY_CTOR(interval, TNamed)
183  ROOT_COPY_ASSIGN_OP(interval)
184  interval(int zz, int aa, double pid, double pidmin = -1., double pidmax = -1.)
185  {
186  fZ = zz;
187  fA = aa;
188  fPID = pid;
189  fPIDMin = pidmin;
190  fPIDmax = pidmax;
191  SetName(Form("%d_%d", zz, aa));
192  }
193  bool is_inside(double pid)
194  {
196  if (pid > fPIDMin && pid < fPIDmax) return kTRUE;
197  return kFALSE;
198  }
199  bool is_left_of(double pid)
200  {
202  return (fPIDmax < pid);
203  }
204  bool is_right_of(double pid)
205  {
207  return (fPIDMin > pid);
208  }
209 
210  int GetA()
211  {
212  return fA;
213  }
214  int GetZ()
215  {
216  return fZ;
217  }
218  double GetPID()
219  {
220  return fPID;
221  }
222  double GetPIDmin()
223  {
224  return fPIDMin;
225  }
226  double GetPIDmax()
227  {
228  return fPIDmax;
229  }
230 
231  void SetA(int aa)
232  {
233  fA = aa;
234  }
235  void SetZ(int zz)
236  {
237  fZ = zz;
238  }
239  bool SetPID(double pid)
240  {
242  fPID = pid;
243  if (fPIDMin > 0 && fPIDmax > 0) {
244  if (pid >= fPIDMin && pid <= fPIDmax) return true;
245  return false;
246  }
247  return true;
248  }
249  void SetPIDmin(double pidmin)
250  {
251  fPIDMin = pidmin;
252  }
253  void SetPIDmax(double pidmax)
254  {
255  fPIDmax = pidmax;
256  }
257 
258 
259  ClassDef(interval, 1) //
260 };
261 
262 class interval_set: public TNamed {
263 public:
264  int fType;
265  int fZ;
269 
270  void Copy(TObject& o) const
271  {
272  TNamed::Copy(o);
273  interval_set& i = dynamic_cast<interval_set&>(o);
274  i.fType = fType;
275  i.fZ = fZ;
277  i.fNPIDs = fNPIDs;
278  i.fPIDs = fPIDs;
279  }
280  ROOT_DEF_CTOR(interval_set, TNamed)
281  ROOT_COPY_CTOR(interval_set, TNamed)
282  ROOT_COPY_ASSIGN_OP(interval_set)
283  int GetZ()
284  {
285  return fZ;
286  }
287  int GetNPID()
288  {
289  return fIntervals.GetSize();
290  }
292  {
293  return &fIntervals;
294  }
296 
297  interval_set(int zz, int type);
298  void add(int aa, double pid, double pidmin = -1., double pidmax = -1.);
299  double eval(KVIdentificationResult* idr);
300  bool is_inside(double pid);
301  bool is_above(double pid);
302 
303  ClassDef(interval_set, 1) //
304 };
305 
306 
307 
308 
309 
310 #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:1496
Hybrid charge & mass identification grid.
Bool_t fHasMassIDRegion
set to true if grid has a limited region for mass identification, indicated by an info "MassID"
bool MassIdentificationFromMultiGaussFit(KVMultiGaussIsotopeFit *, KVIdentificationResult *) const
KVList fTables
intervals for mass id
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
KVUniqueNameList fFits
multi-gaussian fits for mass id
KVMultiGaussIsotopeFit * GetMultiGaussFit(int z) const
virtual void ReadFromAsciiFile(std::ifstream &gridfile)
KVList * GetIntervalSets()
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
Function for fitting PID mass spectra.
virtual void Copy(TObject &obj) const
virtual Int_t GetSize() const
virtual TObject * FindObject(const char *name) const
Optimised list in which named objects can only be placed once.
virtual Int_t GetEntries() const
virtual void Copy(TObject &named) 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)
void Copy(TObject &o) const
interval_set(int zz, int type)
KVList * GetIntervals()
bool SetPID(double pid)
bool is_right_of(double pid)
double GetPID()
bool is_left_of(double pid)
double GetPIDmin()
void Copy(TObject &o) const
double fPIDmax
void SetZ(int zz)
void SetPIDmin(double pidmin)
double fPIDMin
void SetA(int aa)
double GetPIDmax()
void SetPIDmax(double pidmax)
bool is_inside(double pid)