15 #include "StEtrFastSimMaker.h"
17 #include "StEventTypes.h"
18 #include "StEtrHitCollection.h"
22 #include "tables/St_g2t_etr_hit_Table.h"
23 #include "StEventHitIter.h"
24 #include "StuDraw3DEvent.h"
25 static TRandom *myRandom = 0;
29 StEtrFastSimMaker::StEtrFastSimMaker(
const char *name):
StMaker(name)
31 myRandom =
new TRandom();
32 mErr[0] = 3e-2; mErr[1] = 3e-2; mErr[2] = 0;
37 int StEtrFastSimMaker::InitRun(
int RunNo)
40 LOG_DEBUG <<
"Smearing SVT hits by " << mErr[0] <<
" " << mErr[2] <<
" cm in the ETR " << endm;
48 if (! stEvent) { LOG_WARN <<
"No StEvent on input, bye bye" << endm;
return kStWarn; }
52 stEvent->setEtrHitCollection(etrCol);
55 St_g2t_etr_hit *g2t_etr_hit = (St_g2t_etr_hit *) geant(
"g2t_etr_hit");
57 LOG_WARN <<
"No g2t_etr_hit on input, bye bye" << endm;
return kStWarn;
60 g2t_etr_hit_st *g2t = g2t_etr_hit->GetTable();
61 int Nhits = g2t_etr_hit->GetNRows();
63 for (
int i = 0; i < Nhits; i++) {
65 g2t_etr_hit_st *tb = g2t+i;
66 for (
int j=0;j<3;j++) {xyzG[j] = tb->x[j];}
68 for (
int j=0;j<2;j++) {xyzG[j]+= gRandom->Gaus(0, mErr[j]);}
71 int section =(tb->volume_id )%100;
72 int layer = (tb->volume_id/100 )%100;
73 int sector = (tb->volume_id/10000)%100;
76 etrHit->setIdTruth(tb->track_p,100);
77 etrCol->addHit(etrHit);
79 Info(
"Make",
"%d EtrHits was pushed into StEvent",Nhits);
81 static int etrDraw = 0;
87 iter.AddDetector(kEtrId);
StEventHitIter is the top level hook, providing hits to the Stv tracking code.
Class StuDraw3DEvent - to draw the 3D StEvent primitives like StTrack, StHit, StVertex decorated with...
virtual void Clear(Option_t *opt="update")
Remove all objects from the list and update the screen if opt is "update".