PandaRoot
PndEmcClusterCalibrator.h
Go to the documentation of this file.
1 //--------------------------------------------------------------------------
2 // Description:
3 // Class PndEmcClusterCalibrator
4 // Do an energy and position corrections for EMC cluster
5 // PndEmcClusterCalibrator is a factory which call specific method depending on the input parameter "method"
6 // method=1 - PndEmcClusterHistCalibrator is called, which perform correction from the interpolation on 2-dimensional histogram on (Energy, theta)
7 // method=2 - PndEmcClusterSimpleCalibrator is called, where energy correction is parametrised as a function of (Energy, theta)
8 // PndEmcAbsClusterCalibrator - abstract interface class
9 //
10 // Author List:
11 // D.Melnychuk
12 // PndEmcClusterHistCalibrator class is based on code PndEmcMakeCorr.cxx
13 // (A. Biegun, M. Babai)
14 // PndEmcClusterSimpleCalibrator class is based on EmcPhotonSimpleCalib class in Babar framework (Jan Zhong)
15 //------------------------------------------------------------------------
16 //#pragma once
17 #ifndef PNDEMCCLUSTERCALIBRATOR_H
18 #define PNDEMCCLUSTERCALIBRATOR_H
19 
20 #include "TObject.h"
21 #include "TVector3.h"
22 #include <TH2.h>
23 #include <TFile.h>
24 #include <TString.h>
25 #include <cstdlib>
26 
27 class PndEmcCluster;
28 class PndEmcDigi;
30 
31 // Abstract interface class for EMC Cluster calibrator
33 
34  public:
35  // Constructors
36  PndEmcAbsClusterCalibrator(Int_t version = 1);
37 
38  // Destructor
40 
41  // Methods
42  virtual Double_t Energy(PndEmcCluster *clust, Int_t pid = 22) = 0;
43  virtual TVector3 Where(PndEmcCluster *clust, Int_t pid = 22) = 0;
44 
45  protected:
46  Int_t fVersion;
47  TString fPath;
48 };
49 
50 // Factory for creation EMC Cluster calibrator
52 
53  public:
54  // Constructors
56 
57  // Destructor
58  virtual ~PndEmcClusterCalibrator();
59 
60  static PndEmcAbsClusterCalibrator *MakeEmcClusterCalibrator(Int_t method, Int_t version = 1);
61 
62  private:
64  PndEmcClusterCalibrator &operator=(const PndEmcClusterCalibrator &) { return *this; };
65 };
66 
68  public:
69  PndEmcClusterHistCalibrator(Int_t version = 1);
70  virtual ~PndEmcClusterHistCalibrator();
71 
72  // Methods
73  virtual Double_t Energy(PndEmcCluster *clust, Int_t pid = 22);
74  virtual TVector3 Where(PndEmcCluster *clust, Int_t pid = 22);
75 
76  private:
77  Int_t FindTheBin(TH2 *lookup_table, Float_t value_x, Float_t value_y, Int_t &bin_x, Int_t &bin_y);
78 
79  Double_t GetValueInZ(TH2 *lookup_table, Float_t value_x, Float_t value_y, Bool_t use_interpolation = kFALSE);
80 
81  TFile *fPhoton, *fElectron, *fPion;
82  TH2F *fHEnergyRatioBarrelPhoton, *fHEnergyRatioFwdPhoton, *fHEnergyRatioBwdPhoton, *fHEnergyRatioShashlykPhoton;
83  TH2F *fHThetaDiffBarrelPhoton, *fHThetaDiffFwdPhoton, *fHThetaDiffBwdPhoton, *fHThetaDiffShashlykPhoton;
84  // TH2F *fHEnergyRatioBarrelElectron, *fHEnergyRatioFwdElectron, *fHEnergyRatioBwdElectron, *fHEnergyRatioShashlykElectron;
85  // TH2F *fHThetaDiffBarrelElectron, *fHThetaDiffFwdElectron, *fHThetaDiffBwdElectron, *fHThetaDiffShashlykElectron;
86  // TH2F *fHEnergyRatioBarrelPion, *fHEnergyRatioFwdPion, *fHEnergyRatioBwdPion, *fHEnergyRatioShashlykPion;
87  // TH2F *fHThetaDiffBarrelPion, *fHThetaDiffFwdPion, *fHThetaDiffBwdPion, *fHThetaDiffShashlykPion;
88 
90  PndEmcClusterHistCalibrator &operator=(const PndEmcClusterHistCalibrator &) { return *this; };
91 };
92 
94  public:
95  PndEmcClusterSimpleCalibrator(Int_t version = 1);
97 
98  void Init(){};
99 
100  // Methods
101  virtual Double_t Energy(PndEmcCluster *clust, Int_t pid = 22);
102  virtual TVector3 Where(PndEmcCluster *clust, Int_t pid = 22);
103 
104  private:
106 
108  PndEmcClusterSimpleCalibrator &operator=(const PndEmcClusterSimpleCalibrator &) { return *this; };
109 };
110 #endif // PndEmcClusterCalibrator_HH
virtual Double_t Energy(PndEmcCluster *clust, Int_t pid=22)=0
virtual ~PndEmcAbsClusterCalibrator()
virtual TVector3 Where(PndEmcCluster *clust, Int_t pid=22)=0
PndEmcAbsClusterCalibrator(Int_t version=1)