7 #include "TClonesArray.h"
9 #include "FairLogger.h"
10 #include "FairRootManager.h"
11 #include "FairRunAna.h"
12 #include "FairRuntimeDb.h"
26 : FairTask(
"Ideal STS Hit Producer Task")
39 FairRunAna::Instance()->GetRuntimeDb()->getContainer(
"CbmTrdParSetGas"));
46 FairRootManager* ioman = FairRootManager::Instance();
48 cout <<
"-E- CbmStsHitProducerTaskIdeal::Init: "
49 <<
"RootManager not instantised!" << endl;
54 fPointArray = (TClonesArray*) ioman->GetObject(
"StsPoint");
56 cout <<
"-W- CbmStsHitProducerTaskIdeal::Init: "
57 <<
"No STSPoint array!" << endl;
62 fHitArray =
new TClonesArray(
"CbmStsHit");
64 "StsHit",
"STS",
fHitArray, IsOutputBranchPersistent(
"StsHit"));
69 cout <<
"-I- CbmStsHitProducerTaskIdeal: Intialisation successfull" << endl;
77 std::vector<CbmStsPoint>
80 std::vector<CbmStsPoint> vec;
81 Int_t entries = arr->GetEntriesFast();
84 LOG(info) <<
"Entries in TCA for data type " << point->GetName() <<
": "
87 for (
int i = 0;
i < entries; ++
i) {
89 vec.emplace_back(*point);
95 std::vector<CbmStsHit>
103 Double_t dx {0.0001};
107 std::vector<CbmStsHit> hitVect {};
111 for (
unsigned long iPoint = 0; iPoint < pointVect.size(); ++iPoint) {
114 detID = pointVect.at(iPoint).GetDetectorID();
117 x = 0.5 * (pointVect.at(iPoint).GetXOut() + pointVect.at(iPoint).GetXIn());
118 y = 0.5 * (pointVect.at(iPoint).GetYOut() + pointVect.at(iPoint).GetYIn());
119 z = 0.5 * (pointVect.at(iPoint).GetZOut() + pointVect.at(iPoint).GetZIn());
123 dpos.SetXYZ(dx, dx, 0.);
125 hitVect.emplace_back(detID,
pos,
dpos, 0., iPoint, iPoint, 0., 0.);
134 if (!
fHitArray) Fatal(
"Exec",
"No StsHit array");
151 for (
auto const hit :
hits) {
152 new ((*fHitArray)[iPoint])
CbmStsHit(hit);
158 cout <<
"-I- CbmStsHitProducerTaskIdeal: " <<
points.size() <<
" StsPoints, "
159 <<
hits.size() <<
" Hits created." << endl;