FairRoot/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 
21 class PndDiscDigitizedHit : public FairTimeStamp
22 {
23 
24 public:
26  PndDiscDigitizedHit(FairLink const & fairln_mc_point,
27  const Int_t & detector_id_, const Int_t & readout_id_,
28  const Int_t & sensor_id_, const Int_t & dead_time_entity_,
29  const Int_t & pixel_number_, const Double_t & pixel_pos_,
30  const Double_t & tdc_time, const Double_t & panda_timestamp,
31  const Int_t classifier);
32 
33  virtual ~PndDiscDigitizedHit() { }
34 
35 
36  // getters ...
37  const Int_t & GetDetectorID() const { return detector_id; }
38  const Int_t & GetReadoutID() const { return readout_id; }
39  const Int_t & GetSensorID() const { return sensor_id; }
40  const Int_t & GetPixelNumber() const { return pixel_number; }
41  const Int_t & GetDeadTimeEntity() const { return dead_time_entity; }
42  const Double_t & GetTdcTime() const { return tdc_time; }
43  const Double_t & GetPixelPosition() const { return pixel_pos; }
44  const Int_t & GetClassifier() const { return digit_classifier; }
45 
46 
47  virtual bool SortOrder(const FairTimeStamp* s2) const {
49  if (detector_id < digit.GetDetectorID()) return true;
50  else if (detector_id > digit.GetDetectorID()) return false;
51  if (readout_id < digit.GetReadoutID()) return true;
52  else if (readout_id > digit.GetReadoutID()) return false;
53  if (dead_time_entity < digit.GetDeadTimeEntity()) return true;
54  else if (dead_time_entity > digit.GetDeadTimeEntity()) return false;
55  //if (pixel_number < digit.GetPixelNumber()) return true;
56  //else if (pixel_number > digit.GetPixelNumber()) return false;
57  return false; // equal
58  }
59 
60 
61  // the less operator to sort by 'deadtime entity':
62  virtual bool operator<(const PndDiscDigitizedHit & digit) const {
63  if (detector_id < digit.GetDetectorID()) return true;
64  else if (detector_id > digit.GetDetectorID()) return false;
65  if (readout_id < digit.GetReadoutID()) return true;
66  else if (readout_id > digit.GetReadoutID()) return false;
67  if (dead_time_entity < digit.GetDeadTimeEntity()) return true;
68  else if (dead_time_entity > digit.GetDeadTimeEntity()) return false;
69  //if (pixel_number < digit.GetPixelNumber()) return true;
70  //else if (pixel_number > digit.GetPixelNumber()) return false;
71  return false; // equal
72  }
73 
74 
75  // is something using this operator??
76  virtual bool operator == (const PndDiscDigitizedHit & digit) const {
77  return ( ( detector_id == digit.GetDetectorID() )
78  && ( readout_id == digit.GetReadoutID() )
79  && ( dead_time_entity == digit.GetDeadTimeEntity() )
80  );
81  }
82 
83 
84  // needed by FairWriteoutBuffer
85  virtual bool equal(FairTimeStamp* data) {
87  return (*this) == (*digit);
88  }
89 
90 
91  virtual void Print(std::ostream& out = std::cout);
92 
93 
94 protected:
95 
96  Int_t detector_id; // detector id (quarter that has fired)
97  Int_t readout_id; // id number of the readout element
98  Int_t sensor_id; // id number of the sensor on an readout element (to handle more than one sensor)
99  Int_t pixel_number; // pixel pos
100  Int_t dead_time_entity; // used to group hits by dead_time_entity (used in operators for time based simulation)
101  Double_t pixel_pos; // binned pixel pos ...
102 
103  Double_t tdc_time; // time determined by tdc
104  Int_t digit_classifier; // 0 - typical hit, 1 - dark count, 2 - from mixed background
105 
106  ClassDef(PndDiscDigitizedHit, 4)
107 };
108 
109 
110 #endif // PNDDISCDIGITIZEDHIT_HH
virtual void Print(std::ostream &out=std::cout)
const Int_t & GetReadoutID() const
virtual bool operator==(const PndDiscDigitizedHit &digit) const
virtual bool operator<(const PndDiscDigitizedHit &digit) const
const Double_t & GetTdcTime() const
virtual bool SortOrder(const FairTimeStamp *s2) const
const Int_t & GetDeadTimeEntity() const
const Int_t & GetClassifier() const
Double_t
const Int_t & GetDetectorID() const
TFile * out
Definition: reco_muo.C:20
const Int_t & GetPixelNumber() const
const Int_t & GetSensorID() const
virtual bool equal(FairTimeStamp *data)
const Double_t & GetPixelPosition() const