397 |
* If no options are specified, the default is assumed. Default is: |
* If no options are specified, the default is assumed. Default is: |
398 |
* +TRK2+CAL2+CAL1+TOF+TRG+ND+AC+S4+ORB |
* +TRK2+CAL2+CAL1+TOF+TRG+ND+AC+S4+ORB |
399 |
*/ |
*/ |
400 |
PamLevel2::PamLevel2(TString ddir,TString list,TString detlist){ |
PamLevel2::PamLevel2(TString ddir,TString llist,TString detlist){ |
401 |
Initialize(); |
Initialize(); |
402 |
TList* listf = GetListOfLevel2Files(ddir,list); |
TList* listf = GetListOfLevel2Files(ddir,llist); |
403 |
GetPamTree(listf,detlist); |
if(listf)GetPamTree(listf,detlist); |
404 |
GetRunTree(listf); |
if(listf)GetRunTree(listf); |
405 |
}; |
}; |
406 |
|
|
407 |
PamLevel2::PamLevel2(TString ddir,TList *list,TString detlist){ |
PamLevel2::PamLevel2(TString ddir,TList *llist,TString detlist){ |
408 |
Initialize(); |
Initialize(); |
409 |
GetPamTree(list,detlist); |
GetPamTree(llist,detlist); |
410 |
GetRunTree(list); |
GetRunTree(llist); |
411 |
}; |
}; |
412 |
/** |
/** |
413 |
* Constructor |
* Constructor |
416 |
* Default trees/branches are loaded. Default is: |
* Default trees/branches are loaded. Default is: |
417 |
* +TRK2+CAL2+CAL1+TOF+TRG+ND+AC+S4+ORB |
* +TRK2+CAL2+CAL1+TOF+TRG+ND+AC+S4+ORB |
418 |
*/ |
*/ |
419 |
PamLevel2::PamLevel2(TString ddir,TString list){ |
PamLevel2::PamLevel2(TString ddir,TString llist){ |
420 |
Initialize(); |
Initialize(); |
421 |
TList* listf = GetListOfLevel2Files(ddir,list); |
TList* listf = GetListOfLevel2Files(ddir,llist); |
422 |
GetPamTree(listf,""); |
GetPamTree(listf,""); |
423 |
GetRunTree(listf); |
GetRunTree(listf); |
424 |
}; |
}; |
1867 |
TList* PamLevel2::GetListOfLevel2Files(TString ddir, TString flisttxt = ""){ |
TList* PamLevel2::GetListOfLevel2Files(TString ddir, TString flisttxt = ""){ |
1868 |
|
|
1869 |
TString wdir = gSystem->WorkingDirectory(); |
TString wdir = gSystem->WorkingDirectory(); |
1870 |
|
// cout << "Working directory: "<<wdir<<endl; |
1871 |
|
|
1872 |
// if(ddir=="")ddir = wdir; |
// if(ddir=="")ddir = wdir; |
1873 |
// TSystemDirectory *datadir = new TSystemDirectory(gSystem->BaseName(ddir),ddir); |
// TSystemDirectory *datadir = new TSystemDirectory(gSystem->BaseName(ddir),ddir); |
1874 |
if ( ddir != ""){ |
if ( ddir != ""){ |
1893 |
// flisttxt = fullpath; |
// flisttxt = fullpath; |
1894 |
if ( !flisttxt.EndsWith(".root") ){ |
if ( !flisttxt.EndsWith(".root") ){ |
1895 |
|
|
1896 |
flisttxt = gSystem->ConcatFileName(gSystem->DirName(flisttxt),gSystem->BaseName(flisttxt)); |
TString dir = gSystem->DirName(flisttxt); |
1897 |
|
// cout << " List directory "<<dir<<endl; |
1898 |
|
if(dir == "." || dir == "") |
1899 |
|
flisttxt = gSystem->ConcatFileName(wdir.Data(),gSystem->BaseName(flisttxt)); |
1900 |
|
// flisttxt = gSystem->ConcatFileName(gSystem->DirName(flisttxt),gSystem->BaseName(flisttxt)); |
1901 |
|
|
1902 |
if( !gSystem->ChangeDirectory(ddir) ){ |
if( !gSystem->ChangeDirectory(ddir) ){ |
1903 |
cout << "Cannot change directory : "<<ddir<<endl; |
cout << "Cannot change directory : "<<ddir<<endl; |
1908 |
ifstream in; |
ifstream in; |
1909 |
in.open(flisttxt, ios::in); //open input file list |
in.open(flisttxt, ios::in); //open input file list |
1910 |
if(!in.good()){ |
if(!in.good()){ |
1911 |
cout <<" ERROR opening the file "<<endl; |
cout <<" TList* PamLevel2::GetListOfLevel2Files(TString, TString) --> ERROR opening the file "<<endl; |
1912 |
gSystem->ChangeDirectory(wdir); // back to the working directory |
gSystem->ChangeDirectory(wdir); // back to the working directory |
1913 |
return 0; |
return 0; |
1914 |
} |
} |
1962 |
|
|
1963 |
TSystemDirectory *datadir = new TSystemDirectory(gSystem->BaseName(ddir),ddir); |
TSystemDirectory *datadir = new TSystemDirectory(gSystem->BaseName(ddir),ddir); |
1964 |
TList *temp = datadir->GetListOfFiles(); |
TList *temp = datadir->GetListOfFiles(); |
1965 |
|
if(!temp)return 0; |
1966 |
// temp->Print(); |
// temp->Print(); |
1967 |
// cout << "*************************************" << endl; |
// cout << "*************************************" << endl; |
1968 |
|
|
3129 |
} |
} |
3130 |
|
|
3131 |
TList *lk = f->GetListOfKeys(); |
TList *lk = f->GetListOfKeys(); |
3132 |
|
if(!lk)return; |
3133 |
TIter next(lk); |
TIter next(lk); |
3134 |
TKey *key =0; |
TKey *key =0; |
3135 |
|
|