CbmRoot
Loading...
Searching...
No Matches
CbmMvdSensorHitfinderTask.h
Go to the documentation of this file.
1/* Copyright (C) 2014-2016 Institut fuer Kernphysik, Goethe-Universitaet Frankfurt, Frankfurt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Philipp Sitzmann [committer] */
4
5// -------------------------------------------------------------------------
6// ----- CbmMvdSensorHitfinderTask header file -----
7// ----- Created 11/09/13 P.Sitzmann -----
8// -------------------------------------------------------------------------
9
10
11#ifndef CBMMVDSENSORHITFINDERTASK_H
12#define CBMMVDSENSORHITFINDERTASK_H 1
13
14#include "CbmMvdCluster.h" // for CbmMvdCluster
15#include "CbmMvdSensorTask.h" // for CbmMvdSensorTask
16
17#include <FairTask.h> // for InitStatus
18
19#include <Rtypes.h> // for ClassDef
20#include <RtypesCore.h> // for Int_t, Double_t, Bool_t, Float_t, kTRUE
21#include <TClonesArray.h> // for TClonesArray
22#include <TString.h> // for TString
23
24#include <map> // for map
25#include <utility> // for pair
26
27class CbmMvdSensor;
28class TBuffer;
29class TCanvas;
30class TClass;
31class TH1F;
32class TH2F;
33class TMemberInspector;
34class TObjArray;
35class TObject;
36class TVector3;
37
39
40 public:
43
44
49 CbmMvdSensorHitfinderTask(Int_t mode);
50
51
54
55
57 void ExecChain();
58 void Exec();
59
61 void InitTask(CbmMvdSensor* mySensor);
62
64 {
65 new ((*fInputBuffer)[fInputBuffer->GetEntriesFast()]) CbmMvdCluster(*((CbmMvdCluster*) cluster));
66 inputSet = kTRUE;
67 };
68
69 void SetInput(TObject* cluster)
70 {
71 new ((*fInputBuffer)[fInputBuffer->GetEntriesFast()]) CbmMvdCluster(*((CbmMvdCluster*) cluster));
72 inputSet = kTRUE;
73 };
74
76 //Double_t GetSigmaX() const { return fSigmaX; };
77
79 void SetSigmaNoise(Double_t sigmaNoise, Bool_t addNoise)
80 {
81 fSigmaNoise = sigmaNoise;
82 fAddNoise = addNoise;
83 }
84 void SetSeedThreshold(Double_t seedCharge) { fSeedThreshold = seedCharge; }
85 void SetNeighbourThreshold(Double_t neighCharge) { fNeighThreshold = neighCharge; }
100 void SetAdcDynamic(Int_t adcDynamic) { fAdcDynamic = adcDynamic; };
101 void SetAdcOffset(Int_t adcOffset) { fAdcOffset = adcOffset; };
102 void SetAdcBits(Int_t adcBits) { fAdcBits = adcBits; };
103 Int_t GetAdcCharge(Float_t charge);
104
107 void SetHitPosErrX(Double_t errorX) { fHitPosErrX = errorX; }
108 void SetHitPosErrY(Double_t errorY) { fHitPosErrY = errorY; }
109 void SetHitPosErrZ(Double_t errorZ) { fHitPosErrZ = errorZ; }
111
112
113 //protected:
114 protected:
115 // ---------- Protected data members ------------------------------------
116
119 Int_t fAdcBits;
122
123 TClonesArray* fClusters;
124
125
128
129 // Debug Histograms
137 Float_t* fGausArray;
140
141 std::map<std::pair<Int_t, Int_t>, Int_t> fDigiMap;
142 std::map<std::pair<Int_t, Int_t>, Int_t>::iterator fDigiMapIt;
143
144
145 TH2F* h;
146 TH2F* h3;
147 TH1F* h1;
148 TH1F* h2;
149 TH1F* Qseed;
151
152 TCanvas* c1;
153
154 private:
155 Int_t fNEvent;
156 Int_t fMode;
157 Int_t fCounter;
158 Double_t fSigmaNoise;
163 Bool_t inputSet;
164
165
166 Double_t fLayerRadius;
168 Double_t fLayerPosZ;
169 Double_t fHitPosX;
170 Double_t fHitPosY;
171 Double_t fHitPosZ;
172 Double_t fHitPosErrX;
173 Double_t fHitPosErrY;
174 Double_t fHitPosErrZ;
175
176 TString fBranchName;
177
179 static const Short_t fChargeArraySize = 7; //must be an odd number >3, recommended numbers= 5 or 7
180
181 Bool_t fAddNoise;
182
185
186
187 // ----- Private methods ---------------------------------------------
188
189
191 void Reset();
192
194 void Finish();
195
196
198 InitStatus ReInit();
199
200
205
206
207 void SetMvdGeometry(Int_t detId);
208
209 // void GenerateFakeDigis(Double_t pixelSizeX, Double_t pixelSizeY);
210 // void CheckForNeighbours(vector<Int_t>* clusterArray, Int_t clusterDigi, TArrayS* pixelUsed);
211
212 void CreateHit(CbmMvdCluster* clusterArray, TVector3& pos, TVector3& dpos);
213 void ComputeCenterOfGravity(CbmMvdCluster* clusterArray, TVector3& pos, TVector3& dpos, double& indicatedTime,
214 double& startTime, double& endTime);
215 // void UpdateDebugHistos(vector<Int_t>* clusterArray, Int_t seedIndexX, Int_t seedIndexY);
216
217 private:
220
222};
223
224
225#endif
226
227/* fGausArray=new Float_t[fGausArrayLimit];
228 for(Int_t i=0;i<fGausArrayLimit;i++){fGausArray[i]=gRandom->Gaus(0, fSigmaNoise);};
229 fGausArrayIt=0;
230*/
TVector3 dpos
void SetInputCluster(CbmMvdCluster *cluster)
void InitTask(CbmMvdSensor *mySensor)
std::map< std::pair< Int_t, Int_t >, Int_t >::iterator fDigiMapIt
CbmMvdSensorHitfinderTask operator=(const CbmMvdSensorHitfinderTask &)
void ComputeCenterOfGravity(CbmMvdCluster *clusterArray, TVector3 &pos, TVector3 &dpos, double &indicatedTime, double &startTime, double &endTime)
CbmMvdSensorHitfinderTask(const CbmMvdSensorHitfinderTask &)
std::map< std::pair< Int_t, Int_t >, Int_t > fDigiMap
void SetSeedThreshold(Double_t seedCharge)
ClassDef(CbmMvdSensorHitfinderTask, 1)
void SetSigmaNoise(Double_t sigmaNoise, Bool_t addNoise)
void CreateHit(CbmMvdCluster *clusterArray, TVector3 &pos, TVector3 &dpos)
void SetMvdGeometry(Int_t detId)
void SetNeighbourThreshold(Double_t neighCharge)
TClonesArray * fInputBuffer