CbmRoot
CbmMvdSensorHitfinderTask.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- CbmMvdSensorHitfinderTask header file -----
3 // ----- Created 11/09/13 P.Sitzmann -----
4 // -------------------------------------------------------------------------
5 
6 
7 #ifndef CBMMVDSENSORHITFINDERTASK_H
8 #define CBMMVDSENSORHITFINDERTASK_H 1
9 
10 #include "CbmMvdCluster.h"
11 #include "CbmMvdDigi.h"
12 #include "CbmMvdPoint.h"
13 #include "FairTask.h"
14 
15 #include "TArrayS.h"
16 #include "TCanvas.h"
17 #include "TObjArray.h"
18 #include "TRefArray.h"
19 
20 
21 #include "TH1.h"
22 #include "TH1F.h"
23 #include "TH2.h"
24 #include "TMath.h"
25 #include "TRandom3.h"
26 #include "TStopwatch.h"
27 #include "TString.h"
28 #include <list>
29 #include <map>
30 #include <utility>
31 #include <vector>
32 
33 #include "CbmMvdSensor.h"
34 #include "CbmMvdSensorTask.h"
35 
36 class TClonesArray;
37 class TRandom3;
39 
41 
42 public:
45 
46 
51  CbmMvdSensorHitfinderTask(Int_t mode);
52 
53 
56 
57 
59  void ExecChain();
60  void Exec();
61 
63  void InitTask(CbmMvdSensor* mySensor);
64 
65  void SetInputCluster(CbmMvdCluster* cluster) {
66  new ((*fInputBuffer)[fInputBuffer->GetEntriesFast()])
67  CbmMvdCluster(*((CbmMvdCluster*) cluster));
68  inputSet = kTRUE;
69  };
70 
72  //Double_t GetSigmaX() const { return fSigmaX; };
73 
75  void SetSigmaNoise(Double_t sigmaNoise, Bool_t addNoise) {
76  fSigmaNoise = sigmaNoise;
77  fAddNoise = addNoise;
78  }
79  void SetSeedThreshold(Double_t seedCharge) { fSeedThreshold = seedCharge; }
80  void SetNeighbourThreshold(Double_t neighCharge) {
81  fNeighThreshold = neighCharge;
82  }
97  void SetAdcDynamic(Int_t adcDynamic) { fAdcDynamic = adcDynamic; };
98  void SetAdcOffset(Int_t adcOffset) { fAdcOffset = adcOffset; };
99  void SetAdcBits(Int_t adcBits) { fAdcBits = adcBits; };
100  Int_t GetAdcCharge(Float_t charge);
101 
104  void SetHitPosErrX(Double_t errorX) { fHitPosErrX = errorX; }
105  void SetHitPosErrY(Double_t errorY) { fHitPosErrY = errorY; }
106  void SetHitPosErrZ(Double_t errorZ) { fHitPosErrZ = errorZ; }
108 
109 
110  //protected:
111 protected:
112  // ---------- Protected data members ------------------------------------
113 
114  Int_t fAdcDynamic;
115  Int_t fAdcOffset;
116  Int_t fAdcBits;
117  Int_t fAdcSteps;
118  Float_t fAdcStepSize;
119 
120  TClonesArray* fClusters;
121 
122 
123  TObjArray* fPixelChargeHistos;
125 
126  // Debug Histograms
134  Float_t* fGausArray;
137 
138  std::map<std::pair<Int_t, Int_t>, Int_t> fDigiMap;
139  std::map<std::pair<Int_t, Int_t>, Int_t>::iterator fDigiMapIt;
140 
141 
142  TH2F* h;
143  TH2F* h3;
144  TH1F* h1;
145  TH1F* h2;
146  TH1F* Qseed;
148 
149  TCanvas* c1;
150 
151 private:
152  Int_t fNEvent;
153  Int_t fMode;
154  Int_t fCounter;
155  Double_t fSigmaNoise;
156  Double_t fSeedThreshold;
157  Double_t fNeighThreshold;
159  Bool_t fUseMCInfo;
160  Bool_t inputSet;
161 
162 
163  Double_t fLayerRadius;
165  Double_t fLayerPosZ;
166  Double_t fHitPosX;
167  Double_t fHitPosY;
168  Double_t fHitPosZ;
169  Double_t fHitPosErrX;
170  Double_t fHitPosErrY;
171  Double_t fHitPosErrZ;
172 
173  TString fBranchName;
174 
176  static const Short_t fChargeArraySize =
177  7; //must be an odd number >3, recommended numbers= 5 or 7
178 
179  Bool_t fAddNoise;
180 
182 
184 
185  // ----- Private methods ---------------------------------------------
186 
187 
189  void Reset();
190 
192  void Finish();
193 
194 
196  InitStatus ReInit();
197 
198 
202  Int_t GetMvdGeometry();
203 
204 
205  void SetMvdGeometry(Int_t detId);
206 
207  // void GenerateFakeDigis(Double_t pixelSizeX, Double_t pixelSizeY);
208  // void CheckForNeighbours(vector<Int_t>* clusterArray, Int_t clusterDigi, TArrayS* pixelUsed);
209 
210  void CreateHit(CbmMvdCluster* clusterArray, TVector3& pos, TVector3& dpos);
211  void ComputeCenterOfGravity(CbmMvdCluster* clusterArray,
212  TVector3& pos,
213  TVector3& dpos);
214  // void UpdateDebugHistos(vector<Int_t>* clusterArray, Int_t seedIndexX, Int_t seedIndexY);
215 
216 private:
219 
221 };
222 
223 
224 #endif
225 
226 /* fGausArray=new Float_t[fGausArrayLimit];
227  for(Int_t i=0;i<fGausArrayLimit;i++){fGausArray[i]=gRandom->Gaus(0, fSigmaNoise);};
228  fGausArrayIt=0;
229 */
CbmMvdSensorHitfinderTask::fAdcDynamic
Int_t fAdcDynamic
Definition: CbmMvdSensorHitfinderTask.h:114
CbmMvdSensorHitfinderTask::operator=
CbmMvdSensorHitfinderTask operator=(const CbmMvdSensorHitfinderTask &)
CbmMvdSensorHitfinderTask::CbmMvdSensorHitfinderTask
CbmMvdSensorHitfinderTask()
Definition: CbmMvdSensorHitfinderTask.cxx:61
CbmMvdSensorHitfinderTask::fAdcSteps
Int_t fAdcSteps
Definition: CbmMvdSensorHitfinderTask.h:117
CbmMvdSensorHitfinderTask::~CbmMvdSensorHitfinderTask
virtual ~CbmMvdSensorHitfinderTask()
Definition: CbmMvdSensorHitfinderTask.cxx:168
CbmMvdSensorHitfinderTask::fBadHitHisto
TH2F * fBadHitHisto
Definition: CbmMvdSensorHitfinderTask.h:133
CbmMvdSensorHitfinderTask::fGausArrayIt
Int_t fGausArrayIt
Definition: CbmMvdSensorHitfinderTask.h:135
CbmMvdSensorHitfinderTask::fHitPosErrZ
Double_t fHitPosErrZ
Definition: CbmMvdSensorHitfinderTask.h:171
CbmMvdSensorHitfinderTask::Qseed
TH1F * Qseed
Definition: CbmMvdSensorHitfinderTask.h:146
CbmMvdPileupManager
Definition: CbmMvdPileupManager.h:28
CbmMvdDigi.h
CbmMvdSensorHitfinderTask::SetNeighbourThreshold
void SetNeighbourThreshold(Double_t neighCharge)
Definition: CbmMvdSensorHitfinderTask.h:80
CbmMvdSensorHitfinderTask::fHitPosZ
Double_t fHitPosZ
Definition: CbmMvdSensorHitfinderTask.h:168
CbmMvdSensorHitfinderTask::fShowDebugHistos
Bool_t fShowDebugHistos
Definition: CbmMvdSensorHitfinderTask.h:158
CbmMvdSensorHitfinderTask::fTotalChargeInNpixelsArray
TObjArray * fTotalChargeInNpixelsArray
Definition: CbmMvdSensorHitfinderTask.h:124
CbmMvdSensorHitfinderTask::fChargeArraySize
static const Short_t fChargeArraySize
Definition: CbmMvdSensorHitfinderTask.h:176
CbmMvdSensorHitfinderTask::SetSeedThreshold
void SetSeedThreshold(Double_t seedCharge)
Definition: CbmMvdSensorHitfinderTask.h:79
CbmMvdSensorHitfinderTask::GetAdcCharge
Int_t GetAdcCharge(Float_t charge)
Definition: CbmMvdSensorHitfinderTask.cxx:492
CbmMvdSensorHitfinderTask::ReInit
InitStatus ReInit()
Definition: CbmMvdSensorHitfinderTask.cxx:219
CbmMvdSensor.h
CbmMvdSensorHitfinderTask::InitTask
void InitTask(CbmMvdSensor *mySensor)
Definition: CbmMvdSensorHitfinderTask.cxx:188
CbmMvdSensorHitfinderTask::fGausArrayLimit
Int_t fGausArrayLimit
Definition: CbmMvdSensorHitfinderTask.h:136
CbmMvdSensorHitfinderTask::fMode
Int_t fMode
Definition: CbmMvdSensorHitfinderTask.h:153
CbmMvdSensorHitfinderTask::fResolutionHistoMergedY
TH1F * fResolutionHistoMergedY
Definition: CbmMvdSensorHitfinderTask.h:132
CbmMvdCluster
Definition: CbmMvdCluster.h:27
CbmMvdSensorHitfinderTask::SetHitPosErrX
void SetHitPosErrX(Double_t errorX)
Definition: CbmMvdSensorHitfinderTask.h:104
CbmMvdSensorHitfinderTask::fSeedThreshold
Double_t fSeedThreshold
Definition: CbmMvdSensorHitfinderTask.h:156
CbmMvdSensorHitfinderTask::SetHitPosErrZ
void SetHitPosErrZ(Double_t errorZ)
Definition: CbmMvdSensorHitfinderTask.h:106
CbmMvdSensorHitfinderTask::SetAdcBits
void SetAdcBits(Int_t adcBits)
Definition: CbmMvdSensorHitfinderTask.h:99
CbmMvdSensorHitfinderTask::fNeighThreshold
Double_t fNeighThreshold
Definition: CbmMvdSensorHitfinderTask.h:157
CbmMvdSensorHitfinderTask::fAddNoise
Bool_t fAddNoise
Definition: CbmMvdSensorHitfinderTask.h:179
CbmMvdSensorHitfinderTask::ShowDebugHistograms
void ShowDebugHistograms()
Definition: CbmMvdSensorHitfinderTask.h:107
CbmMvdSensorHitfinderTask::fBranchName
TString fBranchName
Definition: CbmMvdSensorHitfinderTask.h:173
CbmMvdSensorHitfinderTask::GetMvdGeometry
Int_t GetMvdGeometry()
CbmMvdSensorTask
Definition: CbmMvdSensorTask.h:26
CbmMvdPoint.h
CbmMvdSensor
Definition: CbmMvdSensor.h:40
dpos
TVector3 dpos
Definition: CbmMvdSensorDigiToHitTask.cxx:61
CbmMvdSensorHitfinderTask::c1
TCanvas * c1
Definition: CbmMvdSensorHitfinderTask.h:149
CbmMvdSensorHitfinderTask::fResolutionHistoMergedX
TH1F * fResolutionHistoMergedX
Definition: CbmMvdSensorHitfinderTask.h:131
CbmMvdSensorHitfinderTask::SetAdcOffset
void SetAdcOffset(Int_t adcOffset)
Definition: CbmMvdSensorHitfinderTask.h:98
CbmMvdSensorHitfinderTask::fAdcStepSize
Float_t fAdcStepSize
Definition: CbmMvdSensorHitfinderTask.h:118
CbmMvdSensorHitfinderTask::h
TH2F * h
Definition: CbmMvdSensorHitfinderTask.h:142
CbmMvdSensorHitfinderTask::fResolutionHistoY
TH1F * fResolutionHistoY
Definition: CbmMvdSensorHitfinderTask.h:128
CbmMvdSensorHitfinderTask::fHitPosY
Double_t fHitPosY
Definition: CbmMvdSensorHitfinderTask.h:167
CbmMvdSensorHitfinderTask::SetMvdGeometry
void SetMvdGeometry(Int_t detId)
CbmMvdSensorHitfinderTask::h1
TH1F * h1
Definition: CbmMvdSensorHitfinderTask.h:144
CbmMvdSensorHitfinderTask
Definition: CbmMvdSensorHitfinderTask.h:40
CbmMvdSensorHitfinderTask::fHitPosErrY
Double_t fHitPosErrY
Definition: CbmMvdSensorHitfinderTask.h:170
CbmMvdSensorHitfinderTask::SetHitPosErrY
void SetHitPosErrY(Double_t errorY)
Definition: CbmMvdSensorHitfinderTask.h:105
CbmMvdSensorHitfinderTask::CbmMvdSensorHitfinderTask
CbmMvdSensorHitfinderTask(const CbmMvdSensorHitfinderTask &)
CbmMvdSensorHitfinderTask::fHitPosX
Double_t fHitPosX
Definition: CbmMvdSensorHitfinderTask.h:166
CbmMvdSensorHitfinderTask::CreateHit
void CreateHit(CbmMvdCluster *clusterArray, TVector3 &pos, TVector3 &dpos)
Definition: CbmMvdSensorHitfinderTask.cxx:256
CbmMvdSensorHitfinderTask::SetSigmaNoise
void SetSigmaNoise(Double_t sigmaNoise, Bool_t addNoise)
Definition: CbmMvdSensorHitfinderTask.h:75
CbmMvdSensorHitfinderTask::fHitPosErrX
Double_t fHitPosErrX
Definition: CbmMvdSensorHitfinderTask.h:169
CbmMvdSensorHitfinderTask::fLayerRadiusInner
Double_t fLayerRadiusInner
Definition: CbmMvdSensorHitfinderTask.h:164
CbmMvdSensorHitfinderTask::Exec
void Exec()
Definition: CbmMvdSensorHitfinderTask.cxx:231
CbmMvdSensorHitfinderTask::Reset
void Reset()
Definition: CbmMvdSensorHitfinderTask.cxx:506
CbmMvdSensorHitfinderTask::fGausArray
Float_t * fGausArray
Definition: CbmMvdSensorHitfinderTask.h:134
CbmMvdSensorHitfinderTask::fNEvent
Int_t fNEvent
Definition: CbmMvdSensorHitfinderTask.h:152
CbmMvdSensorTask::fInputBuffer
TClonesArray * fInputBuffer
Definition: CbmMvdSensorTask.h:53
CbmMvdSensorHitfinderTask::Finish
void Finish()
Definition: CbmMvdSensorHitfinderTask.cxx:489
CbmMvdSensorHitfinderTask::fUseMCInfo
Bool_t fUseMCInfo
Definition: CbmMvdSensorHitfinderTask.h:159
CbmMvdSensorHitfinderTask::fLayerPosZ
Double_t fLayerPosZ
Definition: CbmMvdSensorHitfinderTask.h:165
CbmMvdSensorHitfinderTask::ExecChain
void ExecChain()
Definition: CbmMvdSensorHitfinderTask.cxx:227
CbmMvdSensorHitfinderTask::fAdcOffset
Int_t fAdcOffset
Definition: CbmMvdSensorHitfinderTask.h:115
CbmMvdSensorHitfinderTask::fDigiMap
std::map< std::pair< Int_t, Int_t >, Int_t > fDigiMap
Definition: CbmMvdSensorHitfinderTask.h:138
CbmMvdSensorHitfinderTask::fPixelChargeHistos
TObjArray * fPixelChargeHistos
Definition: CbmMvdSensorHitfinderTask.h:123
CbmMvdSensorHitfinderTask::fResolutionHistoX
TH1F * fResolutionHistoX
Definition: CbmMvdSensorHitfinderTask.h:127
pos
TVector3 pos
Definition: CbmMvdSensorDigiToHitTask.cxx:60
CbmMvdSensorHitfinderTask::fDigisInCluster
Int_t fDigisInCluster
Definition: CbmMvdSensorHitfinderTask.h:175
CbmMvdSensorHitfinderTask::ComputeCenterOfGravity
void ComputeCenterOfGravity(CbmMvdCluster *clusterArray, TVector3 &pos, TVector3 &dpos)
Definition: CbmMvdSensorHitfinderTask.cxx:298
CbmMvdSensorHitfinderTask::fCounter
Int_t fCounter
Definition: CbmMvdSensorHitfinderTask.h:154
CbmMvdSensorHitfinderTask::fDigiMapIt
std::map< std::pair< Int_t, Int_t >, Int_t >::iterator fDigiMapIt
Definition: CbmMvdSensorHitfinderTask.h:139
CbmMvdSensorHitfinderTask::fResolutionHistoCleanX
TH1F * fResolutionHistoCleanX
Definition: CbmMvdSensorHitfinderTask.h:129
CbmMvdSensorHitfinderTask::SetAdcDynamic
void SetAdcDynamic(Int_t adcDynamic)
Definition: CbmMvdSensorHitfinderTask.h:97
CbmMvdSensorHitfinderTask::inputSet
Bool_t inputSet
Definition: CbmMvdSensorHitfinderTask.h:160
CbmMvdSensorHitfinderTask::fClusters
TClonesArray * fClusters
Definition: CbmMvdSensorHitfinderTask.h:120
CbmMvdSensorHitfinderTask::SetInputCluster
void SetInputCluster(CbmMvdCluster *cluster)
Definition: CbmMvdSensorHitfinderTask.h:65
CbmMvdSensorHitfinderTask::fResolutionHistoCleanY
TH1F * fResolutionHistoCleanY
Definition: CbmMvdSensorHitfinderTask.h:130
CbmMvdSensorTask.h
CbmMvdSensorHitfinderTask::fLayerRadius
Double_t fLayerRadius
Definition: CbmMvdSensorHitfinderTask.h:163
CbmMvdSensorHitfinderTask::fFullClusterHisto
TH1F * fFullClusterHisto
Definition: CbmMvdSensorHitfinderTask.h:147
CbmMvdSensorHitfinderTask::h3
TH2F * h3
Definition: CbmMvdSensorHitfinderTask.h:143
CbmMvdSensorHitfinderTask::fAdcBits
Int_t fAdcBits
Definition: CbmMvdSensorHitfinderTask.h:116
CbmMvdSensorHitfinderTask::fSigmaNoise
Double_t fSigmaNoise
Definition: CbmMvdSensorHitfinderTask.h:155
CbmMvdSensorHitfinderTask::h2
TH1F * h2
Definition: CbmMvdSensorHitfinderTask.h:145
CbmMvdCluster.h
CbmMvdSensorHitfinderTask::ClassDef
ClassDef(CbmMvdSensorHitfinderTask, 1)