CbmRoot
CbmTrdClusterFinder.h
Go to the documentation of this file.
1 #ifndef CBMTRDCLUSTERFINDER_H
2 #define CBMTRDCLUSTERFINDER_H
3 
4 #include "FairTask.h"
5 
6 #include <map>
7 #include <set>
8 #include <vector>
9 
10 class CbmTrdCluster;
11 class CbmTrdDigi;
12 class CbmTrdParSetAsic;
13 class CbmTrdParSetGas;
14 class CbmTrdParSetGeo;
15 class CbmTrdParSetDigi;
16 class CbmTrdParSetGain;
17 class CbmTrdModuleRec;
18 class TClonesArray;
19 class TGeoPhysicalNode;
20 
37 class CbmTrdClusterFinder : public FairTask {
38  friend class CbmTrdModuleRecR;
39  friend class CbmTrdModuleRecT;
40 
41 public:
42  enum CbmTrdRecDef {
43  kTime = 0,
49  kFASP
50  };
51 
56 
61 
62  static Float_t GetMinimumChargeTH() { return fgMinimumChargeTH; }
63  static Bool_t HasDumpClusters() { return TESTBIT(fgConfig, kDumpClusters); }
64  static Bool_t HasMultiHit() { return TESTBIT(fgConfig, kMultiHit); }
65  static Bool_t HasNeighbourCol() { return TESTBIT(fgConfig, kNeighbourCol); }
66  static Bool_t HasNeighbourRow() { return TESTBIT(fgConfig, kNeighbourRow); }
67  static Bool_t HasRowMerger() { return TESTBIT(fgConfig, kRowMerger); }
68  static Bool_t IsTimeBased() { return TESTBIT(fgConfig, kTime); }
69 
71  //virtual InitStatus ReInit();
72  virtual InitStatus Init();
73  virtual void SetParContainers();
74 
76  virtual void Exec(Option_t* option);
77 
79  virtual void Finish();
80 
81 
82  static void SetDumpClusters(Bool_t set = kTRUE) {
83  set ? SETBIT(fgConfig, kDumpClusters) : CLRBIT(fgConfig, kDumpClusters);
84  }
85  static void SetRowMerger(Bool_t set = kTRUE) {
86  set ? SETBIT(fgConfig, kRowMerger) : CLRBIT(fgConfig, kRowMerger);
87  }
88  static void SetMultiHit(Bool_t set = kTRUE) {
89  set ? SETBIT(fgConfig, kMultiHit) : CLRBIT(fgConfig, kMultiHit);
90  }
91  static void SetNeighbourEnable(Bool_t col = kTRUE, Bool_t row = kFALSE) {
92  col ? SETBIT(fgConfig, kNeighbourCol) : CLRBIT(fgConfig, kNeighbourCol);
93  row ? SETBIT(fgConfig, kNeighbourRow) : CLRBIT(fgConfig, kNeighbourRow);
94  }
95  static void SetMinimumChargeTH(Float_t th) { fgMinimumChargeTH = th; }
96  static void SetTimeBased(Bool_t set = kTRUE) {
97  set ? SETBIT(fgConfig, kTime) : CLRBIT(fgConfig, kTime);
98  }
99 
100 protected:
102  Bool_t AddCluster(CbmTrdCluster* c);
103 
104 private:
107 
108  Int_t AddClusters(TClonesArray* clusters, Bool_t moveOwner = kTRUE);
110 
111  static Int_t
113  static Float_t fgMinimumChargeTH;
114 
115 
116  TClonesArray* fClusters;
118  std::map<Int_t, std::set<Int_t>> fDigiMap;
119  std::map<Int_t, std::set<Int_t>> fModuleMap;
120 
121  std::set<Int_t> fNeighbours;
122  std::map<Int_t, std::set<Int_t>>
123  fModDigiMap; //std::map<Int_t ModuleID, std::vector<Int_t DigiID> >
124 
125  std::map<Int_t, Int_t> fDigiRow;
126  std::map<Int_t, Int_t> fDigiCol;
127  std::map<Int_t, Double_t> fDigiCharge;
128 
129  std::vector<std::set<Int_t>> fClusterBuffer;
130  std::map<Int_t, std::vector<std::set<Int_t>>> fModClusterDigiMap;
131 
132  //==================================================================
133  std::map<Int_t, CbmTrdModuleRec*>
140 
142 };
143 #endif
CbmTrdClusterFinder::CbmTrdRecDef
CbmTrdRecDef
Definition: CbmTrdClusterFinder.h:42
CbmTrdClusterFinder::AddCluster
Bool_t AddCluster(CbmTrdCluster *c)
Save one finished cluster to the output.
Definition: CbmTrdClusterFinder.cxx:83
CbmTrdClusterFinder::fDigiCol
std::map< Int_t, Int_t > fDigiCol
Definition: CbmTrdClusterFinder.h:126
CbmTrdClusterFinder::kFASP
@ kFASP
use FASP ASIC for triangular pad plane geometry
Definition: CbmTrdClusterFinder.h:49
CbmTrdParSetGas
Describe TRD module working settings (HV, etc)
Definition: CbmTrdParSetGas.h:15
CbmTrdClusterFinder::ClassDef
ClassDef(CbmTrdClusterFinder, 1)
CbmTrdParSetAsic
Describe TRD module ASIC settings (electronic gain, delays, etc)
Definition: CbmTrdParSetAsic.h:18
CbmTrdClusterFinder::HasDumpClusters
static Bool_t HasDumpClusters()
Definition: CbmTrdClusterFinder.h:63
CbmTrdClusterFinder::SetMultiHit
static void SetMultiHit(Bool_t set=kTRUE)
Definition: CbmTrdClusterFinder.h:88
CbmTrdClusterFinder::kDumpClusters
@ kDumpClusters
write clustered digis to output
Definition: CbmTrdClusterFinder.h:48
CbmTrdModuleRec
Abstract class for module wise cluster finding and hit reconstruction.
Definition: CbmTrdModuleRec.h:16
CbmTrdClusterFinder::kRowMerger
@ kRowMerger
merge clusters over neighbour rows
Definition: CbmTrdClusterFinder.h:45
CbmTrdClusterFinder::fModDigiMap
std::map< Int_t, std::set< Int_t > > fModDigiMap
Definition: CbmTrdClusterFinder.h:123
CbmTrdClusterFinder::fClusterBuffer
std::vector< std::set< Int_t > > fClusterBuffer
Definition: CbmTrdClusterFinder.h:129
CbmTrdCluster
Data Container for TRD clusters.
Definition: CbmTrdCluster.h:23
CbmTrdClusterFinder::kMultiHit
@ kMultiHit
multi hit detection
Definition: CbmTrdClusterFinder.h:44
CbmTrdParSetGain
Definition: CbmTrdParSetGain.h:16
CbmTrdClusterFinder::AddClusters
Int_t AddClusters(TClonesArray *clusters, Bool_t moveOwner=kTRUE)
Definition: CbmTrdClusterFinder.cxx:286
CbmTrdClusterFinder
Definition: CbmTrdClusterFinder.h:37
CbmTrdClusterFinder::CbmTrdClusterFinder
CbmTrdClusterFinder(const CbmTrdClusterFinder &)
CbmTrdClusterFinder::kNeighbourRow
@ kNeighbourRow
use neighbour trigger; row wise
Definition: CbmTrdClusterFinder.h:47
CbmTrdClusterFinder::fGainPar
CbmTrdParSetGain * fGainPar
parameter list for keV->ADC gain conversion
Definition: CbmTrdClusterFinder.h:138
CbmTrdClusterFinder::fModuleMap
std::map< Int_t, std::set< Int_t > > fModuleMap
/‍** sector digis **‍/
Definition: CbmTrdClusterFinder.h:119
d
double d
Definition: P4_F64vec2.h:24
CbmTrdClusterFinder::fDigiRow
std::map< Int_t, Int_t > fDigiRow
Definition: CbmTrdClusterFinder.h:125
CbmTrdClusterFinder::HasNeighbourRow
static Bool_t HasNeighbourRow()
Definition: CbmTrdClusterFinder.h:66
CbmTrdClusterFinder::fDigiCharge
std::map< Int_t, Double_t > fDigiCharge
Definition: CbmTrdClusterFinder.h:127
CbmTrdClusterFinder::HasRowMerger
static Bool_t HasRowMerger()
Definition: CbmTrdClusterFinder.h:67
CbmTrdClusterFinder::fgMinimumChargeTH
static Float_t fgMinimumChargeTH
Definition: CbmTrdClusterFinder.h:113
CbmTrdClusterFinder::SetNeighbourEnable
static void SetNeighbourEnable(Bool_t col=kTRUE, Bool_t row=kFALSE)
Definition: CbmTrdClusterFinder.h:91
CbmTrdClusterFinder::fDigiPar
CbmTrdParSetDigi * fDigiPar
parameter list for read-out geometry
Definition: CbmTrdClusterFinder.h:137
CbmTrdClusterFinder::HasMultiHit
static Bool_t HasMultiHit()
Definition: CbmTrdClusterFinder.h:64
CbmTrdClusterFinder::HasNeighbourCol
static Bool_t HasNeighbourCol()
Definition: CbmTrdClusterFinder.h:65
CbmTrdClusterFinder::AddModule
CbmTrdModuleRec * AddModule(const CbmTrdDigi *d)
Definition: CbmTrdClusterFinder.cxx:90
CbmTrdClusterFinder::fGasPar
CbmTrdParSetGas * fGasPar
parameter list for HV status
Definition: CbmTrdClusterFinder.h:136
CbmTrdParSetGeo
Definition: CbmTrdParSetGeo.h:9
CbmTrdModuleRecR
Rectangular pad module; Cluster finding and hit reconstruction algorithms.
Definition: CbmTrdModuleRecR.h:14
CbmTrdClusterFinder::CbmTrdClusterFinder
CbmTrdClusterFinder()
Default constructor.
Definition: CbmTrdClusterFinder.cxx:44
CbmTrdClusterFinder::operator=
CbmTrdClusterFinder & operator=(const CbmTrdClusterFinder &)
CbmTrdClusterFinder::fAsicPar
CbmTrdParSetAsic * fAsicPar
parameter list for ASIC characterization
Definition: CbmTrdClusterFinder.h:135
CbmTrdClusterFinder::fgConfig
static Int_t fgConfig
Configuration map for the clusterizer. See CbmTrdRecDef for details.
Definition: CbmTrdClusterFinder.h:112
CbmTrdClusterFinder::fClusters
TClonesArray * fClusters
Definition: CbmTrdClusterFinder.h:116
CbmTrdModuleRecT
Triangular pad module; Cluster finding and hit reconstruction algorithms.
Definition: CbmTrdModuleRecT.h:16
CbmTrdClusterFinder::SetMinimumChargeTH
static void SetMinimumChargeTH(Float_t th)
Definition: CbmTrdClusterFinder.h:95
CbmTrdClusterFinder::fModClusterDigiMap
std::map< Int_t, std::vector< std::set< Int_t > > > fModClusterDigiMap
Definition: CbmTrdClusterFinder.h:130
CbmTrdClusterFinder::SetParContainers
virtual void SetParContainers()
Definition: CbmTrdClusterFinder.cxx:149
CbmTrdClusterFinder::fGeoPar
CbmTrdParSetGeo * fGeoPar
parameter list for modules geometry
Definition: CbmTrdClusterFinder.h:139
CbmTrdClusterFinder::IsTimeBased
static Bool_t IsTimeBased()
Definition: CbmTrdClusterFinder.h:68
CbmTrdClusterFinder::SetTimeBased
static void SetTimeBased(Bool_t set=kTRUE)
Definition: CbmTrdClusterFinder.h:96
CbmTrdClusterFinder::~CbmTrdClusterFinder
~CbmTrdClusterFinder()
Default destructor.
Definition: CbmTrdClusterFinder.cxx:69
CbmTrdClusterFinder::fModules
std::map< Int_t, CbmTrdModuleRec * > fModules
list of modules being processed
Definition: CbmTrdClusterFinder.h:134
CbmTrdDigi
Definition: CbmTrdDigi.h:14
CbmTrdParSetDigi
Definition: CbmTrdParSetDigi.h:15
CbmTrdClusterFinder::Exec
virtual void Exec(Option_t *option)
Executed task.
Definition: CbmTrdClusterFinder.cxx:213
CbmTrdClusterFinder::kTime
@ kTime
select Time based/Event by event reconstruction
Definition: CbmTrdClusterFinder.h:43
CbmTrdClusterFinder::Finish
virtual void Finish()
Definition: CbmTrdClusterFinder.cxx:337
CbmTrdClusterFinder::fDigiMap
std::map< Int_t, std::set< Int_t > > fDigiMap
Definition: CbmTrdClusterFinder.h:118
CbmTrdClusterFinder::SetRowMerger
static void SetRowMerger(Bool_t set=kTRUE)
Definition: CbmTrdClusterFinder.h:85
CbmTrdClusterFinder::GetMinimumChargeTH
static Float_t GetMinimumChargeTH()
Definition: CbmTrdClusterFinder.h:62
CbmTrdClusterFinder::kNeighbourCol
@ kNeighbourCol
use neighbour trigger; column wise
Definition: CbmTrdClusterFinder.h:46
CbmTrdClusterFinder::fNeighbours
std::set< Int_t > fNeighbours
/‍** sector id per module **‍/
Definition: CbmTrdClusterFinder.h:121
CbmTrdClusterFinder::Init
virtual InitStatus Init()
Definition: CbmTrdClusterFinder.cxx:163
CbmTrdClusterFinder::SetDumpClusters
static void SetDumpClusters(Bool_t set=kTRUE)
Definition: CbmTrdClusterFinder.h:82