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