PandaRoot
PndSdsCalcPixel.h
Go to the documentation of this file.
1 #ifndef PNDSDSCALCPIXEL_H
2 #define PNDSDSCALCPIXEL_H
3 
4 #include "PndSdsPixel.h"
5 #include "FairGeoVector.h"
6 #include <iostream>
7 #include <vector>
8 //#include <XYVector.h>
9 //#include "CLHEP/Vector/TwoVector.h"
11 
24  public:
27 
33  PndSdsCalcPixel(Double_t w, Double_t l, Double_t threshold = 0, Double_t noise = 0);
34 
36  std::vector<PndSdsPixel> GetPixels(Double_t inx, Double_t iny, Double_t outx, Double_t outy, Double_t energy);
37  // Alternative in terms of I/O
38  Int_t GetPixelsAlternative(Double_t inx, Double_t iny, Double_t outx, Double_t outy, Double_t energy, std::vector<Int_t> &cols, std::vector<Int_t> &rows,
39  std::vector<Double_t> &charges);
40  void SetVerboseLevel(Int_t level) { fVerboseLevel = level; };
41  std::ostream &operator<<(std::ostream &out);
42 
43  private:
44  std::vector<PndSdsPixel> fPixels;
45  Double_t fPixelWidth;
46  Double_t fPixelLength;
47  Double_t fThreshold;
48  Double_t fNoise;
49  Double_t fEnergy;
50  Int_t fVerboseLevel;
51 
52  typedef enum { kQuadUNDEF, kUR, kUL, kDL, kDR } EQuadrantType;
53  typedef enum { kPixelUNDEF, kU, kD, kL, kR } ENextPixelType;
54 
55  EQuadrantType fQuad;
56  ENextPixelType fNextPixel;
57 
58  FairGeoVector fIn; // entry point of particle in sensor
59  FairGeoVector fOut; // exit point of particle out of sensor
60  FairGeoVector fDir; // direction of particle inside sensor
61  FairGeoVector fPos; // actual position of stepping inside sensor
62 
63  FairGeoVector fCon;
64 
65  PndSdsPixel fActivePixel;
66  Double_t fCperL; // Charge per Tracklength;
67  bool fStop;
68  void CalcConMatrix();
69  void ApplyConMatrix();
70  void CalcQuadrant();
71  void CalcCperL(Double_t Energy);
72  void CalcStartPixel(); // pixel 0,0 is in lower left corner
73  void CalcPixel();
74  void ConvertPixels();
75 
76  Double_t SmearCharge(Double_t charge);
77 };
78 
79 #endif
std::ostream & operator<<(std::ostream &out)
std::vector< PndSdsPixel > GetPixels(Double_t inx, Double_t iny, Double_t outx, Double_t outy, Double_t energy)
Main function to calculate the vector<PndSdsPixel> of fired pixel.
void SetVerboseLevel(Int_t level)
Calculates the pixels (digis) fired from a particle hitting the sensor.
Int_t GetPixelsAlternative(Double_t inx, Double_t iny, Double_t outx, Double_t outy, Double_t energy, std::vector< Int_t > &cols, std::vector< Int_t > &rows, std::vector< Double_t > &charges)
PndSdsCalcPixel()
Default constructor.