1 // Macro to merge TPC performance train output.
2 // One can merge all performance objects stored in the
3 // output files or one of them:
11 // It is recommeneded to merge particular components
12 // for a big statistcs due to too big size of the output. For small
13 // dedicated productions (e.g. flat-p) all components can be merged at once.
16 void MergeOutput(const char* filename = "list.txt", const char* comp = "ALL", Int_t max=2)
21 // Create new collections
22 TList *collTPC = new TList;
23 TList *collRes = new TList;
24 TList *collResTPCInner = new TList;
25 TList *collEff = new TList;
26 TList *colldEdxTPCInner = new TList;
27 TList *collDCA = new TList;
29 // Open the input stream
33 // Read the input list of files and add them to the chain
38 if (!perfile.Contains("root")) continue; // protection
40 if(counter>max) break;
41 printf("%s \n",perfile.Data());
42 TFile::Open(perfile.Data());
44 TList *coutput = gFile->Get("coutput");
46 if(str.CompareTo("ALL")==0) {
47 collTPC->Add(coutput->FindObject("AliPerformanceTPC"));
48 collRes->Add(coutput->FindObject("AliPerformanceRes"));
49 collResTPCInner->Add(coutput->FindObject("AliPerformanceResTPCInner"));
50 collEff->Add(coutput->FindObject("AliPerformanceEff"));
51 colldEdxTPCInner->Add(coutput->FindObject("AliPerformanceDEdxTPCInner"));
52 collDCA->Add(coutput->FindObject("AliPerformanceDCA"));
54 else if(str.CompareTo("TPC")==0) {
55 collTPC->Add(coutput->FindObject("AliPerformanceTPC"));
57 else if(str.CompareTo("RES")==0) {
58 collRes->Add(coutput->FindObject("AliPerformanceRes"));
59 collResTPCInner->Add(coutput->FindObject("AliPerformanceResTPCInner"));
61 else if(str.CompareTo("EFF")==0) {
62 collEff->Add(coutput->FindObject("AliPerformanceEff"));
64 else if(str.CompareTo("DEDX")==0) {
65 colldEdxTPCInner->Add(coutput->FindObject("AliPerformanceDEdxTPCInner"));
67 else if(str.CompareTo("DCA")==0) {
68 collDCA->Add(coutput->FindObject("AliPerformanceDCA"));
77 AliPerformanceTPC *tpc = new AliPerformanceTPC("AliPerformanceTPC","AliPerformanceTPC",0,kFALSE);
78 AliPerformanceRes *res = new AliPerformanceRes("AliPerformanceRes","res",0,kFALSE);
79 AliPerformanceRes *resTPCInner = new AliPerformanceRes("AliPerformanceResTPCInner","AliPerformanceResTPCInner",3,kFALSE);
80 AliPerformanceEff *eff = new AliPerformanceEff("AliPerformanceEff","AliPerformanceEff",0,kFALSE);
81 AliPerformanceDEdx *dedx = new AliPerformanceDEdx("AliPerformanceDEdxTPCInner","AliPerformanceDEdxTPCInner",3,kFALSE);
82 AliPerformanceDCA *dca = new AliPerformanceDCA("AliPerformanceDCA","AliPerformanceDCA",0,kFALSE);
85 TFolder *outList = new TFolder();
87 outList->SetName("coutput");
89 // merge objects and add to the list
90 if(!str.CompareTo("ALL")) {
95 resTPCInner->Merge(collResTPCInner);
96 outList->Add(resTPCInner);
99 dedx->Merge(colldEdxTPCInner);
104 else if(!str.CompareTo("TPC")) {
108 else if(!str.CompareTo("RES")) {
111 resTPCInner->Merge(collResTPCInner);
112 outList->Add(resTPCInner);
114 else if(!str.CompareTo("EFF")) {
118 else if(!str.CompareTo("DEDX")) {
119 dedx->Merge(colldEdxTPCInner);
122 else if(!str.CompareTo("DCA")) {
128 TFile *outFile = new TFile("TPC.Performance.Merged.root","recreate");