PandaRoot
BSEmcMakePreclusters.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 //---------------------------------------------------------------------
18 //#pragma once
19 #ifndef BSEMCMAKEPRECLUSTERS_HH
20 #define BSEMCMAKEPRECLUSTERS_HH
21 
22 #include <memory>
23 #include <string>
24 #include <vector>
25 
26 #include "Rtypes.h"
27 #include "RtypesCore.h"
28 
29 #include "PndContainerI.h"
30 #include "PndProcess.h"
31 
34 #include "BSEmcPositionAlgo.h"
35 #include "BSEmcPrecluster.h"
36 
38 class BSEmcDigi;
40 class BSEmcPrecluster;
42 class TBuffer;
43 class TClass;
44 class TMemberInspector;
45 struct BSEmcClusteringData;
46 template <class T>
47 class PndContainerI;
48 template <class T>
50 
61  public:
63  virtual ~BSEmcMakePreclusters();
64 
65  virtual void SetDetectorName(const std::string &t_detectorName) /*override*/;
66  virtual void RequestDataContainer(PndContainerRegister *t_register) /*override*/;
67  virtual void GetDataContainer(PndContainerRegister *t_register) /*override*/;
68  virtual void SetupParameters(const PndParameterRegister *t_paramRegister) /*override*/;
69  virtual void Process() /*override*/;
70  std::vector<BSEmcPrecluster *> Precluster(const std::vector<const BSEmcDigi *> &t_digiCont);
71 
75  void SetPositionMethod(Int_t t_method) { fPosMethod = t_method; }
76  void SetDigiPositionType(Int_t t_type) { fDigiPosType = t_type; } // select whether to use mapped or real digi position
77 
78  void SetClusteringParName(const std::string &t_parName) { fClusteringParName = t_parName; }
79  void SetClusterPropertiesParName(const std::string &t_parName) { fClusterPropertiesParName = t_parName; }
80  void SetPositionParName(const std::string &t_parName) { fPositionParName = t_parName; }
81  void SetNeighbouringRelationParName(const std::string &t_parName) { fNeighbouringRelationParName = t_parName; }
82 
83  void SetDigiBranchName(const TString &t_branchname) { fDigiBranchname = t_branchname; }
84  void SetPreclusterBranchName(const TString &t_branchname) { fPreclusterBranchname = t_branchname; }
85 
86  protected:
87  virtual void FinishPreclusters(const std::vector<const BSEmcDigi *> &t_digiCont, const std::vector<BSEmcPrecluster *> &t_preclusterCont);
88  void FinishPrecluster(const std::vector<const BSEmcDigi *> &t_digiCont, BSEmcPrecluster *t_cluster);
89 
90  private:
91  TString fDigiBranchname{""};
92  TString fPreclusterBranchname{""};
93 
94  PndContainerI<BSEmcDigi> *fDigiArray{nullptr};
95  PndMutableContainerI<BSEmcPrecluster> *fPreclusterArray{nullptr};
96  std::string fClusteringParName{""};
97  std::string fClusterPropertiesParName{""};
98  std::string fPositionParName{""};
99  std::string fNeighbouringRelationParName{""};
100  Double_t fDigiEnergyThreshold{-1};
101  Int_t fPosMethod{0};
102  Int_t fDigiPosType{0};
103  BSEmcCrystalPositionPar *fPositionPar{nullptr};
104  BSEmcGeoNeighbouringRelationPar *fNeighbouringRelationPar{nullptr};
105 
106  std::unique_ptr<BSEmcPositionAlgo> fPositionProcess{new BSEmcPositionAlgo};
107  Int_t evtCounter;
108  Int_t digiCounter;
109  Int_t nTotDigisPassed;
110  Int_t fNrOfDigis;
111  Int_t fNrOfEvents;
112  Int_t nPrecProg;
113  Double_t DCtotRtime;
114  Double_t DCtotCtime;
115 
116  ClassDef(BSEmcMakePreclusters, 1)
117 };
118 #endif /*BSEMCMAKEPRECLUSTERS_HH*/
Base Process class.
Definition: PndProcess.h:36
void SetClusteringParName(const std::string &t_parName)
virtual void RequestDataContainer(PndContainerRegister *t_register)
Pass the container register to the process, and get the processes container requirements.
represents an emc precluster, formed in the (virtual) data concentrators
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...
Helper class to calculate the cluster position.
virtual void GetDataContainer(PndContainerRegister *t_register)
Pass the container register to the process, and set the processes container requirements.
void FinishPrecluster(const std::vector< const BSEmcDigi *> &t_digiCont, BSEmcPrecluster *t_cluster)
Online like preclustering, takes digis, sorts them into DataConcentrator and only clusters within one...
virtual ~BSEmcMakePreclusters()
Parameter for crystal positions.
virtual void Process()
The actual data transformation (digitizing, clustering, etc.) should be defined here.
void SetClusterPropertiesParName(const std::string &t_parName)
represents the reconstructed hit of one emc crystal
Definition: BSEmcDigi.h:59
virtual void FinishPreclusters(const std::vector< const BSEmcDigi *> &t_digiCont, const std::vector< BSEmcPrecluster *> &t_preclusterCont)
void SetPreclusterBranchName(const TString &t_branchname)
Interface to a datacontainer to be used in PandaROOT.
void SetPositionMethod(Int_t t_method)
virtual void SetupParameters(const PndParameterRegister *t_paramRegister)
Fetch all parameters from the PndParameterRegister.
std::vector< BSEmcPrecluster * > Precluster(const std::vector< const BSEmcDigi *> &t_digiCont)
Helper class to indirect the Parameter fetching via the FairRuntimeDb.
Neigbouring Relations based on a list of detectorIds.
void SetPositionParName(const std::string &t_parName)
void SetDigiPositionType(Int_t t_type)
void SetDigiBranchName(const TString &t_branchname)
void SetNeighbouringRelationParName(const std::string &t_parName)