25#include "TApplication.h"
28#include "TBenchmark.h"
36int main(
int argc,
char **argv)
39 std::cout <<
"usage: MainGo4EventServerExample eventnumber"<<std::endl;
43 TApplication theApp(
"App", &argc, argv);
53 const char *num = argv[1];
54 Int_t maxevents = atoi(num);
57 TCanvas *can =
new TCanvas(
"MyCanvas",
"MainGo4EventServer");
59 TH1D* histo1 =
new TH1D (
"histogram 1",
"mbsevent data",400,0,4000);
60 TH1D* histo2 =
new TH1D (
"histogram 2",
"simpleevent data",400,0,4000);
67 Short_t idfield[2] = {0,3};
88 TString testfilename = TString::Format(
"%s/data/test.lmd",getenv(
"GO4SYS"));
124 event->SetEventSource(input);
131 std::cout <<
"starting event loop:"<< std::endl;
132 mybench.Start(
"Go4EventServer");
133 for(Int_t t = 0; t < maxevents; ++t)
137 Int_t errmess =
event->Fill();
140 std::cout <<
"no more events from MbsSource."<< std::endl;
144 else if(errmess != 0)
146 std::cout <<
"ERROR on event fill."<< std::endl;
150 sub=
event->GetSubEvent(3);
152 value = sub->
Data(1);
159 output->
Store(event);
168 value= simpsub->
fiD1;
176 simpoutput->
Store(simpevent);
179 if(t%2000 == 0 && t != 0) {
187 std::cout <<
" 2000 events processed "<< std::endl;
191 std::cout <<
"\t finished filling and saving events."<<std::endl;
192 mybench.Show(
"Go4EventServer");
int main(int argc, char **argv)
MainGo4EventServerExample.
void SetEventSource(TGo4EventSource *src)
Setter for the event source that is currently used by the Fill method.
void SetInputEvent(TGo4EventElement *raw)
Sets reference to external raw event which is used by the concrete processor to unpack the interestin...
The abstract interface class for the raw event store.
virtual Int_t Store(TGo4EventElement *event)=0
Stores eventelement event into the storage implementation.
Event store which fills entries to an own root TTree in a TFile.
static TGo4Log * Instance()
static void SetIgnoreLevel(Int_t level)
Define threshold for output.
static void LogfileEnable(Bool_t on=kTRUE)
switch writing to logfile on or off
Wrapper for the standard gsi event structure as delivered from mbs.
Implements the gsi mbs lmd file source.
Subevent class for gsi mbs data.
Int_t Data(Int_t i) const
Returns the value at position i in the fiData field.
Simple Event structure containing a fixed size TClonesArray of subevents.
Int_t Fill() override
Method called by the event owner (analysis step) to fill the event element from the set event source.
void PrintEvent() override
Method prints content of the event.
TGo4SimpleSubEvent * GetSubEvent(Short_t procid)
Access to subevent in list by procid.
void Clear(Option_t *opt="") override
Method called by the event owner (analysis step) to clear the event element.