20#include <FairRootManager.h>
22#include <FairRuntimeDb.h>
25#include <TGeoPhysicalNode.h>
27#include <boost/filesystem.hpp>
46 std::vector<cbm::algo::sts::HitfinderPars::Module> gpuModules;
48 LOG(info) << GetName() <<
": Creating modules";
51 for (
Int_t iModule = 0; iModule <
fSetup->GetNofModules(); iModule++) {
69 Double_t lorentzF = 0.;
70 Double_t lorentzB = 0.;
73 TGeoBBox*
shape =
dynamic_cast<TGeoBBox*
>(setupSensor->
GetPnode()->GetShape());
75 Double_t dZ = 2. *
shape->GetDZ();
79 if (FairRun::Instance()->GetField()) {
80 Double_t local[3] = {0., 0., 0.};
82 setupSensor->
GetPnode()->GetMatrix()->LocalToMaster(local, global);
83 Double_t field[3] = {0., 0., 0.};
84 FairRun::Instance()->GetField()->Field(global, field);
91 lorentzF = lorentzShift.first;
92 lorentzB = lorentzShift.second;
96 CbmStsRecoModule recoModule{setupModule, modPar, sensPar, lorentzF, lorentzB};
100 TGeoHMatrix* matrix = recoModule.getMatrix();
101 std::copy_n(matrix->GetRotationMatrix(), 9, localToGlobal.
rotation.begin());
102 std::copy_n(matrix->GetTranslation(), 3, localToGlobal.
translation.begin());
106 .address = moduleAddress,
108 .pitch = sensPar.
GetPar(6),
109 .stereoF = sensPar.
GetPar(8),
110 .stereoB = sensPar.
GetPar(9),
111 .lorentzF = float(lorentzF),
112 .lorentzB = float(lorentzB),
113 .localToGlobal = localToGlobal,
115 gpuModules.emplace_back(gpuModulePars);
134 std::vector<float> landauValuesF;
135 std::copy(landauValues.begin(), landauValues.end(), std::back_inserter(landauValuesF));
138 .nChannels = nChannels,
139 .modules = gpuModules,
142 .values = landauValuesF,
143 .stepSize = float(landauStepSize),
149 namespace fs = boost::filesystem;
150 fs::path filePath = fs::absolute(fs::weakly_canonical(
fsRecoParOutputDir +
"/StsHitfinder.yaml"));
164 LOG(info) <<
"==========================================================";
165 LOG(info) << GetName() <<
": Initialising ";
168 FairRootManager* ioman = FairRootManager::Instance();
173 LOG(info) << GetName() <<
": Sim settings " <<
fParSim->ToString();
185 LOG(info) << GetName() <<
": Created " << nModules <<
" modules";
187 LOG(info) << GetName() <<
": Initialisation successful.";
188 LOG(info) <<
"==========================================================";
200 TString sourceModu =
"database";
207 sourceModu =
"user-defined";
214 sourceModu =
"user-defined, global";
216 LOG(info) << GetName() <<
": Module parameters (" << sourceModu <<
") " <<
fParSetModule->ToString();
219 TString sourceSens =
"database";
226 sourceSens =
"user-defined";
233 sourceSens =
"user-defined, global";
235 LOG(info) << GetName() <<
": Sensor parameters (" << sourceSens <<
")" <<
fParSetSensor->ToString();
238 TString sourceCond =
"database";
245 sourceSens =
"user-defined";
252 sourceCond =
"user-defined, global";
254 LOG(info) << GetName() <<
": Sensor conditions (" << sourceCond <<
")" <<
fParSetCond->ToString();
260 Double_t dZ, Double_t bY)
263 Double_t vBias = conditions.
GetVbias();
264 Double_t vFd = conditions.
GetVfd();
265 Double_t eField = (vBias + vFd) / dZ;
269 Double_t deltaZ = dZ / nSteps;
270 Double_t dxMeanE = 0.;
271 Double_t dxMeanH = 0.;
272 for (
Int_t j = 0; j <= nSteps; j++) {
273 eField -= 2 * vFd / dZ * deltaZ / dZ;
276 dxMeanE += muHallE * (dZ - Double_t(j) * deltaZ);
277 dxMeanH += muHallH * Double_t(j) * deltaZ;
279 dxMeanE /= Double_t(nSteps);
280 dxMeanH /= Double_t(nSteps);
281 Double_t shiftF = dxMeanE * bY * 1.e-4;
282 Double_t shiftB = dxMeanH * bY * 1.e-4;
286 return {shiftF, shiftB};
293 FairRuntimeDb* db = FairRun::Instance()->GetRuntimeDb();
Class representing an element of the STS setup.
TGeoPhysicalNode * GetPnode() const
Int_t GetNofDaughters() const
CbmStsElement * GetDaughter(Int_t index) const
Class representing an instance of a readout unit in the CBM-STS.
Parameters of the STS readout ASIC.
double GetDynRange() const
Dynamic range of ADC.
uint16_t GetNofAdc() const
Number of ADC channels.
double GetZeroNoiseRate() const
Zero-crossing noise rate.
double GetNoise() const
Electronic noise RMS.
double GetThreshold() const
ADC Threshold.
double GetTimeResol() const
Time resolution.
double GetDeadTime() const
Single-channel dead time.
Parameters for one STS module.
uint32_t GetNofChannels() const
Number of channels.
const CbmStsParAsic & GetParAsic(uint32_t channel) const
ASIC parameters for a given channel.
Parameters for operating conditions of a STS sensor.
Double_t GetVbias() const
Bias voltage.
Double_t GetHallMobility(Double_t eField, Int_t chargeType) const
Hall mobility.
Constructional parameters of a STS sensor.
Float_t GetPar(UInt_t index) const
Get a parameter.
Parameters container for CbmStsParModule.
Parameters container for CbmStsParSensorCond.
Parameters container for CbmStsParSensor.
Settings for STS simulation (digitizer)
std::pair< std::vector< double >, double > GetLandauWidthTable() const
Raw values of landau width interpolation table.
static CbmStsPhysics * Instance()
Accessor to singleton instance.
Class for reconstruction in one STS module.
static CbmStsSetup * Instance()
CbmStsParSetSensorCond * fParSetCond
Sensor conditions.
virtual void SetParContainers()
Define the needed parameter containers.
CbmStsParModule * fUserParModule
void InitParams()
Initialise parameters.
std::pair< Double_t, Double_t > LorentzShift(const CbmStsParSensorCond &conditions, Double_t dZ, Double_t bY)
Average Lorentz Shift in a sensor.
UInt_t CreateModules()
Instantiate reconstruction modules @value Number of modules created.
CbmStsParSetModule * fParSetModule
Module parameters.
CbmStsParSensorCond * fUserParCond
CbmStsParSim * fParSim
Instance of STS setup.
std::string fsRecoParOutputDir
virtual ~CbmTaskStsHitFinderParWrite()
Destructor.
CbmStsParSetSensor * fParSetSensor
Sensor parameters.
CbmStsParSetSensorCond * fUserParSetCond
CbmStsParSensor * fUserParSensor
CbmStsParSetModule * fUserParSetModule
virtual InitStatus Init()
Initialisation.
CbmTaskStsHitFinderParWrite()
Constructor.
CbmStsParSetSensor * fUserParSetSensor
std::vector< Module > modules