GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TLaBr.h
Go to the documentation of this file.
1#ifndef TLABR_H
2#define TLABR_H
3
4/** \addtogroup Detectors
5 * @{
6 */
7
8/////////////////////////////////////////////////////////////
9///
10/// \class TLaBr
11///
12/// The TLaBr class defines the observables and algorithms used
13/// when analyzing LaBr data. It includes detector positions,
14/// etc.
15///
16/////////////////////////////////////////////////////////////
18#include <vector>
19#include <cstdio>
20
21#include "TVector3.h"
22
23#include "Globals.h"
24#include "TSuppressed.h"
25#include "TTransientBits.h"
26#include "TLaBrHit.h"
27
28class TLaBr : public TSuppressed {
29public:
30 enum class ELaBrBits {
31 kIsSuppressed = 1 << 0,
32 kBit1 = 1 << 1,
33 kBit2 = 1 << 2,
34 kBit3 = 1 << 3,
35 kBit4 = 1 << 4,
36 kBit5 = 1 << 5,
37 kBit6 = 1 << 6,
38 kBit7 = 1 << 7
39 };
40
41 TLaBr();
42 TLaBr(const TLaBr& rhs);
43 TLaBr(TLaBr&&) noexcept = default;
44 TLaBr& operator=(const TLaBr&); //!<!
45 TLaBr& operator=(TLaBr&&) noexcept = default;
46 ~TLaBr() override;
47
48 void Copy(TObject& rhs) const override;
49 TLaBrHit* GetLaBrHit(const int& i) const { return static_cast<TLaBrHit*>(GetHit(i)); }
50
51#if !defined(__CINT__) && !defined(__CLING__)
52 void SetSuppressionCriterion(std::function<bool(const TDetectorHit*, const TDetectorHit*)> criterion)
53 {
54 fSuppressionCriterion = std::move(criterion);
55 }
56 std::function<bool(const TDetectorHit*, const TDetectorHit*)> GetSuppressionCriterion() const { return fSuppressionCriterion; }
57
58 bool SuppressionCriterion(const TDetectorHit* hit, const TDetectorHit* bgoHit) override { return fSuppressionCriterion(hit, bgoHit); }
59#endif
60
61 TLaBrHit* GetSuppressedHit(const int& i); //!<!
62 Short_t GetSuppressedMultiplicity(const TBgo* fBgo);
63 bool IsSuppressed() const;
64 void SetSuppressed(bool flag);
65 void ResetSuppressed();
66
67#if !defined(__CINT__) && !defined(__CLING__)
68 void AddFragment(const std::shared_ptr<const TFragment>&, TChannel*) override; //!<!
69#endif
70 void BuildHits() override {} // no need to build any hits, everything already done in AddFragment
71
72 static TVector3 GetPosition(int DetNbr) { return fPosition[DetNbr]; } //!<!
73
74private:
75#if !defined(__CINT__) && !defined(__CLING__)
76 static std::function<bool(const TDetectorHit*, const TDetectorHit*)> fSuppressionCriterion;
77#endif
78 std::vector<TDetectorHit*> fSuppressedHits; // The set of suppressed LaBr hits
79
80 static std::array<TVector3, 9> fPosition; //!<! Position of each detectir
81
82 mutable TTransientBits<UChar_t> fLaBrBits; // Transient member flags
83
84 void ClearStatus() const { fLaBrBits = 0; } //!<!
85 void SetBitNumber(const ELaBrBits bit, const bool set) const { fLaBrBits.SetBit(bit, set); }
86 Bool_t TestBitNumber(const ELaBrBits bit) const { return fLaBrBits.TestBit(bit); }
87
88public:
89 void Clear(Option_t* opt = "") override; //!<!
90 void Print(Option_t* opt = "") const override; //!<!
91 void Print(std::ostream& out) const override; //!<!
92
93 /// \cond CLASSIMP
94 ClassDefOverride(TLaBr, 1) // LaBr Physics structure // NOLINT(readability-else-after-return)
95 /// \endcond
96};
97/*! @} */
98#endif
Definition TBgo.h:22
virtual TDetectorHit * GetHit(const int &index) const
Definition TDetector.cxx:61
Definition TLaBr.h:28
void Print(Option_t *opt="") const override
!
Definition TLaBr.cxx:79
static TVector3 GetPosition(int DetNbr)
!
Definition TLaBr.h:72
void SetSuppressionCriterion(std::function< bool(const TDetectorHit *, const TDetectorHit *)> criterion)
Definition TLaBr.h:52
TTransientBits< UChar_t > fLaBrBits
Definition TLaBr.h:82
TLaBr()
Definition TLaBr.cxx:30
TLaBr(TLaBr &&) noexcept=default
void SetBitNumber(const ELaBrBits bit, const bool set) const
Definition TLaBr.h:85
Short_t GetSuppressedMultiplicity(const TBgo *fBgo)
Definition TLaBr.cxx:111
Bool_t TestBitNumber(const ELaBrBits bit) const
Definition TLaBr.h:86
static std::array< TVector3, 9 > fPosition
! Position of each detectir
Definition TLaBr.h:17
void Copy(TObject &rhs) const override
Definition TLaBr.cxx:61
bool SuppressionCriterion(const TDetectorHit *hit, const TDetectorHit *bgoHit) override
Definition TLaBr.h:58
bool IsSuppressed() const
Definition TLaBr.cxx:92
void SetSuppressed(bool flag)
Definition TLaBr.cxx:97
void Clear(Option_t *opt="") override
!
Definition TLaBr.cxx:50
void ClearStatus() const
!
Definition TLaBr.h:84
ELaBrBits
Definition TLaBr.h:30
TLaBrHit * GetSuppressedHit(const int &i)
!
Definition TLaBr.cxx:132
std::vector< TDetectorHit * > fSuppressedHits
Definition TLaBr.h:78
std::function< bool(const TDetectorHit *, const TDetectorHit *)> GetSuppressionCriterion() const
Definition TLaBr.h:56
TLaBrHit * GetLaBrHit(const int &i) const
Definition TLaBr.h:49
void AddFragment(const std::shared_ptr< const TFragment > &, TChannel *) override
!
Definition TLaBr.cxx:143
void BuildHits() override
!
Definition TLaBr.h:70
static std::function< bool(const TDetectorHit *, const TDetectorHit *)> fSuppressionCriterion
Definition TLaBr.h:76
void ResetSuppressed()
Definition TLaBr.cxx:102
void SetBit(T bit, Bool_t flag)
Bool_t TestBit(T bit) const