CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ResidualFitter.h
Go to the documentation of this file.
1 #ifndef RecoParticleFlow_PFRootEvent_ResidualFitter_h
2 #define RecoParticleFlow_PFRootEvent_ResidualFitter_h
3 
4 #include <RQ_OBJECT.h>
5 #include <TH3.h>
6 #include <TH2.h>
7 #include <TCanvas.h>
8 #include <TF1.h>
9 
10 
11 class ResidualFitter : public TH3D, public TQObject {
12 
13  // RQ_OBJECT("ResidualFitter")
14 
15  public:
16  ResidualFitter(const char* name,
17  const char* title,
18  int nbinsx, double xlow, double xup,
19  int nbinsy, double ylow, double yup,
20  int nbinsz, double zlow, double zup);
21 
23 
24  static void SetCanvas(int x, int y) { xCanvas_=x; yCanvas_=y;}
25  void CreateCanvas();
26 
27  void AddTrue( double x, double y, double z)
28  {true_.push_back( Point(x,y,z) ); }
29  void AddMeas( double x, double y, double z )
30  {meas_.push_back( Point(x,y,z) ); }
31  void Fill();
32 
33  void SetFitFunction(TF1* func) { fitFunction_ = func; }
34  void SetFitOptions(const char* opt) {fitOptions_ = opt; }
35 
36  void FitSlicesZ(TF1 *f1=0);
37  void ExecuteEvent(Int_t event, Int_t px, Int_t py, TObject *sel);
38 
39  void Fit(int x, int y, const char* opt="");
40  void ShowFit(TH2* h2d, double x, double y);
41 
42  void SetAutoRange(int n) {
43  autoRangeN_= n;
44  fitOptions_ += "R";
45  }
46 
47  void SetMinN(int n) { minN_ = n;}
48 
49  void cd() {canvas_->cd(); }
50 
51  TF1* GetFunction() {return fitFunction_;}
52 
53  TH1D* CurBin() {return curBin_;}
54 
55  TCanvas* GetCanvas() {return canvas_;}
56 
57  class Point {
58  public:
59  Point() : x_(-10), y_(-10), z_(-10) {}
60  Point(double x, double y, double z) :
61  x_(x), y_(y), z_(z) {}
62  private:
63  double x_;
64  double y_;
65  double z_;
66 
67  friend class ResidualFitter;
68  };
69 
70  private:
71  std::vector< ResidualFitter::Point > true_;
72  std::vector< ResidualFitter::Point > meas_;
73 
76 
77  TCanvas* canvas_;
78 
79  static int xCanvas_;
80  static int yCanvas_;
81 
82 
83  TCanvas* canvasFit_;
84 
85  TH1D* curBin_;
86  TH2D* mean_;
87  TH2D* sigma_;
88  TH2D* chi2_;
89  /* TH2D* nseen_; */
90 
91  int oldBinx_;
92  int oldBiny_;
93 
95 
98  int minN_;
99 
100  ClassDef(ResidualFitter,1)
101 };
102 
103 #endif
void Fit(int x, int y, const char *opt="")
ResidualFitter(const char *name, const char *title, int nbinsx, double xlow, double xup, int nbinsy, double ylow, double yup, int nbinsz, double zlow, double zup)
Point(double x, double y, double z)
void SetAutoRange(int n)
static void SetCanvas(int x, int y)
std::pair< double, double > Point
Definition: CaloEllipse.h:18
void ExecuteEvent(Int_t event, Int_t px, Int_t py, TObject *sel)
float float float z
void AddMeas(double x, double y, double z)
void FitSlicesZ(TF1 *f1=0)
TCanvas * GetCanvas()
TCanvas * canvas_
static int xCanvas_
TF1 * GetFunction()
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::string fitOptions_
std::vector< ResidualFitter::Point > true_
void SetFitOptions(const char *opt)
std::vector< ResidualFitter::Point > meas_
static int yCanvas_
TCanvas * canvasFit_
void SetMinN(int n)
void AddTrue(double x, double y, double z)
void SetFitFunction(TF1 *func)
Definition: DDAxes.h:10
void ShowFit(TH2 *h2d, double x, double y)