PandaRoot
BSEmcExpClusterSplittingProcess.h
Go to the documentation of this file.
1 //--------------------------------------------------------------------------
2 // File and Version Information:
3 // $Id:$
4 //
5 // Description:
6 // Class BSEmcExpClusterSplittingProcess.
7 // Concrete implementation of BSEmcAbsClusterSplitter which splits
8 // on the basis of exponential distance from the bump centroid.
9 //
10 // Environment:
11 // Software developed for the BaBar Detector at the SLAC B-Factory.
12 //
13 // Adapted for the PANDA experiment at GSI
14 //
15 // Author List:
16 // Phil Strother
17 //
18 // Copyright Information:
19 // Copyright (C) 1997 Imperial College
20 //
21 // Modified:
22 // M. Babai
23 //------------------------------------------------------------------------
24 
25 #ifndef BSEMCEXPCLUSTERSPLITTINGPROCESS_HH
26 #define BSEMCEXPCLUSTERSPLITTINGPROCESS_HH
27 
28 #include <map>
29 #include <memory>
30 #include <string>
31 #include <vector>
32 
33 #include "Rtypes.h"
34 #include "RtypesCore.h"
35 #include "TString.h"
36 #include "TVector3.h"
37 
38 #include "PndContainerI.h"
39 #include "PndProcess.h"
40 
41 #include "BSEmcCluster.h"
42 
43 #include "BSEmcClusteringPar.h"
46 #include "BSEmcPositionAlgo.h"
47 
48 class BSEmcDigi;
49 class BSEmcCluster;
50 class BSEmcSubCluster;
51 class FairParGenericSet;
52 class BSEmcClusteringPar;
55 class TBuffer;
56 class TClass;
57 class TMemberInspector;
58 struct BSEmcClusteringData;
59 template <class T>
60 class PndContainerI;
61 template <class T>
63 
65  Double_t fEnergy{0};
66  TVector3 fLocation{0, 0, 0};
67 };
68 
80  public:
81  // Constructor
83  // Destructor
85 
86  virtual void SetDetectorName(const std::string &t_detectorName) /*override*/;
87  virtual void SetupParameters(const PndParameterRegister *t_paramRegister) /*override*/;
88  virtual void RequestDataContainer(PndContainerRegister *t_register) /*override*/;
89  virtual void GetDataContainer(PndContainerRegister *t_register) /*override*/;
90  virtual void Process() /*override*/;
91  std::vector<BSEmcSubCluster *> SubClustering(const std::vector<const BSEmcDigi *> &t_digiCont, const std::vector<BSEmcCluster *> &t_clusterCont);
92  void SetClusteringParName(const std::string &t_parName) { fClusteringParName = t_parName; }
93  void SetClusterPropertiesParName(const std::string &t_parName) { fClusterPropertiesParName = t_parName; }
94  void SetPositionParName(const std::string &t_parName) { fPositionParName = t_parName; }
95  void SetNeighbouringRelationParName(const std::string &t_parName) { fNeighbouringRelationParName = t_parName; }
96 
97  void SetDigiBranchName(const TString &t_branchname) { fDigiBranchname = t_branchname; }
98  void SetClusterBranchName(const TString &t_branchname) { fClusterBranchname = t_branchname; }
99  void SetSubClusterBranchName(const TString &t_branchname) { fSubClusterBranchname = t_branchname; }
100 
101  private:
102  std::string fClusteringParName{""};
103  std::string fClusterPropertiesParName{""};
104  std::string fPositionParName{""};
105  std::string fNeighbouringRelationParName{""};
106 
107  TString fDigiBranchname{""};
108  TString fClusterBranchname{""};
109  TString fSubClusterBranchname{""};
110 
111  PndContainerI<BSEmcDigi> *fDigiArray{nullptr};
112  PndMutableContainerI<BSEmcCluster> *fClusterArray{nullptr};
113  PndMutableContainerI<BSEmcSubCluster> *fSubClusterArray{nullptr};
114  std::vector<BSEmcSubCluster *> fSubClusterVector{};
115 
116  Double_t fMoliereRadius{-1};
117  Double_t fExponentialConstant{-1};
118  Int_t fMaxIterations{-1};
119  Double_t fCentroidShift{-1};
120  Int_t fMaxSubClusters{-1};
121  Double_t fMinDigiEnergy{-1};
122 
123  std::unique_ptr<BSEmcPositionAlgo> fPositionProcess{new BSEmcPositionAlgo};
124  std::unique_ptr<BSEmcEnergyCalculationAlgo> fEnergyProcess{new BSEmcEnergyCalculationAlgo};
125  BSEmcCrystalPositionPar *fPositionPar{nullptr};
126  Double_t fClusterEnergyCut{-1};
127 
128  private:
129  std::vector<DigiLocationInfo> GetEnergyAndLocationInfo(const std::vector<const BSEmcDigi *> &t_digiCont, const std::vector<BSEmcDigiInfo_t> &t_digis) const;
130  void ClearSubClusters(std::map<Int_t, BSEmcSubCluster *> &t_tmpsubClusters) const;
131  Double_t
132  CalculateWeight(Int_t t_currentDigiDetID, Int_t t_currentMaxDetId, const TVector3 &t_currentdigisPosition, const std::map<Int_t, DigiLocationInfo> &t_centroidPositions) const;
133  void UpdateCentroidPositions(const std::map<Int_t, BSEmcSubCluster *> &t_subClusters, std::map<Int_t, DigiLocationInfo> &t_centroidPositions) const;
134  void AddDigiWithWeightToSubCluster(Int_t t_digiIdx, Double_t t_weight, BSEmcSubCluster *t_subcluster);
135  void AddSubClusters(const std::map<Int_t, BSEmcSubCluster *> &t_subClusters, const std::vector<BSEmcCluster *> &t_clusterCont, Int_t t_clusterIdx);
136  void SplitIntoMultipleSubCluster(BSEmcCluster *t_cluster, Int_t t_clusterIdx, const std::vector<const BSEmcDigi *> &t_digiCont, const std::vector<BSEmcCluster *> &t_clusterCont);
137  void SplitIntoSingleSubCluster(BSEmcCluster *t_cluster, Int_t t_clusterIdx);
138 
139  ClassDef(BSEmcExpClusterSplittingProcess, 2);
140 };
141 #endif /*BSEMCEXPCLUSTERSPLITTINGPROCESS_HH*/
void SetDigiBranchName(const TString &t_branchname)
Base Process class.
Definition: PndProcess.h:24
Container for clustering parameter.
void SetNeighbouringRelationParName(const std::string &t_parName)
splits clusters on the basis of exponential distance from the subCluster centroid ...
Helper class to calculate the cluster position.
a cluster (group of neighboring crystals) of hit emc crystals
Definition: BSEmcCluster.h:54
Parameter for crystal positions.
void SetPositionParName(const std::string &t_parName)
represents the reconstructed hit of one emc crystal
Definition: BSEmcDigi.h:47
void SetClusteringParName(const std::string &t_parName)
void SetClusterBranchName(const TString &t_branchname)
Interface to a datacontainer to be used in PandaROOT.
void SetClusterPropertiesParName(const std::string &t_parName)
Helper class to calculate the Energies of a cluster.
Helper class to indirect the Parameter fetching via the FairRuntimeDb.
represents a reconstructed (splitted) emc cluster
simple Struct used in Cluster classes to index crystal. Includes the weight of the crystal on the cur...
Definition: BSEmcCluster.h:39
void SetSubClusterBranchName(const TString &t_branchname)