FairRoot/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 
35  public:
36 
37  // Constructors
38  PndEmcAbsClusterCalibrator(Int_t version=1);
39 
40  // Destructor
42 
43  // Methods
44  virtual Double_t Energy(PndEmcCluster *clust, Int_t pid=22) = 0;
45  virtual TVector3 Where(PndEmcCluster *clust, Int_t pid=22) = 0;
46 
47  protected:
48 
49  Int_t fVersion;
51 };
52 
53 // Factory for creation EMC Cluster calibrator
55 {
56 
57  public:
58 
59  // Constructors
61 
62  // Destructor
63  virtual ~PndEmcClusterCalibrator();
64 
65  static PndEmcAbsClusterCalibrator *MakeEmcClusterCalibrator(Int_t method, Int_t version=1);
66 
67  private:
68 
71 
72 };
73 
75 {
76  public:
77  PndEmcClusterHistCalibrator(Int_t version=1);
79 
80  // Methods
81  virtual Double_t Energy(PndEmcCluster *clust, Int_t pid=22);
82  virtual TVector3 Where(PndEmcCluster *clust, Int_t pid=22);
83 
84  private:
85  Int_t FindTheBin(TH2* lookup_table, Float_t value_x, Float_t value_y, Int_t &bin_x, Int_t &bin_y);
86 
87  Double_t GetValueInZ(TH2 *lookup_table, Float_t value_x, Float_t value_y, Bool_t use_interpolation = kFALSE);
88 
89  TFile *fPhoton, *fElectron, *fPion;
92 // TH2F *fHEnergyRatioBarrelElectron, *fHEnergyRatioFwdElectron, *fHEnergyRatioBwdElectron, *fHEnergyRatioShashlykElectron;
93 // TH2F *fHThetaDiffBarrelElectron, *fHThetaDiffFwdElectron, *fHThetaDiffBwdElectron, *fHThetaDiffShashlykElectron;
94 // TH2F *fHEnergyRatioBarrelPion, *fHEnergyRatioFwdPion, *fHEnergyRatioBwdPion, *fHEnergyRatioShashlykPion;
95 // TH2F *fHThetaDiffBarrelPion, *fHThetaDiffFwdPion, *fHThetaDiffBwdPion, *fHThetaDiffShashlykPion;
96 
99 };
100 
102 {
103  public:
104  PndEmcClusterSimpleCalibrator(Int_t version=1);
106 
107  void Init() {};
108 
109  // Methods
110  virtual Double_t Energy(PndEmcCluster *clust, Int_t pid=22);
111  virtual TVector3 Where(PndEmcCluster *clust, Int_t pid=22);
112 
113  private:
115 
118 };
119 #endif // PndEmcClusterCalibrator_HH
represents the reconstructed hit of one emc crystal
Definition: PndEmcDigi.h:40
int pid()
virtual Double_t Energy(PndEmcCluster *clust, Int_t pid=22)=0
Int_t FindTheBin(TH2 *lookup_table, Float_t value_x, Float_t value_y, Int_t &bin_x, Int_t &bin_y)
PndEmcClusterSimpleCalibrator & operator=(const PndEmcClusterSimpleCalibrator &)
PndEmcClusterCalibrator & operator=(const PndEmcClusterCalibrator &)
virtual TVector3 Where(PndEmcCluster *clust, Int_t pid=22)
PndEmcClusterHistCalibrator & operator=(const PndEmcClusterHistCalibrator &)
Double_t
static PndEmcAbsClusterCalibrator * MakeEmcClusterCalibrator(Int_t method, Int_t version=1)
a cluster (group of neighboring crystals) of hit emc crystals
Definition: PndEmcCluster.h:29
virtual Double_t Energy(PndEmcCluster *clust, Int_t pid=22)
virtual TVector3 Where(PndEmcCluster *clust, Int_t pid=22)=0
virtual Double_t Energy(PndEmcCluster *clust, Int_t pid=22)
PndEmcClusterCalibrationParObject * fParObject
Double_t GetValueInZ(TH2 *lookup_table, Float_t value_x, Float_t value_y, Bool_t use_interpolation=kFALSE)
virtual TVector3 Where(PndEmcCluster *clust, Int_t pid=22)