20#include <FairRootManager.h>
22#include <FairRuntimeDb.h>
25#include <TGeoPhysicalNode.h>
44 std::vector<cbm::algo::sts::HitfinderPars::Module> gpuModules;
46 LOG(info) << GetName() <<
": Creating modules";
54 Int_t moduleAddress = Int_t(setupModule->
GetAddress());
58 Int_t sensorAddress = Int_t(setupSensor->
GetAddress());
67 Double_t lorentzF = 0.;
68 Double_t lorentzB = 0.;
71 TGeoBBox*
shape =
dynamic_cast<TGeoBBox*
>(setupSensor->
GetPnode()->GetShape());
73 Double_t dZ = 2. *
shape->GetDZ();
77 if (FairRun::Instance()->GetField()) {
78 Double_t local[3] = {0., 0., 0.};
80 setupSensor->
GetPnode()->GetMatrix()->LocalToMaster(local, global);
81 Double_t field[3] = {0., 0., 0.};
82 FairRun::Instance()->GetField()->Field(global, field);
89 lorentzF = lorentzShift.first;
90 lorentzB = lorentzShift.second;
94 CbmStsRecoModule recoModule{setupModule, modPar, sensPar, lorentzF, lorentzB};
98 TGeoHMatrix* matrix = recoModule.getMatrix();
99 std::copy_n(matrix->GetRotationMatrix(), 9, localToGlobal.
rotation.begin());
100 std::copy_n(matrix->GetTranslation(), 3, localToGlobal.
translation.begin());
104 .address = moduleAddress,
106 .pitch = sensPar.
GetPar(6),
107 .stereoF = sensPar.
GetPar(8),
108 .stereoB = sensPar.
GetPar(9),
109 .lorentzF = float(lorentzF),
110 .lorentzB = float(lorentzB),
111 .localToGlobal = localToGlobal,
113 gpuModules.emplace_back(gpuModulePars);
132 std::vector<float> landauValuesF;
133 std::copy(landauValues.begin(), landauValues.end(), std::back_inserter(landauValuesF));
136 .nChannels = nChannels,
137 .modules = gpuModules,
140 .values = landauValuesF,
141 .stepSize = float(landauStepSize),
146 std::string filename =
"StsHitfinder.yaml";
149 return pars.modules.size();
159 LOG(info) <<
"==========================================================";
160 LOG(info) << GetName() <<
": Initialising ";
163 FairRootManager* ioman = FairRootManager::Instance();
180 LOG(info) << GetName() <<
": Created " << nModules <<
" modules";
182 LOG(info) << GetName() <<
": Initialisation successful.";
183 LOG(info) <<
"==========================================================";
195 TString sourceModu =
"database";
202 sourceModu =
"user-defined";
209 sourceModu =
"user-defined, global";
211 LOG(info) << GetName() <<
": Module parameters (" << sourceModu <<
") " <<
fParSetModule->
ToString();
214 TString sourceSens =
"database";
221 sourceSens =
"user-defined";
228 sourceSens =
"user-defined, global";
233 TString sourceCond =
"database";
240 sourceSens =
"user-defined";
247 sourceCond =
"user-defined, global";
249 LOG(info) << GetName() <<
": Sensor conditions (" << sourceCond <<
")" <<
fParSetCond->
ToString();
255 Double_t dZ, Double_t bY)
258 Double_t vBias = conditions.
GetVbias();
259 Double_t vFd = conditions.
GetVfd();
260 Double_t eField = (vBias + vFd) / dZ;
264 Double_t deltaZ = dZ / nSteps;
265 Double_t dxMeanE = 0.;
266 Double_t dxMeanH = 0.;
267 for (Int_t j = 0; j <= nSteps; j++) {
268 eField -= 2 * vFd / dZ * deltaZ / dZ;
271 dxMeanE += muHallE * (dZ - Double_t(j) * deltaZ);
272 dxMeanH += muHallH * Double_t(j) * deltaZ;
274 dxMeanE /= Double_t(nSteps);
275 dxMeanH /= Double_t(nSteps);
276 Double_t shiftF = dxMeanE * bY * 1.e-4;
277 Double_t shiftB = dxMeanH * bY * 1.e-4;
281 return {shiftF, shiftB};
288 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.
void SetGlobalPar(const CbmStsParModule ¶ms)
Set global parameters (for all modules)
const CbmStsParModule & GetParModule(UInt_t address)
Get condition parameters of a sensor.
virtual void clear()
Reset all parameters.
std::string ToString() const
Info to string.
Parameters container for CbmStsParSensorCond.
std::string ToString()
Info to string.
void SetGlobalPar(Double_t vDep, Double_t vBias, Double_t temperature, Double_t cCoupling, Double_t cInterstrip)
Set global conditions (for all sensors)
virtual void clear()
Reset all parameters.
const CbmStsParSensorCond & GetParSensor(UInt_t address)
Get condition parameters of a sensor.
Parameters container for CbmStsParSensor.
std::string ToString() const
Info to string.
void SetGlobalPar(const CbmStsParSensor ¶ms)
Set global parameters (for all modules)
const CbmStsParSensor & GetParSensor(UInt_t address)
Get condition parameters of a sensor.
virtual void clear()
Reset all parameters.
Settings for STS simulation (digitizer)
Bool_t LorentzShift() const
Check whether Lorentz shift is applied.
std::string ToString() const
String output.
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.
Bool_t Init(const char *geometryFile=nullptr)
Initialise the setup.
CbmStsModule * GetModule(Int_t index) const
Get a module from the module array.
static CbmStsSetup * Instance()
Int_t GetNofModules() const
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.
virtual ~CbmTaskStsHitFinderParWrite()
Destructor
CbmStsParSetSensor * fParSetSensor
Sensor parameters.
CbmStsParSetSensorCond * fUserParSetCond
CbmStsParSensor * fUserParSensor
CbmStsParSetModule * fUserParSetModule
virtual InitStatus Init()
Initialisation.
CbmTaskStsHitFinderParWrite()
Constructor.
CbmStsParSetSensor * fUserParSetSensor