GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TDemand.cxx
Go to the documentation of this file.
1#include "TDemand.h"
2#include "TMnemonic.h"
3
4#include <cstdio>
5#include <iostream>
6#include <cmath>
7
8#include "TClass.h"
9#include "TMath.h"
10
11/// \cond CLASSIMP
12//ClassImp(TDemand)
13/// \endcond
14
15//==========================================================================//
16//==========================================================================//
17//==========================================================================//
18//==========================================================================//
19//==========================================================================//
20
21//approximate (x,y,z) of the TDemand OGS detectors. Using TIGRESS coordinate system.
22const std::array<double, 6> TDemand::fXPositions = {55.5, 43.5, -43.5, -55.5, -43.5, 43.5};
23const std::array<double, 6> TDemand::fYPositions = {0, 45.5, 45.5, 0, -45.5, -45.5};
24const std::array<double, 6> TDemand::fZPositions = {93.9, 93.9, 93.9, 93.9, 93.9, 93.9};
25
27{
28 Clear();
29}
30
32{
33 rhs.Copy(*this);
34}
35
36void TDemand::Copy(TObject& rhs) const
37{
38 TDetector::Copy(rhs);
39}
40
41void TDemand::Print(Option_t*) const
42{
43 /// Prints out TDemand members, currently shows only multiplicity.
44 Print(std::cout);
45}
46
47void TDemand::Print(std::ostream& out) const
48{
49 std::ostringstream str;
50 str << GetMultiplicity() << " hits" << std::endl;
51 out << str.str();
52}
53
55{
56 rhs.Copy(*this);
57 return *this;
58}
59
60void TDemand::AddFragment(const std::shared_ptr<const TFragment>& frag, TChannel*)
61{
62 auto* hit = new TDemandHit(*frag);
63 AddHit(hit);
64}
65
66TVector3 TDemand::GetPosition(const TDemandHit& hit)
67{
69}
70
71TVector3 TDemand::GetPosition(int DetNbr)
72{
73 if(1 > DetNbr || 6 < DetNbr) { //if detector number is not 1,2,3,4,5,6, then return a 0 vector
74 return TVector3(0, 0, 0);
75 }
76
77 else {
78 return TVector3(fXPositions[DetNbr - 1], fYPositions[DetNbr - 1], fZPositions[DetNbr - 1]); //-1 because we index the detectors at 1 but the vector at 0
79 }
80}
static const std::array< double, 6 > fYPositions
Definition TDemand.h:23
TDemand()
Definition TDemand.cxx:26
static TVector3 GetPosition(int DetNbr)
!
Definition TDemand.cxx:71
void Print(Option_t *opt="") const override
!
Definition TDemand.cxx:41
void Copy(TObject &) const override
!
Definition TDemand.cxx:36
TDemand & operator=(const TDemand &)
!
Definition TDemand.cxx:54
void AddFragment(const std::shared_ptr< const TFragment > &, TChannel *) override
!
Definition TDemand.cxx:60
static const std::array< double, 6 > fZPositions
Definition TDemand.h:24
static const std::array< double, 6 > fXPositions
Definition TDemand.h:22
virtual Int_t GetDetector() const
!
void Copy(TObject &) const override
!
Definition TDetector.cxx:24
virtual Short_t GetMultiplicity() const
Definition TDetector.h:73
void Clear(Option_t *="") override
!
Definition TDetector.h:68
virtual void AddHit(TDetectorHit *hit)
Definition TDetector.h:63