#ifndef SCANROOT_HH
#define SCANROOT_HH

#include "TNamed.h"
#include "TH1.h"
#include "TH2.h"
#include "TFile.h"
#include "TROOT.h"
#include "TSystem.h"
#include "PelIO.h"
#include "TFile.h"
#include "TDatime.h"
#include "TStopwatch.h"
#include "TSystemDirectory.h"
#include "TClassMenuItem.h"
#include "TClass.h"
#include "log.hh"

#define MAXPARAM 8192

typedef void (*fillHist)(short,float*);
typedef bool (*l2)(short,float*);

class ScanRoot : public TNamed
{
  private:
    PelIO*           mIo;
    TDirectory*      mDir;
    TString          mHistLibrary;
    TString          mL2Library;
    bool             mHistLoaded;
    bool             mL2Loaded;
    bool             mDebug;
    bool             mLog;
    bool             mH1;
    bool             mH2;
    bool             mKeepLast;
    short            mMaxNpar;
    short            mNpar;
    short            mNparLast;
    float            mPar[MAXPARAM];
    float            mParLast[MAXPARAM];

    int              getROOTString(char*,char*);
    void             setPath();
    TObject*         findObject(TDirectory*, char*);
    void             zeroDir(TDirectory*);
    void             saveDir(TFile*, TDirectory*, TDirectory*, bool);
    void             prepareHistograms(TDirectory*);

  public:
                     ScanRoot(bool = false);
                     ScanRoot(TDirectory*);
    virtual          ~ScanRoot();

    void             stat();
    void             init();
    void             finish();

    void             cd()                   { mDir->cd();}
    void             addHist(char*);
    void             saveHist(char*);
    int              loadHist(char*);
    void             unloadHist();
    int              loadL2(char*);
    void             unloadL2();
    void             zero();
    void             zero(char*);
    void             go(int = 0);
    bool             process(short, float*);

    void             debug(bool d = false)  { mDebug = d; mIo->setDebug(d);}
    void             setNPar(int n = 128)   { mMaxNpar = (n<MAXPARAM) ? n : MAXPARAM;}
    void             setLog(bool a = true)  { mLog = a;}
    void             setKeepLastEvent(bool a = true)  { mKeepLast = a;}

    char*            getL2Lib()             { if(mL2Loaded) return (char*)mL2Library.Data(); else return NULL;}
    char*            getHistLib()           { if(mHistLoaded) return (char*)mHistLibrary.Data(); else return NULL;}
    TDirectory*      getDir()               { return mDir;}
    PelIO*           getIO()                { return mIo;}
    int              getNPar()              { return mMaxNpar;}
    bool             getDebug()             { return mDebug;}

    float*           getParCurrent()        { return mPar;}
    float*           getParLast()           { return mParLast;}
    short            getNParCurrent()       { return mNpar;}
    short            getNParLast()          { if(mKeepLast) return mNparLast; else return 0;}

    void             addPar(int p, float v) { if(mIo) mIo->addPar(p,v);}

    fillHist         fillHistograms;
    l2               l2trigger;

  ClassDef(ScanRoot,1)
};
#endif


ROOT page - Class index - Class Hierarchy - 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.