EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairFileHeader.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairFileHeader.cxx
1 // -------------------------------------------------------------------------
2 // ----- FairFileHeader source file -----
3 // ----- Created 20/04/11 M.Al-Turany -----
4 // -------------------------------------------------------------------------
5 
6 
7 #include "FairFileHeader.h"
8 #include "FairRootManager.h"
9 #include "FairFileInfo.h"
10 
11 
12 // ----- Default constructor -------------------------------------------
14  :TNamed(),
15  fRunId(0),
16  fTaskList(new TList()),
17  fFileList(new TList())
18 {
19 
20 }
21 // -------------------------------------------------------------------------
22 void FairFileHeader::AddTaskClassName(TString taskname)
23 {
24  fTaskList->AddLast(new TObjString(taskname));
25 }
26 // -------------------------------------------------------------------------
27 void FairFileHeader::AddInputFile(TFile* f, UInt_t id, UInt_t ChId)
28 {
29  fFileList->AddLast(new FairFileInfo(f,id, ChId));
30 }
31 // -------------------------------------------------------------------------
32 FairFileInfo* FairFileHeader::GetFileInfo(UInt_t id, UInt_t ChId)
33 {
34  TIterator* Iter=fFileList->MakeIterator();
35  Iter->Reset();
36  TObject* obj=0;
37  FairFileInfo* info=0;
38  while((obj=Iter->Next())) {
39  info=dynamic_cast <FairFileInfo*> (obj);
40  if(info->GetIdentifier() == id && info->GetOrderInChain()==ChId) {return info;}
41  }
42  return 0;
43 
44 }
45 // ----- Destructor ----------------------------------------------------
47 {
48 }
49 // -------------------------------------------------------------------------
50 
51