PandaRoot
PndEmcDistributedClustering.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 PNDEMCDISTRIBUTEDCLUSTERING_H
20 #define PNDEMCDISTRIBUTEDCLUSTERING_H
21 
22 #include "FairTask.h"
23 #include <vector>
24 
25 #include "FairTSBufferFunctional.h"
26 #include "TStopwatch.h"
27 #include "TH1.h"
28 #include "TVector3.h"
29 
30 class TClonesArray;
31 class TObjectArray;
32 class PndEmcDigi;
33 class PndEmcCluster;
34 class PndEmcGeoPar;
35 class PndEmcRecoPar;
36 class BinaryFunctor;
37 
46 class PndEmcDistributedClustering : public FairTask
47 {
48 public:
49 
50  // Constructors
51 
52  PndEmcDistributedClustering(Int_t verbose=0, Bool_t storeclusters=kTRUE);
53 
54  // Destructor
55 
57 
59  virtual InitStatus Init();
60 
62  virtual void Exec(Option_t* opt);
63 
65  virtual void FinishTask();
66 
67  void SetStorageOfData(Bool_t val);
68 
70  void StoreClusterBaseDigis(Bool_t val = kTRUE) { fStoreClusterBase = kTRUE; }
71 
73  void SetTimebunchCutTime(Double_t time) { fTimebunchCutTime = time; }
75  void SetClusterActiveTime(Double_t dt) { fClusterActiveTime = dt; }
76 
78  void SetClusterMinimumEnergy(Double_t minE) { fClusterEnergyCut = minE; }
79  void EnableRemovalOfLowEnergyClusters(Bool_t enable) {fRemoveLowEclus = enable;}
83  void SetPositionMethod(Int_t method) { fPosMethod = method; }
90  void SetNeighbourMethod(Int_t nbmethod) { fNbMethod = nbmethod; }
98  void SetAutoDetermineTimecuts(Bool_t autodet) {fAutoDetermine = autodet;}
99 
100  void SetFactor(TVector3* factor) {fFactor = factor;}
101 
102 protected:
103  virtual void FinishPreclusters();
104  void FinishPrecluster(PndEmcCluster* tmpcluster);
105  virtual void FinishClusters();
106  void FinishCluster(PndEmcCluster* tmpcluster, int);
107  virtual void RemoveLowEnergyClusters();
108  virtual void MapDistancesToSingleHitClusters();
109 
110 private:
112  TClonesArray* fDigiArray;
113  TClonesArray* fPreclusterArray;
114 
116  TClonesArray* fClusterArray;
117 
118  PndEmcGeoPar* fGeoPar;
119  PndEmcRecoPar* fRecoPar;
121  Double_t fDigiEnergyTresholdBarrel;
122  Double_t fDigiEnergyTresholdFWD;
123  Double_t fDigiEnergyTresholdBWD;
124  Double_t fDigiEnergyTresholdShashlyk;
125  Double_t fClusterEnergyCut;
127  Double_t fTimebunchCutTime; // Defines how long clusters are kept open in timebased reconstruction
128  Double_t fClusterActiveTime;
129  BinaryFunctor* fDigiFunctor;
130 
131  std::vector<Double_t> fClusterPosParam;
132 
133  Int_t fNrOfEvents;
134  Int_t fPosMethod;
135  Int_t fNbMethod;
136  Int_t evtCounter;
137  Int_t digiCounter;
138  Int_t fNrOfDigis;
139  Int_t nDistProg;
140  Int_t fRemovedClusters;
141  Double_t DCtotRtime;
142  Double_t DCtotCtime;
143  Double_t CNtotRtime;
144  Double_t CNtotCtime;
145  bool tagSingleClus;
146  bool printClusters;
147  Bool_t fAutoDetermine;
148 
149  TH1I* hNdigis;
150 // TH1I* hClusMultiplicity;
151 // TH1D* hTimeDifference;
152  TH1D* hSingle;
153  TH1D* hDistancesToSingleHitClusters;
154 // TH1D* hRadDiff;
155 // TH1D* hPosDiff;
156 
157  Bool_t fStoreClusters;
158  Bool_t fStoreClusterBase; //restore digis in case of a timebased run
159  Bool_t fRemoveLowEclus;
160 
162  virtual void SetParContainers();
163 
164  TStopwatch fTimer;
165  int counter;
166  double stoptime;
167 
168  TVector3* fFactor;
169 
170  ClassDef(PndEmcDistributedClustering, 2)
171 };
172 #endif // PNDEMCDISTRIBUTEDCLUSTERING_HH
void SetAutoDetermineTimecuts(Bool_t autodet)
Task to create clusters from digis.
virtual void MapDistancesToSingleHitClusters()
virtual void FinishPreclusters()
void SetClusterActiveTime(Double_t dt)
Set time threshold for separating digis within a timebunch in ns.
PndEmcDistributedClustering(Int_t verbose=0, Bool_t storeclusters=kTRUE)
virtual InitStatus Init()
void EnableRemovalOfLowEnergyClusters(Bool_t enable)
virtual ~PndEmcDistributedClustering()
void SetStorageOfData(Bool_t val)
Method to specify whether clusters are stored or not.
void SetTimebunchCutTime(Double_t time)
Override EmcRecoPar cluster active time parameter ..to be set in ns!!!
virtual void FinishClusters()
virtual void Exec(Option_t *opt)
void FinishPrecluster(PndEmcCluster *tmpcluster)
void SetClusterMinimumEnergy(Double_t minE)
Set minimum cluster energy.
void StoreClusterBaseDigis(Bool_t val=kTRUE)
Restoring digis makes only sense if reconstruction is done timebased.
virtual void RemoveLowEnergyClusters()
void FinishCluster(PndEmcCluster *tmpcluster, int)
Parameter set for Emc Reco.
Definition: PndEmcRecoPar.h:25