14#include "FairParGenericSet.h"
15#include "FairRootManager.h"
17#include "FairRuntimeDb.h"
20#include "TClonesArray.h"
41 FairRootManager* ioman = FairRootManager::Instance();
43 cout <<
"-E- CbmStsHitProducerIdealWrapper::Init: "
44 <<
"RootManager not instantised!" << endl;
49 fPointArray = (TClonesArray*) ioman->GetObject(
"StsPoint");
51 cout <<
"-W- CbmStsHitProducerIdealWrapper::Init: "
52 <<
"No STSPoint array!" << endl;
57 fHitArray =
new TClonesArray(
"CbmStsHit");
58 ioman->Register(
"StsHit",
"STS",
fHitArray, IsOutputBranchPersistent(
"StsHit"));
64 cout <<
"-I- CbmStsHitProducerIdealWrapper: Intialisation successfull" << endl;
71 LOG(info) <<
"Setting parameter containers for " << GetName();
75 for (Int_t iparC = 0; iparC < fParCList->GetEntries(); ++iparC) {
76 FairParGenericSet* tempObj = (FairParGenericSet*) (fParCList->At(iparC));
77 fParCList->Remove(tempObj);
79 std::string sParamName {tempObj->GetName()};
80 FairParGenericSet* newObj =
81 dynamic_cast<FairParGenericSet*
>(FairRun::Instance()->GetRuntimeDb()->getContainer(sParamName.data()));
83 if (
nullptr == newObj) {
84 LOG(error) <<
"Failed to obtain parameter container " << sParamName <<
", for parameter index " << iparC;
88 fParCList->AddAt(newObj, iparC);
96 std::vector<CbmStsPoint> vec;
97 Int_t entries = arr->GetEntriesFast();
100 LOG(info) <<
"Entries in TCA for data type " << point->GetName() <<
": " << entries;
102 for (
int i = 0; i < entries; ++i) {
104 vec.emplace_back(*point);
115 if (!
fHitArray) Fatal(
"Exec",
"No StsHit array");
129 for (
const auto& hit :
hits) {
130 new ((*fHitArray)[iPoint])
CbmStsHit(hit);
135 cout <<
"-I- CbmStsHitProducerIdealWrapper: " <<
points.size() <<
" StsPoints, " <<
hits.size() <<
" Hits created."
ClassImp(CbmConverterManager)
Data class for a reconstructed hit in the STS.
static vector< vector< QAHit > > hits
virtual std::vector< CbmStsHit > ProcessInputData(const std::vector< CbmStsPoint > &)
virtual void Exec(Option_t *opt)
CbmStsHitProducerIdealWrapper()
TClonesArray * fPointArray
virtual InitStatus Init()
std::vector< CbmStsPoint > Convert(TClonesArray *arr)
virtual void SetParContainers()
Inherited from FairTask.
CbmStsHitProducerIdealAlgo * fAlgo
~CbmStsHitProducerIdealWrapper()
data class for a reconstructed 3-d hit in the STS