7 #include "TClonesArray.h"
9 #include "FairLogger.h"
10 #include "FairParGenericSet.h"
11 #include "FairRootManager.h"
13 #include "FairRuntimeDb.h"
25 : FairTask(
"Ideal STS Hit Producer Task") {}
37 FairRootManager* ioman = FairRootManager::Instance();
39 cout <<
"-E- CbmStsHitProducerIdealWrapper::Init: "
40 <<
"RootManager not instantised!" << endl;
45 fPointArray = (TClonesArray*) ioman->GetObject(
"StsPoint");
47 cout <<
"-W- CbmStsHitProducerIdealWrapper::Init: "
48 <<
"No STSPoint array!" << endl;
53 fHitArray =
new TClonesArray(
"CbmStsHit");
55 "StsHit",
"STS",
fHitArray, IsOutputBranchPersistent(
"StsHit"));
61 cout <<
"-I- CbmStsHitProducerIdealWrapper: Intialisation successfull"
68 LOG(info) <<
"Setting parameter containers for " << GetName();
72 for (Int_t iparC = 0; iparC < fParCList->GetEntries(); ++iparC) {
73 FairParGenericSet* tempObj = (FairParGenericSet*) (fParCList->At(iparC));
74 fParCList->Remove(tempObj);
76 std::string sParamName {tempObj->GetName()};
77 FairParGenericSet* newObj =
dynamic_cast<FairParGenericSet*
>(
78 FairRun::Instance()->GetRuntimeDb()->getContainer(sParamName.data()));
80 if (
nullptr == newObj) {
81 LOG(error) <<
"Failed to obtain parameter container " << sParamName
82 <<
", for parameter index " << iparC;
86 fParCList->AddAt(newObj, iparC);
91 std::vector<CbmStsPoint>
94 std::vector<CbmStsPoint> vec;
95 Int_t entries = arr->GetEntriesFast();
98 LOG(info) <<
"Entries in TCA for data type " << point->GetName() <<
": "
101 for (
int i = 0;
i < entries; ++
i) {
103 vec.emplace_back(*point);
113 if (!
fHitArray) Fatal(
"Exec",
"No StsHit array");
127 for (
auto const hit :
hits) {
128 new ((*fHitArray)[iPoint])
CbmStsHit(hit);
133 cout <<
"-I- CbmStsHitProducerIdealWrapper: " <<
points.size()
134 <<
" StsPoints, " <<
hits.size() <<
" Hits created." << endl;