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//==========================================================================//
12//==========================================================================//
13//==========================================================================//
14//==========================================================================//
15//==========================================================================//
16
17//approximate (x,y,z) of the TDemand OGS detectors. Using TIGRESS coordinate system.
18const std::array<double, 6> TDemand::fXPositions = {55.5, 43.5, -43.5, -55.5, -43.5, 43.5};
19const std::array<double, 6> TDemand::fYPositions = {0, 45.5, 45.5, 0, -45.5, -45.5};
20const std::array<double, 6> TDemand::fZPositions = {93.9, 93.9, 93.9, 93.9, 93.9, 93.9};
21
23{
24 Clear();
25}
26
28{
29 rhs.Copy(*this);
30}
31
32void TDemand::Copy(TObject& rhs) const
33{
34 TDetector::Copy(rhs);
35}
36
37void TDemand::Print(Option_t*) const
38{
39 /// Prints out TDemand members, currently shows only multiplicity.
40 Print(std::cout);
41}
42
43void TDemand::Print(std::ostream& out) const
44{
45 std::ostringstream str;
46 str << GetMultiplicity() << " hits" << std::endl;
47 out << str.str();
48}
49
51{
52 rhs.Copy(*this);
53 return *this;
54}
55
56void TDemand::AddFragment(const std::shared_ptr<const TFragment>& frag, TChannel*)
57{
58 auto* hit = new TDemandHit(*frag);
59 AddHit(hit);
60}
61
62TVector3 TDemand::GetPosition(const TDemandHit& hit)
63{
65}
66
67TVector3 TDemand::GetPosition(int DetNbr)
68{
69 if(1 > DetNbr || 6 < DetNbr) { //if detector number is not 1,2,3,4,5,6, then return a 0 vector
70 return TVector3(0, 0, 0);
71 }
72
73 else {
74 return TVector3(fXPositions[DetNbr - 1], fYPositions[DetNbr - 1], fZPositions[DetNbr - 1]); //-1 because we index the detectors at 1 but the vector at 0
75 }
76}
static const std::array< double, 6 > fYPositions
Definition TDemand.h:19
TDemand()
Definition TDemand.cxx:22
static TVector3 GetPosition(int DetNbr)
!
Definition TDemand.cxx:67
void Print(Option_t *opt="") const override
!
Definition TDemand.cxx:37
void Copy(TObject &) const override
!
Definition TDemand.cxx:32
TDemand & operator=(const TDemand &)
!
Definition TDemand.cxx:50
void AddFragment(const std::shared_ptr< const TFragment > &, TChannel *) override
!
Definition TDemand.cxx:56
static const std::array< double, 6 > fZPositions
Definition TDemand.h:20
static const std::array< double, 6 > fXPositions
Definition TDemand.h:18
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.cxx:54
virtual void AddHit(TDetectorHit *hit)
Definition TDetector.h:63