GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TSharc2.h
Go to the documentation of this file.
1#ifndef TSHARC2_H
2#define TSHARC2_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 "TSharc2Hit.h"
19
20class TSharc2 : public TDetector {
21public:
22 TSharc2();
23 TSharc2(const TSharc2& rhs);
24 TSharc2(TSharc2&&) noexcept = default;
25 TSharc2& operator=(TSharc2&&) noexcept = default;
26 TSharc2& operator=(const TSharc2& rhs)
27 {
28 if(this != &rhs) {
29 rhs.Copy(*this);
30 }
31 return *this;
32 } //!<!
33 ~TSharc2() override = default;
34
35 TSharc2Hit* GetSharc2Hit(const int& i) const { return static_cast<TSharc2Hit*>(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 Hits().size(); } //!<!
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(TSharc2Hit*, TSharc2Hit*, int, int); //!<!
63 void RemoveHits(std::vector<TSharc2Hit>*, 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
72public:
73 static double GetDetectorThickness(TSharc2Hit& hit, double dist = -1.0); //!
74 static double GetDeadLayerThickness(TSharc2Hit& hit); //!
75
76private:
77 static double fXoffset; //!<!
78 static double fYoffset; //!<!
79 static double fZoffset; //!<!
80
81 // various sharc dimensions set in mm
82 // BOX dimensions
83 static double fXdim; //! total X dimension of all boxes
84 static double fYdim; //! total Y dimension of all boxes
85 static double fZdim; //! total Z dimension of all boxes
86 static double fXposUB; //!
87 static double fYminUB; //!
88 static double fZminUB; //!
89
90 //downstream cS2
91 static double fZposDS2; //!
92 static double fXminDS2; //!
93 static double fStripPitchDS2; //!
94 static double fSectorWidthDS2; //!
95
96 //upstream cS2
97 static double fZposUS2; //!
98 static double fXminUS2; //!
99 static double fStripPitchUS2; //!
100 static double fSectorWidthUS2; //!
101
102 // segmentation
103 // static const int frontstripslist[16] ;
104 // static const int backstripslist[16] ;
105 // pitches
106 static double fStripFPitch; //!
107 static double fStripBPitch; //!
108 static double fRingPitch; //!
109 static double fSegmentPitch; //! angular pitch, degrees
110
111 /// \cond CLASSIMP
112 ClassDefOverride(TSharc2, 7) // NOLINT(readability-else-after-return)
113 /// \endcond
114};
115/*! @} */
116#endif
virtual TDetectorHit * GetHit(const int &index) const
Definition TDetector.cxx:61
std::vector< TDetectorHit * > & Hits()
Definition TDetector.h:78
void RemoveHits(std::vector< TSharc2Hit > *, std::set< int > *)
!
Definition TSharc2.cxx:118
std::vector< TFragment > fBackFragments
Definition TSharc2.h:70
static double fXdim
Definition TSharc2.h:83
static double fXposUB
total Z dimension of all boxes
Definition TSharc2.h:86
int GetSize() const
!
Definition TSharc2.h:49
~TSharc2() override=default
void Print(Option_t *="") const override
!
Definition TSharc2.cxx:142
TSharc2(TSharc2 &&) noexcept=default
static double GetXOffset()
Definition TSharc2.h:38
int CombineHits(TSharc2Hit *, TSharc2Hit *, int, int)
!
static double fStripFPitch
Definition TSharc2.h:106
static double fSectorWidthDS2
Definition TSharc2.h:94
static double GetZOffset()
Definition TSharc2.h:40
static double fStripBPitch
Definition TSharc2.h:107
TSharc2()
Definition TSharc2.cxx:59
static double fZdim
total Y dimension of all boxes
Definition TSharc2.h:85
void BuildHits() override
!
Definition TSharc2.cxx:89
static double fYoffset
!
Definition TSharc2.h:78
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 fRingPitch
Definition TSharc2.h:108
void Copy(TObject &) const override
!
Definition TSharc2.cxx:154
static double fXoffset
!
Definition TSharc2.h:77
void AddFragment(const std::shared_ptr< const TFragment > &, TChannel *) override
!
Definition TSharc2.cxx:71
static double fXminUS2
Definition TSharc2.h:98
static TVector3 GetOffset()
Definition TSharc2.h:41
static double fZminUB
Definition TSharc2.h:88
TSharc2Hit * GetSharc2Hit(const int &i) const
Definition TSharc2.h:35
static double fZposDS2
Definition TSharc2.h:91
static double GetYOffset()
Definition TSharc2.h:39
static double GetDetectorThickness(TSharc2Hit &hit, double dist=-1.0)
Definition TSharc2.cxx:205
static double fZposUS2
Definition TSharc2.h:97
static double fStripPitchUS2
Definition TSharc2.h:99
static void SetXYZOffset(const double x, const double y, const double z)
Definition TSharc2.h:42
static double fZoffset
!
Definition TSharc2.h:79
static double fStripPitchDS2
Definition TSharc2.h:93
void Clear(Option_t *="") override
!
Definition TSharc2.cxx:128
static double fYminUB
Definition TSharc2.h:87
static double fYdim
total X dimension of all boxes
Definition TSharc2.h:84
static double GetDeadLayerThickness(TSharc2Hit &hit)
Definition TSharc2.cxx:224
static double fSegmentPitch
Definition TSharc2.h:109
static double fSectorWidthUS2
Definition TSharc2.h:100
static double fXminDS2
Definition TSharc2.h:92
std::vector< TFragment > fFrontFragments
Definition TSharc2.h:69