PandaRoot
BSEmcMergePreclusters.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------
2 // File and Version Information:
3 // $Id: $
4 //
5 //---------------------------------------------------------------------
6 //#pragma once
7 #ifndef BSEMCMERGEPRECLUSTERS_HH
8 #define BSEMCMERGEPRECLUSTERS_HH
9 
10 #include <memory>
11 #include <string>
12 #include <vector>
13 
14 #include "Rtypes.h"
15 #include "RtypesCore.h"
16 
17 #include "PndContainerI.h"
18 #include "PndProcess.h"
19 
20 #include "BSEmcCluster.h"
21 
22 #include "BSEmcDigi.h"
24 #include "BSEmcPositionAlgo.h"
25 #include "BSEmcPrecluster.h"
26 
27 class BSEmcCluster;
29 class BSEmcDigi;
31 class BSEmcPrecluster;
33 class TBuffer;
34 class TClass;
35 class TMemberInspector;
36 struct BSEmcClusteringData;
37 template <class T>
38 class PndContainerI;
39 template <class T>
41 
52  public:
54 
55  virtual ~BSEmcMergePreclusters();
56 
57  virtual void SetDetectorName(const std::string &t_detectorName) /*override*/;
58  virtual void RequestDataContainer(PndContainerRegister *t_register) /*override*/;
59  virtual void GetDataContainer(PndContainerRegister *t_register) /*override*/;
60  virtual void SetupParameters(const PndParameterRegister *t_paramRegister) /*override*/;
61  virtual void Process() /*override*/;
62  std::vector<BSEmcCluster *> MergePreclusters(const std::vector<const BSEmcDigi *> &t_digiCont, const std::vector<BSEmcPrecluster *> &t_preclusterCont);
63 
64  void SetPositionMethod(Int_t method)
65  {
66  fPosMethod = method;
67  }
74  void SetNeighbourMethod(Int_t nbmethod)
75  {
76  fNbMethod = nbmethod;
77  }
84  void SetClusteringParName(const std::string &t_parName) { fClusteringParName = t_parName; }
85  void SetClusterPropertiesParName(const std::string &t_parName) { fClusterPropertiesParName = t_parName; }
86  void SetPositionParName(const std::string &t_parName) { fPositionParName = t_parName; }
87  void SetNeighbouringRelationParName(const std::string &t_parName) { fNeighbouringRelationParName = t_parName; }
88 
89  void SetDigiBranchName(const TString &t_branchname) { fDigiBranchname = t_branchname; }
90  void SetPreclusterBranchName(const TString &t_branchname) { fPreclusterBranchname = t_branchname; }
91  void SetClusterBranchName(const TString &t_branchname) { fClusterBranchname = t_branchname; }
92 
93  protected:
94  std::vector<Int_t> FindNeighbouringPrecluster(const std::vector<BSEmcPrecluster *> &t_preclusterCont);
95  std::vector<Int_t> ClusterNeigbours(const std::vector<Int_t> &t_neighbours, const std::vector<BSEmcPrecluster *> &t_preclusterCont);
96 
97  std::vector<BSEmcCluster *> MergePreclustersIntoCluster(const std::vector<Int_t> &t_clusterNrForPrecluster, const std::vector<BSEmcPrecluster *> &t_preclusterCont);
98 
99  virtual void FinishClusters(const std::vector<const BSEmcDigi *> &t_digiCont, const std::vector<BSEmcCluster *> &t_clusterCont);
100  void FinishCluster(const std::vector<const BSEmcDigi *> &t_digiCont, BSEmcCluster *tmpcluster);
101 
102  private:
103  TString fDigiBranchname{""};
104  TString fPreclusterBranchname{""};
105  TString fClusterBranchname{""};
106 
107  PndContainerI<BSEmcDigi> *fDigiArray{nullptr};
108  PndMutableContainerI<BSEmcPrecluster> *fPreclusterArray{nullptr};
109  PndMutableContainerI<BSEmcCluster> *fClusterArray{nullptr};
110  std::string fClusteringParName{""};
111  std::string fClusterPropertiesParName{""};
112  std::string fPositionParName{""};
113  std::string fNeighbouringRelationParName{""};
114  BSEmcGeoNeighbouringRelationPar *fNeighbouringRelationPar{nullptr};
115 
116  BSEmcCrystalPositionPar *fPositionPar{nullptr};
117  std::unique_ptr<BSEmcPositionAlgo> fPositionProcess{new BSEmcPositionAlgo};
118  Int_t fPosMethod;
119  Int_t fNbMethod;
120  Int_t evtCounter;
121  Int_t precCounter;
122  Int_t fNrOfPres;
123  Int_t nMrgProg;
124  Int_t nTotClusters;
125  Int_t fRemovedClusters;
126  Int_t nTotDigis;
127  Int_t wrongConnection;
128  Double_t CNtotRtime;
129  Double_t CNtotCtime;
130 
131  Int_t fClusterNr{0};
132  ClassDef(BSEmcMergePreclusters, 2)
133 };
134 #endif /*BSEMCMERGEPRECLUSTERS_HH*/
Base Process class.
Definition: PndProcess.h:24
Process to merge preclusters into Clusters.
virtual void SetDetectorName(const std::string &t_detectorName)
Set the Detector name. Important, as most EmcParameter need to know for which detector they need to b...
std::vector< BSEmcCluster * > MergePreclusters(const std::vector< const BSEmcDigi *> &t_digiCont, const std::vector< BSEmcPrecluster *> &t_preclusterCont)
std::vector< Int_t > FindNeighbouringPrecluster(const std::vector< BSEmcPrecluster *> &t_preclusterCont)
void SetDigiBranchName(const TString &t_branchname)
void SetNeighbouringRelationParName(const std::string &t_parName)
represents an emc precluster, formed in the (virtual) data concentrators
void SetNeighbourMethod(Int_t nbmethod)
void FinishCluster(const std::vector< const BSEmcDigi *> &t_digiCont, BSEmcCluster *tmpcluster)
Helper class to calculate the cluster position.
void SetPreclusterBranchName(const TString &t_branchname)
void SetClusteringParName(const std::string &t_parName)
virtual void GetDataContainer(PndContainerRegister *t_register)
Pass the container register to the process, and set the processes container requirements.
void SetClusterPropertiesParName(const std::string &t_parName)
void SetPositionParName(const std::string &t_parName)
a cluster (group of neighboring crystals) of hit emc crystals
Definition: BSEmcCluster.h:54
virtual void RequestDataContainer(PndContainerRegister *t_register)
Pass the container register to the process, and get the processes container requirements.
Parameter for crystal positions.
void SetPositionMethod(Int_t method)
virtual void Process()
The actual data transformation (digitizing, clustering, etc.) should be defined here.
represents the reconstructed hit of one emc crystal
Definition: BSEmcDigi.h:47
virtual ~BSEmcMergePreclusters()
std::vector< BSEmcCluster * > MergePreclustersIntoCluster(const std::vector< Int_t > &t_clusterNrForPrecluster, const std::vector< BSEmcPrecluster *> &t_preclusterCont)
Interface to a datacontainer to be used in PandaROOT.
virtual void FinishClusters(const std::vector< const BSEmcDigi *> &t_digiCont, const std::vector< BSEmcCluster *> &t_clusterCont)
Helper class to indirect the Parameter fetching via the FairRuntimeDb.
Neigbouring Relations based on a list of detectorIds.
void SetClusterBranchName(const TString &t_branchname)
std::vector< Int_t > ClusterNeigbours(const std::vector< Int_t > &t_neighbours, const std::vector< BSEmcPrecluster *> &t_preclusterCont)
virtual void SetupParameters(const PndParameterRegister *t_paramRegister)
Fetch all parameters from the PndParameterRegister.