00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TGo4SimpleEventProcessor.h"
00017
00018 #include <iostream.h>
00019
00020 #include "TGo4SimpleEvent.h"
00021 #include "Go4EventServer/Go4EventServer.h"
00022
00023
00024 TGo4SimpleEventProcessor::TGo4SimpleEventProcessor()
00025 :TGo4EventProcessor("Go4 Standard SimpleEvent Processor")
00026 {
00027 TRACE((14,"TGo4SimpleEventProcessor::TGo4SimpleEventProcessor(Int_t)",__LINE__, __FILE__));
00028
00029 }
00030
00031 TGo4SimpleEventProcessor::~TGo4SimpleEventProcessor()
00032 {
00033 TRACE((14,"TGo4SimpleEventProcessor::TGo4SimpleEventProcessor(Int_t)",__LINE__, __FILE__));
00034
00035 }
00036
00037 void TGo4SimpleEventProcessor::BuildSimpleEvent(TGo4SimpleEvent* target)
00038 {
00039 TRACE((11,"TGo4SimpleEventProcessor::TGo4SimpleEventProcessor(Int_t)",__LINE__, __FILE__));
00040 TGo4MbsEvent* input= (TGo4MbsEvent* ) GetInputEvent();
00041 TGo4MbsSubEvent* insub;
00042 TGo4SimpleSubEvent* outsubix;
00043 TGo4SimpleSubEvent* outsub;
00044 if(input)
00045 {
00046 Short_t procid;
00047 input->ResetIterator();
00048 while ( (insub= input->NextSubEvent() ) !=0 )
00049 {
00050
00051 procid=insub->GetProcid();
00052 outsubix=target->GetSubEvent(procid);
00053 if (outsubix!=0)
00054 {
00055 outsub=outsubix;
00056 }
00057 else
00058 {
00059
00060 outsub=target->AddSubEvent(procid);
00061 if (outsub==0)
00062 {
00063 cout << "simple event processor: error adding subevent"<< endl;
00064 return;
00065 }
00066 else { }
00067
00068 }
00069
00070
00071 outsub->Clear();
00072 Int_t fieldsize= (insub->GetDlen() -2) * sizeof(Short_t)/sizeof(Int_t);
00073 outsub->fiFieldLen=fieldsize;
00074 void* sourcefield = (void*) (insub->GetDataField());
00075 void* destfield = (void*) &(outsub->fiD0);
00076 memcpy(destfield,
00077 sourcefield,
00078 fieldsize*sizeof(Int_t));
00079
00080 }
00081 target->fiCount= input->GetCount();
00082
00083
00084 }
00085 else
00086 {
00087 cout << "Simple Event Processor: no input event !"<< endl;
00088 }
00089
00090 }
00091
00092
00093
00094 ClassImp(TGo4SimpleEventProcessor)
00095
00096
00097
00098
00099