19#ifndef R3BFileSource_H
20#define R3BFileSource_H 1
22#include "FairSource.h"
33class FairMCEventHeader;
42 R3BFileSource(TFile* f,
const char* Title =
"InputRootFile", UInt_t identifier = 0);
43 R3BFileSource(
const TString* RootFileName,
const char* Title =
"InputRootFile", UInt_t identifier = 0);
44 R3BFileSource(
const TString RootFileName,
const char* Title =
"InputRootFile", UInt_t identifier = 0);
53 Bool_t
Init()
override;
55 void Close()
override;
56 void Reset()
override;
104 void SetBeamTime(Double_t beamTime, Double_t gapTime);
114 Bool_t
ActivateObject(TObject** obj,
const char* BrName)
override;
130#if ROOT_VERSION_CODE <= ROOT_VERSION(6, 22, 8)
144 Int_t fCurrentEntryNr;
146 std::list<TString> fFriendFileList;
147 std::list<TString> fInputChainList;
148 std::map<TString, TChain*> fFriendTypeList;
149 std::map<TString, std::list<TString>*> fCheckInputBranches;
150 std::list<TString> fInputLevel;
151 std::map<TString, std::multimap<TString, TArrayI>> fRunIdInfoAll;
157 TObjArray* fListFolder;
159 FairRuntimeDb* fRtdb;
165 UInt_t fSourceIdentifier;
169 Bool_t IsInitialized;
172 FairMCEventHeader* fMCHeader;
178 FairFileHeader* fFileHeader;
181 Bool_t fEventTimeInMCHeader;
186 Bool_t fEvtHeaderIsNew;
189 UInt_t fCurrentEntryNo;
191 UInt_t fTimeforEntryNo;
194 Double_t fEventTimeMin;
196 Double_t fEventTimeMax;
204 Double_t fEventMeanTime;
210 Bool_t fCheckFileLayout;
213 Int_t GetRunid(uint64_t ts);
216 std::ifstream fInputFile;
217 TString fInputFileName;
220 std::vector<UInt_t> fRunid;
221 std::vector<uint64_t> fTimestamp;
222 uint64_t prevts, nextts;
void FillEventHeader(FairEventHeader *feh) override
static R3BFileSource * Instance()
static instance
Int_t ReadEvent(UInt_t i=0) override
void SetBeamTime(Double_t beamTime, Double_t gapTime)
Set the repetition time of the beam when it can interact (beamTime) and when no interaction happen (g...
Bool_t InitUnpackers() override
void SetEventTimeInterval(Double_t min, Double_t max)
Set the min and max limit for event time in ns.
Int_t CheckMaxEventNo(Int_t EvtEnd=0) override
Check the maximum event number we can run to.
R3BFileSource(TFile *f, const char *Title="InputRootFile", UInt_t identifier=0)
Double_t GetDeltaEventTime()
void SetInTree(TTree *tempTree)
Set the input tree when running on PROOF worker.
void AddFriend(TString FileName)
Add a friend file (input) by name)
void AddFile(TString FileName)
Add ROOT file to input, the file will be chained to already added files.
Bool_t ActivateObject(TObject **obj, const char *BrName) override
void SetEvtHeaderNew(Bool_t Status)
Set the status of the EvtHeader.
Bool_t SpecifyRunId()
Read one event from source to find out which RunId to use.
void SetInputFile(TString name)
void SetParUnpackers() override
~R3BFileSource() override
Bool_t ReInitUnpackers() override
TFolder * GetBranchDescriptionFolder()
void SetCheckFileLayout(Bool_t enable)
Allow to disable the testing the file layout when adding files to a chain.
void CreateNewFriendChain(TString inputFile, TString inputLevel)
Source_Type GetSourceType() override
void ReadBranchEvent(const char *BrName) override
Read the tree entry on one branch.
void SetFileHeader(FairFileHeader *f)
void SetInputFileName(TString tstr)
Bool_t CompareBranchList(TFile *fileHandle, TString inputLevel)
void SetEventMeanTime(Double_t mean)
Set the mean time for the event in ns.
TObjArray * GetListOfFolders()
const TFile * GetRootFile()