GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TMeshProviderProc.cxx
Go to the documentation of this file.
1 // $Id: TMeshProviderProc.cxx 2627 2019-10-01 08:02:45Z linev $
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 
14 #include "TMeshProviderProc.h"
15 
16 #include "TGo4Log.h"
17 #include "TGo4Analysis.h"
18 #include "TGo4EventElement.h"
19 #include "TGo4UserException.h"
20 
21 //***********************************************************
22 // this one is used in TXXXAnlFact
24  :TGo4EventProcessor(name)
25 {
26  TGo4Log::Info("TMeshProviderProc: Create %s", name);
27 }
28 //***********************************************************
30  : TGo4EventProcessor("ProviderProcessor")
31 {
32 }
33 //***********************************************************
35 {
36 }
37 //***********************************************************
38 
39 //-----------------------------------------------------------
41 {
43 if(myinput==0 ||
44  (myinput!=0 && myinput->CheckEventSource("TGo4EventProcessor")))
45  {
46  // source of our input event is processor and not file:
47  // we have to reset the pointer from framework!
48  // the trick is: name of this processor (up to the "_") is name of required event
49  // note that TGo4StepFactory forbids to use same name for different objects,
50  // since object name is used as pointer name in the processline call
51  TString eventname=GetName();
52  eventname.Resize(eventname.Index("_",1)); //
53  //std::cout <<"SetRealInput of"<<GetName()<<" sees eventname "<<eventname.Data() << std::endl;
54  myinput=TGo4Analysis::Instance()->GetEventStructure(eventname.Data());
55  if(myinput==0)
56  throw TGo4UserException(3,"Error setting real input event %s", GetName());
57  else
58  SetInputEvent(myinput);
59  }
60 //else if(myinput!=0 && myinput->CheckEventSource("TGo4FileSource"))
61 // {
62 // // this provider reads from file. ok
63 //
64 // }
65 //else
66 // {
67 // // neither processor or file input: something is very wrong
68 // throw TGo4UserException(3,"No source found for provider %s", GetName());
69 // }
70 // we skip the last checks for performance reasons...
71 
72 }
Bool_t CheckEventSource(const char *classname)
TGo4EventElement * GetEventStructure(const char *name)
void SetInputEvent(TGo4EventElement *raw)
TGo4EventElement * GetInputEvent()
static TGo4Analysis * Instance()
static void Info(const char *text,...)
Definition: TGo4Log.cxx:287