PandaRoot
PndGemFindClustersTB.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 //* $Id: */
14 
15 // -------------------------------------------------------------------------
16 // ----- PndGemFindClustersTB header file -----
17 // ----- Created 15/06/2013 by R. Karabowicz -----
18 // -------------------------------------------------------------------------
19 
30 #ifndef PNDGEMFINDCLUSTERSTB_H
31 #define PNDGEMFINDCLUSTERSTB_H 1
32 
33 #include "FairTask.h"
34 #include "FairTSBufferFunctional.h"
35 
36 #include "TStopwatch.h"
37 
38 #include <map>
39 #include <set>
40 
41 class TClonesArray;
42 class PndGemDigiPar;
43 class PndGemSensor;
44 class PndGemStation;
45 
46 struct DigiClusterTB {
47  Int_t detId;
48  std::vector<Int_t> digiNr;
49  std::vector<Int_t> chanNr;
50  std::vector<Double_t> sigADC;
51  std::vector<Double_t> sigTDC;
52  Double_t cluTDC;
53  Double_t cluADC;
54  Double_t cluPos;
55  Int_t cluPMn;
56  Int_t cluPMx;
57  Double_t cluMPs;
58  Double_t cluMVl;
59 };
60 
61 class PndGemFindClustersTB : public FairTask {
62 
63  public:
66 
68  PndGemFindClustersTB(Int_t iVerbose);
69 
71  PndGemFindClustersTB(const char *name, Int_t iVerbose = 0);
72 
74  virtual ~PndGemFindClustersTB();
75 
77  virtual void Exec(Option_t *opt);
78 
79  void SetInBranchName(TString ibn) { fInBranchName = ibn.Data(); }
80 
81  private:
82  PndGemDigiPar *fDigiPar;
83  TClonesArray *fDigis;
84  TClonesArray *fClusters;
86  Int_t fTNofEvents;
87  Int_t fTNofDigis;
88  Int_t fTNofClusters;
89 
90  BinaryFunctor *fFunctor;
91 
92  Double_t fPrepTime;
93  Double_t fCreateTime;
94  Double_t fSortTime;
95  Double_t fCheckTime;
96  Double_t fAnaTime;
97  Double_t fWriteTime;
98  Double_t fAllTime;
99 
100  TString fInBranchName;
101 
102  std::vector<DigiClusterTB> fDigiClusters;
103 
104  TStopwatch fTimer;
105 
107  virtual void SetParContainers();
108 
110  virtual InitStatus Init();
111 
113  virtual InitStatus ReInit();
114 
116  Int_t CreateClusters();
117 
119  Int_t WriteClusters();
120 
121  void AnalyzeClusters();
122 
123  void SortClusters();
124  void SortCluster(Int_t clus);
125  void PrintClusters();
126  void PrintCluster(Int_t clus);
127 
128  void CheckClusters();
129  void CheckCluster(Int_t clus);
130 
131  void JoinTwoClusters(Int_t clus1, Int_t clus2);
132 
133  void AddDigiToCluster(Int_t digiNr, Int_t clusNr);
134 
136  Bool_t CompareDigiToClusters(Int_t digiNumber);
137 
139  virtual void Finish();
140 
141  ClassDef(PndGemFindClustersTB, 1);
142 };
143 
144 #endif
std::vector< Double_t > sigTDC
Digitization Parameter Class for GEM part.
Definition: PndGemDigiPar.h:42
std::vector< Int_t > digiNr
void SetInBranchName(TString ibn)
std::vector< Double_t > sigADC
std::vector< Int_t > chanNr