-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateGainMap.C
More file actions
34 lines (28 loc) · 841 Bytes
/
createGainMap.C
File metadata and controls
34 lines (28 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
void testTChain(TString FileList){
gSystem->Load("/home/tklemenz/GEMtest/code/libGEMEvent.so");
GEMEvent *fEvent=0x0;
fEvent=0x0;
fChain = new TChain("GEM");
//fChain = 0x0;
fChain->SetBranchAddress("Events",&fEvent);
TString allFiles;
if (FileList.EndsWith(".txt")){
allFiles=gSystem->GetFromPipe(Form("cat %s",FileList.Data()));
}
else {
allFiles=gSystem->GetFromPipe(Form("ls %s",FileList.Data()));
}
TObjArray *arr = allFiles.Tokenize("\n");
for (int ifile=0; ifile<arr->GetEntriesFast(); ++ifile){
TString file=arr->At(ifile)->GetName();
fChain->Add(file);
}
//pointer rausfinden
cout<<arr->At(0)->GetName()<<endl;
cout<<endl;
cout<<arr->At(1)->GetName()<<endl;
cout<<endl;
cout<<allFiles<<endl;
cout<<arr->GetEntriesFast()<<endl;
cout<<fChain->GetListOfFiles()<<endl;
}