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