GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TS3.h
Go to the documentation of this file.
1#ifndef TS3_H
2#define TS3_H
3
4/** \addtogroup Detectors
5 * @{
6 */
7
8#include <iostream>
9#include <TRandom2.h>
10
11#include "TDetector.h"
12#include "TS3Hit.h"
13#include "TChannel.h"
14#include "TMnemonic.h"
15
16class TS3 : public TDetector {
17public:
18 enum class ES3Bits {
19 kPixelsSet = BIT(0),
20 kBit1 = BIT(1),
21 kBit2 = BIT(2),
22 kBit3 = BIT(3),
23 kBit4 = BIT(4),
24 kBit5 = BIT(5),
25 kBit6 = BIT(6),
26 kBit7 = BIT(7)
27 };
28
29 enum class ES3GlobalBits {
30 kPreSector = BIT(0), ///< Preference sector energy when building pixels
31 kMultHit = BIT(1), ///< Attempt to reconstruct multi strip-hit events
32 kKeepShared = BIT(2), ///< When kMultHit, reconstruct rather than discard charge sharing
33 kGBit3 = BIT(3)
34 };
35
36 TS3();
37 TS3(const TS3&);
38 TS3(TS3&&) noexcept = default;
39 TS3& operator=(const TS3&);
40 TS3& operator=(TS3&&) noexcept = default;
41 ~TS3() override = default;
42
43#ifndef __CINT__
44 void AddFragment(const std::shared_ptr<const TFragment>&, TChannel*) override; //!<!
45#endif
46 void BuildHits() override {} ///< no need to build any hits, everything already done in AddFragment
47
48 Short_t GetRingMultiplicity() const { return fS3RingHits.size(); }
49 Short_t GetSectorMultiplicity() const { return fS3SectorHits.size(); }
50
52 void SetFrontBackEnergy(double de)
53 {
55 SetPixels(false);
56 } ///< Set fractional allowed energy difference
57 void SetFrontBackEOffset(double de)
58 {
60 SetPixels(false);
61 } ///< Set fractional allowed energy difference
62 void SetFrontBackTime(int time)
63 {
64 fFrontBackTime = time;
65 SetPixels(false);
66 } ///< Set absolute allow time difference
67 static Int_t GetFrontBackTime() { return fFrontBackTime; } //!<!
68 static double GetFrontBackEnergy() { return fFrontBackEnergy; } //!<!
69 static double GetFrontBackOffset() { return fFrontBackOffset; } //!<!
70
71 TS3Hit* GetS3Hit(const int& i) const { return static_cast<TS3Hit*>(GetHit(i)); }
72 TS3Hit* GetRingHit(const int& i);
73 TS3Hit* GetSectorHit(const int& i);
74 TS3Hit* GetPixelHit(const int& i);
75
76 static bool PreferenceSector(bool set = true)
77 {
79 return set;
80 } //!<!
82 static bool SetMultiHit(bool set = true)
83 {
85 return set;
86 } //!<!
87 static bool MultiHit() { return TestGlobalBit(ES3GlobalBits::kMultHit); } //!<!
88 static bool SetKeepShared(bool set = true)
89 {
91 return set;
92 } //!<!
93 static bool KeepShared() { return TestGlobalBit(ES3GlobalBits::kKeepShared); } //!<!
94
96 void SetPixels(bool flag = true) { SetBitNumber(ES3Bits::kPixelsSet, flag); }
97 void BuildPixels();
98
99 static TVector3 GetPosition(int ring, int sector, bool smear = false);
100 static TVector3 GetPosition(int ring, int sector, double offsetphi, double offsetZ, bool sectorsdownstream,
101 bool smear = false);
102
103 void SetTargetDistance(double dist) { fTargetDistance = dist; }
104
105 void ResetRingsSectors();
106
107 void ClearTransients() override
108 {
109 fS3Bits = 0;
110 for(const auto& hit : fS3PixelHits) {
111 hit.ClearTransients();
112 }
113 for(const auto& hit : fS3RingHits) {
114 hit.ClearTransients();
115 }
116 for(const auto& hit : fS3SectorHits) {
117 hit.ClearTransients();
118 }
119 }
120
121 void Copy(TObject&) const override;
122 void Clear(Option_t* opt = "all") override; //!<!
123 void Print(Option_t* opt = "") const override; //!<!
124 void Print(std::ostream& out) const override; //!<!
125
126private:
127 std::vector<TS3Hit> fS3RingHits; ///< vector to store hits of the ring side
128 std::vector<TS3Hit> fS3SectorHits; ///< vector to store hits of the sector side
129 std::vector<TS3Hit> fS3PixelHits; //!<! transient vector to hold the on-the-fly calculated pixel hits
130
131 TTransientBits<UChar_t> fS3Bits; ///< flags for transient members
132 void ClearStatus() { fS3Bits = 0; }
133 void SetBitNumber(ES3Bits bit, Bool_t set = true);
134 Bool_t TestBitNumber(ES3Bits bit) const { return (fS3Bits.TestBit(bit)); }
135
137 static void SetGlobalBit(ES3GlobalBits bit, Bool_t set = true) { fGlobalS3Bits.SetBit(bit, set); }
138 static Bool_t TestGlobalBit(ES3GlobalBits bit) { return (fGlobalS3Bits.TestBit(bit)); }
139
140 /// for geometery
141 static int fRingNumber; //!<!
142 static int fSectorNumber; //!<!
143
144 static double fOffsetPhiCon; //!<!
145 static double fOffsetPhiSet; //!<!
146
147 static double fOuterDiameter; //!<!
148 static double fInnerDiameter; //!<!
149 static double fTargetDistance; //!<!
150
151 //In cfd units for historic reasons
152 static Int_t fFrontBackTime; //!<!
153 static double fFrontBackEnergy; //!<!
154 static double fFrontBackOffset; //!<!
155
156 /// \cond CLASSIMP
157 ClassDefOverride(TS3, 4) // NOLINT(readability-else-after-return)
158 /// \endcond
159};
160/*! @} */
161#endif
virtual TDetectorHit * GetHit(const int &index) const
Definition TDetector.cxx:84
Definition TS3.h:16
void SetTargetDistance(double dist)
Definition TS3.h:103
static bool SectorPreference()
!
Definition TS3.h:81
static TTransientBits< UShort_t > fGlobalS3Bits
Global Bit.
Definition TS3.h:136
static int fRingNumber
for geometery
Definition TS3.h:141
Int_t GetPixelMultiplicity()
Definition TS3.cxx:86
std::vector< TS3Hit > fS3PixelHits
! transient vector to hold the on-the-fly calculated pixel hits
Definition TS3.h:129
Bool_t TestBitNumber(ES3Bits bit) const
Definition TS3.h:134
TS3Hit * GetS3Hit(const int &i) const
Definition TS3.h:71
std::vector< TS3Hit > fS3RingHits
vector to store hits of the ring side
Definition TS3.h:127
static bool PreferenceSector(bool set=true)
!
Definition TS3.h:76
void SetFrontBackEOffset(double de)
Set fractional allowed energy difference.
Definition TS3.h:57
static double fOffsetPhiSet
!
Definition TS3.h:145
void SetFrontBackEnergy(double de)
Set fractional allowed energy difference.
Definition TS3.h:52
void Clear(Option_t *opt="all") override
!
Definition TS3.cxx:417
Short_t GetRingMultiplicity() const
Definition TS3.h:48
TS3Hit * GetRingHit(const int &i)
Definition TS3.cxx:375
static Bool_t TestGlobalBit(ES3GlobalBits bit)
Definition TS3.h:138
static bool KeepShared()
!
Definition TS3.h:93
void ClearStatus()
Definition TS3.h:132
TS3(TS3 &&) noexcept=default
void ClearTransients() override
!
Definition TS3.h:107
void BuildPixels()
Definition TS3.cxx:96
bool PixelsSet() const
Definition TS3.h:95
ES3GlobalBits
Definition TS3.h:29
@ kPreSector
Preference sector energy when building pixels.
@ kKeepShared
When kMultHit, reconstruct rather than discard charge sharing.
@ kMultHit
Attempt to reconstruct multi strip-hit events.
std::vector< TS3Hit > fS3SectorHits
vector to store hits of the sector side
Definition TS3.h:128
static int fSectorNumber
!
Definition TS3.h:142
static TVector3 GetPosition(int ring, int sector, bool smear=false)
Definition TS3.cxx:327
TS3Hit * GetPixelHit(const int &i)
Definition TS3.cxx:395
static bool SetMultiHit(bool set=true)
!
Definition TS3.h:82
static bool MultiHit()
!
Definition TS3.h:87
static double fInnerDiameter
!
Definition TS3.h:148
void ResetRingsSectors()
Definition TS3.cxx:364
static double fOffsetPhiCon
!
Definition TS3.h:144
TS3()
Definition TS3.cxx:26
static double GetFrontBackOffset()
!
Definition TS3.h:69
void AddFragment(const std::shared_ptr< const TFragment > &, TChannel *) override
!
Definition TS3.cxx:50
void SetPixels(bool flag=true)
Definition TS3.h:96
static Int_t GetFrontBackTime()
!
Definition TS3.h:67
TTransientBits< UChar_t > fS3Bits
flags for transient members
Definition TS3.h:131
static bool SetKeepShared(bool set=true)
!
Definition TS3.h:88
static double fOuterDiameter
!
Definition TS3.h:147
static double fFrontBackEnergy
!
Definition TS3.h:153
static double fTargetDistance
!
Definition TS3.h:149
TS3Hit * GetSectorHit(const int &i)
Definition TS3.cxx:385
static double fFrontBackOffset
!
Definition TS3.h:154
Short_t GetSectorMultiplicity() const
Definition TS3.h:49
static double GetFrontBackEnergy()
!
Definition TS3.h:68
void SetBitNumber(ES3Bits bit, Bool_t set=true)
Definition TS3.cxx:80
static void SetGlobalBit(ES3GlobalBits bit, Bool_t set=true)
Definition TS3.h:137
ES3Bits
Definition TS3.h:18
void Copy(TObject &) const override
Definition TS3.cxx:42
void BuildHits() override
no need to build any hits, everything already done in AddFragment
Definition TS3.h:46
static Int_t fFrontBackTime
!
Definition TS3.h:152
void SetFrontBackTime(int time)
Set absolute allow time difference.
Definition TS3.h:62
void Print(Option_t *opt="") const override
!
Definition TS3.cxx:405
void SetBit(T bit, Bool_t flag)
Bool_t TestBit(T bit) const