//////////////////////////////////////////////////////////////////////// // // Manage the input of a ZDAB dispatch stream. Reads events from a // dispatch stream and provides the information to the analysis part of // RAT. // // Author: Anthony LaTorre - contact person // // REVISION HISTORY: // 2015-05-25 : D. Auty - Added code to allow part runs // //////////////////////////////////////////////////////////////////////// #ifndef __RAT_InDispatchProducer__ #define __RAT_InDispatchProducer__ #include #include #include class G4UIcmdWithAString; class G4UIcommand; namespace RAT { class InDispatchProducer : public Producer { public: // Default Constructor // // Read in parameters from macro, but can't run until SetMainBlock() // is called. InDispatchProducer(); // Normal constructor // // Read in parameters from macro and set ProcBlock so we know what // to do with the data we read. // // block: The block of processors to run on each event. InDispatchProducer(ProcBlock *block); // Reads and processes all of the events from a dispatch stream. // // Runs RAT's main loop by reading ZDAB records and, if // they represent triggers, calling ProcBlock::DSEvent() to // process them. Or, if they represent run headers, it calls // ProcBlock::BeginOfRun() and/or ProcBlock::EndofRun(). Other // records may update the DS without triggering a loop through // the processors, such as TRIG records, whereas others may be // ignored. // // hostname: The hostname to read from. virtual void ReadEvents(const G4String & hostname); // Fails. Don't call this. // // Override G4UImessenger (from Producer) method to Log::Die() // instead of returning an empty string. virtual G4String GetCurrentValue(G4UIcommand * ); // Sneakily runs RAT's main loop. Not called directly. // // Gets a Geant4 /rat/indispatch/read command // and runs ReadEvents() on the file. On any other command, aborts. I // think this is probably an abuse of G4UImessenger::SetNewValue(). // // command: The macro command, like /rat/inzdab/read // newValue: The filename, since command has to be /read virtual void SetNewValue(G4UIcommand * command,G4String newValue); protected: // Initialises // // Learns what the valid commands are, sets help text. void Init(); // Information for /rat/inzdab/read G4UIcmdWithAString *fReadCmd; }; } // namespace RAT #endif