22#include "TClonesArray.h"
24#include "TGeoMatrix.h"
25#include "TGeoPhysicalNode.h"
26#include "TGeoVolume.h"
27#include <TMCProcess.h>
30#include "FairEventHeader.h"
33#include "FairMCEventHeader.h"
34#include "FairMCPoint.h"
35#include "FairRunAna.h"
36#include "FairRunSim.h"
37#include "FairRuntimeDb.h"
67using std::setprecision;
70using std::stringstream;
84 , fPixelNstations(nPixelStations)
85 , fPixelResolutionXcm(resolutionXcm)
86 , fPixelResolutionYcm(resolutionYcm)
87 , fPixelResolutionTns(resolutionTns)
106 assert(FairRunAna::Instance());
107 FairRuntimeDb* rtdb = FairRunAna::Instance()->GetRuntimeDb();
131 FairRootManager* ioman = FairRootManager::Instance();
135 fPoints = (TClonesArray*) ioman->GetObject(
"StsPoint");
166 std::vector<std::pair<double, int>> sortedPoints;
167 sortedPoints.reserve(
fPoints->GetEntriesFast());
169 for (Int_t iPoint = 0; iPoint <
fPoints->GetEntriesFast(); iPoint++) {
171 sortedPoints.push_back(std::make_pair(point->GetTime(), iPoint));
174 std::sort(sortedPoints.begin(), sortedPoints.end(),
175 [](std::pair<double, int>& left, std::pair<double, int>& right) { return left.first < right.first; });
177 for (UInt_t iSorted = 0; iSorted < sortedPoints.size(); iSorted++) {
178 Int_t iPoint = sortedPoints[iSorted].second;
181 UInt_t address =
static_cast<UInt_t
>(point->GetDetectorID());
182 UShort_t channel = 0;
190 Long64_t time = Long64_t(round(timef));
191 if (time < 0) { time = 0; }
211 LOG(info) << left << setw(15) << GetName() <<
"[" << fixed << setprecision(3) << timer.RealTime() <<
" s]"
212 <<
" Points processed " <<
fPoints->GetEntriesFast();
234 fParSim->setInputVersion(-2, 1);
241 UInt_t nChannels = 2048;
242 UInt_t nAsicChannels = 128;
246 Double_t dynRange = 75000.;
247 Double_t threshold = 3000.;
248 Double_t deadTime = 800.;
249 Double_t noiseRms = 1000.;
250 Double_t znr = 3.9789e-3;
277 LOG(info) << GetName() <<
"--- Using global ASIC parameters for Pixels: \n " << userParAsicPixel.
ToString();
278 LOG(info) << GetName() <<
"--- Using global ASIC parameters for Strips: \n " << userParAsicPixel.
ToString();
292 TGeoBBox* box =
dynamic_cast<TGeoBBox*
>(sensor->
GetPnode()->GetShape());
294 Double_t lX = 2. * box->GetDX();
295 Double_t lY = 2. * box->GetDY();
296 Double_t lZ = 2. * box->GetDZ();
ClassImp(CbmStsDigitizePixel)
friend fvec sqrt(const fvec &a)
void GetEventInfo()
Get event information.
Int_t fCurrentInput
Start time of run [ns].
Double_t fCurrentEventTime
Number of current MC entry.
Int_t fCurrentMCEntry
Number of current MC event.
Bool_t fCreateMatches
Flag for production of inter-event noise.
void SetCreateMatches(Bool_t choice=kTRUE)
Set creation of links to MC.
Bool_t fProduceNoise
Flag for event-by-event mode.
Base class template for CBM digitisation tasks.
void SendData(Double_t time, CbmStsDigi *digi, CbmMatch *match=nullptr)
void AddLink(const CbmLink &newLink)
Data class for a single-channel message in the STS.
Task class for simulating the detector response of the experimental STS Pixel setup.
virtual InitStatus Init()
CbmStsParSim * fParSim
Simulation settings.
CbmStsParSetSensorCond * fParSetCond
Sensor conditions.
virtual InitStatus ReInit()
virtual ~CbmStsDigitizePixel()
Double_t fPixelResolutionYcm
TClonesArray * fPoints
STS setup interface.
CbmStsParSetSensor * fParSetSensor
Sensor parameters.
Double_t fPixelResolutionTns
Double_t fStripResolutionXcm
Double_t fPixelResolutionXcm
void InitParams()
Initialise the parameters.
virtual void Exec(Option_t *opt)
virtual void SetParContainers()
Inherited from FairTask.
CbmStsParSetModule * fParSetModule
Module parameter.
Double_t fStripResolutionTns
Double_t fStripResolutionYcm
TGeoPhysicalNode * GetPnode() const
Parameters of the STS readout ASIC.
std::string ToString() const
Info to string.
Parameters for one STS module.
void SetAllAsics(const CbmStsParAsic &asicPar)
Set all ASICs with the same parameter set.
Constructional parameters of a STS sensor.
void SetPar(UInt_t index, Float_t value)
Set a parameter.
Parameters container for CbmStsParModule.
virtual void clear()
Reset all parameters.
void SetParModule(UInt_t address, const CbmStsParModule &par)
Set the parameters for a module.
std::string ToString() const
Info to string.
Parameters container for CbmStsParSensorCond.
Parameters container for CbmStsParSensor.
void SetParSensor(UInt_t address, const CbmStsParSensor &par)
Set the parameters for a sensor.
std::string ToString() const
Info to string.
virtual void clear()
Reset all parameters.
Settings for STS simulation (digitizer)
std::string ToString() const
String output.
void SetGenerateNoise(Bool_t choice=kTRUE)
Activate or de-activate inter-event noise.
void SetEventMode(Bool_t choice=kTRUE)
Set event-by-event simulation mode.
static CbmStsPhysics * Instance()
Accessor to singleton instance.
Class representing an instance of a sensor in the CBM-STS.
Int_t GetNofSensors() const
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()
CbmStsSensor * GetSensor(Int_t index) const
Get a sensor from the sensor array.
Int_t GetStationNumber(Int_t address)
Int_t GetNofModules() const
Bool_t IsInit() const
Initialisation status for sensor parameters.