FairRoot/PandaRoot
PndSdsPixel.h
Go to the documentation of this file.
1 #ifndef PndSdsPixel_HH
2 #define PndSdsPixel_HH
3 
4 #include <iostream>
5 #include <string>
6 #include <vector>
7 #include "Rtypes.h"
8 
10 {
11  public :
13  fFe(-1),
14  fCol(-1),
15  fRow(-1),
16  fCharge(-1.0),
17  fSensorID(-1),
18  fMCIndex(),
19  fAddNoise(0.)
20  {};
21 
22  PndSdsPixel(Int_t sensorID, Int_t fe, Int_t col, Int_t row, Double_t charge, int index=-1) :
23  fFe(fe),
24  fCol(col),
25  fRow(row),
26  fCharge(charge),
27  fSensorID(sensorID),
28  fMCIndex(),
29  fAddNoise(0.)
30  {
31  if (index >= 0) fMCIndex.push_back(index);
32  };
33 
34  void SetCol(Int_t col) {fCol = col;};
35  void SetRow(Int_t row) {fRow = row;};
36  void SetCharge(Double_t charge) {fCharge = charge;};
37  void SetSensorID(Int_t sensorID) {fSensorID = sensorID;};
38  void SetFE (Int_t fe) {fFe = fe;};
39  void SetAddNoise (Double_t addnoise) {fAddNoise=addnoise;};
40 
41  Int_t GetCol() const {return fCol;};
42  Int_t GetRow() const {return fRow;};
43  Double_t GetCharge() const {return fCharge;};
44  Int_t GetSensorID() const {return fSensorID;};
45  Int_t GetFE() const {return fFe;};
46  std::vector<int> GetMCIndex(){return fMCIndex;};
48  if (fMCIndex.size() > 0)
49  return fMCIndex[0];
50  return -2;
51  };
52  Double_t GetAddNoise() const {return fAddNoise;};
53 
54  void AddCharge(Double_t charge){fCharge+= charge;};
55  void AddMCIndex(int i){fMCIndex.push_back(i);};
56 
58  {
59  out << "Detector: " << pixel.GetSensorID() << " FE: " << pixel.GetFE() << " Pixel (C/R): " << pixel.GetCol() << " " << pixel.GetRow()
60  << " Charge: " << pixel.GetCharge() << " from MCHit: " << pixel.GetFirstMCIndex();
61  return out;
62  };
63 
64 
65  private :
66  Int_t fFe;
67  Int_t fCol;
68  Int_t fRow;
70  Int_t fSensorID;
71  std::vector<int> fMCIndex;
72  Double_t fAddNoise; // Variable for testing
73 };
74 
75 
76 #endif
Double_t fAddNoise
Definition: PndSdsPixel.h:72
Double_t fCharge
Definition: PndSdsPixel.h:69
int row
Definition: anaLmdDigi.C:67
Int_t i
Definition: run_full.C:25
friend std::ostream & operator<<(std::ostream &out, PndSdsPixel pixel)
Definition: PndSdsPixel.h:57
Int_t GetSensorID() const
Definition: PndSdsPixel.h:44
int col
Definition: anaLmdDigi.C:67
Int_t fCol
Definition: PndSdsPixel.h:67
std::vector< int > GetMCIndex()
Definition: PndSdsPixel.h:46
Int_t fSensorID
Definition: PndSdsPixel.h:70
Int_t GetCol() const
Definition: PndSdsPixel.h:41
Int_t GetFE() const
Definition: PndSdsPixel.h:45
int GetFirstMCIndex()
Definition: PndSdsPixel.h:47
void SetCol(Int_t col)
Definition: PndSdsPixel.h:34
Int_t GetRow() const
Definition: PndSdsPixel.h:42
void SetCharge(Double_t charge)
Definition: PndSdsPixel.h:36
Double_t
void SetRow(Int_t row)
Definition: PndSdsPixel.h:35
void AddMCIndex(int i)
Definition: PndSdsPixel.h:55
void SetSensorID(Int_t sensorID)
Definition: PndSdsPixel.h:37
TFile * out
Definition: reco_muo.C:20
void SetFE(Int_t fe)
Definition: PndSdsPixel.h:38
std::vector< int > fMCIndex
List of indices of the corresponding MC hits.
Definition: PndSdsPixel.h:71
void SetAddNoise(Double_t addnoise)
Definition: PndSdsPixel.h:39
PndSdsPixel(Int_t sensorID, Int_t fe, Int_t col, Int_t row, Double_t charge, int index=-1)
Definition: PndSdsPixel.h:22
void AddCharge(Double_t charge)
Definition: PndSdsPixel.h:54
Int_t fRow
Definition: PndSdsPixel.h:68
Double_t GetCharge() const
Definition: PndSdsPixel.h:43
int fe
Definition: anaLmdDigi.C:67
Double_t GetAddNoise() const
Definition: PndSdsPixel.h:52