PandaRoot
PndGemFindClusters.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 // ----- PndGemFindClusters header file -----
17 // ----- Created 15/02/2009 by R. Karabowicz -----
18 // -------------------------------------------------------------------------
19 
30 #ifndef PNDGEMFINDCLUSTERS_H
31 #define PNDGEMFINDCLUSTERS_H 1
32 
33 #include "FairTask.h"
34 
35 #include "TStopwatch.h"
36 
37 #include <map>
38 #include <set>
39 
40 class TClonesArray;
41 class PndGemDigiPar;
42 class PndGemSensor;
43 class PndGemStation;
44 
45 struct DigiCluster {
46  Int_t detId;
47  std::vector<Int_t> digiNr;
48  std::vector<Int_t> chanNr;
49  std::vector<Double_t> sigADC;
50  Double_t cluTDC;
51  Double_t cluADC;
52  Double_t cluPos;
53  Int_t cluPMn;
54  Int_t cluPMx;
55  Double_t cluMPs;
56  Double_t cluMVl;
57 };
58 
59 class PndGemFindClusters : public FairTask {
60 
61  public:
64 
66  PndGemFindClusters(Int_t iVerbose);
67 
69  PndGemFindClusters(const char *name, Int_t iVerbose = 0);
70 
72  virtual ~PndGemFindClusters();
73 
75  virtual void Exec(Option_t *opt);
76 
77  private:
78  PndGemDigiPar *fDigiPar;
79  TClonesArray *fDigis;
80  TClonesArray *fClusters;
82  std::map<Double_t, Int_t> fTimeOrderedDigis;
83  std::vector<DigiCluster> fDigiClusters;
84 
85  Int_t fTNofEvents;
86  Int_t fTNofDigis;
87  Int_t fTNofClusters;
88 
89  TStopwatch fTimer;
90 
92  virtual void SetParContainers();
93 
95  virtual InitStatus Init();
96 
98  virtual InitStatus ReInit();
99 
101  Int_t SortDigis();
102 
103  // /** Find clusters **/
104  // void FindClusters();//not used
105 
107  Int_t CreateClusters();
108 
110  Int_t WriteClusters();
111 
112  // /** Compare digi to clusters **/
113  // Bool_t CompareDigiToClusters(Int_t digiNumber);
114 
116  Bool_t CompareDigiToClustersDigis(Int_t digiNumber);
117 
118  // /** Analyze clusters **/
119  // void AnalyzeClusters();//not used
120 
122  // void ClearClusters();//not used
123 
124  // void ClearClusters2();
125 
126  void SortClusters();
127  void SortCluster(Int_t clus);
128  void PrintClusters();
129  void PrintCluster(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  virtual void Finish();
137 
138  ClassDef(PndGemFindClusters, 1);
139 };
140 
141 #endif
std::vector< Int_t > digiNr
std::vector< Int_t > chanNr
Digitization Parameter Class for GEM part.
Definition: PndGemDigiPar.h:42
std::vector< Double_t > sigADC