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)
std::map< TString, TChain * > fFriendTypeList
FairMCEventHeader * fMCHeader
MC Event header.
std::ifstream fInputFile
input file with runids
FairRuntimeDb * fRtdb
RuntimeDb.
void FillEventHeader(FairEventHeader *feh) override
std::list< TString > fInputLevel
Bool_t fEvtHeaderIsNew
This flag is true if the event header was created in this session otherwise it is false which means t...
static R3BFileSource * Instance()
static instance
Bool_t fEventTimeInMCHeader
This is true if the event time used, came from simulation.
std::list< TString > fFriendFileList
List of all files added with AddFriend.
FairFileHeader * fFileHeader
File Header.
R3BFileSource(const R3BFileSource &)
std::map< TString, std::list< TString > * > fCheckInputBranches
Int_t ReadEvent(UInt_t i=0) override
Double_t fGapTime
Time without particles in beam (gap) (ns)
R3BEventHeader * fEvtHeader
Event Header.
TFolder * fFolderOut
folder structure of output
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
TFile * fRootFile
ROOT file.
void SetEventTimeInterval(Double_t min, Double_t max)
Set the min and max limit for event time in ns.
TString fInputTitle
Title of input source, could be input, background or signal.
TObjArray * fListFolder
list of folders from all input (and friends) files
Int_t CheckMaxEventNo(Int_t EvtEnd=0) override
Check the maximum event number we can run to.
UInt_t fCurrentEntryNo
for internal use, to return the same event time for the same entry
UInt_t fNoOfEntries
No of Entries in this source.
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)
TF1 * fTimeProb
used to generate random numbers for event time;
Double_t fEventTimeMax
max time for one Event (ns)
void AddFile(TString FileName)
Add ROOT file to input, the file will be chained to already added files.
std::list< TString > fInputChainList
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 fCheckFileLayout
True if the file layout should be checked when adding files to a chain.
Int_t fCurrentEntryNr
Current Entry number.
Bool_t ReInitUnpackers() override
std::vector< uint64_t > fTimestamp
static TMCThreadLocal R3BFileSource * fSourceInstance
Double_t fEventTimeMin
min time for one event (ns)
Double_t fEventMeanTime
EventMean time used (P(t)=1/fEventMeanTime*Exp(-t/fEventMeanTime)
TFolder * GetBranchDescriptionFolder()
void SetCheckFileLayout(Bool_t enable)
Allow to disable the testing the file layout when adding files to a chain.
Double_t fEventTime
Time of event since th start (ns)
std::map< TString, std::multimap< TString, TArrayI > > fRunIdInfoAll
void CreateNewFriendChain(TString inputFile, TString inputLevel)
TFolder * fFolderIn
folder structure of input
UInt_t fTimeforEntryNo
for internal use, to return the same event time for the same entry
Source_Type GetSourceType() override
TTree * fInTree
Input Tree.
R3BFileSource operator=(const R3BFileSource &)
void ReadBranchEvent(const char *BrName) override
Read the tree entry on one branch.
void SetFileHeader(FairFileHeader *f)
Int_t GetRunid(uint64_t ts)
GetRunid method to obtain the runid as function of timestamps.
void SetInputFileName(TString tstr)
Double_t fBeamTime
Time of particles in beam (ns)
TChain * fInChain
Input Chain.
Bool_t CompareBranchList(TFile *fileHandle, TString inputLevel)
void SetEventMeanTime(Double_t mean)
Set the mean time for the event in ns.
Bool_t IsInitialized
Initialization flag, true if initialized.
TObjArray * GetListOfFolders()
std::vector< UInt_t > fRunid
const TFile * GetRootFile()