9 #include <TClonesArray.h>
10 #include <TGenericClassInfo.h>
22 , fPointArray(nullptr)
32 std::cout <<
"-E- FairTestDetectorDigiTask::Init: "
33 <<
"RootManager not instantiated!" << std::endl;
37 fPointArray =
static_cast<TClonesArray*
>(ioman->
GetObject(
"FairTestDetectorPoint"));
39 std::cout <<
"-W- FairTestDetectorDigiTask::Init: "
40 <<
"No Point array!" << std::endl;
45 fDigiArray =
new TClonesArray(
"FairTestDetectorDigi");
46 ioman->
Register(
"FairTestDetectorDigi",
"FairTestDetector", fDigiArray, kTRUE);
58 for (
int ipnt = 0; ipnt < fPointArray->GetEntries(); ipnt++) {
64 Int_t xPad = CalcPad(point->
GetX(), point->
GetXOut());
65 Int_t yPad = CalcPad(point->
GetY(), point->
GetYOut());
66 Int_t zPad = CalcPad(point->
GetZ(), point->
GetZOut());
68 Double_t timestamp = CalcTimeStamp(point->
GetTime());
71 if (fTimeResolution > 0) {
74 digi->SetTimeStampError(0);
81 Int_t FairTestDetectorDigiTask::CalcPad(Double_t posIn, Double_t posOut)
83 Int_t result =
static_cast<Int_t
>(posIn + posOut) / 2;
87 Double_t FairTestDetectorDigiTask::CalcTimeStamp(Double_t timeOfFlight)
90 Double_t detectionTime = gRandom->Gaus(0, fTimeResolution);
92 Double_t result = eventTime + timeOfFlight + detectionTime;
virtual InitStatus Init()
virtual void Exec(Option_t *opt)
static FairRootManager * Instance()
ClassImp(FairEventBuilder)
TObject * GetObject(const char *BrName)
void Register(const char *name, const char *Foldername, TNamed *obj, Bool_t toFile)
void SetTimeStampError(Double_t t)
FairTestDetectorDigiTask()
~FairTestDetectorDigiTask()