Go to the documentation of this file.
8 #include <TClonesArray.h>
10 #include <TGeoPhysicalNode.h>
24 #include <FairField.h>
26 #include <FairRuntimeDb.h>
31 using std::setprecision;
43 : FairTask(
"RecoSts", 1)
45 , fWriteClusters(writeClusters)
46 , fRunParallel(runParallel) {}
64 Int_t moduleAddress = Int_t(setupModule->
GetAddress());
68 Int_t sensorAddress = Int_t(setupSensor->
GetAddress());
87 Double_t lorentzF = 0.;
88 Double_t lorentzB = 0.;
92 dynamic_cast<TGeoBBox*
>(setupSensor->
GetPnode()->GetShape());
94 Double_t dZ = 2. *
shape->GetDZ();
98 if (FairRun::Instance()->GetField()) {
99 Double_t local[3] = {0., 0., 0.};
101 setupSensor->
GetPnode()->GetMatrix()->LocalToMaster(local, global);
102 Double_t field[3] = {0., 0., 0.};
103 FairRun::Instance()->GetField()->Field(global, field);
110 lorentzF = lorentzShift.first;
111 lorentzB = lorentzShift.second;
117 auto result =
fModules.insert({moduleAddress, recoModule});
118 assert(result.second);
142 Int_t nEvents =
fEvents->GetEntriesFast();
143 LOG(info) << setw(20) << left << GetName() <<
": Processing time slice "
145 << (nEvents == 1 ?
" event" :
" events");
146 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
161 std::cout << std::endl;
162 LOG(info) <<
"=====================================";
163 LOG(info) << GetName() <<
": Run summary";
168 LOG(info) <<
"Digis / TSlice : "
170 LOG(info) <<
"Digis used / TSlice : "
172 LOG(info) <<
"Digis ignored / TSlice : "
174 LOG(info) <<
"Clusters / TSlice : "
176 LOG(info) <<
"Hits / TSlice : "
180 LOG(info) <<
"Time per TSlice : "
189 LOG(info) <<
"Digis used / event : "
191 LOG(info) <<
"Digis ignored / event : "
193 LOG(info) <<
"Clusters / event : "
205 LOG(info) <<
"Time Reset : " << fixed << setprecision(1) << setw(6)
206 << 1000. *
fTime1 <<
" ms (" << setprecision(1) << setw(4)
208 LOG(info) <<
"Time Distribute : " << fixed << setprecision(1) << setw(6)
209 << 1000. *
fTime2 <<
" ms (" << setprecision(1)
211 LOG(info) <<
"Time Reconstruct : " << fixed << setprecision(1) << setw(6)
212 << 1000. *
fTime3 <<
" ms (" << setprecision(1) << setw(4)
214 LOG(info) <<
"Time Output : " << fixed << setprecision(1) << setw(6)
215 << 1000. *
fTime4 <<
" ms (" << setprecision(1) << setw(4)
217 LOG(info) <<
"=====================================";
226 std::cout << std::endl;
227 LOG(info) <<
"==========================================================";
228 LOG(info) << GetName() <<
": Initialising ";
231 FairRootManager* ioman = FairRootManager::Instance();
240 LOG(info) << GetName() <<
": Using event-by-event mode";
241 fEvents =
dynamic_cast<TClonesArray*
>(ioman->GetObject(
"Event"));
243 LOG(warn) << GetName()
244 <<
": Event mode selected but no event array found!";
249 LOG(info) << GetName() <<
": Using time-based mode";
253 LOG(fatal) << GetName() <<
": No StsDigi branch in input!";
256 fClusters =
new TClonesArray(
"CbmStsCluster", 1);
257 ioman->Register(
"StsCluster",
260 IsOutputBranchPersistent(
"StsCluster"));
263 fHits =
new TClonesArray(
"CbmStsHit", 1);
265 "StsHit",
"Hits in STS",
fHits, IsOutputBranchPersistent(
"StsHit"));
291 LOG(info) << GetName() <<
": Created " << nModules <<
" modules";
293 LOG(info) << GetName() <<
": Initialisation successful.";
294 LOG(info) <<
"==========================================================";
302 std::pair<Double_t, Double_t>
307 Double_t vBias = conditions.
GetVbias();
308 Double_t vFd = conditions.
GetVfd();
309 Double_t eField = (vBias + vFd) / dZ;
313 Double_t deltaZ = dZ / nSteps;
314 Double_t dxMeanE = 0.;
315 Double_t dxMeanH = 0.;
316 for (Int_t j = 0; j <= nSteps; j++) {
317 eField -= 2 * vFd / dZ * deltaZ / dZ;
320 dxMeanE += muHallE * (dZ - Double_t(j) * deltaZ);
321 dxMeanH += muHallH * Double_t(j) * deltaZ;
323 dxMeanE /= Double_t(nSteps);
324 dxMeanH /= Double_t(nSteps);
325 Double_t shiftF = dxMeanE * bY * 1.e-4;
326 Double_t shiftB = dxMeanH * bY * 1.e-4;
330 return {shiftF, shiftB};
340 Int_t nDigisGood = 0;
341 Int_t nDigisIgnored = 0;
350 Double_t time1 =
fTimer.RealTime();
359 Int_t digiIndex = -1;
361 for (Int_t iDigi = 0; iDigi < nDigis; iDigi++) {
375 Int_t moduleAddress =
377 auto it =
fModules.find(moduleAddress);
379 LOG(warn) <<
"Unknown module address: "
389 Double_t time2 =
fTimer.RealTime();
400 Double_t time3 =
fTimer.RealTime();
410 ULong64_t offsetClustersF = 0;
411 ULong64_t offsetClustersB = 0;
414 const vector<CbmStsCluster>& moduleClustersF =
416 offsetClustersF =
fClusters->GetEntriesFast();
417 for (
auto& cluster : moduleClustersF) {
418 UInt_t index =
fClusters->GetEntriesFast();
424 const vector<CbmStsCluster>& moduleClustersB =
426 offsetClustersB =
fClusters->GetEntriesFast();
427 for (
auto& cluster : moduleClustersB) {
428 UInt_t index =
fClusters->GetEntriesFast();
434 const vector<CbmStsHit>& moduleHits =
fModuleIndex[it]->GetHits();
435 for (
auto& hit : moduleHits) {
436 UInt_t index =
fHits->GetEntriesFast();
445 Double_t time4 =
fTimer.RealTime();
448 Double_t realTime = time1 + time2 + time3 + time4;
463 LOG(info) << setw(20) << left << GetName() <<
"[" << fixed
464 << setprecision(4) << realTime <<
" s] : Event " << right
465 << setw(6) <<
event->GetNumber() <<
", digis: " << nDigis
466 <<
", ignored: " << nDigisIgnored <<
", clusters: " << nClusters
467 <<
", hits " << nHits;
470 LOG(info) << setw(20) << left << GetName() <<
"[" << fixed
471 << setprecision(4) << realTime <<
" s] : TSlice " << right
473 <<
", ignored: " << nDigisIgnored <<
", clusters: " << nClusters
474 <<
", hits " << nHits;
482 FairRuntimeDb* db = FairRun::Instance()->GetRuntimeDb();
489 db->getContainer(
"CbmStsParSetSensorCond"));
void AddDigiToQueue(const CbmStsDigi *digi, Int_t digiIndex)
Add a digi to the processing queue.
Int_t fNofEvents
Number of events processed.
virtual void Exec(Option_t *opt)
Task execution.
virtual ~CbmRecoSts()
Destructor
Data class for STS clusters.
Double_t GetHallMobility(Double_t eField, Int_t chargeType) const
Hall mobility.
virtual InitStatus Init()
Initialisation.
CbmStsParSetModule * fParSetModule
Module parameters.
Double_t fNofDigisIgnored
Total number of ignored digis.
std::map< UInt_t, CbmStsRecoModule * > fModules
InitStatus Init()
Initialisation.
CbmStsParModule * fUserParModule
CbmStsSetup * fSetup
Output hit array.
CbmRecoSts(ECbmRecoMode mode=kCbmRecoTimeslice, Bool_t writeClusters=kFALSE, Bool_t runParallel=kFALSE)
Constructor.
ClassImp(CbmRecoSts) CbmRecoSts
Class for reconstruction in one STS module.
Parameters for operating conditions of a STS sensor.
static CbmStsSetup * Instance()
Int_t GetFrontClusterId() const
static Int_t GetNofDigis(ECbmModuleId systemId)
Double_t fNofClusters
Total number of clusters produced.
void SetBackClusterId(Int_t index)
Set the index of the backside cluster To keep track of the input during matching.
std::string ToString() const
String output.
std::vector< CbmStsRecoModule * > fModuleIndex
const CbmStsParModule & GetParModule(UInt_t address)
Get condition parameters of a sensor.
static Bool_t IsPresent(ECbmModuleId systemId)
Presence of a digi branch.
UInt_t CreateModules()
Instantiate reconstruction modules @value Number of modules created.
TGeoPhysicalNode * GetPnode() const
static CbmDigiManager * Instance()
Static instance.
CbmStsParSetSensor * fParSetSensor
Sensor parameters.
std::string ToString() const
Info to string.
data class for a reconstructed 3-d hit in the STS
Parameters container for CbmStsParSensorCond.
Double_t fNofDigis
Total number of digis processed.
Class representing an instance of a readout unit in the CBM-STS.
Constructional parameters of a STS sensor.
Double_t fTime2
Time for distributing data.
std::string ToString()
Info to string.
const CbmStsParSensor & GetParSensor(UInt_t address)
Get condition parameters of a sensor.
void ProcessData(CbmEvent *event=nullptr)
Process one time slice or event.
Double_t fNofHits
Total number of clusters produced.
Int_t fNofTimeslices
ROOT timer.
Parameters container for CbmStsParSensor.
virtual void Finish()
End-of-run action.
const Digi * Get(Int_t index) const
Get a digi object.
Parameters for one STS module.
Double_t fTimeTot
Total execution time.
void SetFrontClusterId(Int_t index)
Set the index of the frontside cluster To keep track of the input during matching.
Double_t fTime1
Time for resetting modules.
Double_t fTime3
Time for reconstruction.
std::pair< Double_t, Double_t > LorentzShift(const CbmStsParSensorCond &conditions, Double_t dZ, Double_t bY)
Average Lorentz Shift in a sensor.
Bool_t Init(const char *geometryFile=nullptr)
Initialise the setup.
TClonesArray * fHits
Output cluster array.
Data class for a single-channel message in the STS.
Double_t fTime4
Time for output results.
CbmStsModule * GetModule(Int_t index) const
Get a module from the module array.
Double_t fNofDigisUsed
Total number of used digis.
CbmStsParSetSensorCond * fParSetCond
Sensor conditions.
CbmStsParSim * fParSim
Instance of STS setup.
Int_t GetBackClusterId() const
Bool_t LorentzShift() const
Check whether Lorentz shift is applied.
constexpr auto ToIntegralType(T enumerator) -> typename std::underlying_type< T >::type
CbmStsElement * GetDaughter(Int_t index) const
Int_t GetNofDaughters() const
CbmStsParSensorCond * fUserParSensorCond
Settings for STS simulation (digitizer)
Task class for local reconstruction in the STS.
virtual void SetParContainers()
Define the needed parameter containers.
Class characterising one event by a collection of links (indices) to data objects,...
Parameters container for CbmStsParModule.
Double_t GetVbias() const
Bias voltage.
CbmStsParSensor * fUserParSensor
ECbmRecoMode fMode
Time-slice or event.
Int_t GetMotherAddress(Int_t address, Int_t level)
Construct the address of an element from the address of a descendant element.
@ kSts
Silicon Tracking System.
TClonesArray * fClusters
Interface to digi branch.
Int_t GetNofModules() const
Class representing an element of the STS setup.
const CbmStsParSensorCond & GetParSensor(UInt_t address)
Get condition parameters of a sensor.
std::string ToString(Int_t address)
String output.
CbmDigiManager * fDigiManager
Input array of events.
static Int_t GetSystemId(UInt_t address)