WTI/Experiment Electronics/Data Processing: Go4 |
Previous tutorial 3 | | Go4 | TXXXEvent.h | TXXXEvent.cxx | | Next tutorial 5 |
>. ./rename.sh XXX Simsequence to customize the names. TSimEvent is now our output event class.
fact->DefOutputEvent("Dummy","TGo4EventElement");We defined the output event to be of class TGo4EventElement. This is a default class provided by Go4. Actually the function Fill in this class calls our BuildEvent function of TSimProc.cxx. Because we now want to use our class TSimEvent instead, we simply comment out the line with TGo4EventElement and uncomment the line with TSimEvent. To speficy the output file name and enable output the following lines at the end must be uncommented:
store = new TGo4FileStoreParameter(outfile);
step->SetEventStore(store);
step->SetStoreEnabled(kTRUE);
TSimEvent * data = (TsimEvent *) target;The histograms are now filled with the data of TSimEvent. For that we must uncomment the else block in FillHistograms. The return code of BuildEvent function indicates if this event shall be written to the output file (when writing is enabled).
for(i = 0; i < 8; i++)
{
data->f1[i]=f1[i];
data->f2[i]=f2[i];
}
FillHistograms(data);
> go4analysis -events 100000
> ....
> dir *.root
tree.root contains our output events with the two arrays as ROOT tree. In the next tutorial we will learn how to process this file.
result.root
tree.root