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