CbmRoot
Loading...
Searching...
No Matches
CbmMvdSensorClusterfinderTask.h
Go to the documentation of this file.
1/* Copyright (C) 2014-2017 Institut fuer Kernphysik, Goethe-Universitaet Frankfurt, Frankfurt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Philipp Sitzmann [committer] */
4
5// -------------------------------------------------------------------------
6// ----- CbmMvdSensorClusterfinderTask header file -----
7// ----- Created 11/09/13 P.Sitzmann -----
8// -------------------------------------------------------------------------
9
10
11#ifndef CBMMVDSENSORCLUSTERFINDERTASK_H
12#define CBMMVDSENSORCLUSTERFINDERTASK_H 1
13
14
15#include "CbmMvdCluster.h"
16#include "CbmMvdDigi.h"
17#include "CbmMvdSensor.h"
18#include "CbmMvdSensorTask.h"
19#include "TArrayS.h"
20#include "TCanvas.h"
21#include "TH1.h"
22#include "TH1F.h"
23#include "TH2.h"
24#include "TMath.h"
25#include "TObjArray.h"
26#include "TRandom3.h"
27#include "TRefArray.h"
28#include "TStopwatch.h"
29#include "TString.h"
30
31#include <TClonesArray.h>
32
33#include <list>
34#include <map>
35#include <utility>
36#include <vector>
37
38class TClonesArray;
39class TRandom3;
40
42
43 public:
46
47
52 CbmMvdSensorClusterfinderTask(Int_t mode, Int_t iVerbose);
53
54
57
58
60 void ExecChain();
61 void Exec(); // Processes time slice by organizing data and calling ExecFrame for each hardware frame.
62 void ExecFrame(Int_t currentFrame); // Processes data of a given frame + consecutive frame (time walk).
63
65 void InitTask(CbmMvdSensor* mySensor);
66
67 virtual void SetInputDigi(CbmMvdDigi* digi)
68 {
69 new ((*fInputBuffer)[fInputBuffer->GetEntriesFast()]) CbmMvdDigi(*((CbmMvdDigi*) digi));
70 inputSet = kTRUE;
71 }
72
73 virtual void SetInput(TObject* digi)
74 {
75 new ((*fInputBuffer)[fInputBuffer->GetEntriesFast()]) CbmMvdDigi(*((CbmMvdDigi*) digi));
76 inputSet = kTRUE;
77 }
78
80 void SetSigmaNoise(Double_t sigmaNoise, Bool_t addNoise)
81 {
82 fSigmaNoise = sigmaNoise;
83 fAddNoise = addNoise;
84 }
85 void SetSeedThreshold(Double_t seedCharge) { fSeedThreshold = seedCharge; }
86 void SetNeighbourThreshold(Double_t neighCharge) { fNeighThreshold = neighCharge; }
87
88
89 void SetAdcDynamic(Int_t adcDynamic) { fAdcDynamic = adcDynamic; };
90 void SetAdcOffset(Int_t adcOffset) { fAdcOffset = adcOffset; };
91 void SetAdcBits(Int_t adcBits) { fAdcBits = adcBits; };
92 Int_t GetAdcCharge(Float_t charge);
93
96 void SetHitPosErrX(Double_t errorX) { fHitPosErrX = errorX; }
97 void SetHitPosErrY(Double_t errorY) { fHitPosErrY = errorY; }
98 void SetHitPosErrZ(Double_t errorZ) { fHitPosErrZ = errorZ; }
99
100 void UpdateDebugHistos(CbmMvdCluster* cluster);
101
102 //protected:
103 protected:
104 // ---------- Protected data members ------------------------------------
105
108 Int_t fAdcBits;
110 Int_t fAddress;
112
113 TClonesArray* fDigis;
116
117 // Debug Histograms
125 Float_t* fGausArray;
128
129 std::map<std::pair<Int_t, Int_t>, Int_t> fDigiMap;
130 std::map<std::pair<Int_t, Int_t>, Int_t>::iterator fDigiMapIt;
131
132
133 TH2F* h;
134 TH2F* h3;
135 TH1F* h1;
136 TH1F* h2;
137 TH1F* Qseed;
139
140 TCanvas* c1;
141
142 private:
143 Int_t fNEvent;
144 Int_t fMode;
145 Int_t fCounter;
146 Int_t fVerbose;
147 Double_t fSigmaNoise;
151 Bool_t inputSet;
152
153 std::map<std::pair<Int_t, Int_t>, Int_t> ftempPixelMap; //* couples Pixel(x,y) with collected charge
154
155
156 Double_t fLayerRadius;
158 Double_t fLayerPosZ;
159 Double_t fHitPosX;
160 Double_t fHitPosY;
161 Double_t fHitPosZ;
162 Double_t fHitPosErrX;
163 Double_t fHitPosErrY;
164 Double_t fHitPosErrZ;
165
166 TString fBranchName;
167
168 static const Short_t fChargeArraySize = 5; //must be an odd number >3, recommended numbers= 5 or 7
169
170 Bool_t fAddNoise;
171
172 // ----- Private methods ---------------------------------------------
173
174
176 void Reset() { ; };
177
179 void Finish();
180
181 void CheckForNeighbours(std::vector<Int_t>* clusterArray, Int_t clusterDigi, TArrayS* pixelUsed);
182
184 Bool_t ReInit();
185
186
190 Int_t GetMvdGeometry() { return 0; };
191
192
193 private:
196
197 TClonesArray* fInputFrameBuffer;
198 TClonesArray* fOutputFrameBuffer;
199 TArrayS* fPixelUsed;
200
201 void CleanBuffers(Int_t);
202
204};
205
206
207#endif
CbmMvdSensorClusterfinderTask(const CbmMvdSensorClusterfinderTask &)
void SetSigmaNoise(Double_t sigmaNoise, Bool_t addNoise)
void UpdateDebugHistos(CbmMvdCluster *cluster)
std::map< std::pair< Int_t, Int_t >, Int_t > fDigiMap
ClassDef(CbmMvdSensorClusterfinderTask, 1)
void CheckForNeighbours(std::vector< Int_t > *clusterArray, Int_t clusterDigi, TArrayS *pixelUsed)
std::map< std::pair< Int_t, Int_t >, Int_t >::iterator fDigiMapIt
std::map< std::pair< Int_t, Int_t >, Int_t > ftempPixelMap
void SetNeighbourThreshold(Double_t neighCharge)
virtual void SetInputDigi(CbmMvdDigi *digi)
CbmMvdSensorClusterfinderTask operator=(const CbmMvdSensorClusterfinderTask &)
TClonesArray * fInputBuffer