PandaRoot
PndDiscDigitizedHit.h
Go to the documentation of this file.
1 //-------------------------------------------------------------------------
2 // Author: Oliver Merle (Oliver.Merle@exp2.physik.uni-giessen.de)
3 // Changes: Mustafa Schmidt (Mustafa.A.Schmidt@physik.uni-giessen.de)
4 // Date: 30.11.2015
5 // Description: Digitizing hits from Monte Carlo simulations
6 //-------------------------------------------------------------------------
7 
8 #ifndef PNDDISCDIGITIZEDHIT_HH
9 #define PNDDISCDIGITIZEDHIT_HH
10 
11 #include "FairTimeStamp.h"
12 #include "FairLogger.h"
13 
14 #include "TObject.h"
15 #include "TString.h"
16 #include "PndDetectorList.h"
17 
18 #include <iostream>
19 
20 class PndDiscDigitizedHit : public FairTimeStamp {
21 
22  public:
24  PndDiscDigitizedHit(FairLink const &fairln_mc_point, const Int_t &detector_id_, const Int_t &readout_id_, const Int_t &sensor_id_, const Int_t &dead_time_entity_,
25  const Int_t &pixel_number_, const Double_t &pixel_pos_, const Double_t &tdc_time, const Double_t &panda_timestamp, const Int_t classifier);
26 
27  virtual ~PndDiscDigitizedHit() {}
28 
29  // getters ...
30  const Int_t &GetDetectorID() const { return detector_id; }
31  const Int_t &GetReadoutID() const { return readout_id; }
32  const Int_t &GetSensorID() const { return sensor_id; }
33  const Int_t &GetPixelNumber() const { return pixel_number; }
34  const Int_t &GetDeadTimeEntity() const { return dead_time_entity; }
35  const Double_t &GetTdcTime() const { return tdc_time; }
36  const Double_t &GetPixelPosition() const { return pixel_pos; }
37  const Int_t &GetClassifier() const { return digit_classifier; }
38 
39  virtual bool SortOrder(const FairTimeStamp *s2) const
40  {
42  if (detector_id < digit.GetDetectorID())
43  return true;
44  else if (detector_id > digit.GetDetectorID())
45  return false;
46  if (readout_id < digit.GetReadoutID())
47  return true;
48  else if (readout_id > digit.GetReadoutID())
49  return false;
50  if (dead_time_entity < digit.GetDeadTimeEntity())
51  return true;
52  else if (dead_time_entity > digit.GetDeadTimeEntity())
53  return false;
54  // if (pixel_number < digit.GetPixelNumber()) return true;
55  // else if (pixel_number > digit.GetPixelNumber()) return false;
56  return false; // equal
57  }
58 
59  // the less operator to sort by 'deadtime entity':
60  virtual bool operator<(const PndDiscDigitizedHit &digit) const
61  {
62  if (detector_id < digit.GetDetectorID())
63  return true;
64  else if (detector_id > digit.GetDetectorID())
65  return false;
66  if (readout_id < digit.GetReadoutID())
67  return true;
68  else if (readout_id > digit.GetReadoutID())
69  return false;
70  if (dead_time_entity < digit.GetDeadTimeEntity())
71  return true;
72  else if (dead_time_entity > digit.GetDeadTimeEntity())
73  return false;
74  // if (pixel_number < digit.GetPixelNumber()) return true;
75  // else if (pixel_number > digit.GetPixelNumber()) return false;
76  return false; // equal
77  }
78 
79  // is something using this operator??
80  virtual bool operator==(const PndDiscDigitizedHit &digit) const
81  {
82  return ((detector_id == digit.GetDetectorID()) && (readout_id == digit.GetReadoutID()) && (dead_time_entity == digit.GetDeadTimeEntity()));
83  }
84 
85  // needed by FairWriteoutBuffer
86  virtual bool equal(FairTimeStamp *data)
87  {
89  return (*this) == (*digit);
90  }
91 
92  virtual void Print(std::ostream &out = std::cout);
93 
94  protected:
95  Int_t detector_id; // detector id (quarter that has fired)
96  Int_t readout_id; // id number of the readout element
97  Int_t sensor_id; // id number of the sensor on an readout element (to handle more than one sensor)
98  Int_t pixel_number; // pixel pos
99  Int_t dead_time_entity; // used to group hits by dead_time_entity (used in operators for time based simulation)
100  Double_t pixel_pos; // binned pixel pos ...
101 
102  Double_t tdc_time; // time determined by tdc
103  Int_t digit_classifier; // 0 - typical hit, 1 - dark count, 2 - from mixed background
104 
105  ClassDef(PndDiscDigitizedHit, 4)
106 };
107 
108 #endif // PNDDISCDIGITIZEDHIT_HH
const Double_t & GetTdcTime() const
const Double_t & GetPixelPosition() const
const Int_t & GetReadoutID() const
virtual void Print(std::ostream &out=std::cout)
const Int_t & GetSensorID() const
const Int_t & GetClassifier() const
virtual bool operator<(const PndDiscDigitizedHit &digit) const
const Int_t & GetPixelNumber() const
const Int_t & GetDeadTimeEntity() const
virtual bool operator==(const PndDiscDigitizedHit &digit) const
virtual bool equal(FairTimeStamp *data)
virtual bool SortOrder(const FairTimeStamp *s2) const
const Int_t & GetDetectorID() const