CbmRoot
CbmMvdSensorClusterfinderTask.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- CbmMvdSensorClusterfinderTask header file -----
3 // ----- Created 11/09/13 P.Sitzmann -----
4 // -------------------------------------------------------------------------
5 
6 
7 #ifndef CBMMVDSENSORCLUSTERFINDERTASK_H
8 #define CBMMVDSENSORCLUSTERFINDERTASK_H 1
9 
10 
11 #include "CbmMvdCluster.h"
12 #include "CbmMvdDigi.h"
13 
14 #include "TArrayS.h"
15 #include "TCanvas.h"
16 #include "TObjArray.h"
17 #include "TRefArray.h"
18 
19 
20 #include "TH1.h"
21 #include "TH1F.h"
22 #include "TH2.h"
23 #include "TMath.h"
24 #include "TRandom3.h"
25 #include "TStopwatch.h"
26 #include "TString.h"
27 #include <list>
28 #include <map>
29 #include <utility>
30 #include <vector>
31 
32 #include "CbmMvdSensor.h"
33 #include "CbmMvdSensorTask.h"
34 
35 class TClonesArray;
36 class TRandom3;
37 
39 
40 public:
43 
44 
49  CbmMvdSensorClusterfinderTask(Int_t mode, Int_t iVerbose);
50 
51 
54 
55 
57  void ExecChain();
58  void Exec();
59 
61  void InitTask(CbmMvdSensor* mySensor);
62 
63  virtual void SetInputDigi(CbmMvdDigi* digi) {
64  new ((*fInputBuffer)[fInputBuffer->GetEntriesFast()])
65  CbmMvdDigi(*((CbmMvdDigi*) digi));
66  inputSet = kTRUE;
67  }
68 
69 
71  void SetSigmaNoise(Double_t sigmaNoise, Bool_t addNoise) {
72  fSigmaNoise = sigmaNoise;
73  fAddNoise = addNoise;
74  }
75  void SetSeedThreshold(Double_t seedCharge) { fSeedThreshold = seedCharge; }
76  void SetNeighbourThreshold(Double_t neighCharge) {
77  fNeighThreshold = neighCharge;
78  }
79 
80 
81  void SetAdcDynamic(Int_t adcDynamic) { fAdcDynamic = adcDynamic; };
82  void SetAdcOffset(Int_t adcOffset) { fAdcOffset = adcOffset; };
83  void SetAdcBits(Int_t adcBits) { fAdcBits = adcBits; };
84  Int_t GetAdcCharge(Float_t charge);
85 
88  void SetHitPosErrX(Double_t errorX) { fHitPosErrX = errorX; }
89  void SetHitPosErrY(Double_t errorY) { fHitPosErrY = errorY; }
90  void SetHitPosErrZ(Double_t errorZ) { fHitPosErrZ = errorZ; }
91 
92  void UpdateDebugHistos(CbmMvdCluster* cluster);
93 
94  //protected:
95 protected:
96  // ---------- Protected data members ------------------------------------
97 
98  Int_t fAdcDynamic;
99  Int_t fAdcOffset;
100  Int_t fAdcBits;
101  Int_t fAdcSteps;
102  Int_t fAddress;
103  Float_t fAdcStepSize;
104 
105  TClonesArray* fDigis;
106  TObjArray* fPixelChargeHistos;
108 
109  // Debug Histograms
117  Float_t* fGausArray;
120 
121  std::map<std::pair<Int_t, Int_t>, Int_t> fDigiMap;
122  std::map<std::pair<Int_t, Int_t>, Int_t>::iterator fDigiMapIt;
123 
124 
125  TH2F* h;
126  TH2F* h3;
127  TH1F* h1;
128  TH1F* h2;
129  TH1F* Qseed;
131 
132  TCanvas* c1;
133 
134 private:
135  Int_t fNEvent;
136  Int_t fMode;
137  Int_t fCounter;
138  Int_t fVerbose;
139  Double_t fSigmaNoise;
140  Double_t fSeedThreshold;
141  Double_t fNeighThreshold;
142  Bool_t fUseMCInfo;
143  Bool_t inputSet;
144 
145  std::map<std::pair<Int_t, Int_t>, Int_t>
146  ftempPixelMap; //* couples Pixel(x,y) with collected charge
147 
148 
149  Double_t fLayerRadius;
151  Double_t fLayerPosZ;
152  Double_t fHitPosX;
153  Double_t fHitPosY;
154  Double_t fHitPosZ;
155  Double_t fHitPosErrX;
156  Double_t fHitPosErrY;
157  Double_t fHitPosErrZ;
158 
159  TString fBranchName;
160 
161  static const Short_t fChargeArraySize =
162  5; //must be an odd number >3, recommended numbers= 5 or 7
163 
164  Bool_t fAddNoise;
165 
166  // ----- Private methods ---------------------------------------------
167 
168 
170  void Reset() { ; };
171 
173  void Finish();
174 
175 
176  void CheckForNeighbours(std::vector<Int_t>* clusterArray,
177  Int_t clusterDigi,
178  TArrayS* pixelUsed);
179 
181  Bool_t ReInit();
182 
183 
187  Int_t GetMvdGeometry() { return 0; };
188 
189 
190 private:
193 
195 };
196 
197 
198 #endif
CbmMvdSensorClusterfinderTask::ExecChain
void ExecChain()
Definition: CbmMvdSensorClusterfinderTask.cxx:200
CbmMvdSensorClusterfinderTask::fDigiMapIt
std::map< std::pair< Int_t, Int_t >, Int_t >::iterator fDigiMapIt
Definition: CbmMvdSensorClusterfinderTask.h:122
CbmMvdSensorClusterfinderTask::fResolutionHistoMergedX
TH1F * fResolutionHistoMergedX
Definition: CbmMvdSensorClusterfinderTask.h:114
CbmMvdSensorClusterfinderTask::fNEvent
Int_t fNEvent
Definition: CbmMvdSensorClusterfinderTask.h:135
CbmMvdSensorClusterfinderTask::fLayerPosZ
Double_t fLayerPosZ
Definition: CbmMvdSensorClusterfinderTask.h:151
CbmMvdSensorClusterfinderTask::fAddNoise
Bool_t fAddNoise
Definition: CbmMvdSensorClusterfinderTask.h:164
CbmMvdSensorClusterfinderTask::inputSet
Bool_t inputSet
Definition: CbmMvdSensorClusterfinderTask.h:143
CbmMvdSensorClusterfinderTask::fAdcSteps
Int_t fAdcSteps
Definition: CbmMvdSensorClusterfinderTask.h:101
CbmMvdSensorClusterfinderTask::fNeighThreshold
Double_t fNeighThreshold
Definition: CbmMvdSensorClusterfinderTask.h:141
CbmMvdSensorClusterfinderTask::InitTask
void InitTask(CbmMvdSensor *mySensor)
Definition: CbmMvdSensorClusterfinderTask.cxx:81
CbmMvdSensorClusterfinderTask::SetNeighbourThreshold
void SetNeighbourThreshold(Double_t neighCharge)
Definition: CbmMvdSensorClusterfinderTask.h:76
CbmMvdSensorClusterfinderTask::SetSeedThreshold
void SetSeedThreshold(Double_t seedCharge)
Definition: CbmMvdSensorClusterfinderTask.h:75
CbmMvdSensorClusterfinderTask::fAddress
Int_t fAddress
Definition: CbmMvdSensorClusterfinderTask.h:102
CbmMvdSensorClusterfinderTask::SetAdcBits
void SetAdcBits(Int_t adcBits)
Definition: CbmMvdSensorClusterfinderTask.h:83
CbmMvdDigi.h
CbmMvdSensorClusterfinderTask::c1
TCanvas * c1
Definition: CbmMvdSensorClusterfinderTask.h:132
CbmMvdSensorClusterfinderTask::fDigis
TClonesArray * fDigis
Definition: CbmMvdSensorClusterfinderTask.h:105
CbmMvdSensorClusterfinderTask::fResolutionHistoY
TH1F * fResolutionHistoY
Definition: CbmMvdSensorClusterfinderTask.h:111
CbmMvdSensorClusterfinderTask::fAdcOffset
Int_t fAdcOffset
Definition: CbmMvdSensorClusterfinderTask.h:99
CbmMvdSensorClusterfinderTask::fHitPosY
Double_t fHitPosY
Definition: CbmMvdSensorClusterfinderTask.h:153
CbmMvdSensorClusterfinderTask::fTotalChargeInNpixelsArray
TObjArray * fTotalChargeInNpixelsArray
Definition: CbmMvdSensorClusterfinderTask.h:107
CbmMvdSensorClusterfinderTask::fResolutionHistoMergedY
TH1F * fResolutionHistoMergedY
Definition: CbmMvdSensorClusterfinderTask.h:115
CbmMvdSensorClusterfinderTask::h3
TH2F * h3
Definition: CbmMvdSensorClusterfinderTask.h:126
CbmMvdSensorClusterfinderTask::fGausArrayIt
Int_t fGausArrayIt
Definition: CbmMvdSensorClusterfinderTask.h:118
CbmMvdSensor.h
CbmMvdSensorClusterfinderTask::fHitPosErrY
Double_t fHitPosErrY
Definition: CbmMvdSensorClusterfinderTask.h:156
CbmMvdSensorClusterfinderTask::fUseMCInfo
Bool_t fUseMCInfo
Definition: CbmMvdSensorClusterfinderTask.h:142
CbmMvdSensorClusterfinderTask::Reset
void Reset()
Definition: CbmMvdSensorClusterfinderTask.h:170
CbmMvdSensorClusterfinderTask::fVerbose
Int_t fVerbose
Definition: CbmMvdSensorClusterfinderTask.h:138
CbmMvdSensorClusterfinderTask::fAdcDynamic
Int_t fAdcDynamic
Definition: CbmMvdSensorClusterfinderTask.h:98
CbmMvdSensorClusterfinderTask::Exec
void Exec()
Definition: CbmMvdSensorClusterfinderTask.cxx:204
CbmMvdSensorClusterfinderTask
Definition: CbmMvdSensorClusterfinderTask.h:38
CbmMvdCluster
Definition: CbmMvdCluster.h:27
CbmMvdSensorClusterfinderTask::ReInit
Bool_t ReInit()
Definition: CbmMvdSensorClusterfinderTask.cxx:192
CbmMvdSensorClusterfinderTask::SetHitPosErrZ
void SetHitPosErrZ(Double_t errorZ)
Definition: CbmMvdSensorClusterfinderTask.h:90
CbmMvdSensorClusterfinderTask::CbmMvdSensorClusterfinderTask
CbmMvdSensorClusterfinderTask()
Definition: CbmMvdSensorClusterfinderTask.cxx:17
CbmMvdSensorClusterfinderTask::Finish
void Finish()
Definition: CbmMvdSensorClusterfinderTask.cxx:571
CbmMvdSensorClusterfinderTask::GetMvdGeometry
Int_t GetMvdGeometry()
Definition: CbmMvdSensorClusterfinderTask.h:187
CbmMvdSensorClusterfinderTask::fHitPosX
Double_t fHitPosX
Definition: CbmMvdSensorClusterfinderTask.h:152
CbmMvdSensorClusterfinderTask::SetSigmaNoise
void SetSigmaNoise(Double_t sigmaNoise, Bool_t addNoise)
Definition: CbmMvdSensorClusterfinderTask.h:71
CbmMvdSensorClusterfinderTask::~CbmMvdSensorClusterfinderTask
virtual ~CbmMvdSensorClusterfinderTask()
Definition: CbmMvdSensorClusterfinderTask.cxx:22
CbmMvdSensorClusterfinderTask::fResolutionHistoCleanX
TH1F * fResolutionHistoCleanX
Definition: CbmMvdSensorClusterfinderTask.h:112
CbmMvdSensorClusterfinderTask::fGausArray
Float_t * fGausArray
Definition: CbmMvdSensorClusterfinderTask.h:117
CbmMvdSensorTask
Definition: CbmMvdSensorTask.h:26
CbmMvdSensorClusterfinderTask::fDigiMap
std::map< std::pair< Int_t, Int_t >, Int_t > fDigiMap
Definition: CbmMvdSensorClusterfinderTask.h:121
CbmMvdSensor
Definition: CbmMvdSensor.h:40
CbmMvdSensorClusterfinderTask::fAdcStepSize
Float_t fAdcStepSize
Definition: CbmMvdSensorClusterfinderTask.h:103
CbmMvdSensorClusterfinderTask::Qseed
TH1F * Qseed
Definition: CbmMvdSensorClusterfinderTask.h:129
CbmMvdSensorClusterfinderTask::ftempPixelMap
std::map< std::pair< Int_t, Int_t >, Int_t > ftempPixelMap
Definition: CbmMvdSensorClusterfinderTask.h:146
CbmMvdSensorClusterfinderTask::SetInputDigi
virtual void SetInputDigi(CbmMvdDigi *digi)
Definition: CbmMvdSensorClusterfinderTask.h:63
CbmMvdSensorClusterfinderTask::fBranchName
TString fBranchName
Definition: CbmMvdSensorClusterfinderTask.h:159
CbmMvdSensorClusterfinderTask::h
TH2F * h
Definition: CbmMvdSensorClusterfinderTask.h:125
CbmMvdSensorClusterfinderTask::fGausArrayLimit
Int_t fGausArrayLimit
Definition: CbmMvdSensorClusterfinderTask.h:119
CbmMvdSensorClusterfinderTask::ClassDef
ClassDef(CbmMvdSensorClusterfinderTask, 1)
CbmMvdSensorClusterfinderTask::fFullClusterHisto
TH1F * fFullClusterHisto
Definition: CbmMvdSensorClusterfinderTask.h:130
CbmMvdSensorClusterfinderTask::h1
TH1F * h1
Definition: CbmMvdSensorClusterfinderTask.h:127
CbmMvdSensorClusterfinderTask::fSeedThreshold
Double_t fSeedThreshold
Definition: CbmMvdSensorClusterfinderTask.h:140
CbmMvdSensorClusterfinderTask::fMode
Int_t fMode
Definition: CbmMvdSensorClusterfinderTask.h:136
CbmMvdSensorClusterfinderTask::fSigmaNoise
Double_t fSigmaNoise
Definition: CbmMvdSensorClusterfinderTask.h:139
CbmMvdSensorClusterfinderTask::CheckForNeighbours
void CheckForNeighbours(std::vector< Int_t > *clusterArray, Int_t clusterDigi, TArrayS *pixelUsed)
Definition: CbmMvdSensorClusterfinderTask.cxx:350
CbmMvdSensorClusterfinderTask::fHitPosErrZ
Double_t fHitPosErrZ
Definition: CbmMvdSensorClusterfinderTask.h:157
CbmMvdSensorClusterfinderTask::fAdcBits
Int_t fAdcBits
Definition: CbmMvdSensorClusterfinderTask.h:100
CbmMvdSensorClusterfinderTask::SetHitPosErrX
void SetHitPosErrX(Double_t errorX)
Definition: CbmMvdSensorClusterfinderTask.h:88
CbmMvdSensorClusterfinderTask::fChargeArraySize
static const Short_t fChargeArraySize
Definition: CbmMvdSensorClusterfinderTask.h:161
CbmMvdSensorClusterfinderTask::SetAdcOffset
void SetAdcOffset(Int_t adcOffset)
Definition: CbmMvdSensorClusterfinderTask.h:82
CbmMvdSensorClusterfinderTask::SetHitPosErrY
void SetHitPosErrY(Double_t errorY)
Definition: CbmMvdSensorClusterfinderTask.h:89
CbmMvdSensorTask::fInputBuffer
TClonesArray * fInputBuffer
Definition: CbmMvdSensorTask.h:53
CbmMvdSensorClusterfinderTask::GetAdcCharge
Int_t GetAdcCharge(Float_t charge)
Definition: CbmMvdSensorClusterfinderTask.cxx:417
CbmMvdSensorClusterfinderTask::UpdateDebugHistos
void UpdateDebugHistos(CbmMvdCluster *cluster)
Definition: CbmMvdSensorClusterfinderTask.cxx:430
CbmMvdSensorClusterfinderTask::operator=
CbmMvdSensorClusterfinderTask operator=(const CbmMvdSensorClusterfinderTask &)
CbmMvdSensorClusterfinderTask::SetAdcDynamic
void SetAdcDynamic(Int_t adcDynamic)
Definition: CbmMvdSensorClusterfinderTask.h:81
CbmMvdSensorClusterfinderTask::fLayerRadius
Double_t fLayerRadius
Definition: CbmMvdSensorClusterfinderTask.h:149
CbmMvdSensorClusterfinderTask::fBadHitHisto
TH2F * fBadHitHisto
Definition: CbmMvdSensorClusterfinderTask.h:116
CbmMvdDigi
Definition: CbmMvdDigi.h:21
CbmMvdSensorClusterfinderTask::CbmMvdSensorClusterfinderTask
CbmMvdSensorClusterfinderTask(const CbmMvdSensorClusterfinderTask &)
CbmMvdSensorClusterfinderTask::fResolutionHistoCleanY
TH1F * fResolutionHistoCleanY
Definition: CbmMvdSensorClusterfinderTask.h:113
CbmMvdSensorTask.h
CbmMvdSensorClusterfinderTask::fPixelChargeHistos
TObjArray * fPixelChargeHistos
Definition: CbmMvdSensorClusterfinderTask.h:106
CbmMvdSensorClusterfinderTask::fResolutionHistoX
TH1F * fResolutionHistoX
Definition: CbmMvdSensorClusterfinderTask.h:110
CbmMvdSensorClusterfinderTask::fHitPosErrX
Double_t fHitPosErrX
Definition: CbmMvdSensorClusterfinderTask.h:155
CbmMvdSensorClusterfinderTask::fCounter
Int_t fCounter
Definition: CbmMvdSensorClusterfinderTask.h:137
CbmMvdSensorClusterfinderTask::h2
TH1F * h2
Definition: CbmMvdSensorClusterfinderTask.h:128
CbmMvdSensorClusterfinderTask::fLayerRadiusInner
Double_t fLayerRadiusInner
Definition: CbmMvdSensorClusterfinderTask.h:150
CbmMvdSensorClusterfinderTask::fHitPosZ
Double_t fHitPosZ
Definition: CbmMvdSensorClusterfinderTask.h:154
CbmMvdCluster.h