FairRoot/PandaRoot
PndGemHit.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndGemHit header file -----
3 // ----- Created by R.Kliemt -----
4 // -------------------------------------------------------------------------
5 
6 
16 #ifndef PNDGEMHIT_H
17 #define PNDGEMHIT_H
18 
19 
20 #include "TVector3.h"
21 #include "TString.h"
22 #include "FairHit.h"
23 
24 #include <stdio.h>
25 #include <iostream>
26 
27 class PndGemHit : public FairHit
28 {
30  out << "Gem hit" /*in detector " << hit.GetDetName()*/ << " at ("
31  << hit.GetX() << ", " << hit.GetY() << ", " << hit.GetZ() << ") cm "
32  << " with " << hit.GetCharge() << " e" << ", Cluster No. " << hit.GetRefIndex() << std::endl;
33 
34  return out;
35  }
36 
37  public:
38 
40  PndGemHit();
41 
42 
52  PndGemHit(Int_t detID, TVector3& pos, TVector3& dpos, Int_t index, Double_t charge, Int_t NDigiHits, TString fromStr = "GEMPoint");
53  PndGemHit(Int_t detID, TVector3& pos, TVector3& dpos, Int_t digi1, Int_t digi2, Double_t dr, Double_t dp, Int_t index, TString fromStr = "GEMCluster");
54  PndGemHit(Int_t detID, TVector3& pos, TVector3& dpos, Double_t charge, Double_t time, Int_t digi1, Int_t digi2, Double_t dr, Double_t dp, Int_t index, TString fromStr = "GEMCluster");
55 
56  //PndGemHit(PndGemHit& c);
58  virtual ~PndGemHit();
59 
60 
63  void SetCharge(Double_t charge){ fCharge = charge;}
64  void SetNDigiHits(Int_t pixel) { fNDigiHits = pixel;}
65  void SetBotIndex(Int_t id) { fBotIndex = id;}
66  void SetErrors(Double_t dr, Double_t dp) { fDr = dr; fDp = dp; };
67  void SetDigiNr(Int_t digi1, Int_t digi2) { fDigiNr[0] = digi1; fDigiNr[1] = digi2; };
68 
69  Double_t GetCharge() const { return fCharge;}
70  Int_t GetNDigiHits() const { return fNDigiHits;}
71  TVector3 GetPosition() const { return TVector3(fX,fY,fZ);}
72  Int_t GetBotIndex() const { return fBotIndex;}
73  Double_t GetEloss() const { return (fCharge * 3.61e-9);} // 3.6 eV/Electron in Silicon
74 
75  Double_t GetDr() const { return fDr; };
76  Double_t GetDp() const { return fDp; };
77  Int_t GetDigiNr(Int_t iside) const { if ( iside*(iside-1) == 0 ) return fDigiNr[iside]; return -1;};
78 
79  Int_t GetSystemId() const {
80  return ( ( fDetectorID & ( 31<<27) ) >> 27); }
81  Int_t GetStationNr() const {
82  return ( ( fDetectorID & (8191<< 8) ) >> 8 ); }
83  Int_t GetSensorNr() const { // sensor number within station
84  return ( ( fDetectorID & ( 3<< 6) ) >> 6 ); }
85 
86  // // CAUTION The errors in the GemHit are LOCAL, but the coordinates are in the LAB
87  //
88  // Double_t GetDxLocal() const { return fDx;};
89  // Double_t GetDyLocal() const { return fDy;};
90  // Double_t GetDzLocal() const { return fDz;};
91  // void PositionErrorLocal(TVector3& dpos) const;
92 
93  // /** overloaded accessors **/
94  // Double_t GetDx() {return GetD(0);};
95  // Double_t GetDy() {return GetD(1);};
96  // Double_t GetDz() {return GetD(2);};
97  // void PositionError(TVector3& dpos);
98 
100  virtual void Print(const Option_t* opt = 0) const;
101 
102  private:
103 
104  Int_t fDigiNr[2];
105  Double_t fDr; // error in radius calculation
106  Double_t fDp; // error in angle calculation
107 
109  Int_t fNDigiHits;
110  //if more then in the cluster cand, look for the bottom cluster.
111  Int_t fBotIndex;
112  ClassDef(PndGemHit,1);
113 
114 };
115 
116 // inline void PndGemHit::PositionErrorLocal(TVector3& dpos) const {
117 // dpos.SetXYZ(fDx, fDy, fDz);
118 // }
119 //
120 // inline void PndGemHit::PositionError(TVector3& dpos) {
121 // dpos.SetXYZ(GetDx(), GetDy(), GetDz());
122 // }
123 
124 #endif
TVector3 pos
Double_t fDr
Definition: PndGemHit.h:105
virtual ~PndGemHit()
Definition: PndGemHit.cxx:88
Double_t fCharge
Definition: PndGemHit.h:108
Double_t fX
Definition: PndCaloDraw.cxx:34
Double_t fDp
Definition: PndGemHit.h:106
virtual void Print(const Option_t *opt=0) const
Definition: PndGemHit.cxx:94
Int_t fBotIndex
number of fired Digis for this hit,
Definition: PndGemHit.h:111
Double_t fZ
Definition: PndCaloDraw.cxx:34
void SetBotIndex(Int_t id)
Definition: PndGemHit.h:65
Int_t GetSensorNr() const
Definition: PndGemHit.h:83
Int_t fNDigiHits
deposited Charge
Definition: PndGemHit.h:109
void SetDigiNr(Int_t digi1, Int_t digi2)
Definition: PndGemHit.h:67
Int_t fDigiNr[2]
Definition: PndGemHit.h:104
Double_t
Double_t GetEloss() const
Definition: PndGemHit.h:73
Int_t GetSystemId() const
Definition: PndGemHit.h:79
Int_t GetNDigiHits() const
Definition: PndGemHit.h:70
Double_t GetDp() const
Definition: PndGemHit.h:76
void SetErrors(Double_t dr, Double_t dp)
Definition: PndGemHit.h:66
Double_t GetCharge() const
Definition: PndGemHit.h:69
TFile * out
Definition: reco_muo.C:20
Int_t GetStationNr() const
Definition: PndGemHit.h:81
void SetNDigiHits(Int_t pixel)
Definition: PndGemHit.h:64
friend std::ostream & operator<<(std::ostream &out, const PndGemHit &hit)
Definition: PndGemHit.h:29
Int_t GetBotIndex() const
Definition: PndGemHit.h:72
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
TVector3 GetPosition() const
Definition: PndGemHit.h:71
Int_t GetDigiNr(Int_t iside) const
Definition: PndGemHit.h:77
ClassDef(PndGemHit, 1)
bottom side of strip clusters
Double_t GetDr() const
Definition: PndGemHit.h:75
void SetCharge(Double_t charge)
Definition: PndGemHit.h:63