CbmRoot
Loading...
Searching...
No Matches
CbmMvdSensorFindHitTask.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// ----- CbmMvdSensorFindHitTask header file -----
7// ----- Created 11/09/13 P.Sitzmann -----
8// -------------------------------------------------------------------------
9
10
11#ifndef CBMMVDSENSORFINDHITTASK_H
12#define CBMMVDSENSORFINDHITTASK_H 1
13
14#include "CbmMvdCluster.h"
15#include "CbmMvdDigi.h"
16#include "CbmMvdPoint.h"
17#include "CbmMvdSensor.h"
18#include "CbmMvdSensorTask.h"
19#include "FairTask.h"
20#include "TArrayS.h"
21#include "TCanvas.h"
22#include "TH1.h"
23#include "TH1F.h"
24#include "TH2.h"
25#include "TMath.h"
26#include "TObjArray.h"
27#include "TRandom3.h"
28#include "TRefArray.h"
29#include "TStopwatch.h"
30#include "TString.h"
31
32#include <TClonesArray.h>
33
34#include <list>
35#include <map>
36#include <utility>
37#include <vector>
38
39class TClonesArray;
40class TRandom3;
42
44
45 public:
48
49
54 CbmMvdSensorFindHitTask(Int_t mode);
55
56
59
60
62 void ExecChain();
63 void Exec();
64
66 void InitTask(CbmMvdSensor* mySensor);
67
68 virtual void SetInput(TObject* digi)
69 {
70 new ((*fInputBuffer)[fInputBuffer->GetEntriesFast()]) CbmMvdDigi(*((CbmMvdDigi*) digi));
71 inputSet = kTRUE;
72 }
73
74 virtual void SetInputDigi(CbmMvdDigi* digi)
75 {
76 new ((*fInputBuffer)[fInputBuffer->GetEntriesFast()]) CbmMvdDigi(*((CbmMvdDigi*) digi));
77 inputSet = kTRUE;
78 }
79
81 //Double_t GetSigmaX() const { return fSigmaX; };
82
84 void SetSigmaNoise(Double_t sigmaNoise, Bool_t addNoise)
85 {
86 fSigmaNoise = sigmaNoise;
87 fAddNoise = addNoise;
88 }
89 void SetSeedThreshold(Double_t seedCharge) { fSeedThreshold = seedCharge; }
90 void SetNeighbourThreshold(Double_t neighCharge) { fNeighThreshold = neighCharge; }
105 void SetAdcDynamic(Int_t adcDynamic) { fAdcDynamic = adcDynamic; };
106 void SetAdcOffset(Int_t adcOffset) { fAdcOffset = adcOffset; };
107 void SetAdcBits(Int_t adcBits) { fAdcBits = adcBits; };
108 Int_t GetAdcCharge(Float_t charge);
109
112 void SetHitPosErrX(Double_t errorX) { fHitPosErrX = errorX; }
113 void SetHitPosErrY(Double_t errorY) { fHitPosErrY = errorY; }
114 void SetHitPosErrZ(Double_t errorZ) { fHitPosErrZ = errorZ; }
116
117
118 //protected:
119 protected:
120 // ---------- Protected data members ------------------------------------
121
124 Int_t fAdcBits;
127
128 TClonesArray* fDigis;
129 TClonesArray* fHits;
130 TClonesArray* fClusters;
131
132
135
136 // Debug Histograms
144 Float_t* fGausArray;
147
148 std::map<std::pair<Int_t, Int_t>, Int_t> fDigiMap;
149 std::map<std::pair<Int_t, Int_t>, Int_t>::iterator fDigiMapIt;
150
151
152 TH2F* h;
153 TH2F* h3;
154 TH1F* h1;
155 TH1F* h2;
156 TH1F* Qseed;
158
159 TCanvas* c1;
160
161 private:
162 Int_t fNEvent;
163 Int_t fMode;
164 Int_t fCounter;
165 Double_t fSigmaNoise;
170 Bool_t inputSet;
171
172
173 Double_t fLayerRadius;
175 Double_t fLayerPosZ;
176 Double_t fHitPosX;
177 Double_t fHitPosY;
178 Double_t fHitPosZ;
179 Double_t fHitPosErrX;
180 Double_t fHitPosErrY;
181 Double_t fHitPosErrZ;
182
183 TString fBranchName;
184
186 static const Short_t fChargeArraySize = 7; //must be an odd number >3, recommended numbers= 5 or 7
187
188 Bool_t fAddNoise;
189
192
193
194 // ----- Private methods ---------------------------------------------
195
196
198 void Reset();
199
201 void Finish();
202
203
205 InitStatus ReInit();
206
207
212
213
214 void SetMvdGeometry(Int_t detId);
215 void AddNoiseToDigis(CbmMvdDigi* digi);
216 // void GenerateFakeDigis(Double_t pixelSizeX, Double_t pixelSizeY);
217 void CheckForNeighbours(std::vector<Int_t>* clusterArray, Int_t clusterDigi, TArrayS* pixelUsed);
218
219 void CreateHit(std::vector<Int_t>* clusterArray, TVector3& pos, TVector3& dpos);
220 void ComputeCenterOfGravity(std::vector<Int_t>* clusterArray, TVector3& pos, TVector3& dpos);
221 void UpdateDebugHistos(std::vector<Int_t>* clusterArray, Int_t seedIndexX, Int_t seedIndexY);
222
223 private:
226
228};
229
230
231#endif
232
233/* fGausArray=new Float_t[fGausArrayLimit];
234 for(Int_t i=0;i<fGausArrayLimit;i++){fGausArray[i]=gRandom->Gaus(0, fSigmaNoise);};
235 fGausArrayIt=0;
236*/
TVector3 dpos
void SetAdcDynamic(Int_t adcDynamic)
void SetHitPosErrZ(Double_t errorZ)
static const Short_t fChargeArraySize
void UpdateDebugHistos(std::vector< Int_t > *clusterArray, Int_t seedIndexX, Int_t seedIndexY)
CbmMvdSensorFindHitTask operator=(const CbmMvdSensorFindHitTask &)
virtual void SetInput(TObject *digi)
CbmMvdSensorFindHitTask(const CbmMvdSensorFindHitTask &)
void SetSeedThreshold(Double_t seedCharge)
ClassDef(CbmMvdSensorFindHitTask, 1)
void ComputeCenterOfGravity(std::vector< Int_t > *clusterArray, TVector3 &pos, TVector3 &dpos)
std::map< std::pair< Int_t, Int_t >, Int_t > fDigiMap
void SetSigmaNoise(Double_t sigmaNoise, Bool_t addNoise)
void AddNoiseToDigis(CbmMvdDigi *digi)
virtual void SetInputDigi(CbmMvdDigi *digi)
std::map< std::pair< Int_t, Int_t >, Int_t >::iterator fDigiMapIt
void SetMvdGeometry(Int_t detId)
void SetHitPosErrX(Double_t errorX)
void SetHitPosErrY(Double_t errorY)
void CheckForNeighbours(std::vector< Int_t > *clusterArray, Int_t clusterDigi, TArrayS *pixelUsed)
void SetNeighbourThreshold(Double_t neighCharge)
void InitTask(CbmMvdSensor *mySensor)
Int_t GetAdcCharge(Float_t charge)
void SetAdcOffset(Int_t adcOffset)
void CreateHit(std::vector< Int_t > *clusterArray, TVector3 &pos, TVector3 &dpos)
TClonesArray * fInputBuffer