GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TSharc.h
Go to the documentation of this file.
1#ifndef TSHARC_H
2#define TSHARC_H
3
4/** \addtogroup Detectors
5 * @{
6 */
7
8#include <vector>
9#include <cstdio>
10#include <map>
11#include <set>
12
13#include "TMath.h"
14#include "TVector3.h"
15
16#include "Globals.h"
17#include "TDetector.h"
18#include "TSharcHit.h"
19
20class TSharc : public TDetector {
21public:
22 TSharc();
23 TSharc(const TSharc& rhs);
24 TSharc(TSharc&&) noexcept = default;
25 TSharc& operator=(const TSharc& rhs)
26 {
27 if(this != &rhs) {
28 rhs.Copy(*this);
29 }
30 return *this;
31 } //!<!
32 TSharc& operator=(TSharc&&) noexcept = default;
33 ~TSharc() override = default;
34
35 TSharcHit* GetSharcHit(const int& i) const { return static_cast<TSharcHit*>(GetHit(i)); }
36 static TVector3 GetPosition(int detector, int frontstrip, int backstrip, double X = 0.00, double Y = 0.00,
37 double Z = 0.00); //!<!
38 static double GetXOffset() { return fXoffset; }
39 static double GetYOffset() { return fYoffset; }
40 static double GetZOffset() { return fZoffset; }
41 static TVector3 GetOffset() { return {fXoffset, fYoffset, fZoffset}; }
42 static void SetXYZOffset(const double x, const double y, const double z)
43 {
44 fXoffset = x;
45 fYoffset = y;
46 fZoffset = z;
47 }
48
49 int GetSize() const { return GetMultiplicity(); } //!<!
50
51 void Copy(TObject&) const override; //!<!
52 void Clear(Option_t* = "") override; //!<!
53 void Print(Option_t* = "") const override; //!<!
54 void Print(std::ostream& out) const override; //!<!
55
56#ifndef __CINT__
57 void AddFragment(const std::shared_ptr<const TFragment>&, TChannel*) override; //!<!
58#endif
59 void BuildHits() override;
60
61private:
62 int CombineHits(TSharcHit*, TSharcHit*, int, int); //!<!
63 void RemoveHits(std::vector<TSharcHit>*, std::set<int>*); //!<!
64
65 // TODO: I think this class could be sped up with a flag method on these transient vectors.
66 // Not sure what is supposed to get sped up here, the transient vectors are only used
67 // to store fragments in them before the hits are build.
68 // After that these vectors aren't used again.
69 std::vector<TFragment> fFrontFragments; //!
70 std::vector<TFragment> fBackFragments; //!
71 std::vector<TFragment> fPadFragments; //!
72
73public:
74 static double GetDetectorThickness(TSharcHit& hit, double dist = -1.0); //!
75 static double GetDeadLayerThickness(TSharcHit& hit); //!
76 static double GetPadThickness(TSharcHit& hit); //!
77 static double GetPadDeadLayerThickness(TSharcHit& hit); //!
78
79private:
80 static double fXoffset; //!<!
81 static double fYoffset; //!<!
82 static double fZoffset; //!<!
83
84 // various sharc dimensions set in mm, taken from IOP SHARC white paper
85 static double fXdim; //! total X dimension of all boxes
86 static double fYdim; //! total Y dimension of all boxes
87 static double fZdim; //! total Z dimension of all boxes
88 static double fRdim; //! Rmax-Rmin for all QQQs
89 static double fPdim; //! QQQ quadrant angular range (degrees)
90 // BOX dimensions
91 static double fXposUB; //!
92 static double fYminUB; //!
93 static double fZminUB; //!
94 static double fXposDB; //!
95 static double fYminDB; //!
96 static double fZminDB; //!
97 // QQQ dimensions
98 static double fZposUQ; //!
99 static double fRmaxUQ; //!
100 static double fRminUQ; //!
101 static double fPminUQ; //! degrees
102 static double fZposDQ; //!
103 static double fRmaxDQ; //!
104 static double fRminDQ; //!
105 static double fPminDQ; //! degrees
106 // segmentation
107 // static const int frontstripslist[16] ;
108 // static const int backstripslist[16] ;
109 // pitches
110 static double fStripFPitch; //!
111 static double fStripBPitch; //!
112 static double fRingPitch; //!
113 static double fSegmentPitch; //! angular pitch, degrees
114
115 /// \cond CLASSIMP
116 ClassDefOverride(TSharc, 7) // NOLINT(readability-else-after-return)
117 /// \endcond
118};
119/*! @} */
120#endif
virtual Short_t GetMultiplicity() const
Definition TDetector.h:73
virtual TDetectorHit * GetHit(const int &index) const
Definition TDetector.cxx:61
TSharc(TSharc &&) noexcept=default
void RemoveHits(std::vector< TSharcHit > *, std::set< int > *)
!
Definition TSharc.cxx:146
static double GetDeadLayerThickness(TSharcHit &hit)
Definition TSharc.cxx:253
void Clear(Option_t *="") override
!
Definition TSharc.cxx:156
int GetSize() const
!
Definition TSharc.h:49
static double fPdim
Rmax-Rmin for all QQQs.
Definition TSharc.h:89
static double GetYOffset()
Definition TSharc.h:39
static double fRingPitch
Definition TSharc.h:112
TSharcHit * GetSharcHit(const int &i) const
Definition TSharc.h:35
static double fStripBPitch
Definition TSharc.h:111
static double fPminDQ
Definition TSharc.h:105
TSharc()
Definition TSharc.cxx:74
static double GetZOffset()
Definition TSharc.h:40
static TVector3 GetOffset()
Definition TSharc.h:41
static double GetXOffset()
Definition TSharc.h:38
static double fYdim
total X dimension of all boxes
Definition TSharc.h:86
static double fZminDB
Definition TSharc.h:96
static double fRminDQ
Definition TSharc.h:104
std::vector< TFragment > fPadFragments
Definition TSharc.h:71
static double fYminUB
Definition TSharc.h:92
static double fZminUB
Definition TSharc.h:93
static double fPminUQ
Definition TSharc.h:101
static double GetDetectorThickness(TSharcHit &hit, double dist=-1.0)
Definition TSharc.cxx:233
static void SetXYZOffset(const double x, const double y, const double z)
Definition TSharc.h:42
static double fZposDQ
degrees
Definition TSharc.h:102
static double fXposDB
Definition TSharc.h:94
static double fRdim
total Z dimension of all boxes
Definition TSharc.h:88
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
static double fZdim
total Y dimension of all boxes
Definition TSharc.h:87
static double fZoffset
!
Definition TSharc.h:82
void Copy(TObject &) const override
!
Definition TSharc.cxx:183
static double GetPadThickness(TSharcHit &hit)
Definition TSharc.cxx:260
static double fZposUQ
Definition TSharc.h:98
static double fRmaxUQ
Definition TSharc.h:99
static double fRmaxDQ
Definition TSharc.h:103
static double fYminDB
Definition TSharc.h:95
static double fXdim
Definition TSharc.h:85
std::vector< TFragment > fFrontFragments
Definition TSharc.h:69
static double GetPadDeadLayerThickness(TSharcHit &hit)
Definition TSharc.cxx:267
static double fRminUQ
Definition TSharc.h:100
void AddFragment(const std::shared_ptr< const TFragment > &, TChannel *) override
!
Definition TSharc.cxx:86
void BuildHits() override
!
Definition TSharc.cxx:107
int CombineHits(TSharcHit *, TSharcHit *, int, int)
!
std::vector< TFragment > fBackFragments
Definition TSharc.h:70
TSharc & operator=(TSharc &&) noexcept=default
static double fSegmentPitch
Definition TSharc.h:113
static double fYoffset
!
Definition TSharc.h:81
static double fXoffset
!
Definition TSharc.h:80
void Print(Option_t *="") const override
!
Definition TSharc.cxx:171
static double fXposUB
QQQ quadrant angular range (degrees)
Definition TSharc.h:91
static double fStripFPitch
degrees
Definition TSharc.h:110