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