Logo ROOT  
Reference Guide
run_h1analysis.C File Reference

Detailed Description

View in nbviewer Open in SWAN Macro driving the analysis can specify file name and type

.- type == 0 : normal

  • type = 1 : use AClic to compile selector
  • type = 2 : use a fill list and then process the fill list///
//----------------------------------------
void run_h1analysis(int type = 0, const char * h1dir = 0) {
std::cout << "Run h1 analysis " << std::endl;
// create first the chain with all the files
TChain chain("h42");
if (h1dir) {
gSystem->Setenv("H1",h1dir);
}
else
gSystem->Setenv("H1","http://root.cern.ch/files/h1/");
std::cout << "Creating the chain" << std::endl;
chain.SetCacheSize(20*1024*1024);
chain.Add("$H1/dstarmb.root");
chain.Add("$H1/dstarp1a.root");
chain.Add("$H1/dstarp1b.root");
chain.Add("$H1/dstarp2.root");
TString selectionMacro = gSystem->GetDirName(__FILE__) + "/h1analysis.C";
if (type == 0)
chain.Process(selectionMacro);
else if (type == 1) {
// use AClic ( add a + at the end
selectionMacro += "+";
chain.Process(selectionMacro);
}
else if (type == 2) {
chain.Process(selectionMacro,"fillList");
chain.Process(selectionMacro,"useList");
}
}
Author

Definition in file run_h1analysis.C.

TSystem::Setenv
virtual void Setenv(const char *name, const char *value)
Set environment variable.
Definition: TSystem.cxx:1645
TChain::Add
virtual Int_t Add(TChain *chain)
Add all files referenced by the passed chain to this chain.
Definition: TChain.cxx:228
TString
Definition: TString.h:136
TSystem::GetDirName
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
Definition: TSystem.cxx:1030
gSystem
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
TChain
Definition: TChain.h:33
type
int type
Definition: TGX11.cxx:121
TChain::SetCacheSize
virtual Int_t SetCacheSize(Long64_t cacheSize=-1)
Set maximum size of the file cache .
Definition: TChain.cxx:2417
TChain::Process
virtual Long64_t Process(const char *filename, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Process all entries in this chain, calling functions in filename.
Definition: TChain.cxx:2203