KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVSpiderIdentificator.h
Go to the documentation of this file.
1 
2 #ifndef __KVSPIDERIDENTIFICATOR_H
3 #define __KVSPIDERIDENTIFICATOR_H
4 
5 #include <TH2F.h>
6 #include <TGraph.h>
7 #include <TFile.h>
8 #include <TMath.h>
9 #include <TNamed.h>
10 #include <TRandom3.h>
11 #include "TSpectrum.h"
12 #include <TROOT.h>
13 #include "KVDroite.h"
14 #include "KVSpiderLine.h"
15 #include <RQ_OBJECT.h>
16 
17 #include <Riostream.h>
18 #include <list>
19 
27 class KVSpiderIdentificator : public TNamed {
28  RQ_OBJECT("KVSpiderIdentificator")
29 protected:
30 
32  bool _debug;
33  bool _auto;
34  bool _sicsi;
35  bool _useFit;
36 
37  double _bfactor;
38  double _ftheta;
39  double _otheta;
40  double _x0;
41  double _y0;
42  double _xm;
43  double _ym;
44  double _xmax;
45  double _ymax;
46  double _alpha;
47 
48  int _nAngleUp;
50 
55 
58 
62 
64 
69 
70 
71 public:
72 
73  enum MatrixType {
77  kOther
78  };
79 
80 
82  KVSpiderIdentificator(TH2F* h_, Double_t Xm = -1, Double_t Ym = -1, Double_t pdx = -1, Double_t pdy = -1, Int_t type = kSiCsI);
83  virtual ~KVSpiderIdentificator();
84 
85  void Init(TH2F* h_ = 0, Double_t Xm = -1, Double_t Ym = -1, Double_t X0 = -1, Double_t Y0 = -1);
86  void Close();
87  void Clear(Option_t* option = "");
88  void SetMode(bool sicsi_ = true)
89  {
90  _sicsi = sicsi_;
91  }
92  void SetParameters(double bining_ = 1.);
93 
94  void SetHistogram(TH2F* h_ = 0, Double_t Xm = -1, Double_t Ym = -1);
95  TH1F* GetProjection(TH2F* h_, KVDroite* d_, int rebin_ = 10);
96  bool SearchPeack(TH1F* h1_, double theta_, int create_, double sigma_ = 2., double peakmin_ = 1., int rebin_ = 10, int smooth_ = 5, TString opt_ = "goff");
97 
98  bool ProcessIdentification();
99  bool GetLines(int npoints_ = 1, double alpha_ = 1.);
100 
101  TList* CreateHistograms(double thmin_, double thmax_, int nth_, bool cos_ = true, double alpha_ = -1.);
102  TH2F* CreateHistogram(double th_, double alpha_ = -1.);
103 
104  void Draw(Option_t* opt_ = "");
105  void SaveAsPdf(Option_t* opt_ = "", const Char_t* path_ = ".");
106 
108  KVSpiderLine* GetLine(int z_);
109 
110  void SetX0(double x0_)
111  {
112  _x0 = x0_;
113  }
114  void SetY0(double y0_)
115  {
116  _y0 = y0_;
117  }
118  void SetXm(double xm_)
119  {
120  _xm = xm_;
121  }
122  void SetYm(double ym_)
123  {
124  _ym = ym_;
125  }
126  void SetAlpha(double aa_)
127  {
128  _alpha = aa_;
129  }
130  void UseFit(bool fit)
131  {
132  _useFit = fit;
133  }
134 
135  double GetX0()
136  {
137  return _x0;
138  }
139  double GetY0()
140  {
141  return _y0;
142  }
143  double GetXm()
144  {
145  return _xm;
146  }
147  double GetYm()
148  {
149  return _ym;
150  }
151  double GetTheta0()
152  {
153  return _ftheta;
154  }
155  void CalculateTheta();
156  void SetNangles(Int_t up, Int_t down)
157  {
158  _nAngleUp = up;
159  _nAngleDown = down;
160  }
161 
162  void Increment(Float_t x) // *SIGNAL*
163  {
166  Emit("Increment(Float_t)", x);
167  }
168 
169 protected :
170 
171  void SetDefault();
172  bool TestHistogram(TH1* h_ = 0);
173  bool CheckPath(const Char_t* path_);
174 
175  ClassDef(KVSpiderIdentificator, 1) // a faire !
176 };
177 
178 #endif
179 
180 
181 
182 
183 
184 
185 
186 
187 
int Int_t
#define RQ_OBJECT(sender_class)
char Char_t
double Double_t
float Float_t
const char Option_t
#define ClassDef(name, id)
Apparently, a straight line.
Definition: KVDroite.h:16
Semi-automatic identification grid generator.
TList * CreateHistograms(double thmin_, double thmax_, int nth_, bool cos_=true, double alpha_=-1.)
bool CheckPath(const Char_t *path_)
void Init(TH2F *h_=0, Double_t Xm=-1, Double_t Ym=-1, Double_t X0=-1, Double_t Y0=-1)
void SaveAsPdf(Option_t *opt_="", const Char_t *path_=".")
bool SearchPeack(TH1F *h1_, double theta_, int create_, double sigma_=2., double peakmin_=1., int rebin_=10, int smooth_=5, TString opt_="goff")
TH1F * GetProjection(TH2F *h_, KVDroite *d_, int rebin_=10)
void SetHistogram(TH2F *h_=0, Double_t Xm=-1, Double_t Ym=-1)
bool GetLines(int npoints_=1, double alpha_=1.)
TH2F * CreateHistogram(double th_, double alpha_=-1.)
KVSpiderLine * GetLine(int z_)
void Clear(Option_t *option="")
void SetNangles(Int_t up, Int_t down)
void SetParameters(double bining_=1.)
void Draw(Option_t *opt_="")
void SetMode(bool sicsi_=true)
Part of Spider Identification.
Definition: KVSpiderLine.h:18
Double_t x[n]
def fit(model, train_loader, val_loader, num_epochs, batch_size, optimizer, criterion, save_best, scheduler)