GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TSharcHit.h
Go to the documentation of this file.
1#ifndef TSHARCHIT_H
2#define TSHARCHIT_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 TSharcHit, the leaner method.
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 TSharcHit : public TDetectorHit {
36public:
37 TSharcHit();
38 TSharcHit(const TSharcHit&);
39 TSharcHit(TSharcHit&&) noexcept = default;
40 TSharcHit& operator=(const TSharcHit&) = default;
41 TSharcHit& operator=(TSharcHit&&) noexcept = default;
42 ~TSharcHit() override = default;
43
44private:
45 // UShort_t fDetectorNumber; //
46 // UShort_t fFrontStrip; //
47 // UShort_t fBackStrip; //
48
51
52public:
53 void Copy(TObject&) const override; //!<!
54 void Copy(TObject&, bool) const override; //!<!
55 void Clear(Option_t* = "") override; //!<!
56 void Print(Option_t* = "") const override; //!<!
57 void Print(std::ostream& out) const override; //!<!
58
59 // inline UShort_t GetDetector() const { return TDetectorHit::GetDetector(); } //!<!
60 UShort_t GetFrontStrip() const { return GetSegment(); } //!<!
61 UShort_t GetBackStrip() const { return GetBack().GetSegment(); } //!<!
62
63 // TDetectorHit* GetFront() const { return this; }
64 TDetectorHit GetBack() const { return fBackHit; }
65 TDetectorHit GetPad() const { return fPadHit; }
66
67 Double_t GetSomeTime() const
68 {
69 return GetCfd() - GetBack().GetCfd() + ((GetBackStrip() % 24) * 157.6) - (GetFrontStrip() * 157.6);
70 }
71
72 inline Double_t GetDeltaE() const { return TDetectorHit::GetEnergy(); } //!<!
73 inline Double_t GetDeltaT() const { return TDetectorHit::GetTime(); } //!<!
74
75 inline Double_t GetDeltaFrontE() const { return TDetectorHit::GetEnergy(); } //!<!
76 inline Double_t GetDeltaFrontT() const { return TDetectorHit::GetTime(); } //!<!
77 inline Double_t GetDeltaBackE() const { return GetBack().GetEnergy(); } //!<!
78 inline Double_t GetDeltaBackT() const { return GetBack().GetTime(); } //!<!
79
80 inline Int_t GetFrontAddress() const { return TDetectorHit::GetAddress(); } //!<!
81 inline Int_t GetBackAddress() const { return GetBack().GetAddress(); } //!<!
82 inline Int_t GetPadAddress() const { return GetPad().GetAddress(); } //!<!
83
84 inline Double_t GetPadE() const { return GetPad().GetEnergy(); } //!<!
85 inline Double_t GetPadT() const { return GetPad().GetTime(); } //!<!
86
87 // std::pair<int,int> GetPixel() { return std::make_pair(fFrontStrip,fBackStrip); } //!<!
88
89 Float_t GetFrontCharge() const
90 {
92 } //!<! //Charge is now stored after integration.
93 Float_t GetBackCharge() const { return GetBack().GetCharge(); } //!<! //Charge is now stored after integration.
94 Float_t GetPadCharge() const { return GetPad().GetCharge(); } //!<! //Charge is now stored after integration.
95
96 inline Double_t GetEnergy(Option_t* = "") const override
97 {
98 if(GetPadAddress() != -1) {
100 }
102 }
103
104 Double_t GetThetaDeg(double Xoff = 0.0, double Yoff = 0.0, double Zoff = 0.0) const
105 {
106 return GetTheta(Xoff, Yoff, Zoff) * TMath::RadToDeg();
107 }; //!<!
108 Double_t GetTheta(double Xoff = 0.0, double Yoff = 0.0, double Zoff = 0.0) const; //!<!
109
110 ///////////////////////////////////////////////////////////////////////
111 ///////////////////////////////////////////////////////////////////////
112 ///////////////////////////////////////////////////////////////////////
113 // void SetDetectorNumber(const UShort_t& det) { fDetectorNumber = det; } //!<!
114 // void SetFrontStrip(const UShort_t& strip) { fFrontStrip = strip; } //!<!
115 // void SetBackStrip(const UShort_t& strip) { fBackStrip = strip; } //!<!
116
117 void SetFront(const TFragment& frag); //!<!
118 void SetBack(const TFragment& frag); //!<!
119 void SetPad(const TFragment& frag); //!<!
120
121 TVector3 GetPosition(Double_t dist) const override; //!<!
122 TVector3 GetPosition() const override; //!<!
123
124private:
125 Double_t GetDefaultDistance() const { return 0.; };
126
127 /// \cond CLASSIMP
128 ClassDefOverride(TSharcHit, 6) // NOLINT(readability-else-after-return)
129 /// \endcond
130};
131/*! @} */
132#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!
TDetectorHit GetPad() const
Definition TSharcHit.h:65
Double_t GetPadE() const
!
Definition TSharcHit.h:84
Double_t GetDeltaFrontE() const
!
Definition TSharcHit.h:75
Double_t GetDeltaBackE() const
!
Definition TSharcHit.h:77
Double_t GetSomeTime() const
Definition TSharcHit.h:67
TDetectorHit fBackHit
Definition TSharcHit.h:49
void SetBack(const TFragment &frag)
!
Definition TSharcHit.cxx:84
Float_t GetBackCharge() const
! //Charge is now stored after integration.
Definition TSharcHit.h:93
TDetectorHit fPadHit
Definition TSharcHit.h:50
Double_t GetThetaDeg(double Xoff=0.0, double Yoff=0.0, double Zoff=0.0) const
Definition TSharcHit.h:104
void Print(Option_t *="") const override
!
Definition TSharcHit.cxx:41
Int_t GetBackAddress() const
!
Definition TSharcHit.h:81
void Copy(TObject &) const override
!
Definition TSharcHit.cxx:19
Int_t GetFrontAddress() const
!
Definition TSharcHit.h:80
Double_t GetDeltaFrontT() const
!
Definition TSharcHit.h:76
Double_t GetDeltaE() const
!
Definition TSharcHit.h:72
Double_t GetEnergy(Option_t *="") const override
Definition TSharcHit.h:96
void SetFront(const TFragment &frag)
!
Definition TSharcHit.cxx:79
TVector3 GetPosition() const override
!
Definition TSharcHit.cxx:67
TDetectorHit GetBack() const
Definition TSharcHit.h:64
Double_t GetDeltaT() const
!
Definition TSharcHit.h:73
Double_t GetDeltaBackT() const
!
Definition TSharcHit.h:78
Int_t GetPadAddress() const
!
Definition TSharcHit.h:82
void Clear(Option_t *="") override
!
Definition TSharcHit.cxx:34
Float_t GetFrontCharge() const
! //Charge is now stored after integration.
Definition TSharcHit.h:89
UShort_t GetFrontStrip() const
!
Definition TSharcHit.h:60
Double_t GetPadT() const
!
Definition TSharcHit.h:85
void SetPad(const TFragment &frag)
!
Definition TSharcHit.cxx:89
UShort_t GetBackStrip() const
!
Definition TSharcHit.h:61
TSharcHit(TSharcHit &&) noexcept=default
Float_t GetPadCharge() const
! //Charge is now stored after integration.
Definition TSharcHit.h:94
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