KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVTGID.h
Go to the documentation of this file.
1 /***************************************************************************
2  KVTGID.h - description
3  -------------------
4  begin : 5 July 2005
5  copyright : (C) 2005 by J.D. Frankland
6  email : frankland@ganil.fr
7 
8 $Id: KVTGID.h,v 1.12 2009/03/03 14:27:15 franklan Exp $
9 ***************************************************************************/
10 
11 #ifndef KVTGID__H
12 #define KVTGID__H
13 
14 #include "TF1.h"
15 #include "KVIDGrid.h"
16 #include "TString.h"
17 #include "KVNumberList.h"
18 
43 class KVTGID: public TF1 {
44 
45 protected:
46 
50  void init();
52 
67 
72 
73  virtual void SetIdent(KVIDLine*, Double_t ID) = 0;
74  virtual KVIDLine* AddLine(KVIDGrid*) = 0;
75 
77  {
79  fTelescopes = s;
80  };
81 
82 public:
83 
85  {
86  return fType;
87  };
88  Int_t GetZorA() const
89  {
90  return fZorA;
91  };
93  {
94  return fLight;
95  };
96 
98  enum {
99  kStatus_OK, //normal identification
100  kStatus_NotBetween_IDMin_IDMax //no solution between fID_min and fID_max
101  };
102 
103  const Char_t* GetFunctionName() const
104  {
105  return fTGIDFunctionName.Data();
106  };
107 
108  KVTGID();
109  KVTGID(const KVTGID&);
110  KVTGID(const Char_t* name, const Char_t* function,
111  Double_t xmin, Double_t xmax, Int_t npar, Int_t par_x,
112  Int_t par_y);
113  virtual ~ KVTGID() {};
114 
115  virtual void Copy(TObject& tgid) const;
117  {
118  fID_max = x;
119  };
121  {
122  return fID_max;
123  };
125  {
126  fID_min = x;
127  };
129  {
130  return fID_min;
131  };
132 
133  virtual Double_t GetIdentification(Double_t ID_min, Double_t ID_max,
134  Double_t& ID_quality,
135  Double_t* par = 0);
136 
137  virtual void AddLineToGrid(KVIDGrid* g, Int_t ID, Int_t npoints,
138  Double_t xmin, Double_t xmax, Bool_t log_scale = kFALSE);
139 
140  virtual void Print(Option_t* option = "") const;
141 
142  Int_t Compare(const TObject* obj) const;
143 
144  inline virtual Int_t GetStatus() const
145  {
146  return fStatus;
147  };
148  virtual const Char_t* GetStatusString() const;
149 
151  Double_t* params = 0);
152 
153  static KVTGID* MakeTGID(const Char_t* name, Int_t type, Int_t light, Int_t ZorA, Int_t mass);
154 
155  void SetLambda(Double_t val)
156  {
157  if (fLambda > -1) SetParameter(fLambda, val);
158  };
160  {
161  return fLambda > -1 ? GetParameter(fLambda) : 0;
162  };
163  void SetMu(Double_t val)
164  {
165  if (fMu > -1) SetParameter(fMu, val);
166  };
167  Double_t GetMu() const
168  {
169  return fMu > -1 ? GetParameter(fMu) : 0;
170  };
171  void SetG(Double_t val)
172  {
173  if (fG > -1) SetParameter(fG, val);
174  };
175  Double_t GetG() const
176  {
177  return fG > -1 ? GetParameter(fG) : 0;
178  };
179  void SetPdx(Double_t val)
180  {
181  if (fPdx > -1) SetParameter(fPdx, val);
182  };
183  Double_t GetPdx() const
184  {
185  return fPdx > -1 ? GetParameter(fPdx) : 0;
186  };
187  void SetPdy(Double_t val)
188  {
189  if (fPdy > -1) SetParameter(fPdy, val);
190  };
191  Double_t GetPdy() const
192  {
193  return fPdy > -1 ? GetParameter(fPdy) : 0;
194  };
195  void SetAlpha(Double_t val)
196  {
197  if (fAlpha > -1) SetParameter(fAlpha, val);
198  };
200  {
201  return fAlpha > -1 ? GetParameter(fAlpha) : 0;
202  };
203  void SetBeta(Double_t val)
204  {
205  if (fBeta > -1) SetParameter(fBeta, val);
206  };
208  {
209  return fBeta > -1 ? GetParameter(fBeta) : 0;
210  };
211  void SetNu(Double_t val)
212  {
213  if (fNu > -1) SetParameter(fNu, val);
214  };
215  Double_t GetNu() const
216  {
217  return fNu > -1 ? GetParameter(fNu) : 0;
218  };
219  void SetXi(Double_t val)
220  {
221  if (fXi > -1) SetParameter(fXi, val);
222  };
223  Double_t GetXi() const
224  {
225  return fXi > -1 ? GetParameter(fXi) : 0;
226  };
227  void SetEta(Double_t val)
228  {
229  if (fEta > -1) SetParameter(fEta, val);
230  };
231  Double_t GetEta() const
232  {
233  return fEta > -1 ? GetParameter(fEta) : 0;
234  };
236  {
237  fMassFormula = val;
238  };
240  {
241  return fMassFormula;
242  };
243  void SetLTGParameters(Double_t* par);
244  void SetLTGParameters(Float_t* par);
245  static Int_t GetNumberOfLTGParameters(Int_t type, Int_t light);
246  void SetLTGParameterNames();
247 
248  void SetValidRuns(const KVNumberList& r)
249  {
250  fRuns = r;
251  };
252  const KVNumberList& GetValidRuns() const
253  {
254  return fRuns;
255  };
257  {
260  return (fRuns.IsEmpty() || fRuns.Contains(run));
261  };
262  void SetVarX(const Char_t* x)
263  {
264  fVarX = x;
265  };
266  const Char_t* GetVarX() const
267  {
268  return fVarX.Data();
269  };
270  void SetVarY(const Char_t* x)
271  {
272  fVarY = x;
273  };
274  const Char_t* GetVarY() const
275  {
276  return fVarY.Data();
277  };
278  void SetIDTelescopes(const TCollection*);
280  {
281  fTelescopes = "/";
282  };
284  {
286  fTelescopes += tel->GetName();
287  fTelescopes += "/";
288  };
290  {
292  TString id = Form("/%s/", tel->GetName());
293  return fTelescopes.Contains(id);
294  };
295  const KVString& GetIDTelescopes() const
296  {
297  return fTelescopes;
298  }
299  void WriteToAsciiFile(std::ofstream&) const;
300  static KVTGID* ReadFromAsciiFile(const Char_t* name, std::ifstream&);
301 
302  ClassDef(KVTGID, 5) //Abstract base class for particle identfication using functionals developed by L. Tassan-Got (IPN Orsay)
303 };
304 
305 #endif
int Int_t
ROOT::R::TRInterface & r
char Char_t
bool Bool_t
double Double_t
float Float_t
const char Option_t
#define ClassDef(name, id)
char * Form(const char *fmt,...)
Base class for KaliVeda framework.
Definition: KVBase.h:135
Abstract base class for 2D identification grids in e.g. (dE,E) maps.
Definition: KVIDGrid.h:73
Base class for lines/cuts used for particle identification in 2D data maps.
Definition: KVIDLine.h:143
Strings used to represent a set of ranges of values.
Definition: KVNumberList.h:83
Bool_t Contains(Int_t val) const
returns kTRUE if the value 'val' is contained in the ranges defined by the number list
Bool_t IsEmpty() const
Definition: KVNumberList.h:173
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:72
Abstract base class for particle identfication using functionals developed by L. Tassan-Got (IPN Orsa...
Definition: KVTGID.h:43
void ClearIDTelescopes()
Definition: KVTGID.h:279
void SetXi(Double_t val)
Definition: KVTGID.h:219
KVTGID()
Default ctor.
Definition: KVTGID.cpp:61
virtual void AddLineToGrid(KVIDGrid *g, Int_t ID, Int_t npoints, Double_t xmin, Double_t xmax, Bool_t log_scale=kFALSE)
Definition: KVTGID.cpp:241
Double_t GetPdx() const
Definition: KVTGID.h:183
@ kStatus_NotBetween_IDMin_IDMax
Definition: KVTGID.h:100
@ kStatus_OK
Definition: KVTGID.h:99
void SetIDTelescopes(const TCollection *)
Definition: KVTGID.cpp:743
Int_t fLight
with (1) or without (0) CsI light-energy dependence
Definition: KVTGID.h:64
Double_t fID_min
minimum ID fitted with functional
Definition: KVTGID.h:47
Bool_t IsValidForTelescope(KVBase *tel) const
Definition: KVTGID.h:289
void SetIDmax(Double_t x)
Definition: KVTGID.h:116
Int_t fNu
Definition: KVTGID.h:60
Int_t fMu
Definition: KVTGID.h:54
virtual KVIDLine * AddLine(KVIDGrid *)=0
Double_t GetIDmin() const
Definition: KVTGID.h:128
Int_t fXi
Definition: KVTGID.h:61
TString fVarX
quantity used for X coordinates
Definition: KVTGID.h:69
Int_t fG
Definition: KVTGID.h:55
Double_t GetG() const
Definition: KVTGID.h:175
Int_t fZorA
used for Z (1) or A (0) identification
Definition: KVTGID.h:65
void SetVarX(const Char_t *x)
Definition: KVTGID.h:262
static KVTGID * MakeTGID(const Char_t *name, Int_t type, Int_t light, Int_t ZorA, Int_t mass)
Definition: KVTGID.cpp:429
Bool_t IsValidForRun(Int_t run) const
Definition: KVTGID.h:256
Double_t GetXi() const
Definition: KVTGID.h:223
void SetLTGParameterNames()
Definition: KVTGID.cpp:723
void SetMu(Double_t val)
Definition: KVTGID.h:163
KVNumberList fRuns
list of runs for which fit is valid
Definition: KVTGID.h:68
Double_t GetLambda() const
Definition: KVTGID.h:159
Double_t fID_max
maximum ID fitted with functional
Definition: KVTGID.h:48
const Char_t * GetVarX() const
Definition: KVTGID.h:266
void SetEta(Double_t val)
Definition: KVTGID.h:227
void SetBeta(Double_t val)
Definition: KVTGID.h:203
Int_t GetLightEnergyDependence() const
Definition: KVTGID.h:92
const KVString & GetIDTelescopes() const
Definition: KVTGID.h:295
Double_t GetIDmax() const
Definition: KVTGID.h:120
void SetValidRuns(const KVNumberList &r)
Definition: KVTGID.h:248
void SetIDmin(Double_t x)
Definition: KVTGID.h:124
void SetPdx(Double_t val)
Definition: KVTGID.h:179
const KVNumberList & GetValidRuns() const
Definition: KVTGID.h:252
TString fVarY
quantity used for Y coordinates
Definition: KVTGID.h:70
Int_t fBeta
Definition: KVTGID.h:59
virtual Int_t GetStatus() const
Definition: KVTGID.h:144
void init()
Definition: KVTGID.cpp:29
Int_t Compare(const TObject *obj) const
Definition: KVTGID.cpp:318
void WriteToAsciiFile(std::ofstream &) const
Write parameters of LTG fit in file.
Definition: KVTGID.cpp:758
virtual ~ KVTGID()
Definition: KVTGID.h:113
Int_t fLambda
indices of parameters
Definition: KVTGID.h:53
Int_t fEta
Definition: KVTGID.h:62
virtual void Copy(TObject &tgid) const
Copy this KVTGID function into the KVTGID object referenced by tgid.
Definition: KVTGID.cpp:139
virtual void SetIdent(KVIDLine *, Double_t ID)=0
Double_t GetPdy() const
Definition: KVTGID.h:191
void SetG(Double_t val)
Definition: KVTGID.h:171
void SetAlpha(Double_t val)
Definition: KVTGID.h:195
Int_t GetZorA() const
Definition: KVTGID.h:88
Double_t GetBeta() const
Definition: KVTGID.h:207
const Char_t * GetFunctionName() const
Definition: KVTGID.h:103
Double_t GetMu() const
Definition: KVTGID.h:167
Int_t fMassFormula
mass formula used to calculate A from Z (if Z identification used)
Definition: KVTGID.h:66
Int_t fStatus
transient member, holds status code of last call to GetIdentification
Definition: KVTGID.h:49
Int_t fPdy
Definition: KVTGID.h:57
Double_t GetDistanceToLine(Double_t x, Double_t y, Int_t id, Double_t *params=0)
Definition: KVTGID.cpp:364
void AddIDTelescope(KVBase *tel)
Definition: KVTGID.h:283
static KVTGID * ReadFromAsciiFile(const Char_t *name, std::ifstream &)
Definition: KVTGID.cpp:813
Double_t GetEta() const
Definition: KVTGID.h:231
Int_t GetMassFormula() const
Definition: KVTGID.h:239
TString fTGIDFunctionName
name of KVTGIDFunctions:: namespace function used for identification
Definition: KVTGID.h:51
void SetVarY(const Char_t *x)
Definition: KVTGID.h:270
void SetNu(Double_t val)
Definition: KVTGID.h:211
virtual Double_t GetIdentification(Double_t ID_min, Double_t ID_max, Double_t &ID_quality, Double_t *par=0)
Definition: KVTGID.cpp:188
KVString fTelescopes
list of telescopes for which fit is valid
Definition: KVTGID.h:71
virtual const Char_t * GetStatusString() const
Returns explanatory message for value of GetStatus()
Definition: KVTGID.cpp:341
Int_t fPdx
Definition: KVTGID.h:56
void SetLambda(Double_t val)
Definition: KVTGID.h:155
Double_t GetNu() const
Definition: KVTGID.h:215
Int_t fType
type of functional (=0 standard, =1 extended)
Definition: KVTGID.h:63
void SetLTGParameters(Double_t *par)
Definition: KVTGID.cpp:527
const Char_t * GetVarY() const
Definition: KVTGID.h:274
static Int_t GetNumberOfLTGParameters(Int_t type, Int_t light)
Definition: KVTGID.cpp:700
Double_t GetAlpha() const
Definition: KVTGID.h:199
Int_t GetFunctionalType() const
Definition: KVTGID.h:84
virtual void Print(Option_t *option="") const
Print info on functional and grid.
Definition: KVTGID.cpp:300
void SetStringTelescopes(const Char_t *s)
Definition: KVTGID.h:76
void SetPdy(Double_t val)
Definition: KVTGID.h:187
void SetMassformula(Int_t val)
Definition: KVTGID.h:235
Int_t fAlpha
Definition: KVTGID.h:58
virtual Double_t GetParameter(const TString &name) const
virtual void SetParameter(const TString &name, Double_t value)
virtual const char * GetName() const
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Double_t x[n]
const long double s
Definition: KVUnits.h:94
const long double g
masses
Definition: KVUnits.h:72