"MarlinReco"  1.16.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 
127  virtual Processor* newProcessor() { return new VTXDigitizer ; }
128 
129 
130  VTXDigitizer() ;
131 
135  virtual void init() ;
136 
140  virtual void processRunHeader( LCRunHeader* run ) ;
141 
144  virtual void processEvent( LCEvent * evt ) ;
145 
148  virtual void check( LCEvent * evt ) ;
149 
152  virtual void end() ;
153 
154 
155  protected:
156 
159  std::string _colName ;
160  std::string _outputCollectionName;
161  std::string _colVTXRelation ;
162 
165  int _nRun ;
166 
169  int _nEvt ;
182  // double _layerThickness;
183 // /** layer half-thickness
184 // */
185 // double _layerHalfThickness;
186 
187 
189  double _pixelSizeX;
190  double _pixelSizeY;
191  double _electronsPerKeV;
192  double _segmentDepth;
193  double _currentTotalCharge;
194 
195  std::vector<int> _laddersInLayer;
196  std::vector<float> _layerRadius;
197  std::vector<float> _layerThickness;
198  std::vector<float> _layerHalfThickness;
199  std::vector<float> _layerLadderLength;
200  std::vector<float> _layerLadderHalfWidth;
201  std::vector<float> _layerPhiOffset;
202  std::vector<float> _layerActiveSiOffset;
203  std::vector<float> _layerHalfPhi;
204  std::vector<float> _layerLadderGap;
205  std::vector<float> _bkgdHitsInLayer;
206  std::vector<float> _layerLadderWidth;
207 
208  int _currentLayer;
209  int _currentModule;
210  int _generateBackground;
211  double _currentParticleMomentum;
212  double _currentParticleEnergy;
213  double _currentParticleMass;
214  double _currentPhi;
215  double _widthOfCluster;
216 
217  double PI,TWOPI,PI2;
218  double SCALING;
219 
220  int _produceFullPattern;
221  int _numberOfSegments;
222  int _debug;
223  int _PoissonSmearing;
224  int _electronicEffects;
225  int _useMCPMomentum;
226  int _removeDrays;
227 
228  double _threshold;
229  double _currentLocalPosition[3];
230  double _currentEntryPoint[3];
231  double _currentExitPoint[3];
232  double _electronicNoise;
233  double _segmentLength;
234 
235  IonisationPointVec _ionisationPoints;
236  SignalPointVec _signalPoints;
237 
238  MyG4UniversalFluctuationForSi * _fluctuate;
239 
243  void FindLocalPosition(SimTrackerHit * hit,
244  double * localPosition,
245  double * localDirection);
246 
247  void TransformToLab(double * xLoc, double * xLab);
248  void ProduceIonisationPoints( SimTrackerHit * hit);
249  void ProduceSignalPoints( );
250  void ProduceHits(SimTrackerHitImplVec & simTrkVec);
251  void TransformXYToCellID(double x, double y,
252  int & ix,
253  int & iy);
254  void TransformCellIDToXY(int ix, int iy,
255  double & x, double & y);
256  void PoissonSmearer( SimTrackerHitImplVec & simTrkVec );
257  void GainSmearer( SimTrackerHitImplVec & simTrkVec );
258  void PrintInfo( SimTrackerHit * simTrkHit, TrackerHitImpl * recoHit);
259  TrackerHitImpl * ReconstructTrackerHit(SimTrackerHitImplVec & simTrkVec );
260  void TrackerHitToLab( TrackerHitImpl * recoHit );
261  void PositionWithinCell(double x, double y,
262  int & ix, int & iy,
263  double & xCell, double & yCell);
264  void generateBackground(LCCollectionVec * col);
265 
266  double _xLayerReco,_yLayerReco,_zLayerReco;
267  double _xLayerSim,_yLayerSim,_zLayerSim;
268  int _iLayer;
269 
270  int _nCoveredX,_nCoveredY,_nCells;
271 
272  int _totEntries;
273  double _totMomentum;
274  double _momX,_momY,_momZ;
275  double _eDep;
276 
277  double _amplX[20];
278  double _amplY[20];
279  double _amplC[100];
280  double _ampl;
281  double _amplMax;
282  double _eSum;
283  double _energyLoss;
284  double _clusterWidthX,_clusterWidthY;
285  double _ampl33,_ampl55,_ampl77;
286  int _ncell33,_ncell55,_ncell77;
287  int _storeNtuple;
288  double _xLocalRecoCOG,_yLocalRecoCOG;
289  double _xLocalRecoEdge,_yLocalRecoEdge;
290  double _xLocalSim,_yLocalSim;
291 
292  std::vector <SimTrackerHitImplVec> _hitsInLayer;
293 
294 
295 
296 
297 } ;
298 
299 #endif
300 
301 
302 
Digitizer for Simulated Hits in the Vertex Detector.
Definition: VTXDigitizer.h:123
int _numberOfLayers
layer thickness
Definition: VTXDigitizer.h:188
Definition: VTXDigitizer.h:27
int _nEvt
Event number.
Definition: VTXDigitizer.h:169
Definition: MyG4UniversalFluctuationForSi.h:52
double _tanLorentzAngle
tangent of Lorentz angle
Definition: VTXDigitizer.h:172
double _cutOnDeltaRays
cut in MeV on delta electrons used in simulation of charge for each ionisation point ...
Definition: VTXDigitizer.h:176
std::string _colName
Input collection name.
Definition: VTXDigitizer.h:159
double _diffusionCoefficient
Diffusion coefficient in mm for nominla layer thickness.
Definition: VTXDigitizer.h:179
int _nRun
Run number.
Definition: VTXDigitizer.h:165
Definition: CCDDigitizer.h:52