PandaRoot
BSEmcXClMoments.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 // File and Version Information:
15 //
16 // Description:
17 // Class BSEmcXClMoments.
18 //
19 // Environment:
20 // Software developed for the BaBar Detector at the SLAC B-Factory.
21 //
22 // Author List:
23 // Thorsten Brandt Originator
24 //
25 // Copyright Information:
26 //
27 // Dima Melnichuk, adaption for pandaroot
28 //
29 //------------------------------------------------------------------------
30 #ifndef BSEMCXCLMOMENTS_HH
31 #define BSEMCXCLMOMENTS_HH
32 
33 #include <iostream>
34 #include <memory>
35 #include <vector>
36 
37 #include "Rtypes.h"
38 #include "RtypesCore.h"
39 
41 #include "BSEmcPositionAlgo.h"
42 
43 class BSEmcDigi;
44 class BSEmcCluster;
46 class TBuffer;
47 class TClass;
48 class TMemberInspector;
49 
50 struct Moments {
51  Double_t Lateral;
52  Double_t Z20;
53  Double_t Z53;
54 };
55 
67 
68  public:
69  // Constructors
71  // Destructor
72  virtual ~BSEmcXClMoments();
73 
75  {
76  fPositionPar = t_positionPar;
77  fPositionAlgo->SetPositionPar(t_positionPar);
78  }
79  Moments CalculateMoments(const BSEmcCluster *t_cluster, const std::vector<const BSEmcDigi *> &t_digiArray);
80 
81  protected:
83  Double_t deposited_energy;
84  Double_t r;
85  Double_t phi;
86  };
87 
88  // Helper functions
89 
90  void Init();
91 
92  // explicit implementation of polynomial part of
93  // Zernike-Functions for n<=5;
94 
95  Double_t f00(Double_t r) const;
96  Double_t f11(Double_t r) const;
97  Double_t f20(Double_t r) const;
98  Double_t f22(Double_t r) const;
99  Double_t f31(Double_t r) const;
100  Double_t f33(Double_t r) const;
101  Double_t f40(Double_t r) const;
102  Double_t f42(Double_t r) const;
103  Double_t f44(Double_t r) const;
104  Double_t f51(Double_t r) const;
105  Double_t f53(Double_t r) const;
106  Double_t f55(Double_t r) const;
107 
108  std::vector<BSEmcClEnergyDeposition> CreateEnergyDeposition(const BSEmcCluster *t_cluster, const std::vector<const BSEmcDigi *> &t_digiArray);
109 
110  // Calculation of Zernike-Moments for n<=5 :
111  Double_t Fast_AbsZernikeMoment(Int_t t_n, Int_t t_m, Double_t t_r0, const std::vector<BSEmcClEnergyDeposition> &t_energydeposition) const;
112 
113  // Calculation of Zernike-Moments for general values of (n,m)
114  Double_t Calc_AbsZernikeMoment(Int_t t_n, Int_t t_m, Double_t t_r0, const std::vector<BSEmcClEnergyDeposition> &t_energydeposition) const;
115 
116  Double_t Fak(Int_t t_n) const;
117 
118  // Absolute value Zernike-Moment of index(m,n); according to the
119  // definition of the Zernike moments, n and m must satisfy
120  // (a) n>=m (b) n-m even (c) n,m>=0
121  // Otherwise this function returns -1;
122  virtual Double_t AbsZernikeMoment(Int_t t_n, Int_t t_m, Double_t t_r0, const std::vector<BSEmcClEnergyDeposition> &t_energydeposition) const;
123 
124  // Parameter for description of the LATeral energydeposition
125  // within the cluster; if cluster contains less than 3 digis,
126  // the function return 0
127  virtual Double_t Lat(const std::vector<BSEmcClEnergyDeposition> &t_energydeposition) const;
128 
129  private:
130  // Data members
131  const BSEmcCluster *fCurrentCluster{nullptr};
132  std::unique_ptr<BSEmcPositionAlgo> fPositionAlgo{new BSEmcPositionAlgo};
133  BSEmcCrystalPositionPar *fPositionPar{nullptr};
134  Int_t fClusterSize{-1};
135 
136  Double_t (BSEmcXClMoments::*fFcn[12])(Double_t) const;
137 
138  ClassDef(BSEmcXClMoments, 1)
139 };
140 
141 #endif /*BSEMCXCLMOMENTS_HH*/
Helper class to calculate the cluster position.
Double_t Z53
void SetPositionPar(BSEmcCrystalPositionPar *t_positionPar)
Double_t Z20
a cluster (group of neighboring crystals) of hit emc crystals
Definition: BSEmcCluster.h:66
Parameter for crystal positions.
Double_t Lateral
Helper class to calculate Zernike and Lateral Moments.
represents the reconstructed hit of one emc crystal
Definition: BSEmcDigi.h:59