KaliVeda
Toolkit for HIC analysis
KVIDZAFromZGrid.h
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 
79 class KVIDZAFromZGrid : public KVIDZAGrid {
80 
81 public:
82  enum PIDType {
85  kIntType
86  };
87 
88 protected:
94 
97 
98  int is_inside(double pid) const;
99 
100 public:
101  KVIDZAFromZGrid();
102  ROOT_COPY_CTOR(KVIDZAFromZGrid, KVIDZAGrid)
103  ROOT_COPY_ASSIGN_OP(KVIDZAFromZGrid)
104 
105  void Copy(TObject& obj) const;
106 
107  virtual void ReadFromAsciiFile(std::ifstream& gridfile);
108  virtual void WriteToAsciiFile(std::ofstream& gridfile);
109 
110  virtual void Identify(Double_t x, Double_t y, KVIdentificationResult*) const;
111  virtual double DeduceAfromPID(KVIdentificationResult* idr) const;
112  void LoadPIDRanges();
113  void ResetPIDRanges();
114  void ReloadPIDRanges();
115  interval_set* GetIntervalSet(int zint) const;
117  {
118  return &fTables;
119  }
120 
121  void PrintPIDLimits();
122  void ClearPIDIntervals();
123  void ExportToGrid();
124 
125  void Initialize();
126 
128  {
136 
137  return (fPIDRange || fTables.GetEntries()) && !fIgnoreMassID;
138  }
139  void SetOnlyZId(Bool_t /*yes*/ = kTRUE)
140  {
146 
148  }
149 
152  {
153  return (KVMultiGaussIsotopeFit*)fFits.FindObject(Form("MultiGaussIsotopeFit_Z=%d", z));
154  }
155 
156  ClassDef(KVIDZAFromZGrid, 1) //Compute Z and A only from Z lines...
157 };
158 
159 
160 
161 class interval: public TNamed {
162  int fType;
163  int fZ;
164  int fA;
165 
166  double fPID;
167  double fPIDMin;
168  double fPIDmax;
169 
170 public:
171  void Copy(TObject& o) const
172  {
173  TNamed::Copy(o);
174  interval& i = dynamic_cast<interval&>(o);
175  i.fType = fType;
176  i.fZ = fZ;
177  i.fA = fA;
178  i.fPID = fPID;
179  i.fPIDMin = fPIDMin;
180  i.fPIDmax = fPIDmax;
181  }
182  ROOT_DEF_CTOR(interval, TNamed)
183  ROOT_COPY_CTOR(interval, TNamed)
184  ROOT_COPY_ASSIGN_OP(interval)
185  interval(int zz, int aa, double pid, double pidmin = -1., double pidmax = -1.)
186  {
187  fZ = zz;
188  fA = aa;
189  fPID = pid;
190  fPIDMin = pidmin;
191  fPIDmax = pidmax;
192  SetName(Form("%d_%d", zz, aa));
193  }
194  bool is_inside(double pid)
195  {
197  if (pid > fPIDMin && pid < fPIDmax) return kTRUE;
198  return kFALSE;
199  }
200  bool is_left_of(double pid)
201  {
203  return (fPIDmax < pid);
204  }
205  bool is_right_of(double pid)
206  {
208  return (fPIDMin > pid);
209  }
210 
211  int GetA()
212  {
213  return fA;
214  }
215  int GetZ()
216  {
217  return fZ;
218  }
219  double GetPID()
220  {
221  return fPID;
222  }
223  double GetPIDmin()
224  {
225  return fPIDMin;
226  }
227  double GetPIDmax()
228  {
229  return fPIDmax;
230  }
231 
232  void SetA(int aa)
233  {
234  fA = aa;
235  }
236  void SetZ(int zz)
237  {
238  fZ = zz;
239  }
240  bool SetPID(double pid)
241  {
243  fPID = pid;
244  if (fPIDMin > 0 && fPIDmax > 0) {
245  if (pid >= fPIDMin && pid <= fPIDmax) return true;
246  return false;
247  }
248  return true;
249  }
250  void SetPIDmin(double pidmin)
251  {
252  fPIDMin = pidmin;
253  }
254  void SetPIDmax(double pidmax)
255  {
256  fPIDmax = pidmax;
257  }
258 
259 
260  ClassDef(interval, 1) //
261 };
262 
263 class interval_set: public TNamed {
264 public:
265  int fType;
266  int fZ;
270 
271  void Copy(TObject& o) const
272  {
273  TNamed::Copy(o);
274  interval_set& i = dynamic_cast<interval_set&>(o);
275  i.fType = fType;
276  i.fZ = fZ;
278  i.fNPIDs = fNPIDs;
279  i.fPIDs = fPIDs;
280  }
281  ROOT_DEF_CTOR(interval_set, TNamed)
282  ROOT_COPY_CTOR(interval_set, TNamed)
283  ROOT_COPY_ASSIGN_OP(interval_set)
284  int GetZ()
285  {
286  return fZ;
287  }
288  int GetNPID()
289  {
290  return fIntervals.GetSize();
291  }
293  {
294  return &fIntervals;
295  }
297 
298  interval_set(int zz, int type);
299  void add(int aa, double pid, double pidmin = -1., double pidmax = -1.);
300  double eval(KVIdentificationResult* idr);
301  bool is_inside(double pid);
302  bool is_above(double pid);
303 
304  ClassDef(interval_set, 1) //
305 };
306 
307 
308 
309 
310 
311 #endif
int Int_t
bool Bool_t
constexpr Bool_t kFALSE
double Double_t
constexpr 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:66
Full result of one attempted particle identification.
Extended TList class which owns its objects by default.
Definition: KVList.h:28
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
void Copy(TObject &named) const override
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)