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