GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TSharc2Hit.cxx
Go to the documentation of this file.
1#include "TSharc2Hit.h"
2
3#include "TClass.h"
4
5#include "TSharc2.h"
6#include "TChannel.h"
7
9{
10 Clear("ALL");
11}
12
14{
15 Clear();
16 rhs.Copy(*this);
17}
18
19void TSharc2Hit::Copy(TObject& rhs) const
20{
22 static_cast<const TDetectorHit&>(fBackHit).Copy(static_cast<TObject&>(static_cast<TSharc2Hit&>(rhs).fBackHit));
23 static_cast<const TDetectorHit&>(fPadHit).Copy(static_cast<TObject&>(static_cast<TSharc2Hit&>(rhs).fPadHit));
24}
25
26void TSharc2Hit::Copy(TObject& rhs, bool waveform) const
27{
28 Copy(rhs);
29 if(waveform) {
30 CopyWave(rhs);
31 }
32}
33
34void TSharc2Hit::Clear(Option_t* options)
35{
36 TDetectorHit::Clear(options); //
37 fBackHit.Clear(options); //
38 fPadHit.Clear(options); //
39}
40
41void TSharc2Hit::Print(Option_t*) const
42{
43 Print(std::cout);
44}
45
46void TSharc2Hit::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 TSharc2Hit::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
68{
70}
71
72Double_t TSharc2Hit::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
!
void Print(Option_t *="") const override
!
void SetPad(const TFragment &frag)
!
TVector3 GetPosition() const override
!
TDetectorHit fBackHit
Definition TSharc2Hit.h:45
UShort_t GetBackStrip() const
!
Definition TSharc2Hit.h:57
Double_t GetTheta(double Xoff=0.0, double Yoff=0.0, double Zoff=0.0) const
!
UShort_t GetFrontStrip() const
!
Definition TSharc2Hit.h:56
void SetFront(const TFragment &frag)
!
void SetBack(const TFragment &frag)
!
void Clear(Option_t *="") override
!
TDetectorHit GetBack() const
Definition TSharc2Hit.h:60
void Copy(TObject &) const override
!
Double_t GetDefaultDistance() const
Definition TSharc2Hit.h:112
TDetectorHit fPadHit
Definition TSharc2Hit.h:46
static double GetXOffset()
Definition TSharc2.h:38
static double GetZOffset()
Definition TSharc2.h:40
static TVector3 GetPosition(int detector, int frontstrip, int backstrip, double X=0.00, double Y=0.00, double Z=0.00)
!
Definition TSharc2.cxx:159
static double GetYOffset()
Definition TSharc2.h:39