FairRoot/PandaRoot
PndDrcDigi.h
Go to the documentation of this file.
1 // --------------------------------------------------------
2 // ---- PndDrcDigi header file ---
3 // ---- Created 30.5.13 by M.Patsyuk ---
4 // --------------------------------------------------------
5 
13 #ifndef PNDDRCDIGI_H
14 #define PNDDRCDIGI_H
15 
16 #include "PndDrcDigi.h"
17 #include "PndDetectorList.h"
18 #include "FairTimeStamp.h"
19 #include "TObject.h"
20 #include "TString.h"
21 #include <iostream>
22 #include <vector>
23 #include "TVector3.h"
24 #include <fstream>
25 #include <iostream>
26 #include "stdio.h"
27 #include "TMath.h"
28 using std::endl;
29 using std::cout;
30 
31 
32 class PndDrcDigi : public FairTimeStamp
33 {
34 public:
36  out << "PndDrcDigi in: " << digi.GetDetectorId()
37  << " charge " << digi.GetCharge() << " e"
38  << " time "<<digi.GetTime()<< " ns"
39  << " timestamp "<< digi.GetTimeStamp()
40  << " charge sharing flag "<< digi.GetChargeSharingFlag()
41  << " sensorid " << digi.GetSensorId()
42  << ", from Point(s) ";
43  std::vector<Int_t>indices = digi.GetIndices();
44  for (unsigned int i = 0; i < indices.size(); i++){
45  out << indices[i] << " ";
46  }
47  out << std::endl;
48 
49  return out;
50  }
51 
52 public : PndDrcDigi();
53  PndDrcDigi(std::vector<Int_t> index, Int_t detectorId, Int_t sensorId, Double_t charge, Double_t time, Int_t CSflag, Double_t timeStamp);
54  PndDrcDigi(Int_t index, Int_t detectorId, Int_t sensorId, Double_t charge, Double_t time, Int_t CSflag, Double_t timeStamp);
55 
57 
58  void Print() {
59  std::cout << *this;
60  }
61 
62  void SetBarID(Int_t BarID);
63  void SetBoxID(Int_t BoxID);
64  void SetTrackID(Int_t TrackID);
65  void SetTrackIniVertex(TVector3 TrackIniVertex);
66  void SetMotherID(Int_t MrID);
67  void SetPdgCode(Int_t Pdg);
68  void SetTrackMom(TVector3 TrackMom);
69  void SetMotherIDPho(Int_t MrIDPho);
70  void SetTimeAtBar(Double_t TimeAtBar);
71  void SetEvtTim(Double_t EvtTim);
72  void SetEventTim(Double_t EventTim);
73  void SetPileUp(Double_t pileup);
74  void SetEventNo(Double_t EventNo);
75 
76  Int_t GetBarID() const { return fBarID; }
77  Int_t GetBoxID() const { return fBoxID; }
78  Int_t GetTrackID() const { return fTrackID; }
79  TVector3 GetTrackIniVertex() { return fTrackIniVertex; }
80  Int_t GetMotherID() const { return fMrID; }
81  Int_t GetPdgCode() const { return fPdg; }
82  TVector3 GetTrackMom() { return fTrackMom; }
83  Int_t GetMotherIDPho() const { return fMrIDPho; }
84  Double_t GetTimeAtBar() const { return fTimeAtBar; }
85  Double_t GetEvtTim() const { return fEvtTim; }
86  Double_t GetEventTim() const { return fEventTim; }
87  Double_t GetPileUp() const { return fPileUp; }
88  Double_t GetEventNo() const { return fEventNo; }
89 
90  Int_t GetDetectorId() const { return fDetectorId; }
91  Int_t GetSensorId() const { return fSensorId; }
92  Double_t GetCharge() const { return fCharge; }
93  std::vector<Int_t> GetIndices() const { return fIndex;}
94  Int_t GetIndex(int i = 0) const{ return fIndex[i];}
95  Int_t GetNIndices() const { return fIndex.size();}
96  Double_t GetTime() const { return fTime; }
97  Int_t GetChargeSharingFlag() const {return fCSflag;}
98 
99  void AddIndex(int index)
100  {
101  fIndex.push_back(index);
102  AddLink(FairLink("DrcPDPoint", index));
103  }
104 
105  void AddIndex(std::vector<Int_t> index)
106  {
107  fIndex = index;
108  AddLinks(FairMultiLinkedData("DrcPDPoint", index));
109  }
110 
111  virtual bool equal(FairTimeStamp* data){
112  PndDrcDigi* myDigi = dynamic_cast <PndDrcDigi*> (data);
113  if (myDigi != 0){
114  if (fSensorId == myDigi->GetSensorId()) return true;
115  }
116  return false;
117  }
118 
119  virtual bool operator<(const PndDrcDigi& myDigi) const{
120  if (fSensorId < myDigi.GetSensorId())return true;
121  return false;
122  }
123  virtual bool operator>(const PndDrcDigi& myDigi) const{
124  if (fSensorId > myDigi.GetSensorId())return true;
125  return false;
126  }
127  virtual bool operator==(const PndDrcDigi& myDigi) const{
128  if (fSensorId == myDigi.GetSensorId()) return true;
129  return false;
130  }
131 
132 protected:
133  std::vector<Int_t> fIndex; // indice of mc points contributing to this digi
134  Int_t fDetectorId; // uniq detector ID
135  Int_t fSensorId; // Geometry ID for sensor volume
136  Double_t fCharge; // collected charge
137  Double_t fTime; // hit time
138  Int_t fCSflag; // flag indicating is the hit was produced directly by the MC point or if it is a result of the charge sharing: 1 - charge sharing hit, 0 - initial hit
139  Int_t fBarID;
140  Int_t fBoxID;
141  Int_t fTrackID;
142  TVector3 fTrackIniVertex;
143  Int_t fMrID;
144  Int_t fMrIDPho;
145  Int_t fPdg;
146  TVector3 fTrackMom;
152 
153  ClassDef(PndDrcDigi,2);
154 };
155 
156 #endif
virtual bool operator>(const PndDrcDigi &myDigi) const
Definition: PndDrcDigi.h:123
TClonesArray * digi
Int_t fMrIDPho
Definition: PndDrcDigi.h:144
Int_t GetMotherIDPho() const
Definition: PndDrcDigi.h:83
Double_t GetPileUp() const
Definition: PndDrcDigi.h:87
Int_t fBoxID
Definition: PndDrcDigi.h:140
Int_t GetNIndices() const
Definition: PndDrcDigi.h:95
Int_t fTrackID
Definition: PndDrcDigi.h:141
void SetTimeAtBar(Double_t TimeAtBar)
Definition: PndDrcDigi.cxx:46
Int_t i
Definition: run_full.C:25
Int_t fPdg
Definition: PndDrcDigi.h:145
virtual bool equal(FairTimeStamp *data)
Definition: PndDrcDigi.h:111
void Print()
Definition: PndDrcDigi.h:58
Int_t fBarID
Definition: PndDrcDigi.h:139
void SetEventNo(Double_t EventNo)
Definition: PndDrcDigi.cxx:58
std::vector< Int_t > fIndex
Definition: PndDrcDigi.h:133
Int_t fCSflag
Definition: PndDrcDigi.h:138
Double_t GetCharge() const
Definition: PndDrcDigi.h:92
TVector3 fTrackMom
Definition: PndDrcDigi.h:146
Double_t GetEventTim() const
Definition: PndDrcDigi.h:86
void SetBarID(Int_t BarID)
Definition: PndDrcDigi.cxx:22
Int_t GetChargeSharingFlag() const
Definition: PndDrcDigi.h:97
Double_t fPileUp
Definition: PndDrcDigi.h:150
Int_t fSensorId
Definition: PndDrcDigi.h:135
void AddIndex(int index)
Definition: PndDrcDigi.h:99
ClassDef(PndDrcDigi, 2)
Int_t fMrID
Definition: PndDrcDigi.h:143
void SetBoxID(Int_t BoxID)
Definition: PndDrcDigi.cxx:25
Double_t fEventTim
Definition: PndDrcDigi.h:149
void SetPileUp(Double_t pileup)
Definition: PndDrcDigi.cxx:55
Double_t
void SetMotherID(Int_t MrID)
Definition: PndDrcDigi.cxx:34
Int_t GetPdgCode() const
Definition: PndDrcDigi.h:81
Int_t GetMotherID() const
Definition: PndDrcDigi.h:80
Double_t GetEvtTim() const
Definition: PndDrcDigi.h:85
void SetTrackMom(TVector3 TrackMom)
Definition: PndDrcDigi.cxx:40
void SetTrackID(Int_t TrackID)
Definition: PndDrcDigi.cxx:28
TFile * out
Definition: reco_muo.C:20
Double_t GetEventNo() const
Definition: PndDrcDigi.h:88
Double_t fCharge
Definition: PndDrcDigi.h:136
friend std::ostream & operator<<(std::ostream &out, PndDrcDigi &digi)
Definition: PndDrcDigi.h:35
void SetEvtTim(Double_t EvtTim)
Definition: PndDrcDigi.cxx:49
Double_t fTimeAtBar
Definition: PndDrcDigi.h:147
Int_t GetTrackID() const
Definition: PndDrcDigi.h:78
virtual bool operator==(const PndDrcDigi &myDigi) const
Definition: PndDrcDigi.h:127
void SetTrackIniVertex(TVector3 TrackIniVertex)
Definition: PndDrcDigi.cxx:31
Double_t fEvtTim
Definition: PndDrcDigi.h:148
Int_t GetBoxID() const
Definition: PndDrcDigi.h:77
Double_t fEventNo
Definition: PndDrcDigi.h:151
virtual bool operator<(const PndDrcDigi &myDigi) const
Definition: PndDrcDigi.h:119
std::vector< Int_t > GetIndices() const
Definition: PndDrcDigi.h:93
void AddIndex(std::vector< Int_t > index)
Definition: PndDrcDigi.h:105
Int_t GetSensorId() const
Definition: PndDrcDigi.h:91
TVector3 GetTrackIniVertex()
Definition: PndDrcDigi.h:79
Double_t fTime
Definition: PndDrcDigi.h:137
void SetPdgCode(Int_t Pdg)
Definition: PndDrcDigi.cxx:37
TVector3 GetTrackMom()
Definition: PndDrcDigi.h:82
void SetEventTim(Double_t EventTim)
Definition: PndDrcDigi.cxx:52
Int_t GetDetectorId() const
Definition: PndDrcDigi.h:90
TVector3 fTrackIniVertex
Definition: PndDrcDigi.h:142
Int_t fDetectorId
Definition: PndDrcDigi.h:134
Int_t GetBarID() const
Definition: PndDrcDigi.h:76
Int_t GetIndex(int i=0) const
Definition: PndDrcDigi.h:94
void SetMotherIDPho(Int_t MrIDPho)
Definition: PndDrcDigi.cxx:43
Double_t GetTimeAtBar() const
Definition: PndDrcDigi.h:84
Double_t GetTime() const
Definition: PndDrcDigi.h:96