PandaRoot
BSEmcExpClusterSplittingProcess.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 // $Id:$
16 //
17 // Description:
18 // Class BSEmcExpClusterSplittingProcess.
19 // Concrete implementation of BSEmcAbsClusterSplitter which splits
20 // on the basis of exponential distance from the bump centroid.
21 //
22 // Environment:
23 // Software developed for the BaBar Detector at the SLAC B-Factory.
24 //
25 // Adapted for the PANDA experiment at GSI
26 //
27 // Author List:
28 // Phil Strother
29 //
30 // Copyright Information:
31 // Copyright (C) 1997 Imperial College
32 //
33 // Modified:
34 // M. Babai
35 //------------------------------------------------------------------------
36 
37 #ifndef BSEMCEXPCLUSTERSPLITTINGPROCESS_HH
38 #define BSEMCEXPCLUSTERSPLITTINGPROCESS_HH
39 
40 #include <map>
41 #include <memory>
42 #include <string>
43 #include <vector>
44 
45 #include "Rtypes.h"
46 #include "RtypesCore.h"
47 #include "TString.h"
48 #include "TVector3.h"
49 
50 #include "PndContainerI.h"
51 #include "PndProcess.h"
52 
53 #include "BSEmcCluster.h"
54 
55 #include "BSEmcClusteringPar.h"
58 #include "BSEmcPositionAlgo.h"
59 
60 class BSEmcDigi;
61 class BSEmcCluster;
62 class BSEmcSubCluster;
63 class FairParGenericSet;
64 class BSEmcClusteringPar;
67 class TBuffer;
68 class TClass;
69 class TMemberInspector;
70 struct BSEmcClusteringData;
71 template <class T>
72 class PndContainerI;
73 template <class T>
75 
77  Double_t fEnergy{0};
78  TVector3 fLocation{0, 0, 0};
79  Double_t fSubClusterEnergy{0};
80 };
81 
93  public:
94  // Constructor
96  // Destructor
98 
99  virtual void SetDetectorName(const std::string &t_detectorName) /*override*/;
100  virtual void SetupParameters(const PndParameterRegister *t_paramRegister) /*override*/;
101  virtual void RequestDataContainer(PndContainerRegister *t_register) /*override*/;
102  virtual void GetDataContainer(PndContainerRegister *t_register) /*override*/;
103  virtual void Process() /*override*/;
104  std::vector<BSEmcSubCluster *> SubClustering(const std::vector<const BSEmcDigi *> &t_digiCont, const std::vector<BSEmcCluster *> &t_clusterCont);
105  void SetClusteringParName(const std::string &t_parName) { fClusteringParName = t_parName; }
106  void SetClusterPropertiesParName(const std::string &t_parName) { fClusterPropertiesParName = t_parName; }
107  void SetPositionParName(const std::string &t_parName) { fPositionParName = t_parName; }
108  void SetNeighbouringRelationParName(const std::string &t_parName) { fNeighbouringRelationParName = t_parName; }
109 
110  void SetDigiBranchName(const TString &t_branchname) { fDigiBranchname = t_branchname; }
111  void SetClusterBranchName(const TString &t_branchname) { fClusterBranchname = t_branchname; }
112  void SetSubClusterBranchName(const TString &t_branchname) { fSubClusterBranchname = t_branchname; }
113 
114  private:
115  std::string fClusteringParName{""};
116  std::string fClusterPropertiesParName{""};
117  std::string fPositionParName{""};
118  std::string fNeighbouringRelationParName{""};
119 
120  TString fDigiBranchname{""};
121  TString fClusterBranchname{""};
122  TString fSubClusterBranchname{""};
123 
124  PndContainerI<BSEmcDigi> *fDigiArray{nullptr};
125  PndMutableContainerI<BSEmcCluster> *fClusterArray{nullptr};
126  PndMutableContainerI<BSEmcSubCluster> *fSubClusterArray{nullptr};
127  std::vector<BSEmcSubCluster *> fSubClusterVector{};
128 
129  Double_t fExponentialConstant{-1};
130  Int_t fMaxIterations{-1};
131  Double_t fCentroidShift{-1};
132  Int_t fMaxSubClusters{-1};
133  Double_t fMinDigiEnergy{-1};
134 
135  std::unique_ptr<BSEmcPositionAlgo> fPositionProcess{new BSEmcPositionAlgo};
136  std::unique_ptr<BSEmcEnergyCalculationAlgo> fEnergyProcess{new BSEmcEnergyCalculationAlgo};
137  Double_t fClusterEnergyCut{-1};
138 
139  protected:
140  Double_t fMoliereRadius{-1};
141  BSEmcCrystalPositionPar *fPositionPar{nullptr};
142 
143  private:
144  std::vector<DigiLocationInfo> GetEnergyAndLocationInfo(const std::vector<const BSEmcDigi *> &t_digiCont, const std::vector<BSEmcDigiInfo_t> &t_digis) const;
145  void ClearSubClusters(std::map<Int_t, BSEmcSubCluster *> &t_tmpsubClusters) const;
146  virtual Double_t
147  CalculateWeight(Int_t t_currentDigiDetID, Int_t t_currentMaxDetId, const TVector3 &t_currentdigisPosition, const std::map<Int_t, DigiLocationInfo> &t_centroidPositions) const;
148  void UpdateCentroidPositions(const std::map<Int_t, BSEmcSubCluster *> &t_subClusters, std::map<Int_t, DigiLocationInfo> &t_centroidPositions) const;
149  void AddDigiWithWeightToSubCluster(Int_t t_digiIdx, Double_t t_weight, BSEmcSubCluster *t_subcluster);
150  void AddSubClusters(const std::map<Int_t, BSEmcSubCluster *> &t_subClusters, const std::vector<BSEmcCluster *> &t_clusterCont, Int_t t_clusterIdx);
151  void SplitIntoMultipleSubCluster(BSEmcCluster *t_cluster, Int_t t_clusterIdx, const std::vector<const BSEmcDigi *> &t_digiCont, const std::vector<BSEmcCluster *> &t_clusterCont);
152  void SplitIntoSingleSubCluster(BSEmcCluster *t_cluster, Int_t t_clusterIdx);
153 
154  ClassDef(BSEmcExpClusterSplittingProcess, 2);
155 };
156 #endif /*BSEMCEXPCLUSTERSPLITTINGPROCESS_HH*/
void SetDigiBranchName(const TString &t_branchname)
Base Process class.
Definition: PndProcess.h:36
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:66
Parameter for crystal positions.
void SetPositionParName(const std::string &t_parName)
represents the reconstructed hit of one emc crystal
Definition: BSEmcDigi.h:59
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:51
void SetSubClusterBranchName(const TString &t_branchname)