12 #ifndef ROOT_TAlienCollection
13 #define ROOT_TAlienCollection
33 class TFileCollection;
35 class TAlienCollection :
public TGridCollection {
39 TList *fFileGroupList;
40 TIter *fFileGroupListIter;
43 UInt_t fNofGroupfiles;
48 TString fLastOutFileName;
49 TFileStager *fFileStager;
52 TString fCollectionName;
53 TList *fTagFilterList;
55 virtual void ParseXML(UInt_t maxentries);
56 Bool_t ExportXML(TFile * file, Bool_t selected, Bool_t online,
57 const char *name,
const char *comment);
60 TAlienCollection() : fFileGroupList(0), fFileGroupListIter(0), fCurrent(0),
61 fNofGroups(0), fNofGroupfiles(0), fHasSUrls(0), fHasSelection(0),
62 fHasOnline(0), fFileStager(0), fExportUrl(
""), fInfoComment(
""),
63 fCollectionName(
"unnamed"), fTagFilterList(0)
65 TAlienCollection(TList *eventlist, UInt_t ngroups = 0,
66 UInt_t ngroupfiles = 0);
67 TAlienCollection(
const char *localCollectionFile, UInt_t maxentries);
69 virtual ~TAlienCollection();
71 TFileCollection* GetFileCollection(
const char* name =
"",
const char* title =
"")
const;
75 Bool_t Remove(TMap * map);
76 const char *GetTURL(
const char *name =
"") ;
77 const char *GetSURL(
const char *name =
"") ;
78 const char *GetLFN(
const char *name =
"") ;
79 Long64_t GetSize(
const char *name =
"") ;
80 Bool_t IsOnline(
const char *name =
"") ;
81 Bool_t IsSelected(
const char *name =
"") ;
83 void SetTag(
const char *tag,
const char *value, TMap * tagmap);
84 Bool_t SelectFile(
const char *name, Int_t = -1, Int_t = -1);
85 Bool_t DeselectFile(
const char *name, Int_t = -1, Int_t = -1);
86 Bool_t InvertSelection();
87 Bool_t DownscaleSelection(UInt_t scaler = 2);
88 Bool_t ExportXML(
const char *exporturl, Bool_t selected, Bool_t online,
89 const char *name,
const char *comment);
90 const char *GetExportUrl() {
91 if (fExportUrl.Length())
return fExportUrl;
else return 0;
94 Bool_t SetExportUrl(
const char *exporturl = 0);
96 void Print(Option_t * opt)
const;
97 TFile *OpenFile(
const char *filename) ;
99 TEntryList *GetEntryList(
const char *name) ;
101 TList *GetFileGroupList()
const {
return fFileGroupList; }
103 UInt_t GetNofGroups()
const {
return fNofGroups; }
105 UInt_t GetNofGroupfiles()
const {
return fNofGroupfiles; }
107 Bool_t OverlapCollection(TGridCollection *comparator);
108 void Add(TGridCollection *addcollection);
109 void AddFast(TGridCollection *addcollection);
110 Bool_t Stage(Bool_t bulk = kFALSE, Option_t* option =
"");
111 Bool_t Prepare(Bool_t bulk = kFALSE) {
return Stage(bulk,
"option=0"); }
113 Bool_t CheckIfOnline(Bool_t bulk = kFALSE);
114 TDSet *GetDataset(
const char *type,
const char *objname =
"*",
const char *dir =
"/");
116 TGridResult *GetGridResult(
const char *filename =
"",
117 Bool_t onlyonline = kTRUE,
118 Bool_t publicaccess = kFALSE);
120 Bool_t LookupSUrls(Bool_t verbose = kTRUE);
122 TList *GetTagFilterList()
const {
return fTagFilterList; }
124 void SetTagFilterList(TList * filterlist) {
if (fTagFilterList)
125 delete fTagFilterList; fTagFilterList = filterlist;
128 const char* GetCollectionName()
const {
return fCollectionName.Data(); }
129 const char* GetInfoComment()
const {
return fInfoComment.Data(); }
131 static TGridCollection *Open(
const char *collectionurl,
132 UInt_t maxentries = 1000000);
133 static TGridCollection *OpenQuery(TGridResult * queryresult,
134 Bool_t nogrouping = kFALSE);
135 static TAlienCollection *OpenAlienCollection(TGridResult * queryresult,
136 Option_t* option =
"");
138 const char *GetOutputFileName(
const char *infile, Bool_t rename = kTRUE,
const char *suffix=
"root");
140 ClassDef(TAlienCollection, 1)