FairRoot/PandaRoot
Functions
testFile.C File Reference

Go to the source code of this file.

Functions

int testFile (TString nome, TString type)
 

Function Documentation

int testFile ( TString  nome,
TString  type 
)

Definition at line 1 of file testFile.C.

References exit(), f, PndFileNameCreator::GetCustomFileName(), PndFileNameCreator::GetRecoFileName(), PndFileNameCreator::GetSimFileName(), namecreator, rootlogon(), t, and TString.

Referenced by eventdisplay(), eventDisplay(), eventDisplay_llbar(), and mcMatch().

1  {
2 
3  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
4  rootlogon();
5 
6  PndFileNameCreator namecreator(nome.Data());
7 
8  if (type = "sim")
9  {
10  TString nome_test = namecreator.GetSimFileName();
11  }
12  else
13  {
14  if (type = "digi")
15  {
16  TString nome_test = namecreator.GetRecoFileName();
17  }
18  else
19  if (type = "pid")
20  {
21  TString nome_test = namecreator.GetCustomFileName("pidtracks");
22  }
23  else
24  {
25  cout << "-------------------------" << endl;
26  cout << "WRONG TYPE SELECTION!!!!!" << endl;
27  cout << "-------------------------" << endl;
28  }
29 
30  }
31 
32  TFile *f = new TFile(nome_test.Data(),"READ");
33 
34  TTree *t = (TTree*) f->Get("pndsim");
35 
36  t->Dump();
37 
38  exit(0);
39 
40 
41  return 0;
42 }
exit(0)
std::string GetSimFileName(std::string addon="", bool cut=false)
std::string GetRecoFileName(std::string addon="", bool cut=false)
A simple class which adds the corresponding file extensions to a given base class.
std::string GetCustomFileName(std::string ext, std::string addon="", bool cut=false)
TFile * f
Definition: bump_analys.C:12
PndFileNameCreator namecreator("../data/Lars/MvdDtsSim.root")
TTree * t
Definition: bump_analys.C:13