JSFSteer


class description - source file - inheritance tree

class JSFSteer : public TNamed

    private:
void InitializeMessage() void LoadSharedLibraries() virtual void MakeConfDir() public:
JSFSteer(const char* name = "JSF", const char* title = "The JLC Study Frame") JSFSteer(const JSFSteer&) virtual ~JSFSteer() void AddTree(TTree* t) virtual Bool_t BeginRun(Int_t nrun) static TClass* Class() virtual Bool_t EndRun() JSFEnv* Env() virtual void FillTree() JSFEventBuf* FindEventBuf(TBranch* branch, Option_t* opt) JSFModule* FindModule(const Text_t* classname, Option_t* opt) TBranch* GetBranch() Int_t GetDate() Int_t GetEvent(Int_t nevt) Int_t GetEventNumber() TFile* GetInput() virtual Bool_t GetLastRunInfo(TFile* file, Int_t lastrun = -1) TObjArray* GetListOfTrees() Int_t GetMinorVersion() Int_t GetNevent() TFile* GetOutput() Int_t GetPatchLevel() Int_t GetReturnCode() Int_t GetRunNumber() Int_t GetTime() Int_t GetVersion() Int_t GetVersionDate() virtual Bool_t Initialize() virtual TClass* IsA() const TTree* ITree() Bool_t MakeTree() TList* Modules() TTree* OTree() virtual void PrintInfo() virtual Bool_t Process(Int_t eventnumber = 1) virtual void SetEventNumber(Int_t event = 1) void SetInput(TFile& file) virtual void SetIOFiles() void SetOutput(TFile& file) void SetReturnCode(Int_t ir) virtual void SetRunNumber(Int_t run = 1) Bool_t SetupTree() virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) virtual Bool_t Terminate()

Data Members


    protected:
JSFSteer* fReadin ! Pointer to readin JSF class Bool_t fIsInitialized ! kTRUE when JSF is initialized. Int_t fLastRun ! Last Run number, or =0 when no run is not processed yet. Bool_t fIsTerminated ! kTRUE when JSF is terminated. Bool_t fRunEnded ! kTRUE after EndRun was called. Bool_t fIsGetEvent ! kTRUE when GetEvent is called. TList* fModules ! List of modules TFile* fIFile ! Pointer to input file TFile* fOFile ! Pointer to output file TTree* fITree ! Pointer to input event tree TTree* fOTree ! Pointer to output event tree JSFEnv* fEnv ! Pointer to the env data. TBranch* fBrJSF ! Branch address of JSFSteer. TChain* fChain ! A tree of chained file. TObjArray* fEventTrees ! Collection of event trees. Double_t fCPUTime[30] ! Double_t fRealTime[30] ! Int_t fVersion JSFSteer version number Int_t fVersionDate JSFSteer version date Int_t fRun Run number Int_t fEvent Event number (1 to n ) Int_t fDate Event Date Int_t fTime Event time Int_t fReturnCode ! Return code of JSF Module public:
JSFSteerConf* fConf ! Pointer to module information. static const JSFSteer::EJSFReturnCode kJSFOK static const JSFSteer::EJSFReturnCode kJSFSkipRestModules static const JSFSteer::EJSFReturnCode kJSFNoOutput static const JSFSteer::EJSFReturnCode kJSFEOF static const JSFSteer::EJSFReturnCode kJSFDoEndRun static const JSFSteer::EJSFReturnCode kJSFTerminate static const JSFSteer::EJSFReturnCode kJSFQuit static const JSFSteer::EJSFReturnCode kJSFNotShowDisplay static const JSFSteer::EJSFReturnCode kJSFNotShowHistogram static const JSFSteer::EJSFReturnCode kJSFFALSE

Class Description

  JLC Study Frame

  Main class to control JLC Study

  Three types of jobs are supported in this framework,  a) Bases,
  b)  Read Bases data->Spring->Hadronize->QuickSim, c) read quick sim data.

  Typical macro files are as follows.
  a) Bases

       {
       // An example of Bases.
       // Calculate cross section of e+e- --> gamma* --> f+f-
         gROOT->Reset();
         TFile file("bases.root","RECREATE");  // Output file.
         bases = new LLbarBases();
         bases->SetEcm(300.0);            // Set ECM
         bases->SetParton(1, 2.0/3.0 );   // Set Parton
         bases->DoBases();
         bases->Write();
         file->Write();
       }

     To run in batch mode, do
       jsf -q -b llbar.C
     where llbar.C is the name of the macro file.

   b) Spring->Hadronize->QuickSim

       {
       // An example to run Spring, Hadronizer, and QuickSim.
       // In this example, LLbar event is created.
         gROOT->Reset();
         TFile file("jsf.root","RECREATE");  // Output file

         jsf    = new JSFSteer();
         full   = new JSFLCFULL();
         spring = new LLbarSpring();
         spring->ReadBases("bases.root");
         hdr=new JSFHadronizer();
         sim=new JSFQuickSim();

         Int_t maxevt=10;
         jsf->Initialize();
         jsf->BeginRun(30);                  // Set Run Number
         for(Int_t ev=1;ev<=maxevt;ev++){
           printf(" start event %dn",ev);
           jsf->Process(ev);
           jsf->FillTree();
           jsf->Clear();
         }
         jsf->Terminate();
         file->Write();
       }

    c) Read QuickSim data.

      {
      //  Example to read QuickSim data.
        TFile f("jsf.root","READ");
        jsf = new JSFSteer();
        jsf->Initialize();

        Int_t maxevt=3;

        for(Int_t i=1;i<=maxevt;i++){
          jsf->GetEvent(i);
          if( !jsf->Process(i) ) break ;
          printf(" read Run %d Event %dn",jsf->GetRunNumber(), jsf->GetEventNumber());
        }
        jsf->Terminate();
      }

$Id: JSFSteer.cxx,v 1.29 2003/05/22 01:03:52 miyamoto Exp $
(Update)
  6-Jan-2001  A.Miyamoto Use Root.3.00 IO functions
                         Class JSFSteerConf was modified.



JSFSteer(const char *name, const char *title) : TNamed(name, title)

void LoadSharedLibraries()
 Load shared libraries specified in JSF.SharedLibraries   environment variable.


~JSFSteer()
  Terminate JSF, if fIsTerminated=kFALSE, then delete fModules


Int_t GetMinorVersion()

Int_t GetPatchLevel()

void SetIOFiles()
  Set Flags for file IO, should be called after Input/Output file is assigned.
  This function is from the constructor of JSFSteer.
  If file is opened ( checked by gFile->IsOpen() ), variables fIFile and
  fOFile are set according to the open mode.
  fIFile=gFile, if TFile option is READ, fOFile=gFile, is CREATED,
  and fIFile=fOFile=gFile, if UPDATE.
  After JSFSteer object is created, fIFile and fOFile can be reset by using
  SetInput and SetOutput member function of JSFSteer class.

  JSFModule class has fFile data member.  fFile=fIFile, if the module is
  executed in input mode. fFile=fOFile, if the module is executed output mode.
  If the JSF module object is created in a user macro, it is in output mode.
  If the JSF is executed in read-root-file mode, the JSF module objects are
  created by JSFSteer though it is created explicitly in the user macro.
  This is necessary to store data in a file to memory.  Such objects are
  shown in the job lists with a title "Readin module".  The Readin modules
  are executed in input mode.

  When Initialize/BeginRun/EndRun/Terminate function of user module is
  called, corresponding functions in JSFSteer change directory to
  conf/init, conf/beginNNNNN, conf/endNNNNN, conf/term, respectively.
  If the module is Readin Module, conf directory is in fIfile.
  If not, it is in fOFile.  The process function of JSFSteer class does not
  call process function of the Readin module.

void InitializeMessage()
  Print message after jsf initialization

Bool_t Process(Int_t i)
  Executes JSFModule::Process(Int_t event).
  If not initialized yet, execute Initialize()
  If begin-run is not processed yet, execute beginrun() ( and endrun() if
  necessary.


Bool_t Initialize()
  Initialize JSF environment, namely
  (1) Make/SetTree
      If output file is writable, create conf directory and write
      JSFSteer class.
  (2) Print initial message.
  (3) Calls JSFModule::Initialize()


Bool_t BeginRun(Int_t nrun)
  Calls JSFModule::BeginRun

  If fIFile == NULL, input, nrun, is used for run number.
  If fIFile != NULL, run number is obtained from a file, fIFile.
  If conf directory in fIFile contains more than two run,
  run number of smallest run number is selected.

Bool_t EndRun()
  Calls JSFModule::EndRun


Bool_t GetLastRunInfo(TFile *file, Int_t lastrun)
  Calls JSFModule::GetLastRunInfo(TFile *file, Int_t lastrun)
  Purpose of this function is to read seed of randam number, etc
  from conf/endNNNNN directory.
  If lastrun < 0, last run number in conf/[classname] is used.


Int_t GetEvent(Int_t nevt)
 Readin event data.
 nevt is the number from 1 to n, Note the difference with
 the event number of root, which ranges from 0 to n-1.

Bool_t Terminate()
  Calls JSFModule::Terminate()

void PrintInfo()
     Gives information about versions etc.

Bool_t MakeTree()
 Create trees for output.  Executed only when fOFile is define.
 If fTree is not defined, create Tree in the output file.
 If fTree is already defined, keep fTree, but JSF branch is
 writeen to fOFile when fOFile != fIFile.
 Then calls JSFModule::MakeBranch.

Bool_t SetupTree()
 Setup addresses to read tree data
 Read the Key infile:/conf/JSF and find modules to read tree,
 then execute SetupBranch() method of each modules.

void SetInput(TFile &file)
 Setup addresses to read tree data
 Read the Key infile:/conf/JSF and find modules to read tree,
 then execute SetupBranch() method of each modules.
 for multiple file input

void MakeConfDir()
 Create conf directory at the top of output file.

JSFModule* FindModule(const Text_t *classname, const Char_t *opt)
 Find JSF Module, which is inherited by "classname".

JSFEventBuf* FindEventBuf(TBranch *branch, const Char_t *opt)
 Find JSFEventBuf object defined for branch



Inline Functions


               void SetOutput(TFile& file)
             TFile* GetOutput()
             TFile* GetInput()
               void SetRunNumber(Int_t run = 1)
               void SetEventNumber(Int_t event = 1)
             TTree* ITree()
             TTree* OTree()
               void AddTree(TTree* t)
         TObjArray* GetListOfTrees()
             TList* Modules()
            JSFEnv* Env()
              Int_t GetVersion()
              Int_t GetVersionDate()
              Int_t GetRunNumber()
              Int_t GetEventNumber()
              Int_t GetDate()
              Int_t GetTime()
              Int_t GetNevent()
               void FillTree()
           TBranch* GetBranch()
               void SetReturnCode(Int_t ir)
              Int_t GetReturnCode()
            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void Streamer(TBuffer& b)
               void StreamerNVirtual(TBuffer& b)
           JSFSteer JSFSteer(const JSFSteer&)


Last update: Tue Jan 20 15:53:50 2004


ROOT page - Home page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.