GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TRcmp.h
Go to the documentation of this file.
1/// \author Dhruval Shah <dsi491@uregina.ca>, University of Regina
2
3#ifndef TRCMP_H
4#define TRCMP_H
5
6/** \addtogroup Detectors
7 * @{
8 */
9
10#include <vector>
11#include <iostream>
12#include <cstdlib>
13#include <map>
14#include <utility>
15#include <set>
16
17#include "TDetector.h"
18#include "TChannel.h"
19#include "TRcmpHit.h"
20#include "TMath.h"
21#include "TVector3.h"
22#include "Globals.h"
23#include "TFragment.h"
24#include "TGRSIMnemonic.h"
25
26////////////////////////////////////////////////////////////
27///
28/// \class TRcmp
29///
30/// The TRcmp class defines the observables and algorithms
31/// used when analyzing RCMP data.
32///
33////////////////////////////////////////////////////////////
34
35class TRcmp : public TDetector {
36public:
37 // these "bits" represent flags that will be used to clear the transient vectors
38 // UChar_t (character) has 8 bits, and it is the smallest data type we can have
39 // thus, the bits that are not used in the class will just be at their default value
40 enum class ERcmpBits {
41 kFrontSet = BIT(0), // flag for the front multiplicity transient vector
42 kBackSet = BIT(1), // flag for the back multiplicity transient vector
43 kPixelSet = BIT(2), // flag for the pixel multiplicity transient vector
44 kBit3 = BIT(3),
45 kBit4 = BIT(4),
46 kBit5 = BIT(5),
47 kBit6 = BIT(6),
48 kBit7 = BIT(7)
49 };
50
51 // constructors and destructors
52 TRcmp(); ///< default constructor
53 TRcmp(const TRcmp&); ///< copy constructor
54 TRcmp(TRcmp&&) noexcept = default;
55 TRcmp& operator=(const TRcmp&);
56 TRcmp& operator=(TRcmp&&) noexcept = default;
57 ~TRcmp() override; ///< destructor
58
59#ifndef __CINT__
60 void AddFragment(const std::shared_ptr<const TFragment>&, TChannel*) override; //!<! //adds front and back fragments to their respective fragment vectors
61#endif
62 void BuildHits() override {} ///< even though we are not using this function, we still need to override it to avoid warning during the sorting process
63
64 // functions to access the individual fragments
65 inline TFragment GetRcmpFrontFrag(const int& i) const { return fFrontPFragVector.at(i); } ///< returns the front fragment stored at the index
66 inline TFragment GetRcmpBackFrag(const int& i) const { return fBackNFragVector.at(i); } ///< returns the back fragment stored at the index
67
68 // functions to access the individual hits
69 inline TRcmpHit* GetRcmpFrontHit(const int& i) const { return fFrontPMulVector.at(i); } ///< returns a front strip hit in RCMP (this hit can be used to fill histograms when looping over front multiplicity)
70 inline TRcmpHit* GetRcmpBackHit(const int& i) const { return fBackNMulVector.at(i); } ///< returns a back strip hit in RCMP (this hit can be used to fill histograms when looping over back multiplicity)
71 inline TRcmpHit* GetRcmpHit(const int& i) const { return fPixelMulVector.at(i); } ///< returns a pixel hit in RCMP (this hit can be used to fill histograms when looping over pixel multiplicity)
72
73 void Copy(TObject&) const override; //!<!
74 void Clear(Option_t* opt = "all") override; //!<!
75 void Print(Option_t* opt = "") const override; //!<!
76 void Print(std::ostream& out) const override; //!<!
77
78 // multiplicity functions
79 size_t GetFrontFragmentMultiplicity() const { return fFrontPFragVector.size(); } ///< returns the size of the vector that contains all the front fragments (within a build window)
80 size_t GetBackFragmentMultiplicity() const { return fBackNFragVector.size(); } ///< returns the size of the vector that contains all the back fragments (within a build window)
81 Short_t GetFrontMultiplicity(); ///< returns the size of the vector that contains all the front hits (within a build window)
82 Short_t GetBackMultiplicity(); ///< returns the size of the vector that contains all the back hits (within a build window)
83 Short_t GetPixelMultiplicity(); ///< returns the size of the vector that contains all the pixel hits (within a build window)
84
85 inline Int_t GetZeroMultiplicity() const { return fZeroMultiplicity; } ///< returns the zero multiplicty counter
86
87 // note that the coincidence time condition is not implemented in the pixel multiplicity function as of now
88 // it can be set in the GRSIFrame helper if needed
89 inline Int_t GetCoincidenceTime() const { return fCoincidenceTime; } ///< returns the coincidence time between front and back strip of a detector in nanoseconds
90 inline void SetCoincidenceTime(const int coincTime) { fCoincidenceTime = coincTime; } ///< sets the coincidence time between front and back strip of a detector in nanoseconds
91
92private:
93 // vectors that contain front and back fragments
94 // note: P-junction (front) and N-ohmic (back)
95 std::vector<TFragment> fFrontPFragVector; ///< stores all front strip fragments
96 std::vector<TFragment> fBackNFragVector; ///< stores all back strip fragments
97
98 // vectors that contain front, back, and pixel hits
99 std::vector<TRcmpHit*> fFrontPMulVector; //!<! transient vector that stores hits for the front strips (i.e., front multiplicity)
100 std::vector<TRcmpHit*> fBackNMulVector; //!<! transient vector that stores hits for the back strips (i.e., back multiplicity)
101 std::vector<TRcmpHit*> fPixelMulVector; //!<! transient vector that stores hits for front+back (i.e., pixel multiplicity)
102
103 TTransientBits<UChar_t> fRcmpBits; ///< flags for transient members
104 void ClearStatus() { fRcmpBits = 0; }
105 void SetBitNumber(ERcmpBits bit, Bool_t set = true); ///< second argument shows that set is true by default
106 Bool_t TestBitNumber(ERcmpBits bit) const { return (fRcmpBits.TestBit(bit)); } ///< returns true if the bit is set
107
108 Int_t fZeroMultiplicity = 0; ///< keep track of zero multiplicty with this counter (it is incremented every time the Pixel Multiplicity loops are entered, but the hits are not built)
109
110 // this would be the default coincidence time unless changed using the SetCoincidenceTime function
111 Int_t fCoincidenceTime = 50; ///< GetTime for TDetectorHit is in nanoseconds, so this is in nanoseconds, too!
112
113 /// \cond CLASSIMP
114 ClassDefOverride(TRcmp, 2) // NOLINT
115 /// \endcond
116};
117
118/*! @} */
119#endif
Definition TRcmp.h:35
Int_t fCoincidenceTime
GetTime for TDetectorHit is in nanoseconds, so this is in nanoseconds, too!
Definition TRcmp.h:111
TFragment GetRcmpFrontFrag(const int &i) const
returns the front fragment stored at the index
Definition TRcmp.h:65
void BuildHits() override
even though we are not using this function, we still need to override it to avoid warning during the ...
Definition TRcmp.h:62
TRcmpHit * GetRcmpBackHit(const int &i) const
returns a back strip hit in RCMP (this hit can be used to fill histograms when looping over back mult...
Definition TRcmp.h:70
void SetCoincidenceTime(const int coincTime)
sets the coincidence time between front and back strip of a detector in nanoseconds
Definition TRcmp.h:90
void SetBitNumber(ERcmpBits bit, Bool_t set=true)
second argument shows that set is true by default
Definition TRcmp.cxx:233
size_t GetFrontFragmentMultiplicity() const
returns the size of the vector that contains all the front fragments (within a build window)
Definition TRcmp.h:79
Short_t GetFrontMultiplicity()
returns the size of the vector that contains all the front hits (within a build window)
Definition TRcmp.cxx:129
TRcmp(TRcmp &&) noexcept=default
void AddFragment(const std::shared_ptr< const TFragment > &, TChannel *) override
! //adds front and back fragments to their respective fragment vectors
Definition TRcmp.cxx:105
std::vector< TFragment > fBackNFragVector
stores all back strip fragments
Definition TRcmp.h:96
void Clear(Option_t *opt="all") override
!
Definition TRcmp.cxx:80
std::vector< TRcmpHit * > fBackNMulVector
! transient vector that stores hits for the back strips (i.e., back multiplicity)
Definition TRcmp.h:100
Short_t GetPixelMultiplicity()
returns the size of the vector that contains all the pixel hits (within a build window)
Definition TRcmp.cxx:183
ERcmpBits
Definition TRcmp.h:40
std::vector< TRcmpHit * > fPixelMulVector
! transient vector that stores hits for front+back (i.e., pixel multiplicity)
Definition TRcmp.h:101
TFragment GetRcmpBackFrag(const int &i) const
returns the back fragment stored at the index
Definition TRcmp.h:66
TRcmpHit * GetRcmpHit(const int &i) const
returns a pixel hit in RCMP (this hit can be used to fill histograms when looping over pixel multipli...
Definition TRcmp.h:71
void Copy(TObject &) const override
!
Definition TRcmp.cxx:49
void ClearStatus()
Definition TRcmp.h:104
TRcmpHit * GetRcmpFrontHit(const int &i) const
returns a front strip hit in RCMP (this hit can be used to fill histograms when looping over front mu...
Definition TRcmp.h:69
Int_t GetCoincidenceTime() const
returns the coincidence time between front and back strip of a detector in nanoseconds
Definition TRcmp.h:89
Int_t GetZeroMultiplicity() const
returns the zero multiplicty counter
Definition TRcmp.h:85
std::vector< TRcmpHit * > fFrontPMulVector
! transient vector that stores hits for the front strips (i.e., front multiplicity)
Definition TRcmp.h:99
Bool_t TestBitNumber(ERcmpBits bit) const
returns true if the bit is set
Definition TRcmp.h:106
Short_t GetBackMultiplicity()
returns the size of the vector that contains all the back hits (within a build window)
Definition TRcmp.cxx:156
TRcmp()
default constructor
Definition TRcmp.cxx:15
Int_t fZeroMultiplicity
keep track of zero multiplicty with this counter (it is incremented every time the Pixel Multiplicity...
Definition TRcmp.h:108
TTransientBits< UChar_t > fRcmpBits
flags for transient members
Definition TRcmp.h:103
size_t GetBackFragmentMultiplicity() const
returns the size of the vector that contains all the back fragments (within a build window)
Definition TRcmp.h:80
std::vector< TFragment > fFrontPFragVector
stores all front strip fragments
Definition TRcmp.h:95
void Print(Option_t *opt="") const override
!
Definition TRcmp.cxx:218
Bool_t TestBit(T bit) const