1    	//*-- Author : Valeri Fine (Faine); E-mail: fine@bnl.gov, fine@mail.cern.ch
2    	//*CMZ : 23/03/98
3    	// Copyright (C) FineSoft, Valery Fine at Brookhaven National Laboratory (fine@bnl.gov)
4    	// $Id: St_Module.h,v 1.11 2003/09/07 03:49:07 perev Exp $
5    	// $Log: St_Module.h,v $
6    	// Revision 1.11  2003/09/07 03:49:07  perev
7    	// gcc 3.2 + WarnOff
8    	//
9    	// Revision 1.10  2001/07/16 23:58:35  fine
10   	// suppressing the compilation warning
11   	//
12   	// Revision 1.9  2000/03/26 01:59:23  fine
13   	// new version of St_Module. Works for STAF module only
14   	//
15   	// Revision 1.8  2000/03/24 20:35:22  fine
16   	// adjusted to ROOT 2.24. Doesn't work yet. Under development
17   	//
18   	// Revision 1.7  1999/12/07 22:26:27  fine
19   	// Clean up to remove the compilation warnings
20   	//
21   	// Revision 1.6  1999/07/28 15:36:33  fisyak
22   	// Resolve clash with TSystem for ELogLevel
23   	//
24   	// Revision 1.5  1999/02/24 17:10:57  fine
25   	//  St_Table  New and Purge method have been introdiced, some clean up for St_module as well
26   	//
27   	// Revision 1.4  1998/11/25 21:58:34  fisyak
28   	// Cleanup
29   	//
30   	// Revision 1.3  1998/08/25 23:07:24  didenko
31   	// New base with Tree
32   	//
33   	
34   	//////////////////////////////////////////////////////////////////////////
35   	//                                                                      //
36   	//  St_Module                                                            //
37   	//                                                                      //
38   	//  St_Module is a virtual base class to call the begin_html <A HREF="http://www.rhic.bnl.gov/STAR/html/ssd_l/staf_l/STAF-current/pams/pams.html">PAMS - Physics Analysis Modules</A> end_html
39   	//  modules from C++ programs and begin_html <A HREF="http://root.cern.ch">ROOT</A> end_html batch and interactive environments.
40   	//                                                                      //
41   	//////////////////////////////////////////////////////////////////////////
42   	
43   	
44   	
45   	#ifndef STAFF_St_Module
46   	#define STAFF_St_Module
47   	
48   	
49   	#include "Rtypes.h"
50   	#include "St_table_header_Table.h" 
51   	#include "TObjArray.h"
52   	
53   	// Copyright (C) FineSoft 1998 Valeri Fine (Faine) E-mail: fine@bnl.gov
54   	
55   	/////////////////////////////////////////////////////////////////////
56   	//                                                                 //
57   	//  St_Module                                                      //
58   	//                                                                 //
59   	/////////////////////////////////////////////////////////////////////
60   	
61   	//______________________________________________________________________________
62   	
63   	//*-- Author :    Valery Fine   24/03/98
64   	
65   	//////////////////////////////////////////////////////////////////////////
66   	//                                                                      //
67   	//  St_Module                                                            //
68   	//                                                                      //
69   	//  St_Module is a virtual base class to call the begin_html <A HREF="http://www.rhic.bnl.gov/STAR/html/ssd_l/staf_l/STAF-current/pams/pams.html">PAMS - Physics Analysis Modules</A> end_html
70   	//  modules from C++ programs and begin_html <A HREF="http://root.cern.ch">ROOT</A> end_html batch and interactive environments.
71   	//                                                                      //
72   	//////////////////////////////////////////////////////////////////////////
73   	
74   	#ifdef __CINT__
75   	#pragma Ccomment on
76   	#endif
77   	
78   	class  St_Module {
79   	private:
80   	        TObjArray  *fParams;      // Array of the input tables
81   	        TObjArray  *fHeaders;     // Array of the headers of that tables
82   	        char       *fName;        // Name of the module for the dynamic loading
83   	        Int_t       fIndex;       // The index pof the current element
84   	protected:
85   	                 void ClearParams();
86   	        virtual  void SetParameter(TTable *f);
87   	        virtual  void SetAllParameters(
88   	                             TTable *f1,TTable *f2,TTable *f3,TTable *f4
89   	                            ,TTable *f5,TTable *f6,TTable *f7,TTable *f8
90   	                            ,TTable *f9,TTable *f10,TTable *f11,TTable *f12
91   	                            ,TTable *f13,TTable *f14,TTable *f15,TTable *f16 
92   	                            ,TTable *f17,TTable *f18,TTable *f19,TTable *f20
93   	                            ,TTable *f21,TTable *f22,TTable *f23,TTable *f24
94   	                            ,TTable *f25,TTable *f26,TTable *f27,TTable *f28
95   	                            ,TTable *f29,TTable *f30,TTable *f31,TTable *f32
96   	                            ,TTable *f33,TTable *f34,TTable *f35,TTable *f36
97   	                            ,TTable *f37,TTable *f38
98   	                       );
99   	
100  	public:
101  	
102  	        St_Module();  // Default ctor;
103  	        St_Module(           TTable *f1,  TTable *f2=0, TTable *f3=0, TTable *f4=0
104  	                            ,TTable *f5=0, TTable *f6=0, TTable *f7=0, TTable *f8=0
105  	                            ,TTable *f9=0, TTable *f10=0, TTable *f11=0, TTable *f12=0
106  	                            ,TTable *f13=0, TTable *f14=0, TTable *f15=0, TTable *f16=0
107  	                            ,TTable *f17=0, TTable *f18=0, TTable *f19=0, TTable *f20=0
108  	                            ,TTable *f21=0, TTable *f22=0, TTable *f23=0, TTable *f24=0
109  	                            ,TTable *f25=0, TTable *f26=0, TTable *f27=0, TTable *f28=0
110  	                            ,TTable *f29=0, TTable *f30=0, TTable *f31=0, TTable *f32=0
111  	                            ,TTable *f33=0, TTable *f34=0, TTable *f35=0, TTable *f36=0
112  	                            ,TTable *f37=0, TTable *f38=0
113  	                ); 
114  	
115  	      St_Module(Char_t *name, TTable *f1=0,  TTable *f2=0,  TTable *f3=0,  TTable *f4=0
116  	                             ,TTable *f5=0,  TTable *f6=0,  TTable *f7=0,  TTable *f8=0
117  	                             ,TTable *f9=0,  TTable *f10=0, TTable *f11=0, TTable *f12=0
118  	                             ,TTable *f13=0, TTable *f14=0, TTable *f15=0, TTable *f16=0
119  	                             ,TTable *f17=0, TTable *f18=0, TTable *f19=0, TTable *f20=0
120  	                             ,TTable *f21=0, TTable *f22=0, TTable *f23=0, TTable *f24=0
121  	                             ,TTable *f25=0, TTable *f26=0, TTable *f27=0, TTable *f28=0
122  	                             ,TTable *f29=0, TTable *f30=0, TTable *f31=0, TTable *f32=0
123  	                             ,TTable *f33=0, TTable *f34=0, TTable *f35=0, TTable *f36=0
124  	                             ,TTable *f37=0, TTable *f38=0
125  	               );
126  	
127  	
128  	  virtual      ~St_Module(); 
129  	
130  	  //  virtual void  Call(){Int_t i=ExecuteModule();}
131  	  virtual void  Call(){ExecuteModule();}
132  	  virtual Int_t CheckParameters(const Char_t *names[]=0);
133  	  virtual Int_t CheckResults(Int_t res, const Char_t *names[]=0);
134  	  virtual Int_t ExecuteModule();
135  	
136  	  table_head_st *GetHeader(Int_t i) const {return ((St_table_header *)fHeaders->At(i))->GetTable();}
137  	  TTable *GetTable(Int_t i) const {return (TTable *)fParams->At(i);}
138  	  void *GetStruct(Int_t i) const {return ((TTable *)fParams->At(i))->GetArray();}
139  	
140  	//VP  virtual Int_t  operator()() { return ExecuteModule(); }
141  	          Int_t  InvokeModule(TTable *f1,    TTable *f2=0,  TTable *f3=0,  TTable *f4=0
142  	                              ,TTable *f5=0,  TTable *f6=0,  TTable *f7=0,  TTable *f8=0
143  	                              ,TTable *f9=0,  TTable *f10=0, TTable *f11=0, TTable *f12=0
144  	                              ,TTable *f13=0, TTable *f14=0, TTable *f15=0, TTable *f16=0
145  	                              ,TTable *f17=0, TTable *f18=0, TTable *f19=0, TTable *f20=0
146  	                              ,TTable *f21=0, TTable *f22=0, TTable *f23=0, TTable *f24=0
147  	                              ,TTable *f25=0, TTable *f26=0, TTable *f27=0, TTable *f28=0
148  	                              ,TTable *f29=0, TTable *f30=0, TTable *f31=0, TTable *f32=0
149  	                              ,TTable *f33=0, TTable *f34=0, TTable *f35=0, TTable *f36=0
150  	                              ,TTable *f37=0, TTable *f38=0
151  	                              );
152  	
153  	         virtual const Char_t *GetTitle(){ return "title";}
154  	         virtual const Char_t *GetName() { return "virtual St_Module";}
155  	
156  	  ClassDef(St_Module,0)
157  	};
158  	#endif
159