//////////////////////////////////////////////////////////////////////// // // Manage the input of Rootfile coming from data acquisition or // simulation. Takes an root file with a "T" tree inside and provide // the information to the analysis part of Rat. The Tree can have been // generated by the data acquisition system or by Rat as a simulation. // // Author: Stan Seibert(?) // P G Jones - contact person // // REVISION HISTORY: // ? : S. Seibert - First version // 2014-04-26 : P. Jones - Refactor run knowledge. // 2015-05-25 : D. Auty - Added code to allow part runs // //////////////////////////////////////////////////////////////////// #ifndef __RAT_InROOTProducer__ #define __RAT_InROOTProducer__ #include #include #include class G4UIcmdWithAString; class G4UIcommand; namespace RAT { namespace DS { class Run; } class InROOTProducer : public Producer { public: // Construct, set the ProcBlock to NULL InROOTProducer(); // Construct with a ProcBlock // // block: block to use InROOTProducer( ProcBlock* block ); // Override the G4UImessenger (from Producer) set method // // command: command to set // newValue: new value to set void SetNewValue( G4UIcommand* command, G4String newValue ); // Override the G4UImessenger (from Producer) get method // // command: command to query // Returns the command value G4String GetCurrentValue( G4UIcommand* command ); // Called whenever the run changes // // run: run to begin/initialise void BeginOfRun( DS::Run& run ); protected: // Load the file into the TChains // // fileName: file to load and read void LoadFile( const std::string& fileName ); // Read the events from the TChains void ReadEntries(); // Initialise the producer void Init(); TChain fDSTree; // The DS::Entry TTree TChain fRunTree; // The DS::Run TTree G4UIcmdWithAString* fLoadCmd; // Command to load a defined file G4UIcommand* fLoadDefaultCmd; // Command to load a file G4UIcommand* fReadCmd; // Command to Start reading }; } // namespace RAT #endif