PandaRoot
PndSdsCalcPixel.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 #ifndef PNDSDSCALCPIXEL_H
14 #define PNDSDSCALCPIXEL_H
15 
16 #include "PndSdsPixel.h"
17 #include "FairGeoVector.h"
18 #include <iostream>
19 #include <vector>
20 //#include <XYVector.h>
21 //#include "CLHEP/Vector/TwoVector.h"
23 
36  public:
39 
45  PndSdsCalcPixel(Double_t w, Double_t l, Double_t threshold = 0, Double_t noise = 0);
46 
48  std::vector<PndSdsPixel> GetPixels(Double_t inx, Double_t iny, Double_t outx, Double_t outy, Double_t energy);
49  // Alternative in terms of I/O
50  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,
51  std::vector<Double_t> &charges);
52  void SetVerboseLevel(Int_t level) { fVerboseLevel = level; };
53  std::ostream &operator<<(std::ostream &out);
54 
55  private:
56  std::vector<PndSdsPixel> fPixels;
57  Double_t fPixelWidth;
58  Double_t fPixelLength;
59  Double_t fThreshold;
60  Double_t fNoise;
61  Double_t fEnergy;
62  Int_t fVerboseLevel;
63 
64  typedef enum { kQuadUNDEF, kUR, kUL, kDL, kDR } EQuadrantType;
65  typedef enum { kPixelUNDEF, kU, kD, kL, kR } ENextPixelType;
66 
67  EQuadrantType fQuad;
68  ENextPixelType fNextPixel;
69 
70  FairGeoVector fIn; // entry point of particle in sensor
71  FairGeoVector fOut; // exit point of particle out of sensor
72  FairGeoVector fDir; // direction of particle inside sensor
73  FairGeoVector fPos; // actual position of stepping inside sensor
74 
75  FairGeoVector fCon;
76 
77  PndSdsPixel fActivePixel;
78  Double_t fCperL; // Charge per Tracklength;
79  bool fStop;
80  void CalcConMatrix();
81  void ApplyConMatrix();
82  void CalcQuadrant();
83  void CalcCperL(Double_t Energy);
84  void CalcStartPixel(); // pixel 0,0 is in lower left corner
85  void CalcPixel();
86  void ConvertPixels();
87 
88  Double_t SmearCharge(Double_t charge);
89 };
90 
91 #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.