FairRoot/PandaRoot
PndSdsHit.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndSdsHit header file -----
3 // ----- Created by T.Stockmanns -----
4 // -------------------------------------------------------------------------
5 
6 
16 #ifndef PNDSDSHIT_H
17 #define PNDSDSHIT_H
18 
19 
20 #include "TVector3.h"
21 #include "TString.h"
22 #include "FairHit.h"
23 #include "PndDetectorList.h"
24 #include "TMatrixD.h"
25 //#include "PndSingleLinkedData.h"
26 
27 #include <stdio.h>
28 #include <iostream>
29 
30 class PndSdsHit : public FairHit
31 {
33  out << "PndSdsHit in " << hit.GetSensorID() << " at" << std::endl;
34  out << "(" << hit.GetX() << ", " << hit.GetY() << ", " << hit.GetZ() << ") cm "
35  << " with " << hit.GetCharge() << " e" << " at Time: " << hit.GetTimeStamp() << " +/- " << hit.GetTimeStampError() << " , Cluster No. " << hit.GetClusterIndex();
36  if (hit.GetBotIndex() > -1)
37  out << " and bottom " << hit.GetBotIndex();
38  if (hit.GetRefIndex() > -1)
39  out << ", mc point id = " << hit.GetRefIndex();
40  else
41  out << ", noise hit without mc poit";
42  out << std::endl;
43 
44  out <<"hit.GetClusterIndex() "<<hit.GetClusterIndex() <<std::endl;
45  out <<"hit.GetBotIndex() "<< hit.GetBotIndex() <<std::endl;
46  out <<"hit.GetRefIndex() "<< hit.GetRefIndex()<<std::endl;
47  out <<"hit.GetNDigiHits() "<< hit.GetNDigiHits()<<std::endl;
48  out <<"hit.GetCharge() "<< hit.GetCharge()<<"("<<hit.GetEloss()<<" GeV)"<<std::endl;
49  out <<"hit.GetSensorID() "<< hit.GetSensorID()<<std::endl;
50  out <<"Error values in FairHit part: (dx,dy,dz) = ("<< hit.GetDx()<<","<<hit.GetDy()<<","<<hit.GetDz()<<")"<<std::endl;
51  return out;
52  }
53 
54  public:
55 
57  PndSdsHit();
58 
59 
69  PndSdsHit(Int_t detID, Int_t sensorID,
70  TVector3& pos, TVector3& dpos, Int_t clindex, Double_t charge, Int_t NDigiHits, Int_t mcindex);
71 
72  //PndSdsHit(PndSdsHit& c);
74  virtual ~PndSdsHit();
75 
76 
79  void SetSensorID(Int_t sensorID) { fSensorID = sensorID;}
80  void SetCharge(Double_t charge){ fCharge = charge;}
81  void SetNDigiHits(Int_t pixel) { fNDigiHits = pixel;}
82  void SetClusterIndex(Int_t datasource, Int_t id, Int_t fileId = -1, Int_t evtId = -1) {
83  fClusterIndex = id;
84  SetLink(FairLink(fileId, evtId, datasource, id));
85  }
86  void SetBotIndex(Int_t id) { fBotIndex = id;}
87  void SetCov(TMatrixD cov);
88 
89  //TString GetDetName() const { return fDetName;}
90  Int_t GetSensorID() const { return fSensorID;}
91  Double_t GetCharge() const { return fCharge;}
92  Int_t GetNDigiHits() const { return fNDigiHits;}
93  TVector3 GetPosition() const { return TVector3(fX,fY,fZ);}
94  Int_t GetClusterIndex() const { return fClusterIndex;}
95  Int_t GetTopIndex() const { return GetClusterIndex();}
96  Int_t GetBotIndex() const { return fBotIndex;}
97  Double_t GetEloss() const { return (fCharge * 3.61e-9);} // 3.6 eV/Electron in Silicon
98  TMatrixD GetCov() const { return fCov;}
99 
100 
101 // FIXME: CAUTION The errors in the SsdHit are LOCAL, but the coordinates are in the LAB
102 //
103 // Double_t GetDxLocal() const { return fDx;};
104 // Double_t GetDyLocal() const { return fDy;};
105 // Double_t GetDzLocal() const { return fDz;};
106 // void PositionErrorLocal(TVector3& dpos) const;
107 
108 // /** overloaded accessors **/
109 // Double_t GetDx() {return GetD(0);};
110 // Double_t GetDy() {return GetD(1);};
111 // Double_t GetDz() {return GetD(2);};
112 // void PositionError(TVector3& dpos);
113 
114 #ifndef __CINT__ // for BOOST serialization
115  template<class Archive>
116  void serialize(Archive & ar, const unsigned int version)
117  {
118  ar & boost::serialization::base_object<FairHit>(*this);
119  ar & fSensorID;
120  ar & fCharge;
121  ar & fNDigiHits;
122  ar & fClusterIndex;
123  ar & fBotIndex;
124  //ar & fCov;
125  }
126 #endif // for BOOST serialization
127 
129  virtual void Print(const Option_t* opt = 0) const;
130 
131  private:
132 // Double_t GetD(Int_t i);
133 #ifndef __CINT__ // for BOOST serialization
135 
136 #endif // for BOOST serialization
137 
138  //TString fDetName; // Detector name
139  Int_t fSensorID;
141  Int_t fNDigiHits;
143  Int_t fBotIndex;
145  ClassDef(PndSdsHit,8);
146 
147 };
148 
149 // inline void PndSdsHit::PositionErrorLocal(TVector3& dpos) const {
150 // dpos.SetXYZ(fDx, fDy, fDz);
151 // }
152 //
153 // inline void PndSdsHit::PositionError(TVector3& dpos) {
154 // dpos.SetXYZ(GetDx(), GetDy(), GetDz());
155 // }
156 
157 #endif
TVector3 pos
Int_t fBotIndex
top/pixel cluster index
Definition: PndSdsHit.h:143
void SetCharge(Double_t charge)
Definition: PndSdsHit.h:80
Int_t GetNDigiHits() const
Definition: PndSdsHit.h:92
virtual void Print(const Option_t *opt=0) const
Definition: PndSdsHit.cxx:66
TVector3 GetPosition() const
Definition: PndSdsHit.h:93
void SetClusterIndex(Int_t datasource, Int_t id, Int_t fileId=-1, Int_t evtId=-1)
Definition: PndSdsHit.h:82
Int_t fNDigiHits
deposited Charge
Definition: PndSdsHit.h:141
Double_t fX
Definition: PndCaloDraw.cxx:34
Double_t GetEloss() const
Definition: PndSdsHit.h:97
friend std::ostream & operator<<(std::ostream &out, const PndSdsHit &hit)
Definition: PndSdsHit.h:32
Int_t fClusterIndex
number of fired Digis for this hit,
Definition: PndSdsHit.h:142
Double_t fZ
Definition: PndCaloDraw.cxx:34
Double_t GetCharge() const
Definition: PndSdsHit.h:91
TMatrixD GetCov() const
Definition: PndSdsHit.h:98
friend class boost::serialization::access
Definition: PndSdsHit.h:134
Double_t
Double_t fCharge
Definition: PndSdsHit.h:140
void SetNDigiHits(Int_t pixel)
Definition: PndSdsHit.h:81
TMatrixD fCov
bottom side of strip clusters
Definition: PndSdsHit.h:144
Int_t GetBotIndex() const
Definition: PndSdsHit.h:96
TFile * out
Definition: reco_muo.C:20
virtual ~PndSdsHit()
Definition: PndSdsHit.cxx:60
void SetBotIndex(Int_t id)
Definition: PndSdsHit.h:86
int hit(Int_t nEvents=0, TString inFile="sim.root", TString parFile="par.root", TString inDigi="digi.root", TString outFile="hit.root", Int_t timeBased=0)
Definition: hit.C:1
Double_t fY
Definition: PndCaloDraw.cxx:34
void serialize(Archive &ar, const unsigned int version)
Definition: PndSdsHit.h:116
Int_t GetTopIndex() const
Definition: PndSdsHit.h:95
Int_t GetClusterIndex() const
Definition: PndSdsHit.h:94
void SetSensorID(Int_t sensorID)
Definition: PndSdsHit.h:79
ClassDef(PndSdsHit, 8)
Hit covariance Matrix.
Int_t GetSensorID() const
Definition: PndSdsHit.h:90
void SetCov(TMatrixD cov)
Definition: PndSdsHit.cxx:70
Int_t fSensorID
unique sensor ID
Definition: PndSdsHit.h:139
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:52