"MarlinReco"  1.32.0
VTXDigitizer.h
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 #ifndef VTXDigitizer_h
3 #define VTXDigitizer_h 1
4 
5 #include "marlin/Processor.h"
6 #include "lcio.h"
7 #include "EVENT/SimTrackerHit.h"
8 #include "IMPL/TrackerHitImpl.h"
9 #include "IMPL/SimTrackerHitImpl.h"
10 #include <string>
11 #include <vector>
12 #include "MyG4UniversalFluctuationForSi.h"
13 #include "EVENT/LCIO.h"
14 #include <IMPL/LCCollectionVec.h>
15 
16 
17 using namespace lcio ;
18 using namespace marlin ;
19 
20 struct IonisationPoint {
21  double x{};
22  double y{};
23  double z{};
24  double eloss{};
25 };
26 
27 struct SignalPoint {
28  double x{};
29  double y{};
30  double sigmaX{};
31  double sigmaY{};
32  double charge{};
33 
34 };
35 
36 typedef std::vector<IonisationPoint> IonisationPointVec;
37 typedef std::vector<SignalPoint> SignalPointVec;
38 typedef std::vector<TrackerHitImpl*> TrackerHitImplVec;
39 typedef std::vector<SimTrackerHitImpl*> SimTrackerHitImplVec;
40 
123 class VTXDigitizer : public Processor {
124 
125  public:
126  VTXDigitizer(const VTXDigitizer&) = delete;
127  VTXDigitizer& operator=(const VTXDigitizer&) = delete;
128 
129  virtual Processor* newProcessor() { return new VTXDigitizer ; }
130 
131 
132  VTXDigitizer() ;
133 
137  virtual void init() ;
138 
142  virtual void processRunHeader( LCRunHeader* run ) ;
143 
146  virtual void processEvent( LCEvent * evt ) ;
147 
150  virtual void check( LCEvent * evt ) ;
151 
154  virtual void end() ;
155 
156 
157  protected:
158 
161  std::string _colName{};
162  std::string _outputCollectionName{};
163  std::string _colVTXRelation{};
164 
167  int _nRun{};
168 
171  int _nEvt{};
174  double _tanLorentzAngle{};
178  double _cutOnDeltaRays{};
181  double _diffusionCoefficient{};
184  // double _layerThickness;
185 // /** layer half-thickness
186 // */
187 // double _layerHalfThickness;
188 
189 
190  int _numberOfLayers{};
191  double _pixelSizeX{};
192  double _pixelSizeY{};
193  double _electronsPerKeV{};
194  double _segmentDepth{};
195  double _currentTotalCharge{};
196 
197  std::vector<int> _laddersInLayer{};
198  std::vector<float> _layerRadius{};
199  std::vector<float> _layerThickness{};
200  std::vector<float> _layerHalfThickness{};
201  std::vector<float> _layerLadderLength{};
202  std::vector<float> _layerLadderHalfWidth{};
203  std::vector<float> _layerPhiOffset{};
204  std::vector<float> _layerActiveSiOffset{};
205  std::vector<float> _layerHalfPhi{};
206  std::vector<float> _layerLadderGap{};
207  std::vector<float> _bkgdHitsInLayer{};
208  std::vector<float> _layerLadderWidth{};
209 
210  int _currentLayer{};
211  int _currentModule{};
212  int _generateBackground{};
213  double _currentParticleMomentum{};
214  double _currentParticleEnergy{};
215  double _currentParticleMass{};
216  double _currentPhi{};
217  double _widthOfCluster{};
218 
219  double PI{},TWOPI{},PI2{};
220  double SCALING{};
221 
222  int _produceFullPattern{};
223  int _numberOfSegments{};
224  int _debug{};
225  int _PoissonSmearing{};
226  int _electronicEffects{};
227  int _useMCPMomentum{};
228  int _removeDrays{};
229 
230  double _threshold{};
231  double _currentLocalPosition[3]{};
232  double _currentEntryPoint[3]{};
233  double _currentExitPoint[3]{};
234  double _electronicNoise{};
235  double _segmentLength{};
236 
237  IonisationPointVec _ionisationPoints{};
238  SignalPointVec _signalPoints{};
239 
240  MyG4UniversalFluctuationForSi * _fluctuate{};
241 
245  void FindLocalPosition(SimTrackerHit * hit,
246  double * localPosition,
247  double * localDirection);
248 
249  void TransformToLab(double * xLoc, double * xLab);
250  void ProduceIonisationPoints( SimTrackerHit * hit);
251  void ProduceSignalPoints( );
252  void ProduceHits(SimTrackerHitImplVec & simTrkVec);
253  void TransformXYToCellID(double x, double y,
254  int & ix,
255  int & iy);
256  void TransformCellIDToXY(int ix, int iy,
257  double & x, double & y);
258  void PoissonSmearer( SimTrackerHitImplVec & simTrkVec );
259  void GainSmearer( SimTrackerHitImplVec & simTrkVec );
260  void PrintInfo( SimTrackerHit * simTrkHit, TrackerHitImpl * recoHit);
261  TrackerHitImpl * ReconstructTrackerHit(SimTrackerHitImplVec & simTrkVec );
262  void TrackerHitToLab( TrackerHitImpl * recoHit );
263  void PositionWithinCell(double x, double y,
264  int & ix, int & iy,
265  double & xCell, double & yCell);
266  void generateBackground(LCCollectionVec * col);
267 
268  double _xLayerReco{},_yLayerReco{},_zLayerReco{};
269  double _xLayerSim{},_yLayerSim{},_zLayerSim{};
270  int _iLayer{};
271 
272  int _nCoveredX{},_nCoveredY{},_nCells{};
273 
274  int _totEntries{};
275  double _totMomentum{};
276  double _momX{},_momY{},_momZ{};
277  double _eDep{};
278 
279  double _amplX[20]{};
280  double _amplY[20]{};
281  double _amplC[100]{};
282  double _ampl{};
283  double _amplMax{};
284  double _eSum{};
285  double _energyLoss{};
286  double _clusterWidthX{},_clusterWidthY{};
287  double _ampl33{},_ampl55{},_ampl77{};
288  int _ncell33{},_ncell55{},_ncell77{};
289  int _storeNtuple{};
290  double _xLocalRecoCOG{},_yLocalRecoCOG{};
291  double _xLocalRecoEdge{},_yLocalRecoEdge{};
292  double _xLocalSim{},_yLocalSim{};
293 
294  std::vector <SimTrackerHitImplVec> _hitsInLayer{};
295 
296 
297 
298 
299 } ;
300 
301 #endif
Digitizer for Simulated Hits in the Vertex Detector.
Definition: VTXDigitizer.h:123
Definition: VTXDigitizer.h:27
Definition: MyG4UniversalFluctuationForSi.h:52
Definition: CCDDigitizer.h:52