CbmRoot
Loading...
Searching...
No Matches
CbmStsHitProducerIdealAlgo.cxx
Go to the documentation of this file.
1/* Copyright (C) 2019-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig [committer] */
4
5// -----------------------------------------------------------------------------
6// ----- -----
7// ----- CbmStsHitProducerIdealAlgo -----
8// ----- -----
9// -----------------------------------------------------------------------------
10
12
13#include "CbmTrdParSetGas.h"
14
15#include <Logger.h>
16
17#include <TList.h>
18
19// -------------------------------------------------------------------------
21
26
27// -------------------------------------------------------------------------
29{
30 LOG(info) << "Initializing tutorial StsHitProducerIdeal algo";
31
32 return kTRUE;
33}
34
36
38
39// -------------------------------------------------------------------------
41{
42 LOG(info) << "Init parameter containers for CbmStsHitProducerIdealAlgo";
43 Bool_t initOK = ReInitContainers();
44
45 return initOK;
46}
48{
49 LOG(info) << "**********************************************";
50 LOG(info) << "ReInit parameter containers for CbmStsHitProducerIdealAlgo";
51
52 fTrdGasPar = static_cast<CbmTrdParSetGas*>(fParCList->FindObject("CbmTrdParSetGas"));
53 if (nullptr == fTrdGasPar) return kFALSE;
54
55 fTrdGasPar->Dump();
56 Bool_t initOK = InitParameters();
57
58 return initOK;
59}
60
62{
63
64 if (nullptr == fParCList) { fParCList = new TList(); }
65
66 fTrdGasPar = new CbmTrdParSetGas("CbmTrdParSetGas");
68
69 return fParCList;
70}
71
73// -------------------------------------------------------------------------
74
75std::vector<CbmStsHit> CbmStsHitProducerIdealAlgo::ProcessInputData(const std::vector<CbmStsPoint>& pointVect)
76{
78
79 // Declare some variables
80 // CbmStsPoint* point{nullptr};
81 Int_t detID {0}; // Detector ID
82 Double_t x {0.};
83 Double_t y {0.};
84 Double_t z {0.1}; // Position
85 Double_t dx {0.0001}; // Position error
86 TVector3 pos {};
87 TVector3 dpos {}; // Position and error vectors
88
89 std::vector<CbmStsHit> hitVect {};
90
91
92 // for(auto point: pointVect) {
93 for (unsigned long iPoint = 0; iPoint < pointVect.size(); ++iPoint) {
94
95 // Detector ID
96 detID = pointVect.at(iPoint).GetDetectorID();
97
98 // Determine hit position (centre plane of station)
99 x = 0.5 * (pointVect.at(iPoint).GetXOut() + pointVect.at(iPoint).GetXIn());
100 y = 0.5 * (pointVect.at(iPoint).GetYOut() + pointVect.at(iPoint).GetYIn());
101 z = 0.5 * (pointVect.at(iPoint).GetZOut() + pointVect.at(iPoint).GetZIn());
102
103 // Create new hit
104 pos.SetXYZ(x, y, z);
105 dpos.SetXYZ(dx, dx, 0.);
106
107 hitVect.emplace_back(detID, pos, dpos, 0., iPoint, iPoint, 0., 0.);
108 } // Loop over MCPoints
109
110 return hitVect;
111}
112
113// -------------------------------------------------------------------------
TVector3 dpos
virtual std::vector< CbmStsHit > ProcessInputData(const std::vector< CbmStsPoint > &)
CbmTrdParSetGas * fTrdGasPar
Settings from parameter file.
Describe TRD module working settings (HV, etc)
virtual void Print(Option_t *opt="") const