CbmRoot
CbmStsHitProducerIdealAlgo.cxx
Go to the documentation of this file.
1
// -----------------------------------------------------------------------------
2
// ----- -----
3
// ----- CbmStsHitProducerIdealAlgo -----
4
// ----- -----
5
// -----------------------------------------------------------------------------
6
7
#include "
CbmStsHitProducerIdealAlgo.h
"
8
9
#include "
CbmTrdParSetGas.h
"
10
11
#include "FairLogger.h"
12
13
#include <TList.h>
14
15
// -------------------------------------------------------------------------
16
CbmStsHitProducerIdealAlgo::CbmStsHitProducerIdealAlgo
() :
CbmAlgo
() {}
17
18
CbmStsHitProducerIdealAlgo::~CbmStsHitProducerIdealAlgo
() {
20
}
21
22
// -------------------------------------------------------------------------
23
Bool_t
CbmStsHitProducerIdealAlgo::Init
() {
24
LOG(info) <<
"Initializing tutorial StsHitProducerIdeal algo"
;
25
26
return
kTRUE;
27
}
28
29
void
CbmStsHitProducerIdealAlgo::Reset
() {}
30
31
void
CbmStsHitProducerIdealAlgo::Finish
() {}
32
33
// -------------------------------------------------------------------------
34
Bool_t
CbmStsHitProducerIdealAlgo::InitContainers
() {
35
LOG(info) <<
"Init parameter containers for CbmStsHitProducerIdealAlgo"
;
36
Bool_t initOK =
ReInitContainers
();
37
38
return
initOK;
39
}
40
Bool_t
CbmStsHitProducerIdealAlgo::ReInitContainers
() {
41
LOG(info) <<
"**********************************************"
;
42
LOG(info) <<
"ReInit parameter containers for CbmStsHitProducerIdealAlgo"
;
43
44
fTrdGasPar
=
45
static_cast<
CbmTrdParSetGas
*
>
(
fParCList
->FindObject(
"CbmTrdParSetGas"
));
46
if
(
nullptr
==
fTrdGasPar
)
return
kFALSE;
47
48
fTrdGasPar
->Dump();
49
Bool_t initOK =
InitParameters
();
50
51
return
initOK;
52
}
53
54
TList*
CbmStsHitProducerIdealAlgo::GetParList
() {
55
56
if
(
nullptr
==
fParCList
) {
fParCList
=
new
TList(); }
57
58
fTrdGasPar
=
new
CbmTrdParSetGas
(
"CbmTrdParSetGas"
);
59
fParCList
->Add(
fTrdGasPar
);
60
61
return
fParCList
;
62
}
63
64
Bool_t
CbmStsHitProducerIdealAlgo::InitParameters
() {
return
kTRUE; }
65
// -------------------------------------------------------------------------
66
67
std::vector<CbmStsHit>
CbmStsHitProducerIdealAlgo::ProcessInputData
(
68
const
std::vector<CbmStsPoint>& pointVect) {
69
fTrdGasPar
->Print();
70
71
// Declare some variables
72
// CbmStsPoint* point{nullptr};
73
Int_t detID {0};
// Detector ID
74
Double_t
x
{0.};
75
Double_t
y
{0.};
76
Double_t z {0.1};
// Position
77
Double_t dx {0.0001};
// Position error
78
TVector3
pos
{};
79
TVector3
dpos
{};
// Position and error vectors
80
81
std::vector<CbmStsHit> hitVect {};
82
83
84
// for(auto point: pointVect) {
85
for
(
unsigned
long
iPoint = 0; iPoint < pointVect.size(); ++iPoint) {
86
87
// Detector ID
88
detID = pointVect.at(iPoint).GetDetectorID();
89
90
// Determine hit position (centre plane of station)
91
x
= 0.5 * (pointVect.at(iPoint).GetXOut() + pointVect.at(iPoint).GetXIn());
92
y
= 0.5 * (pointVect.at(iPoint).GetYOut() + pointVect.at(iPoint).GetYIn());
93
z = 0.5 * (pointVect.at(iPoint).GetZOut() + pointVect.at(iPoint).GetZIn());
94
95
// Create new hit
96
pos
.SetXYZ(
x
,
y
, z);
97
dpos
.SetXYZ(dx, dx, 0.);
98
99
hitVect.emplace_back(detID,
pos
,
dpos
, 0., iPoint, iPoint, 0., 0.);
100
}
// Loop over MCPoints
101
102
return
hitVect;
103
}
104
105
// -------------------------------------------------------------------------
CbmStsHitProducerIdealAlgo::Init
virtual Bool_t Init()
Definition:
CbmStsHitProducerIdealAlgo.cxx:23
CbmStsHitProducerIdealAlgo::InitContainers
Bool_t InitContainers()
Definition:
CbmStsHitProducerIdealAlgo.cxx:34
CbmStsHitProducerIdealAlgo::InitParameters
Bool_t InitParameters()
Definition:
CbmStsHitProducerIdealAlgo.cxx:64
CbmTrdParSetGas
Describe TRD module working settings (HV, etc)
Definition:
CbmTrdParSetGas.h:15
CbmStsHitProducerIdealAlgo::CbmStsHitProducerIdealAlgo
CbmStsHitProducerIdealAlgo()
Definition:
CbmStsHitProducerIdealAlgo.cxx:16
CbmStsHitProducerIdealAlgo::~CbmStsHitProducerIdealAlgo
~CbmStsHitProducerIdealAlgo()
Definition:
CbmStsHitProducerIdealAlgo.cxx:18
CbmStsHitProducerIdealAlgo.h
dpos
TVector3 dpos
Definition:
CbmMvdSensorDigiToHitTask.cxx:61
CbmStsHitProducerIdealAlgo::Reset
virtual void Reset()
Definition:
CbmStsHitProducerIdealAlgo.cxx:29
CbmAlgo< CbmStsPoint, CbmStsHit >::fParCList
TList * fParCList
Parameter management.
Definition:
CbmAlgo.h:35
CbmStsHitProducerIdealAlgo::Finish
virtual void Finish()
Definition:
CbmStsHitProducerIdealAlgo.cxx:31
CbmStsHitProducerIdealAlgo::ProcessInputData
virtual std::vector< CbmStsHit > ProcessInputData(const std::vector< CbmStsPoint > &)
Definition:
CbmStsHitProducerIdealAlgo.cxx:67
x
Double_t x
Definition:
CbmMvdSensorDigiToHitTask.cxx:68
y
Double_t y
Definition:
CbmMvdSensorDigiToHitTask.cxx:68
pos
TVector3 pos
Definition:
CbmMvdSensorDigiToHitTask.cxx:60
CbmAlgo
Definition:
CbmAlgo.h:17
CbmTrdParSetGas.h
CbmStsHitProducerIdealAlgo::GetParList
TList * GetParList()
Definition:
CbmStsHitProducerIdealAlgo.cxx:54
CbmStsHitProducerIdealAlgo::ReInitContainers
Bool_t ReInitContainers()
Definition:
CbmStsHitProducerIdealAlgo.cxx:40
CbmStsHitProducerIdealAlgo::fTrdGasPar
CbmTrdParSetGas * fTrdGasPar
Settings from parameter file.
Definition:
CbmStsHitProducerIdealAlgo.h:44
tutorials
TaskToAlgo
CbmStsHitProducerIdealAlgo.cxx
Generated on Wed Oct 28 2020 15:11:45 for CbmRoot by
1.8.18