//////////////////////////////////// // KRATTA DST reader // for the Asy-Eos experiment // TKratDstReader DECLARATION // Feb 2013 // revison 02/2013 // E.d.F ver 1.0 // sebastian.kupny@uj.edu.pl // Changes: //////////////////////////////////// #ifndef KRATTA_DST_READER_H #define KRATTA_DST_READER_H #include // std::cout #include // std::ifstream #include #include #include #include "TClonesArray.h" #include "TF1.h" #include "TFumili.h" #include "TGraph.h" #include "TH1D.h" #include "TLine.h" #include "TMarker.h" #include "TMath.h" #include "TGeoManager.h" #include "FairRootManager.h" #include "FairRunAna.h" #include "FairRuntimeDb.h" #include "FairTask.h" #include "mktreeraw.h" #include "mktreedstchain_sct_fitABC.h" #include #include #include #include class TKratDstProgressBar : public TNamed { private: int fLen; Long64_t fMax; char *fMeter; time_t fStart; int fUpdateFrequency; public: TKratDstProgressBar( int max, int len=20); int GetUpdateFrequency(void){ return fUpdateFrequency; }; void SetUpdateFrequency( unsigned int newUpdateFrequency ){ fUpdateFrequency = newUpdateFrequency;}; void Reset( int max ); bool UpdateAndWrite(int iev); ClassDef(TKratDstProgressBar,1); }; class TKratDstReader : public FairTask { public: /** Default constructor **/ //TKratDstReader(); /** Constructor **/ TKratDstReader (const char* name, TString runlist, Int_t iVerbose = 1); //TKratDstReader(Int_t verbose); /** Destructor **/ ~TKratDstReader(); /** Virtual method Init **/ virtual InitStatus Init(); /** Virtual method Exec **/ virtual void Exec(Option_t* opt); virtual void Finish(); virtual void Reset(); void SetVerboseLevel( Int_t verbose ) { fVerbose = verbose; } Int_t GetVerboseLevel( void ) { return fVerbose; } /** KRATTA_IN **/ void SetKratContInName( TString ASYEventFromFileName ){ fASYEventFromFileName = ASYEventFromFileName; } TString GetKratContInName( void ) const { return fASYEventFromFileName; } /** KRATTA_OUT **/ void SetKratContOutName( TString ASYEventCopyName ){ fASYEventCopyName = ASYEventCopyName; } TString GetKratContOutName( void ) const { return fASYEventCopyName; } /** DOES WRITE OUTPUT DATA CONTAINER TO THE FILE **/ void SaveOutputIntoTree(Bool_t saveOutputToTree = kTRUE){ fSaveOutputToTree = saveOutputToTree; } Bool_t DoesSaveOutputIntoTree( void ){ return fSaveOutputToTree; } Long64_t GetNumberOfEventsInInputFiles(); protected: Long64_t LoadFilesFromRunlist(); Long64_t fNumberOfEventsInAllFiles; Long64_t fNumberOfEventsInAnalysedFiles; /// For progress bar only. TString fRunlist; Int_t fNFiles; Int_t fCurrentFileNumberOnTheList; TString fInputDstFileName; std::vector fListOfInputFiles; TFile *fInputDstFile; TString fFileMainTreeName; TTree *fFileMainTree; Int_t fNEventsInTree; Int_t fEntryIndex; TString fKrattaAsyPeakClonesArrayName; ASYEvent *fASYEventFromFile; TString fASYEventFromFileName; TClonesArray *fASYEventCopy; TString fASYEventCopyName; TKratDstProgressBar * fProgressBar; /// Returns true if file exist, false otherwise bool CheckIfFileExist( const char * filename ); void GetNextDstFile(); private: TKratDstReader(const TKratDstReader&); TKratDstReader& operator=(const TKratDstReader&){ return *this; } Bool_t fSaveOutputToTree; virtual void SetParContainers(); ClassDef(TKratDstReader,1); }; #endif ///KRATTA_DST_READER_H