00001 // $Id: RecoControl.h,v 1.4 2002/06/13 15:59:54 rhatcher Exp $ 00002 // 00003 // Define Class RecoControl -- implement basic MINOS Reco control, 00004 // for the C++ environment. Adapted from GLAST version G. Irwin 10/96. 00005 // 00006 #ifndef RECOCONTROL_H 00007 #define RECOCONTROL_H 00008 00009 #include <fstream> 00010 #include <stdio.h> 00011 #include <iostream> 00012 #include <string.h> 00013 00014 #include "REROOT_Classes/REROOT_Event.h" 00015 #include "REROOT_Classes/REROOT_GAFKey.h" 00016 #include "REROOT_Classes/REROOT_Geom.h" 00017 #include "REROOT_Classes/ADAMO_Shell.h" 00018 #include "REROOT_Classes/REROOT_Visitor.h" 00019 00020 class RecoControl 00021 { 00022 00023 public: 00024 // most recent record type 00025 enum rectype {NONE, GEOM, GEVT}; 00026 00027 // Constructor and initialization 00028 RecoControl(); 00029 void init(const char*, int); 00030 00031 // Destructor 00032 virtual ~RecoControl(); 00033 00034 // event loop commands 00035 void clear(); 00036 rectype nextRecord(); // read from file or simulate 00037 void reconstruction(); // reconstruct last event 00038 00039 // files 00040 void setOutputFile(const char*); 00041 void setInputFile(const char*); 00042 void setDstFile(const char*); 00043 void closeAll(); 00044 00045 int eof(); // check for eof on read 00046 const char* eventTitle(); // make up and return a title 00047 00048 // printout the various things 00049 void setPrintStream(ostream* o) {pstream = o;} 00050 void printEvent(); 00051 virtual void giveEventTo(REROOT_Visitor&); 00052 virtual void giveGeomTo(REROOT_Visitor&); 00053 00054 // access methods 00055 REROOT_Event* curevent() {return _curevent;} 00056 REROOT_Geom* curgeom() {return _curgeom;} 00057 00058 private: 00059 00060 const char* _iniFile; // name of the initial file used 00061 const char* _inputFileName; // name of input data file 00062 int _nevtot; // number of events to process 00063 long _record; // record count in data file 00064 00065 // Pointers to latest Record objects of each type. 00066 REROOT_Event* _curevent; 00067 REROOT_Geom* _curgeom; 00068 00069 // Pointer to ADAMO_Shell object for executing ADAMO commands. 00070 ADAMO_Shell* _ads; 00071 00072 // Event I/O files (null means no input or output) 00073 istream* _inputStream; 00074 ostream* _outputStream; 00075 ostream* _tupleFile; // write Tuple if defined 00076 ostream* pstream; // for printing 00077 }; 00078 00079 #endif // RECOCONTROL_H
1.3.9.1