//-------------------------------------------------------------------------- // File and Version Information: // $Id: APPLevel3InputModule.hh,v 1.33 2002/07/29 14:39:41 ksmcf Exp $ // // Description: // Class APPLevel3InputModule. This is an online input module // for the AC++ framework. It coordinates and interfaces farm // control with framework control. In addition it returns the // events/records and state information required by framework. // // Environment: // Software developed for CDF II. // // Author List: // Kevin McFarland // Liz Sexton-Kennedy // //------------------------------------------------------------------------ #ifndef APPLEVEL3INPUTMODULE_HH #define APPLEVEL3INPUTMODULE_HH //---------------------- // Base Class Headers -- //---------------------- #include "FrameMods/APPReaderInputModule.hh" //------------------------------------ // Collaborating Class Declarations -- //------------------------------------ #include "BaBar/Experiment.hh" #include "Framework/AbsParmGeneral.hh" class AbsEvent; #include "Trybos/TRY_Fixed_Size_Types.hh" #include "Trybos/TRY_Ybos_Simple_Record.hh" #ifdef USE_CDFEDM2 #include "Edm/Id.hh" #endif #include "Level3Control/FileLevel3Interface.hh" #include "Level3Control/SevbL3Interface.hh" // Level3Interface currently only supported for Linux (Dave Waters, 20.01.2001) : #ifdef L3LINUX #include "Level3Control/Level3Interface.hh" #endif // __Linux__ #include // --------------------- // -- Class Interface -- // --------------------- class APPLevel3InputModule : public APPReaderInputModule { // The output module must be a friend because communication with the // rest of the farm must be coordinated between these two classes. friend class APPLevel3OnlineOutputModule; //-------------------- // Instance Members -- //-------------------- public: // Constructors APPLevel3InputModule( const char* const theName, const char* const theDescription, const int4 exeTag = -1); // Destructor virtual ~APPLevel3InputModule( ); // Operations // // childBeginJob contains initialization methods // (don't override beginJob which establishes record!!) // virtual AppResult childBeginJob( AbsEvent* aJOB ); // // beginRun and endRun methods // virtual AppResult beginRun( AbsEvent* aRun ); virtual AppResult endRun( AbsEvent* aRun ); // // initIOSystem and terminateIOSystem handle most // communication with Level3 event passing code virtual AppResult initIOSystem( ); virtual AppResult terminateIOSystem( ); // Selectors bool isSilent ( ) const; int debugLevel ( ) const; const char* rcsId( ) const; std::string theFilename( ) const; // must be overridden // functions needed to get inputs for FileLevel3Interface std::string inputfname() const; std::string outputfname() const; int eventnumber() const; bool onlineOperation() const; bool sevbInterface() const; int sevbBufferKey() const; int sevbRtrnKey() const; int sevbSemId() const; int sevbBuffSize() const; Abs_Level3Interface* getInterface (); private: // L3 Input module talk-to data AbsParmGeneral _isSilent; AbsParmGeneral _debugLevel; AbsParmGeneral _inputfile; AbsParmGeneral _outputfile; AbsParmGeneral _num_events; AbsParmGeneral _filetype; AbsParmGeneral _onlineOperation; AbsParmGeneral _sevbInterface; AbsParmGeneral _sevbBufferKey; AbsParmGeneral _sevbRtrnKey; AbsParmGeneral _sevbSemId; AbsParmGeneral _sevbBuffSize; AbsParmGeneral _useErrorEventStream; // EDM1 and EDM2 event record buffers TRY_Ybos_Simple_Record* _theTRYRecord; #ifdef USE_CDFEDM2 EventRecord* _edmEvent; std::list< Id > _inputBankOidList; #endif Abs_Level3Interface* _theInterface; // flag indicating that the end is near! (REPENT!) bool _receivedEndRun; // configuration information from Level3 online system std::string _commandInput; long int _run; // These member functions should only be used by this class // these are the functions that get the event // (nextEvent and _eventLimit override functionality in Reader and CDF I.M.s) AppResult nextEvent( AppStopType& theDispatchStopType ); AppResult mapEventToRecord(); bool _eventLimit() const {return true;} // ignore event limits bool overErrorLimit(int errorCount) const; // ignore errors // utility routines for class void bankList(AbsEvent* anEvent); void hexBufferDump(const char *annotation, const long int *buffer, const long int buffer_size, const long int offset); }; // These are needed for backward compatibility #define L3_SUCCESS 0 #define L3_MSG_FAILURE 5 #define L3_MSG_TRUNCATED 6 #define L3_BUFF_FAILURE 7 #define TXTSIZ (80) #endif