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