2 #include "StFttFastSimMaker.h"
4 #include "StEvent/StEvent.h"
5 #include "St_base/StMessMgr.h"
7 #include "StThreeVectorF.hh"
9 #include "tables/St_g2t_fts_hit_Table.h"
10 #include "StEvent/StFttCollection.h"
11 #include "StEvent/StFttPoint.h"
13 #include "StarGenerator/UTIL/StarRandom.h"
16 StFttFastSimMaker::StFttFastSimMaker(
const Char_t *name)
19 int StFttFastSimMaker::Init() {
20 return StMaker::Init();
24 LOG_DEBUG <<
"StFttFastSimMaker::Make" << endm;
31 LOG_DEBUG <<
"Creating StEvent" << endm;
34 if ( event->fttCollection() == nullptr ){
35 LOG_INFO <<
"Creating FttCollection" << endm;
37 event->setFttCollection(fttcollection);
40 St_g2t_fts_hit *g2t_stg_hits = (St_g2t_fts_hit *)GetDataSet(
"geant/g2t_stg_hit");
43 LOG_WARN <<
"geant/g2t_stg_hit is empty" << endm;
47 const double sigXY = 0.01;
48 int nstg = g2t_stg_hits->GetNRows();
49 LOG_DEBUG <<
"This event has " << nstg <<
" stg hits in geant/g2t_stg_hit " << endm;
50 for (
int i = 0; i < nstg; i++) {
51 g2t_fts_hit_st *git = (g2t_fts_hit_st *)g2t_stg_hits->At(i);
54 int track_id = git->track_p;
55 int volume_id = git->volume_id;
56 int plane_id = (volume_id - 1) / 100;
59 if ( volume_id % 2 ==0 )
62 float x = git->x[0] + gRandom->Gaus(0, sigXY);
63 float y = git->x[1] + gRandom->Gaus(0, sigXY);
67 point->setPlane(plane_id);
68 point->setQuadrant(0);
72 point->setIdTruth( track_id );
73 event->fttCollection()->addPoint(point);
virtual void AddData(TDataSet *data, const char *dir=".data")
User methods.