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 #include "BSEmcClusteringData.h"
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 
51 class BSEmcMergePreclusters : public PndProcess<BSEmcClusteringData> {
52  public:
54 
55  virtual ~BSEmcMergePreclusters();
56 
57  virtual void SetDetectorName(const std::string &t_detectorName) /*override*/;
58  virtual void SetData(BSEmcClusteringData *t_data) /*override*/;
59  virtual void SetupParameters(const PndParameterRegister *t_paramRegister) /*override*/;
60  virtual void Process() /*override*/;
61  std::vector<BSEmcCluster *> MergePreclusters(const std::vector<const BSEmcDigi *> &t_digiCont, const std::vector<BSEmcPrecluster *> &t_preclusterCont);
62 
63  void SetPositionMethod(Int_t method)
64  {
65  fPosMethod = method;
66  }
73  void SetNeighbourMethod(Int_t nbmethod)
74  {
75  fNbMethod = nbmethod;
76  }
83  void SetClusteringParName(const std::string &t_parName) { fClusteringParName = t_parName; }
84  void SetClusterPropertiesParName(const std::string &t_parName) { fClusterPropertiesParName = t_parName; }
85  void SetPositionParName(const std::string &t_parName) { fPositionParName = t_parName; }
86  void SetNeighbouringRelationParName(const std::string &t_parName) { fNeighbouringRelationParName = t_parName; }
87 
88  protected:
89  std::vector<Int_t> FindNeighbouringPrecluster(const std::vector<BSEmcPrecluster *> &t_preclusterCont);
90  std::vector<Int_t> ClusterNeigbours(const std::vector<Int_t> &t_neighbours, const std::vector<BSEmcPrecluster *> &t_preclusterCont);
91 
92  std::vector<BSEmcCluster *> MergePreclustersIntoCluster(const std::vector<Int_t> &t_clusterNrForPrecluster, const std::vector<BSEmcPrecluster *> &t_preclusterCont);
93 
94  virtual void FinishClusters(const std::vector<const BSEmcDigi *> &t_digiCont, const std::vector<BSEmcCluster *> &t_clusterCont);
95  void FinishCluster(const std::vector<const BSEmcDigi *> &t_digiCont, BSEmcCluster *tmpcluster);
96 
97  private:
99  PndContainerI<BSEmcDigi> *fDigiArray{nullptr};
100  PndOutputContainerI<BSEmcPrecluster> *fPreclusterArray{nullptr};
101  PndOutputContainerI<BSEmcCluster> *fClusterArray{nullptr};
102  std::string fClusteringParName{""};
103  std::string fClusterPropertiesParName{""};
104  std::string fPositionParName{""};
105  std::string fNeighbouringRelationParName{""};
106  BSEmcGeoNeighbouringRelationPar *fNeighbouringRelationPar{nullptr};
107 
108  BSEmcCrystalPositionPar *fPositionPar{nullptr};
109  std::unique_ptr<BSEmcPositionAlgo> fPositionProcess{new BSEmcPositionAlgo};
110  Int_t fPosMethod;
111  Int_t fNbMethod;
112  Int_t evtCounter;
113  Int_t precCounter;
114  Int_t fNrOfPres;
115  Int_t nMrgProg;
116  Int_t nTotClusters;
117  Int_t fRemovedClusters;
118  Int_t nTotDigis;
119  Int_t wrongConnection;
120  Double_t CNtotRtime;
121  Double_t CNtotCtime;
122 
123  Int_t fClusterNr{0};
124  ClassDef(BSEmcMergePreclusters, 2)
125 };
126 #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 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 SetClusteringParName(const std::string &t_parName)
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
Parameter for crystal positions.
void SetPositionMethod(Int_t method)
virtual void Process()
The actual data transformation (digitizing, clustering, etc.) should be defined here.
Container of addresses for data Container used by BSEmcClusteringTask and passed to Clustering Proces...
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 SetData(BSEmcClusteringData *t_data)
Pass the data container ptrs to the process, and store pointers in class members. ...
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.
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.