GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4CompositeProcessor.cxx
Go to the documentation of this file.
1// $Id$
2//-----------------------------------------------------------------------
3// The GSI Online Offline Object Oriented (Go4) Project
4// Experiment Data Processing at EE department, GSI
5//-----------------------------------------------------------------------
6// Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7// Planckstr. 1, 64291 Darmstadt, Germany
8// Contact: http://go4.gsi.de
9//-----------------------------------------------------------------------
10// This software can be used under the license agreements as stated
11// in Go4License.txt file which is part of the distribution.
12//-----------------------------------------------------------------------
13
15
16#include "TGo4MbsEvent.h"
17
25
26
34
39
41{
42 if (proc) fSubProcessors.AddLast(proc);
43}
44
46{
47 // std::cout << "Dummy, should be reimplemented " << std::endl;
48 // but must not if this is the top beamtime event JAM
49}
50
51
53{
54 // if there is no container event as output, subclass may run in standalone mode
55 InitEvent(outevnt); // for plain subclass mode
56
57 // first need to call SetEvent of all subprocessors to set the input/output structures:
58
59 for (Int_t n = 0; n <= fSubProcessors.GetLast(); n++) {
61 proc->SetInputEvent(GetInputEvent()); //forward input to subprocessors
62 proc->InitEvent(outevnt); // subprocessors may set own eventpointers here
63 } // while
64
65 // treat mbs input if we are in the first step:
66 fMbsInput = dynamic_cast<TGo4MbsEvent *>(GetInputEvent());
67
68// printf("TGo4CompositeProcessor::BuildEvent this = %p name = %s evnt = %p \n", this, GetName(), fMbsInput);
69
70 if(fMbsInput)
71 {
72// if(fMbsInput->GetTrigger() > 11) {
73// std::cout << "**** TGo4CompositeProcessor: Skip trigger event"<< std::endl;
74// return kFALSE;
76
77 fMbsTriggerNumber = fMbsInput->GetTrigger();
78 fMbsEventNumber = fMbsInput->GetCount();
79
80 fMbsInput->ResetIterator();
81 while(auto psubevt = fMbsInput->NextSubEvent()) {
82 // loop over subevents
83 ProcessSubevent(psubevt); // process in our own subclass, if implemented
84
85 for (Int_t n = 0; n <= fSubProcessors.GetLast(); n++) {
86
88
89 if (subcomp) {
92 subcomp->ProcessSubevent(psubevt); // actions implemented in component subclass
93 }
94 } // while proc
95 } // whilesubevents
96 } // mbs input
97
98
99 // in any case, call finalize processing in all subclasses/components:
100 // this is the way to implement actions in second step processors
101 // for first step processors, this can be used to do actions after all subevents are done
102 FinalizeEvent(); // process in our own subclass, if implemented
103
104 for (Int_t n = 0; n <= fSubProcessors.GetLast(); n++) {
106 proc->FinalizeEvent(); // actions implemented in component subclass
107 }
108
109 return kTRUE;
110}
111
void FinalizeEvent() override
implemented by subclass to do actual processing.
virtual void ProcessSubevent(TGo4MbsSubEvent *subevt)
Bool_t BuildEvent(TGo4EventElement *) override
Fill the destination event dest.
void InitEvent(TGo4EventElement *) override
implemented by subclass to assign correct event structures
void AddSubProcessor(TGo4EventProcessor *)
virtual void InitEvent(TGo4EventElement *)
implemented by subclass to assign correct event structures
void SetInputEvent(TGo4EventElement *raw)
Sets reference to external raw event which is used by the concrete processor to unpack the interestin...
TGo4EventProcessor(const char *name)
virtual void FinalizeEvent()
implemented by subclass to do actual processing.
TGo4EventElement * GetInputEvent()
Access to external raw event which is set as association member.
friend class TGo4EventElement
Wrapper for the standard gsi event structure as delivered from mbs.
Subevent class for gsi mbs data.