GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TSharcHit.cxx
Go to the documentation of this file.
1#include "TSharcHit.h"
2
3#include "TClass.h"
4
5#include "TSharc.h"
6#include "TChannel.h"
7
9{
10 Clear("ALL");
11}
12
14{
15 Clear();
16 rhs.Copy(*this);
17}
18
19void TSharcHit::Copy(TObject& rhs) const
20{
22 static_cast<const TDetectorHit&>(fBackHit).Copy(static_cast<TObject&>(static_cast<TSharcHit&>(rhs).fBackHit));
23 static_cast<const TDetectorHit&>(fPadHit).Copy(static_cast<TObject&>(static_cast<TSharcHit&>(rhs).fPadHit));
24}
25
26void TSharcHit::Copy(TObject& rhs, bool waveform) const
27{
28 Copy(rhs);
29 if(waveform) {
30 CopyWave(rhs);
31 }
32}
33
34void TSharcHit::Clear(Option_t* options)
35{
36 TDetectorHit::Clear(options); //
37 fBackHit.Clear(options); //
38 fPadHit.Clear(options); //
39}
40
41void TSharcHit::Print(Option_t*) const
42{
43 Print(std::cout);
44}
45
46void TSharcHit::Print(std::ostream& out) const
47{
48 std::ostringstream str;
49 str << DGREEN << "[D/F/B] = " << std::setw(2) << GetDetector() << "\t/" << std::setw(2) << GetFrontStrip() << "\t/" << std::setw(2) << GetBackStrip() << RESET_COLOR << std::endl;
50 out << str.str();
51}
52
53TVector3 TSharcHit::GetPosition(Double_t) const
54{
55 // return fposition; // returned from this -> i.e front...
56 // PC BENDER PLEASE LOOK AT THIS.
57 //
58 // this is fine, in all reality this function should not be used in sharc analysis,
59 // the buildhits function now properly sets fPosition in the base class, for finer
60 // position tweaks of the target, one should just use the static function in the
61 // sharc mother class. pcb.
62
65}
66
67TVector3 TSharcHit::GetPosition() const
68{
70}
71
72Double_t TSharcHit::GetTheta(double Xoff, double Yoff, double Zoff) const
73{
74 TVector3 posOff;
75 posOff.SetXYZ(Xoff, Yoff, Zoff);
76 return (GetPosition() + posOff).Theta();
77}
78
80{
81 frag.Copy(*this);
82}
83
85{
86 frag.Copy(fBackHit);
87}
88
90{
91 frag.Copy(fPadHit);
92}
#define DGREEN
Definition Globals.h:17
#define RESET_COLOR
Definition Globals.h:5
void Clear(Option_t *opt="") override
!
virtual Int_t GetDetector() const
!
virtual Int_t GetSegment() const
!
void Copy(TObject &) const override
!
virtual void CopyWave(TObject &) const
!
TDetectorHit fBackHit
Definition TSharcHit.h:49
void SetBack(const TFragment &frag)
!
Definition TSharcHit.cxx:84
TDetectorHit fPadHit
Definition TSharcHit.h:50
void Print(Option_t *="") const override
!
Definition TSharcHit.cxx:41
void Copy(TObject &) const override
!
Definition TSharcHit.cxx:19
void SetFront(const TFragment &frag)
!
Definition TSharcHit.cxx:79
TVector3 GetPosition() const override
!
Definition TSharcHit.cxx:67
TDetectorHit GetBack() const
Definition TSharcHit.h:64
void Clear(Option_t *="") override
!
Definition TSharcHit.cxx:34
UShort_t GetFrontStrip() const
!
Definition TSharcHit.h:60
void SetPad(const TFragment &frag)
!
Definition TSharcHit.cxx:89
UShort_t GetBackStrip() const
!
Definition TSharcHit.h:61
Double_t GetTheta(double Xoff=0.0, double Yoff=0.0, double Zoff=0.0) const
!
Definition TSharcHit.cxx:72
Double_t GetDefaultDistance() const
Definition TSharcHit.h:125
static double GetYOffset()
Definition TSharc.h:39
static double GetZOffset()
Definition TSharc.h:40
static double GetXOffset()
Definition TSharc.h:38
static TVector3 GetPosition(int detector, int frontstrip, int backstrip, double X=0.00, double Y=0.00, double Z=0.00)
!
Definition TSharc.cxx:190