AliPhysics  63e47e1 (63e47e1)
ChainBuilder.C
Go to the documentation of this file.
1 
11 #ifndef CHAINBUILDER_C
12 #define CHAINBUILDER_C
13 #ifndef __CINT__
14 # include <TUrl.h>
15 # include <TString.h>
16 # include <TChain.h>
17 # include <TChainElement.h>
18 # include <TSystemDirectory.h>
19 # include <TSystem.h>
20 # include <TFile.h>
21 # include <TFileInfo.h>
22 # include <TList.h>
23 # include <TError.h>
24 # include <TROOT.h>
25 # include <TGridCollection.h>
26 # include <TFileCollection.h>
27 # include <THashList.h>
28 # include <TKey.h>
29 # include <TRegexp.h>
30 # include <fstream>
31 #else
32 class TString;
33 class TChain;
34 class TSystemDirectory;
35 class TUrl;
36 class TFileCollection;
37 #endif
38 
39 //====================================================================
41 {
42  Int_t save = 0;
43  SuppressGuard(Int_t lvl=2000)
44  {
45  save = gErrorIgnoreLevel;
46  gErrorIgnoreLevel = lvl;
47  }
49  {
50  gErrorIgnoreLevel = save;
51  }
52 };
53 
54 // ===================================================================
60 struct ChainBuilder
61 {
62  enum {
63  kVerbose = 0x1,
64  kRecursive = 0x2,
65  kMC = 0x4,
66  kCheck = 0x8,
67  kClean = 0x10,
68  kScan = 0x20,
69  kTrRef = 0x40,
70  kRemote = 0x80
71  };
72  enum {
75  kXML,
78  kZip
79  };
80  //------------------------------------------------------------------
81  static UShort_t CheckSource(TString& src, UShort_t flags)
82  {
83  // Local copy
84  TString tmp(src);
85 
86  // --- Normalize the path ----------------------------------------
87  if (tmp == ".") tmp = "";
88  if (!tmp.BeginsWith("/")) tmp.Prepend("../");
89  if (gSystem->ExpandPathName(tmp)) {
90  Error("ChainBuilder::CheckSource",
91  "Failed to expand source %s", src.Data());
92  return kInvalid;
93  }
94 
95  // --- Stat the file ---------------------------------------------
96  FileStat_t stat;
97  if (gSystem->GetPathInfo(tmp, stat)) return kInvalid;
98  src = tmp;
99 
100  // --- Check if directory or file --------------------------------
101  if (R_ISDIR(stat.fMode)) {
102  if (flags & kVerbose)
103  Info("ChainBuilder::CheckSource", "%s is a directory", tmp.Data());
104  return kDirectory;
105  }
106 
107  // --- check file type -------------------------------------------
108  TString type(gSystem->GetFromPipe(Form("file -b -L %s", src.Data())));
109  if ((flags & kVerbose))
110  Info("ChainBuilder::CheckSource", "file -b %s -> %s",
111  tmp.Data(), type.Data());
112  UShort_t ret = kInvalid;
113  if (type.Contains("ROOT")) ret = kROOT;
114  else if (type.Contains("XML")) ret = kXML;
115  else if (type.Contains("ASCII")) ret = kAscii;
116  else if (type.Contains("Zip")) ret = kZip;
117 
118  if (ret == kInvalid) {
119  Error("ChainBuilder::CheckSource",
120  "Do not now how to process %s of type %s",
121  src.Data(), type.Data());
122  }
123  return ret;
124  }
125  //------------------------------------------------------------------
155  static TChain* Create(const TUrl& url)
156  {
157  TString source = url.GetFile();
158  TString treeName = url.GetAnchor();
159  TString pattern = "";
160  UShort_t flags = 0;
161  TString options = url.GetOptions();
162  TObjArray* tokens = options.Tokenize("&");
163  TObjString* token = 0;
164  TIter next(tokens);
165  while ((token = static_cast<TObjString*>(next()))) {
166  const TString& str = token->String();
167  TString lstr(str); lstr.ToLower();
168  if (lstr.EqualTo("mc")) flags |= kMC;
169  else if (lstr.EqualTo("recursive"))flags |= kRecursive;
170  else if (lstr.EqualTo("verbose")) flags |= kVerbose;
171  else if (lstr.EqualTo("check")) flags |= kCheck;
172  else if (lstr.EqualTo("trackref")) flags |= kTrRef;
173  else if (lstr.EqualTo("clean")) flags |= kClean;
174  else if (lstr.EqualTo("scan")) flags |= kScan;
175  else if (lstr.EqualTo("remote")) flags |= kRemote;
176  else if (lstr.BeginsWith("pattern=")) {
177  Int_t eq = str.Index("=");
178  pattern = str(eq+1, str.Length()-eq-1);
179  pattern.ReplaceAll("@", "#");
180  pattern.ReplaceAll(":", "#");
181  }
182  else
183  Warning("", "Option %s unknown", str.Data());
184  }
185  delete tokens;
186 
187  TString tmp(source);
188  UShort_t type = CheckSource(tmp, flags);
189 
190  return Create(type, tmp, treeName, pattern, flags);
191  }
192  //------------------------------------------------------------------
209  static TChain* Create(const TString& src,
210  const TString& treeName,
211  const TString& pattern,
212  Bool_t mc,
213  Bool_t recursive,
214  Bool_t verbose=false,
215  Bool_t checkFiles=false,
216  Bool_t removeFiles=false,
217  Bool_t trackRefs=false,
218  Bool_t remote=false)
219  {
220  UShort_t flags = 0;
221  if (verbose) flags |= kVerbose;
222  if (recursive) flags |= kRecursive;
223  if (mc) flags |= kMC;
224  if (checkFiles) flags |= kCheck;
225  if (removeFiles) flags |= kClean;
226  if (trackRefs) flags |= kTrRef;
227  if (remote) flags |= kRemote;
228 
229  TString tmp(src);
230  UShort_t type = CheckSource(tmp, flags);
231 
232  return Create(type, tmp, treeName, pattern, flags);
233  }
234  //------------------------------------------------------------------
252  static TChain* Create(UShort_t type,
253  const TString& src,
254  const TString& treeName,
255  const TString& pattern,
256  Bool_t mc,
257  Bool_t recursive,
258  Bool_t verbose=false,
259  Bool_t checkFiles=false,
260  Bool_t removeFiles=false,
261  Bool_t trackRefs=false,
262  Bool_t remote=false)
263  {
264  // Info("ChainBuilder::Create",
265  // "src=%s treeName=%s pattern=%s mc=%s recursive=%s",
266  // src.Data(), treeName.Data(), pattern.Data(),
267  // (mc ? "true" : "false"), (recursive ? "true" : "false"));
268  // --- Create flags
269  UShort_t flags = 0;
270  if (verbose) flags |= kVerbose;
271  if (recursive) flags |= kRecursive;
272  if (mc) flags |= kMC;
273  if (checkFiles) flags |= kCheck;
274  if (removeFiles) flags |= kClean;
275  if (trackRefs) flags |= kTrRef;
276  if (remote) flags |= kRemote;
277 
278 
279  return Create(type, src, treeName, pattern, flags);
280  }
281  //------------------------------------------------------------------
293  static TChain* Create(UShort_t type,
294  const TString& src,
295  const TString& treeName,
296  const TString& pattern,
297  UShort_t flags)
298  {
299  // --- check input -----------------------------------------------
300  if (type == kInvalid) {
301  Error("ChainBuilder::Create", "Source %s isn't a file or directory",
302  src.Data());
303  return 0;
304  }
305 
306  TString tN(treeName);
307  if (tN.IsNull())
308  Warning("ChainBuilder::Create", "No tree name specified, assuming T");
309 
310  TString pat(pattern);
311  if (pat.IsNull()) {
312  if (tN.EqualTo("esdTree")) pat = "AliESD*";
313  else if (tN.EqualTo("aodTree")) pat = "AliAOD*";
314  else if (tN.EqualTo("TE")) pat = "galice*";
315  if ((flags & kVerbose)) Info("", "Pattern set to %s", pat.Data());
316  }
317  if ((flags & kVerbose))
318  Info("ChainBuilder::Create", "Type=%s, tree=%s, pattern=%s",
319  (type == kDirectory ? "directory" :
320  type == kXML ? "XML" :
321  type == kAscii ? "ASCII" :
322  type == kROOT ? "ROOT" : "unknown"),
323  tN.Data(), pat.Data());
324 
325  // --- Create output ---------------------------------------------
326  TChain* chain = new TChain(tN);
327 
328  // --- ZIP archives ----------------------------------------------
329  TString anchor;
330  TString tmp(pat);
331  ExtractAnchor(pat, anchor);
332  if ((flags & kVerbose))
333  Info("", "Full pattern: '%s' filename pattern: '%s' anchor: '%s'",
334  tmp.Data(), pat.Data(), anchor.Data());
335 
336  // --- execute based on type
337  Bool_t ret = true;
338  switch (type) {
339  case kROOT: ret = CreateFromFile(chain, src, anchor, flags); break;
340  case kXML: ret = CreateFromXML(chain, src); break;
341  case kAscii: ret = CreateFromList(chain, src); break;
342  case kDirectory: ret = CreateFromDirectory(chain, src,
343  pat, anchor,
344  flags); break;
345  default: ret = false;
346  }
347 
348  // --- Clean-up --------------------------------------------------
349  if (chain->GetListOfFiles()->GetEntries() <= 0) ret = false;
350  if (!ret) {
351  delete chain;
352  chain = 0;
353  }
354  return chain;
355  }
356  //------------------------------------------------------------------
364  static void CreateCollection(const TString& output,
365  const TUrl& url,
366  const char* remote=0)
367  {
368  TChain* chain = Create(url);
369  if (!chain) return;
370 
371  CreateCollection(output, chain, remote);
372  }
373  //------------------------------------------------------------------
381  static void CreateCollection(const TString& output,
382  const TChain* chain,
383  const char* remote=0)
384  {
385  if (!chain) return;
386  TDirectory* savDir = gDirectory;
387  TFile* out = TFile::Open(output, "RECREATE");
388  if (!out) {
389  Error("", "Failed to open %s for output", output.Data());
390  return;
391  }
392  TFileCollection* collection = new TFileCollection(chain->GetName());
393  TObjArray* files = chain->GetListOfFiles();
394  TChainElement* element = 0;
395  TIter next(files);
396 
397 
398  collection->SetDefaultTreeName(chain->GetName());
399  Long64_t nEntries = 0;
400  while ((element = static_cast<TChainElement*>(next()))) {
401  Info("", "Element: '%s' - '%s' %lld",
402  element->GetName(), element->GetTitle(),
403  element->GetEntries());
404  TFileInfo* info = new TFileInfo(element->GetTitle());
405  TFileInfoMeta* meta = new TFileInfoMeta(Form("/%s",element->GetName()),
406  "TTree", element->GetEntries());
407  info->AddMetaData(meta);
408  info->SetBit(TFileInfo::kStaged);
409  // info->AddUrl(Form("file://%s", element->GetTitle()));
410  collection->Add(info);
411 
412  Long64_t n = element->GetEntries();
413  if (n >= 0) nEntries += n;
414 
415  }
416  Remotify(collection, remote);
417  collection->Update();
418  TFileInfoMeta* cMeta = new TFileInfoMeta(chain->GetName(),
419  "TTree", nEntries);
420  collection->AddMetaData(cMeta);
421  out->cd();
422  collection->Write();
423  Printf("A total of %lld entries", nEntries);
424  // collection->Print("MFL");
425  out->Close();
426  savDir->cd();
427  }
428  //------------------------------------------------------------------
435  static void ExtractAnchor(TString& src, TString& anchor)
436  {
437  anchor = "";
438  Int_t idxHash = src.Index("#");
439 
440  if (idxHash == kNPOS) return;
441 
442  TString tmp = src(0,idxHash);
443  anchor = src(idxHash+1, src.Length()-idxHash-1);
444  src = tmp;
445  }
446 
447  //------------------------------------------------------------------
458  static Bool_t CreateFromFile(TChain* chain,
459  const TString& src,
460  const TString& anchor,
461  UShort_t flags=0)
462  {
463  // Info("CreateFromFile", "Making from single file %s", src.Data());
464 
465  if (!CheckFile(src, anchor, chain, flags)) return false;
466  return true;
467  }
468  //------------------------------------------------------------------
474  static Bool_t CreateFromXML(TChain* chain, const TString& src)
475  {
476  // Info("ChainBuilder::CreateFromXML", "Create from XML");
477  Long_t ret = gROOT->ProcessLine(Form("TAlienCollection(\"%s\")",
478  src.Data()));
479  if (!ret) {
480  Error("ChainBuilder::CreateFromXML",
481  "Cannot create AliEn collection from XML file %s", src.Data());
482  return false;
483  }
484 
485  TGridCollection* collection = reinterpret_cast<TGridCollection*>(ret);
486 #if 0
487  if (!collection) {
488  Error("ChainBuilder::CreateFromXML",
489  "Cannot create AliEn collection from XML file %s", src.Data());
490  return false;
491  }
492 #endif
493 
494  collection->Reset();
495  while (collection->Next()) chain->Add(collection->GetTURL(""));
496 
497  return true;
498  }
499  //------------------------------------------------------------------
505  static Bool_t CreateFromList(TChain* chain,
506  const TString& src,
507  UShort_t flags=0)
508  {
509  // Info("ChainBuilder::CreateFromList", "Creating from list");
510  std::ifstream in(src.Data());
511  if (!in) {
512  Error("ChainBuilder::CreateFromList",
513  "Failed to open list %s", src.Data());
514  return false;
515  }
516 
517  while (in.good()) {
518  TString line;
519  line.ReadToDelim(in);
520  TString l(line.Strip(TString::kBoth));
521  if (l.IsWhitespace() || l.BeginsWith("#")) continue;
522 
523  TString anchor;
524  ExtractAnchor(l, anchor);
525  if (!CheckFile(l, anchor, chain, flags))
526  Warning("ChainBuilder::CreateFromList",
527  "Failed to add %s to chain", l.Data());
528  }
529  return true;
530  }
531  //------------------------------------------------------------------
539  const TString& src,
540  const TString& pattern,
541  const TString& anchor,
542  UShort_t flags)
543  {
544  // Info("", "Scanning src=%s, pattern=%s, mc=%d recursive=%d",
545  // src.Data(), pattern.Data(), mc, recursive);
546  // Save current directory
547  TString savdir(gSystem->WorkingDirectory());
548  TSystemDirectory d(gSystem->BaseName(src.Data()), src.Data());
549  if (flags & kVerbose) Info("", "Will scan %s", d.GetTitle());
550  if (!ScanDirectory(chain, &d, pattern, anchor, flags))
551  return false;
552  // Go back to the saved directory
553  gSystem->ChangeDirectory(savdir);
554 
555  return true;
556  }
557  static void RemoveFile(const TString& path)
558  {
559  Info("", "Removing bad file %s", path.Data());
560  SuppressGuard g;
561  // gSystem->Unlink(path);
562  gSystem->Rename(path, Form("%s.bad", path.Data()));
563  }
564  //------------------------------------------------------------------
565  static TFileCollection* Remotify(TFileCollection* fc, const char* remote=0)
566  {
567  if (!remote) return fc;
568 
569  TList* files = fc->GetList();
570  TFileInfo* element = 0;
571  TIter next(files);
572  while ((element = static_cast<TFileInfo*>(next()))) {
573  element->ResetUrl();
574  TUrl* url = 0;
575  TUrl* furl = 0;
576  while ((url = element->NextUrl())) {
577  if (TString(url->GetProtocol()).BeginsWith("root")) {
578  furl = 0;
579  break;
580  }
581  if (TString(url->GetProtocol()).BeginsWith("file") && furl == 0)
582  furl = url;
583  }
584  if (furl) {
585  TUrl* nurl = static_cast<TUrl*>(furl->Clone());
586  nurl->SetProtocol("rootd");
587  nurl->SetHost(remote);
588  element->AddUrl(nurl->GetUrl(), true);
589  }
590  }
591  return fc;
592  }
593 
594  //------------------------------------------------------------------
605  static Bool_t CheckFile(const TString& path,
606  const TString& anchor,
607  TChain* chain,
608  UShort_t flags=0)
609  {
610  if (flags & kVerbose) Info("", "Checking %s", path.Data());
611  TString fn = path;
612  if (!anchor.IsNull()) fn.Append(TString::Format("#%s", anchor.Data()));
613 
614  TFile* test = 0;
615  {
616  SuppressGuard g((flags & kVerbose) ? 0 : 2000);
617  test = TFile::Open(fn, "READ");
618  }
619  if (!test) {
620  Warning("ChainBuilder::CheckFile", "Failed to open %s", fn.Data());
621  if (flags & kClean) RemoveFile(path);
622  return false;
623  }
624 
625  Bool_t ok = false;
626  TObject* o = test->Get(chain->GetName());
627  TTree* t = dynamic_cast<TTree*>(o);
628  TFileCollection* c = dynamic_cast<TFileCollection*>(o);
629  if (t) {
630  test->Close();
631  ok = true;
632  if (flags & kMC) {
633  const char* auxs[] = { "galice", "Kinematics",
634  (flags & kTrRef ? "TrackRefs" : 0),
635  0 };
636  const char** aux = auxs;
637  while ((*aux)) {
638  TString t1;
639  if (anchor.IsNull())
640  t1 = gSystem->ConcatFileName(gSystem->DirName(path.Data()),
641  Form("%s.root", *aux));
642  else
643  t1 = TString::Format("%s#%s.root", path.Data(), *aux);
644  TFile* t2 = 0;
645  {
646  SuppressGuard g2;
647  t2 = TFile::Open(t1, "READ");
648  }
649  if (!t2) {
650  Error("", "Needed MC file %s not found", t1.Data());
651  ok = false;
652  break;
653  }
654  t2->Close();
655  aux++;
656  }
657  }
658  // if (flags & kRemote)
659  // fn.Prepend(Form("root://%s/", gSystem->HostName()));
660  if (ok) chain->Add(fn, kScan ? -1 : TChain::kBigNumber);
661  } else if (c) {
662  // chain->AddFileInfoList(Remotify(c, flags & kRemote)->GetList());
663  chain->AddFileInfoList(c->GetList());
664  ok = true;
665  } else {
666  // Let's try to find a TFileCollection
667  TList* l = test->GetListOfKeys();
668  TIter next(l);
669  TKey* k = 0;
670  while ((k = static_cast<TKey*>(next()))) {
671  TString cl(k->GetClassName());
672  if (!cl.EqualTo("TFileCollection")) continue;
673  c = dynamic_cast<TFileCollection*>(k->ReadObj());
674  if (!c) {
675  Warning("", "Returned collection invalid");
676  continue;
677  }
678  // Info("", "Adding file collection");
679  // chain->AddFileInfoList(Remotify(c, flags&kRemote)->GetList());
680  chain->AddFileInfoList(c->GetList());
681  ok = true;
682  }
683  test->Close();
684  }
685 
686  if (!ok) {
687  Warning("ChainBuilder::CheckFile",
688  "The file %s does not contain the tree %s or a file collection",
689  path.Data(), chain->GetName());
690  if (flags & kClean) RemoveFile(path);
691  }
692  return ok;
693  }
694  //------------------------------------------------------------------
707  static Bool_t ScanDirectory(TChain* chain,
708  TSystemDirectory* dir,
709  const TString& pattern,
710  const TString& anchor,
711  UShort_t flags)
712  {
713  // Assume failure
714  Bool_t ret = false;
715  TRegexp wild(pattern, true);
716 
717  // Get list of files, and go back to old working directory
718  TString oldDir(gSystem->WorkingDirectory());
719  TList* files = dir->GetListOfFiles();
720  if (!gSystem->ChangeDirectory(oldDir)) {
721  Error("ChainBuilder::ScanDirectory", "Failed to go back to %s",
722  oldDir.Data());
723  return false;
724  }
725  if (!files) {
726  Warning("ChainBuilder::ScanDirectory", "No files");
727  return false;
728  }
729 
730  TList toAdd;
731  toAdd.SetOwner();
732 
733  // Sort list of files and check if we should add it
734  files->Sort();
735  TIter next(files);
736  TSystemFile* file = 0;
737  while ((file = static_cast<TSystemFile*>(next()))) {
738  TString name(file->GetName());
739  TString title(file->GetTitle());
740  TString full(gSystem->ConcatFileName(file->GetTitle(), name.Data()));
741  if (file->IsA()->InheritsFrom(TSystemDirectory::Class())) full = title;
742  // Ignore special links
743  if (name == "." || name == "..") {
744  // Info("ChainBuilder::ScanDirectory", "Ignoring %s", name.Data());
745  continue;
746  }
747  if ((flags & kVerbose)) Info("", "Got file %s", full.Data());
748 
749  FileStat_t fs;
750  if (gSystem->GetPathInfo(full.Data(), fs)) {
751  Warning("ChainBuilder::ScanDirectory", "Cannot stat %s (%s)",
752  full.Data(), gSystem->WorkingDirectory());
753  continue;
754  }
755  // Check if this is a directory
756  if (file->IsDirectory(full)) {
757  if ((flags & kVerbose)) Info("", "Recursive scan of %s", full.Data());
758  if ((flags & kRecursive)) {
759  // if (title[0] == '/')
760  TSystemDirectory* d = new TSystemDirectory(file->GetName(),
761  full.Data());
762  if (ScanDirectory(chain, d, pattern, anchor, flags))
763  ret = true;
764  delete d;
765  }
766  continue;
767  }
768 
769  // If this is not a root file, ignore
770  if (!name.EndsWith(".root") && !name.EndsWith(".zip")) {
771  if ((flags & kVerbose))
772  Info("ScanDirectory", "File %s does not end in .root/.zip",
773  name.Data());
774  continue;
775  }
776 
777  // If this file does not contain AliESDs, ignore
778  if (!name.Contains(wild)) {
779  if ((flags & kVerbose))
780  Info("ChainBuilder::ScanDirectory",
781  "%s does not match pattern %s",
782  name.Data(), pattern.Data());
783  continue;
784  }
785 
786  // Add
787  // Info("ChainBuilder::ScanDirectory", "Adding %s", full.Data());
788  toAdd.Add(new TObjString(full));
789  }
790 
791  TIter nextAdd(&toAdd);
792  TObjString* s = 0;
793  Int_t added = 0;
794  while ((s = static_cast<TObjString*>(nextAdd()))) {
795  // Info("ChainBuilder::ScanDirectory",
796  // "Adding %s", s->GetString().Data());
797  TString fn = s->GetString();
798  if (!CheckFile(fn, anchor, chain, flags)) continue;
799 
800  added++;
801  }
802  if (added > 0) ret = true;
803 
804  gSystem->ChangeDirectory(oldDir);
805  return ret;
806  }
807 };
808 #endif
809 //
810 // EOF
811 //
static Bool_t CheckFile(const TString &path, const TString &anchor, TChain *chain, UShort_t flags=0)
Definition: ChainBuilder.C:605
static TFileCollection * Remotify(TFileCollection *fc, const char *remote=0)
Definition: ChainBuilder.C:565
char * kXML
Maximum number of files to analyze.
Definition: ana.C:126
const char * title
Definition: MakeQAPdf.C:27
const char * url
static UShort_t CheckSource(TString &src, UShort_t flags)
Definition: ChainBuilder.C:81
long long Long64_t
Definition: External.C:43
TSystem * gSystem
static TChain * Create(const TString &src, const TString &treeName, const TString &pattern, Bool_t mc, Bool_t recursive, Bool_t verbose=false, Bool_t checkFiles=false, Bool_t removeFiles=false, Bool_t trackRefs=false, Bool_t remote=false)
Definition: ChainBuilder.C:209
TCanvas * c
Definition: TestFitELoss.C:172
static Bool_t CreateFromFile(TChain *chain, const TString &src, const TString &anchor, UShort_t flags=0)
Definition: ChainBuilder.C:458
static TChain * Create(const TUrl &url)
Definition: ChainBuilder.C:155
static void RemoveFile(const TString &path)
Definition: ChainBuilder.C:557
Definition: External.C:92
static Bool_t CreateFromXML(TChain *chain, const TString &src)
Definition: ChainBuilder.C:474
Bool_t kMC
Set some default values, but used values are set in the code!
Definition: ana.C:141
static void CreateCollection(const TString &output, const TChain *chain, const char *remote=0)
Definition: ChainBuilder.C:381
static TChain * Create(UShort_t type, const TString &src, const TString &treeName, const TString &pattern, Bool_t mc, Bool_t recursive, Bool_t verbose=false, Bool_t checkFiles=false, Bool_t removeFiles=false, Bool_t trackRefs=false, Bool_t remote=false)
Definition: ChainBuilder.C:252
int Int_t
Definition: External.C:63
static Bool_t CreateFromDirectory(TChain *chain, const TString &src, const TString &pattern, const TString &anchor, UShort_t flags)
Definition: ChainBuilder.C:538
Bool_t ScanDirectory(TSystemDirectory *dir, TList *list, const char *pattern, bool recursive=false)
Definition: RunFinalQA.C:23
static void ExtractAnchor(TString &src, TString &anchor)
Definition: ChainBuilder.C:435
static void CreateCollection(const TString &output, const TUrl &url, const char *remote=0)
Definition: ChainBuilder.C:364
static Bool_t CreateFromList(TChain *chain, const TString &src, UShort_t flags=0)
Definition: ChainBuilder.C:505
SuppressGuard(Int_t lvl=2000)
Definition: ChainBuilder.C:43
TFile * file
TList with histograms for a given trigger.
static TChain * Create(UShort_t type, const TString &src, const TString &treeName, const TString &pattern, UShort_t flags)
Definition: ChainBuilder.C:293
unsigned short UShort_t
Definition: External.C:28
void test(int runnumber=195345)
bool Bool_t
Definition: External.C:53
TClonesArray * trackRefs
static Bool_t ScanDirectory(TChain *chain, TSystemDirectory *dir, const TString &pattern, const TString &anchor, UShort_t flags)
Definition: ChainBuilder.C:707
TDirectoryFile * dir