GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TSharc2Hit.h
Go to the documentation of this file.
1#ifndef TSHARC2HIT_H
2#define TSHARC2HIT_H
3
4/** \addtogroup Detectors
5 * @{
6 */
7
8#include <cstdio>
9#include <utility>
10
11#include "TVector3.h"
12#include "TObject.h"
13#include "TRandom.h"
14#include "Rtypes.h"
15#include "TMath.h"
16
17#include "Globals.h"
18#include "TDetectorHit.h"
19#include "TFragment.h"
20
21/////////////////////////////////////////////////////////////////////////
22///
23/// \class TSharc2Hit
24///
25/// This is the updated sharc-hit storage class, designed to better work with
26/// the GRSISort Inheritied class method. A lot has changed, but the main function
27/// stays the same. Since two physial wire hits are needed to make one sharc hit,
28/// and the "front" side will always have better resolution/timing properties, we
29/// will make the inherited charge/time derive from the front. So we do not lose the
30/// back information, the class additionally holds a TDetectorHit for the back and
31/// another for the pad if it is present.
32///
33////////////////////////////////////////////////////////////////////////////
34
35class TSharc2Hit : public TDetectorHit {
36public:
37 TSharc2Hit();
38 TSharc2Hit(const TSharc2Hit&);
39 TSharc2Hit(TSharc2Hit&&) noexcept = default;
40 TSharc2Hit& operator=(const TSharc2Hit&) = default;
41 TSharc2Hit& operator=(TSharc2Hit&&) noexcept = default;
42 ~TSharc2Hit() override = default;
43
44private:
47
48public:
49 void Copy(TObject&) const override; //!<!
50 void Copy(TObject&, bool) const override; //!<!
51 void Clear(Option_t* = "") override; //!<!
52 void Print(Option_t* = "") const override; //!<!
53 void Print(std::ostream& out) const override; //!<!
54
55 // inline UShort_t GetDetector() const { return TDetectorHit::GetDetector(); } //!<!
56 UShort_t GetFrontStrip() const { return GetSegment(); } //!<!
57 UShort_t GetBackStrip() const { return GetBack().GetSegment(); } //!<!
58
59 // TDetectorHit* GetFront() const { return this; }
60 TDetectorHit GetBack() const { return fBackHit; }
61 TDetectorHit GetPad() const { return fPadHit; }
62
63 Double_t GetSomeTime() const
64 {
65 return GetCfd() - GetBack().GetCfd() + ((GetBackStrip() % 24) * 157.6) - (GetFrontStrip() * 157.6);
66 }
67
68 inline Double_t GetDeltaE() const { return TDetectorHit::GetEnergy(); } //!<!
69 inline Double_t GetDeltaT() const { return TDetectorHit::GetTime(); } //!<!
70
71 inline Double_t GetDeltaFrontE() const { return TDetectorHit::GetEnergy(); } //!<!
72 inline Double_t GetDeltaFrontT() const { return TDetectorHit::GetTime(); } //!<!
73 inline Double_t GetDeltaBackE() const { return GetBack().GetEnergy(); } //!<!
74 inline Double_t GetDeltaBackT() const { return GetBack().GetTime(); } //!<!
75
76 inline Int_t GetFrontAddress() const { return TDetectorHit::GetAddress(); } //!<!
77 inline Int_t GetBackAddress() const { return GetBack().GetAddress(); } //!<!
78 inline Int_t GetPadAddress() const { return GetPad().GetAddress(); } //!<!
79
80 inline Double_t GetPadE() const { return GetPad().GetEnergy(); } //!<!
81 inline Double_t GetPadT() const { return GetPad().GetTime(); } //!<!
82
83 Float_t GetFrontCharge() const
84 {
86 } //!<! //Charge is now stored after integration.
87 Float_t GetBackCharge() const { return GetBack().GetCharge(); } //!<! //Charge is now stored after integration.
88 Float_t GetPadCharge() const { return GetPad().GetCharge(); } //!<! //Charge is now stored after integration.
89
90 inline Double_t GetEnergy(Option_t* = "") const override
91 {
92 if(GetPadAddress() != -1) {
94 }
96 }
97
98 Double_t GetThetaDeg(double Xoff = 0.0, double Yoff = 0.0, double Zoff = 0.0) const
99 {
100 return GetTheta(Xoff, Yoff, Zoff) * TMath::RadToDeg();
101 }; //!<!
102 Double_t GetTheta(double Xoff = 0.0, double Yoff = 0.0, double Zoff = 0.0) const; //!<!
103
104 void SetFront(const TFragment& frag); //!<!
105 void SetBack(const TFragment& frag); //!<!
106 void SetPad(const TFragment& frag); //!<!
107
108 TVector3 GetPosition(Double_t dist) const override; //!<!
109 TVector3 GetPosition() const override; //!<!
110
111private:
112 Double_t GetDefaultDistance() const { return 0.; };
113
114 /// \cond CLASSIMP
115 ClassDefOverride(TSharc2Hit, 6) // NOLINT(readability-else-after-return)
116 /// \endcond
117};
118/*! @} */
119#endif
virtual Float_t GetCharge() const
!
virtual UInt_t GetAddress() const
!
virtual double GetEnergy(Option_t *opt="") const
virtual Float_t GetCfd() const
!
virtual Int_t GetSegment() const
!
virtual Double_t GetTime(const ETimeFlag &correct_flag=ETimeFlag::kAll, Option_t *opt="") const
Returns a time value to the nearest nanosecond!
void Print(Option_t *="") const override
!
void SetPad(const TFragment &frag)
!
TVector3 GetPosition() const override
!
TDetectorHit fBackHit
Definition TSharc2Hit.h:45
Double_t GetPadT() const
!
Definition TSharc2Hit.h:81
TSharc2Hit(TSharc2Hit &&) noexcept=default
Double_t GetDeltaFrontT() const
!
Definition TSharc2Hit.h:72
UShort_t GetBackStrip() const
!
Definition TSharc2Hit.h:57
Double_t GetThetaDeg(double Xoff=0.0, double Yoff=0.0, double Zoff=0.0) const
Definition TSharc2Hit.h:98
Double_t GetTheta(double Xoff=0.0, double Yoff=0.0, double Zoff=0.0) const
!
Int_t GetBackAddress() const
!
Definition TSharc2Hit.h:77
UShort_t GetFrontStrip() const
!
Definition TSharc2Hit.h:56
Int_t GetFrontAddress() const
!
Definition TSharc2Hit.h:76
TDetectorHit GetPad() const
Definition TSharc2Hit.h:61
Double_t GetDeltaBackE() const
!
Definition TSharc2Hit.h:73
Double_t GetEnergy(Option_t *="") const override
Definition TSharc2Hit.h:90
Double_t GetDeltaFrontE() const
!
Definition TSharc2Hit.h:71
Double_t GetDeltaBackT() const
!
Definition TSharc2Hit.h:74
void SetFront(const TFragment &frag)
!
void SetBack(const TFragment &frag)
!
Double_t GetSomeTime() const
Definition TSharc2Hit.h:63
Double_t GetDeltaT() const
!
Definition TSharc2Hit.h:69
void Clear(Option_t *="") override
!
Float_t GetBackCharge() const
! //Charge is now stored after integration.
Definition TSharc2Hit.h:87
Double_t GetDeltaE() const
!
Definition TSharc2Hit.h:68
Double_t GetPadE() const
!
Definition TSharc2Hit.h:80
Float_t GetPadCharge() const
! //Charge is now stored after integration.
Definition TSharc2Hit.h:88
TDetectorHit GetBack() const
Definition TSharc2Hit.h:60
Int_t GetPadAddress() const
!
Definition TSharc2Hit.h:78
void Copy(TObject &) const override
!
Double_t GetDefaultDistance() const
Definition TSharc2Hit.h:112
Float_t GetFrontCharge() const
! //Charge is now stored after integration.
Definition TSharc2Hit.h:83
TDetectorHit fPadHit
Definition TSharc2Hit.h:46