1 int MakeTrend(char *infile,int run) {
3 //char input_file[300];
4 //sprintf(input_file,"Run_%d/AnalysisResults.root",run);
8 gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT/ITS -I$ALICE_ROOT -I$ALICE_ROOT/TRD");
9 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/TPC/macros/ConfigOCDB.C");
11 gSystem->Load("libSTAT");
12 gSystem->Load("libANALYSIS");
13 gSystem->Load("libANALYSISalice");
14 gSystem->Load("libANALYSIScalib");
15 gSystem->Load("libCORRFW");
16 gSystem->Load("libTPCcalib");
17 gSystem->Load("libTRDcalib");
18 gSystem->Load("libT0calib");
19 gSystem->Load("libTOFcalib");
20 gSystem->Load("libANALYSISalice.so");
21 gSystem->Load("libANALYSIScalib.so");
22 gSystem->Load("libTENDER.so");
23 gSystem->Load("libPWGPP.so");
27 gSystem->Load("libANALYSIS.so");
28 gSystem->Load("libANALYSISalice.so");
29 gSystem->Load("libTENDER.so");
30 gSystem->Load("libCORRFW.so");
31 gSystem->Load("libPWG0base.so");
32 gSystem->Load("libPWG0dep.so");
33 gSystem->Load("libPWG0selectors.so");
34 gSystem->Load("libPWG1.so");
35 gSystem->Load("libPWG2.so");
36 gSystem->Load("libPWG4base");
37 gSystem->Load("libPWG3muon.so");
38 gSystem->Load("libPWG3muondep.so");
39 gSystem->Load("libPWG2forward.so");
40 gSystem->Load("libPWG4PartCorrBase.so");
41 gSystem->Load("libPWG4PartCorrDep.so");
48 // ConfigOCDB(run,"local:///lustre/alice/alien/alice/data/2011/OCDB");
50 char *outfile = "trending.root";
52 if (!infile) return -1;
53 if (!outfile) return -1;
55 f=TFile::Open(infile,"read");
57 printf("File %s not available\n", infile);
61 cout<< "test breakpoint -------------------------------------"<<endl;
63 list = dynamic_cast<TList*>(f->Get("TPC"));
64 cout<< "test0"<< endl;
65 if (!list) { list = dynamic_cast<TList*>(f->Get("TPCQA")); }
66 cout<< "test1"<< endl;
67 if (!list) { list = dynamic_cast<TList*>(f->Get("TPCQA_v0_c0")); }
68 if (!list) { list = dynamic_cast<TList*>(f->Get("TPCQA_v0_c30")); }
69 if (!list) { list = dynamic_cast<TList*>(f->Get("TPCQA_v0_c70")); }
70 if (!list) { list = dynamic_cast<TList*>(f->Get("TPC_PerformanceQA/TPCQA")); }
71 if (!list) { list = dynamic_cast<TList*>(f->Get("TPC_PerformanceQA")); }
72 if (!list) { list = dynamic_cast<TList*>(f->Get("ITSTPCMatch")); }
73 cout<< "test2"<< endl;
75 printf("QA %s not available\n", infile);
78 cout<< "test3"<< endl;
80 AliPerformanceTPC* pTPC = 0;
81 AliPerformanceDEdx* pTPCgain = 0;
82 AliPerformanceMatch* pTPCmatch = 0;
83 AliPerformanceMatch* pTPCPull = 0;
84 AliPerformanceMatch* pConstrain = 0;
85 if (list) { pTPC = dynamic_cast<AliPerformanceTPC*>(list->FindObject("AliPerformanceTPC")); }
86 if (list) { pTPCgain = dynamic_cast<AliPerformanceDEdx*>(list->FindObject("AliPerformanceDEdxTPCInner")); }
87 if (list) { pTPCmatch = dynamic_cast<AliPerformanceMatch*>(list->FindObject("AliPerformanceMatchTPCITS")); }
88 if (list) { pTPCPull = dynamic_cast<AliPerformanceMatch*>(list->FindObject("AliPerformanceMatchITSTPC")); }
89 if (list) { pConstrain = dynamic_cast<AliPerformanceMatch*>(list->FindObject("AliPerformanceMatchTPCConstrain")); }
92 cout<< "ss "<<pTPC<<pTPCgain<<pTPCmatch <<pTPCPull<<pConstrain<<endl;
94 cout<< ((TH2D*)(pTPC->GetTPCTrackHisto()->Projection(4,5)))->GetEntries()<<endl;
102 his3D_0 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_0_5_7"));
103 his3D_0->GetYaxis()->SetRangeUser(-1,1);
104 his3D_0->GetZaxis()->SetRangeUser(0.25,10);
106 his1D = his3D_0->Project3D("x");
107 Double_t meanTPCncl= his1D->GetMean();
109 cout<< "ss "<< meanTPCncl<<endl;
112 Int_t returncode = 0;
113 AliTPCPerformanceSummary::WriteToFile(pTPC, pTPCgain, pTPCmatch ,pTPCPull,pConstrain, outfile, run);
114 if (f) { delete f; f=0; }
116 ofstream fout("trend_exist");