29#include <FairRootManager.h>
31#include <FairRuntimeDb.h>
33#include <TClonesArray.h>
35#include <TGeoPhysicalNode.h>
43using std::setprecision;
45using std::stringstream;
54 : FairTask(
"RecoStsPixel", 1)
77 LOG(info) <<
"==========================================================";
78 LOG(info) << GetName() <<
": Initialising ";
81 FairRootManager* ioman = FairRootManager::Instance();
86 LOG(info) << GetName() <<
": Using event-by-event mode";
87 fEvents =
dynamic_cast<TClonesArray*
>(ioman->GetObject(
"CbmEvent"));
89 LOG(warn) << GetName() <<
": Event mode selected but no event array found!";
94 LOG(info) << GetName() <<
": Using time-based mode";
104 LOG(fatal) << GetName() <<
": No StsDigi branch in input!";
109 LOG(error) << GetName() <<
" sts digi matches are not present";
115 LOG(error) << GetName() <<
": No CbmMCDataManager!";
122 LOG(fatal) << GetName() <<
": No StsPoint branch in input!";
128 fClusters =
new TClonesArray(
"CbmStsCluster", 1);
129 ioman->Register(
"StsCluster",
"Clusters in STS",
fClusters, IsOutputBranchPersistent(
"StsCluster"));
132 fHits =
new TClonesArray(
"CbmStsHit", 1);
133 ioman->Register(
"StsHit",
"Hits in STS",
fHits, IsOutputBranchPersistent(
"StsHit"));
137 LOG(info) << GetName() <<
": Sim settings " <<
fParSim->ToString();
141 LOG(info) << GetName() <<
": Module parameters " <<
fParSetModule->ToString();
145 LOG(info) << GetName() <<
": Sensor parameters " <<
fParSetModule->ToString();
150 LOG(info) << GetName() <<
": Sensor conditions " <<
fParSetCond->ToString();
157 if (!
fSetup->IsModuleParsInit()) {
160 if (!
fSetup->IsSensorParsInit()) {
163 if (!
fSetup->IsSensorCondInit()) {
168 if (strcmp(
fParSetSensor->getDescription(),
"Experimental STS Pixels")) {
169 LOG(error) << GetName() <<
" STS digis must be produced by the CbmStsDigitizePixel digitizer";
173 LOG(info) << GetName() <<
": Initialisation successful.";
174 LOG(info) <<
"==========================================================";
198 for (
Int_t iEvent = 0; iEvent <
fEvents->GetEntriesFast(); iEvent++) {
212 LOG(error) << GetName() <<
": No StsDigi branch in input!";
219 for (
Int_t iDigi = 0; iDigi < nDigis; iDigi++) {
236 LOG(error) << GetName() <<
" sts digis were not produced by CbmStsDigitizePixel task";
247 UInt_t iCluster =
fClusters->GetEntriesFast();
252 UInt_t iHit =
fHits->GetEntriesFast();
261 LOG(error) <<
"wrong Sts station number " << ista;
266 double staZ = station->
GetZ();
268 if (fabs(pt->GetZ() - staZ) > 1.) {
269 LOG(error) <<
"Sts point Z " << pt->GetZ() <<
" is far from the station Z " << staZ;
280 assert(resX > 1.e-5);
281 assert(resY > 1.e-5);
285 while (fabs(
x) > 3.5) {
286 x = gRandom->Gaus(0., 1.);
291 hit->
SetX(hit->
GetX() + resX * gaus());
292 hit->
SetY(hit->
GetY() + resY * gaus());
308 LOG(info) << GetName() <<
" Processed " << nDigis <<
" digis, created " << nHits <<
" hits";
316 FairRuntimeDb* db = FairRun::Instance()->GetRuntimeDb();
ECbmRecoMode
Reconstruct the full time slice or event-by-event.
XPU_D constexpr auto ToIntegralType(T enumerator) -> typename std::underlying_type< T >::type
Converts an element of enum class to its underlying integral type.
@ kSts
Silicon Tracking System.
ClassImp(CbmRecoStsPixel) CbmRecoStsPixel
friend fvec sqrt(const fvec &a)
static int32_t GetSystemId(uint32_t address)
void AddDigi(int32_t index)
Add digi to cluster.
static CbmDigiManager * Instance()
Static instance.
Class characterising one event by a collection of links (indices) to data objects,...
void SetTimeError(double error)
void SetAddress(int32_t address)
int32_t GetAddress() const
void SetTime(double time)
Task class creating and managing CbmMCDataArray objects.
CbmMCDataObject * GetObject(const char *name)
CbmMCDataArray * InitBranch(const char *name)
const CbmLink & GetLink(int32_t i) const
int32_t GetNofLinks() const
Task class for local reconstruction in the STS Pixel detector.
void Exec(Option_t *opt)
Task execution.
CbmStsParSetSensorCond * fParSetCond
Sensor conditions.
CbmStsParSetModule * fParSetModule
Module parameters.
void SetParContainers()
Define the needed parameter containers.
CbmMCDataArray * fStsPoints
Interface to digi branch.
InitStatus Init()
Initialisation.
TClonesArray * fHits
Output cluster array.
CbmDigiManager * fDigiManager
Input array of events.
CbmStsParSetSensor * fParSetSensor
Sensor parameters.
CbmRecoStsPixel(ECbmRecoMode mode=ECbmRecoMode::Timeslice)
Constructor.
~CbmRecoStsPixel()
Destructor.
ECbmRecoMode fMode
Time-slice or event.
CbmStsParSim * fParSim
Instance of STS setup.
void ProcessData(CbmEvent *event=nullptr)
Process one time slice or event.
void Finish()
End-of-run action.
CbmStsSetup * fSetup
Output hit array.
Data class for STS clusters.
Data class for a single-channel message in the STS.
XPU_D uint16_t GetChannel() const
Channel number in module @value Channel number.
XPU_D int32_t GetAddress() const
data class for a reconstructed 3-d hit in the STS
void SetDv(Double_t dv)
Error of coordinate across front-side strips @value Coordinate error [cm].
void SetFrontClusterId(int32_t index)
Set the index of the frontside cluster To keep track of the input during matching.
void SetBackClusterId(int32_t index)
Set the index of the backside cluster To keep track of the input during matching.
void SetDu(Double_t du)
Error of coordinate across front-side strips @value Coordinate error [cm].
Parameters of the STS readout ASIC.
double GetTimeResol() const
Time resolution.
Parameters for one STS module.
Parameters container for CbmStsParModule.
Parameters container for CbmStsParSensorCond.
Parameters container for CbmStsParSensor.
Settings for STS simulation (digitizer)
static CbmStsSetup * Instance()
CbmStsStation * GetStation(Int_t stationId) const
Int_t GetStationNumber(Int_t address)
Class representing a station of the StsSystem.
Double_t GetSensorPitch(Int_t iSide) const