#ifndef __TQNFBase__
#define __TQNFBase__
#include "TString.h"
#include "QFramework/TQNamedTaggable.h"
#include "QFramework/TQMessageStream.h"
class TQSampleDataReader;
class TQSampleFolder;
class TQFolder;
#include <math.h>
#include <limits>
class TQNFChainloader;
class TQNFBase : public TQNamedTaggable {
protected:
TQNFBase();
TQNFBase(const TString& name);
TQSampleDataReader* fReader;
bool fOwnerOfReader;
TQMessageStream messages;
int verbosity;
std::vector<TString> vNFpaths;
TQNFChainloader* chainLoader;
TQFolder * infoFolder;
TQFolder * cutInfoFolder;
bool initialized;
int iterationNumber;
virtual bool initializeSelf() = 0;
virtual bool finalizeSelf() = 0;
public:
virtual ~TQNFBase();
TString getPathTag(const TString& tagname);
void setSampleFolder(TQSampleFolder* sf);
void setReader(TQSampleDataReader* rd);
TQSampleFolder* getSampleFolder();
TQSampleDataReader* getReader();
void setOutputStream(const TString& outfile = "", int verbosity = 2);
void closeOutputStream();
void setVerbosity(int verbosity);
void setInfoFolder(TQFolder* f);
void setCutInfoFolder(TQFolder* f);
virtual bool readConfiguration(TQFolder* f) = 0;
virtual TString getStatusMessage();
virtual int getStatus();
bool initialize();
bool finalize();
virtual int execute(int itrNumber) = 0;
virtual bool success() = 0;
void setChainLoader(TQNFChainloader * loader);
int deployResult(const std::vector<TString>& startAtCutNames, const std::vector<TString>& stopAtCuts = std::vector<TString>());
virtual int deployResult(const std::vector<TString>& startAtCutnames, const std::vector<TString>& stopAtCuts, int overwrite, bool applyToStopCut) = 0;
std::vector<TString> getTargetCuts(const std::vector<TString>& startCuts, const std::vector<TString>& stopCuts, bool applyToStopCut);
void getTargetCutsWorker(TList* targets, TQFolder* startCut, TList* stopCuts = NULL, bool applyToStopCut = true);
const std::vector<TString>& getNFpaths();
void addNFPath(const TString& path, const TString& cutname, const TString& scalescheme = ".default");
void printNFPaths();
ClassDef(TQNFBase, 0);
};
#endif