1 Int_t ExtractRunNumber(TString filename);
3 void runQAesds(const char *esdlist)
5 ifstream input(esdlist);
8 TString tstr(str.c_str());
9 if(tstr.Contains("alien://")){
10 printf("Data from alien\n");
11 gSystem->Load("libRAliEn");
12 TGrid::Connect("alien://");
15 Int_t runnr = ExtractRunNumber(tstr);
16 printf("runnr %d\n", runnr);
18 gSystem->Load("libANALYSIS");
19 gSystem->Load("libANALYSISalice");
20 gSystem->Load("libTENDER");
21 gSystem->Load("libPWG1");
22 AliLog::SetGlobalLogLevel(AliLog::kError);
23 gROOT->LoadMacro(Form("%s/PWG0/CreateESDChain.C", gSystem->ExpandPathName("$ALICE_ROOT")));
24 TChain *chain = CreateESDChain(esdlist, -1);
25 chain->SetBranchStatus("*FMD*",0);
26 chain->SetBranchStatus("*Calo*",0);
27 chain->SetBranchStatus("Tracks", 1);
28 chain->SetBranchStatus("ESDfriend*",1);
30 chain->GetListOfFiles()->Print();
31 printf("\n ----> CHAIN HAS %d ENTRIES <----\n\n", (Int_t)chain->GetEntries());
33 AliAnalysisManager *TRDqa = new AliAnalysisManager("TRD Cosmics QA");
34 TRDqa->SetInputEventHandler(new AliESDInputHandler);
35 AliTRDinfoGen *info = new AliTRDinfoGen();
36 AliTRDcheckDET *detector = new AliTRDcheckDET();
37 detector->SetDebugLevel(10);
38 detector->SetMCdata(kFALSE);
39 detector->UseClustersOutsideChamber();
41 TRDqa->AddTask(detector);
43 AliAnalysisDataContainer *co[3];
44 TRDqa->ConnectInput( info, 0, TRDqa->GetCommonInputContainer());
45 co[0] = TRDqa->CreateContainer("trackInfo", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
46 co[1] = TRDqa->CreateContainer("eventInfo", AliTRDeventInfo::Class(), AliAnalysisManager::kExchangeContainer);
47 co[2] = TRDqa->CreateContainer("v0Info", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
48 TRDqa->ConnectOutput(info, 0, co[0]);
49 TRDqa->ConnectOutput(info, 1, co[1]);
50 TRDqa->ConnectOutput(info, 2, co[2]);
51 TRDqa->ConnectInput(detector, 0, co[0]);
52 TRDqa->ConnectInput(detector, 1, co[1]);
53 TRDqa->ConnectOutput(detector, 0, TRDqa->CreateContainer(detector->GetName(), TObjArray::Class(), AliAnalysisManager::kOutputContainer, Form("TRD.Perf%d.root", runnr)));
55 if(TRDqa->InitAnalysis()){
57 TRDqa->StartAnalysis("local", chain);
59 gSystem->Exec(Form("mv TRD.DebugPerformance.root TRD.DbgPerf%d.root", runnr));
64 TFile *f=new TFile(Form("TRD.Perf%d.root",run));
65 TH1F *hNtrSec = (TH1F*)checkDET->FindObject("hNtrksSector");
66 TH1F *hNtrks = (TH1F*)checkDET->FindObject("hNtrks"); // tracks/event
67 TH1F *hNtlsSTA = (TH1F*)checkDET->FindObject("hNtlsSTA");
68 TH1F *hNtlsBAR = (TH1F*)checkDET->FindObject("hNtlsBAR");
69 TH1F *hNclTrk = (TH1F*)checkDET->FindObject("hNclTls");
70 TProfile *hPHp = (TProfile*) checkDET->FindObject("<PH>")->FindObject("hPHt");
73 TH2F *hPH = new TH2F("hPH", "PH", 30, 0, 30, 100, 0, 1000);
74 TString filename = Form("TRD.DbgPerf%d.root",run);
75 TChain *debchain = new TChain("PHt");
76 if(filename.EndsWith(".root")) {
77 debchain->AddFile(filename.Data());
78 debchain->Draw("Charge:Timebin>>hPH", "","colz");
80 cout << "No such file... " << filename <<endl;
83 const Float_t Ls1=0.04;
84 TCanvas *tc = new TCanvas ("Monitor", "Monitor",50,50,600,900);
88 pad = tc->cd(1); pad->SetLogy();
89 hNtrks->GetXaxis()->SetTitle("Tracks per event");
90 hNtrks->GetXaxis()->SetTitleOffset(.9);
91 hNtrks->GetXaxis()->SetTitleSize(0.05);
92 hNtrks->GetYaxis()->SetTitle("");
93 //hNtrks->SetTitle(Form("%d",run));
94 hNtrks->SetLineWidth(2);
95 hNtrks->SetLabelSize(Ls1,"xy");
96 hNtrks->GetXaxis()->SetRangeUser(0,20);
98 int Ntracks=hNtrks->Integral();
99 TLatex *text=new TLatex(8,10,Form("%d tracks",Ntracks));
100 text->SetTextSize(0.045); text->SetTextFont(42);
104 hNtrSec->GetXaxis()->SetTitle("Sector");
105 hNtrSec->GetXaxis()->SetTitleOffset(.9);
106 hNtrSec->GetXaxis()->SetTitleSize(0.05);
107 hNtrSec->GetYaxis()->SetTitle("Tracks");
108 //hNtrSec->GetYaxis()->SetTitleSize(0.05);
109 hNtrSec->GetYaxis()->SetTitleOffset(1.2);
110 hNtrSec->SetLineWidth(2);
111 hNtrSec->SetLabelSize(Ls1,"xy");
115 hNtlsBAR->GetXaxis()->SetTitle("Tracklets per track");
116 hNtlsBAR->GetXaxis()->SetTitleOffset(.9);
117 hNtlsBAR->GetXaxis()->SetTitleSize(0.05);
118 hNtlsBAR->GetYaxis()->SetTitle("");
119 //hNtlsBAR->SetStats(1111);
120 hNtlsBAR->SetLabelSize(Ls1,"xy");
121 hNtlsBAR->SetLineWidth(2);
122 //hNtlsBAR->GetYaxis()->SetRangeUser(0,500);
123 hNtlsSTA->GetXaxis()->SetTitle("Tracklets per track");
124 hNtlsSTA->GetYaxis()->SetTitle("");
125 hNtlsBAR->SetLineColor(2); hNtlsBAR->Draw("");
126 hNtlsSTA->SetLineColor(4); hNtlsSTA->Draw("same");
127 leg = new TLegend(0.14,0.35,0.65,0.5);
128 leg->AddEntry(hNtlsBAR,"Barrel","l");
129 leg->AddEntry(hNtlsSTA,"Standalone","l");
130 leg->SetBorderSize(0);
131 leg->SetFillStyle(0);
132 leg->SetMargin(0.15); //separation symbol-text
133 leg->SetEntrySeparation(0.1); //this seems not to do much...
137 hNclTrk->GetXaxis()->SetTitle("Clusters per tracklet");
138 hNclTrk->GetXaxis()->SetTitleOffset(.9);
139 hNclTrk->GetXaxis()->SetTitleSize(0.05);
140 hNclTrk->GetYaxis()->SetTitle("");
141 hNclTrk->SetLabelSize(Ls1,"xy");
142 hNclTrk->SetLineWidth(2);
146 hPHp->GetXaxis()->SetTitle("Time bin (100 ns)");
147 hPHp->GetXaxis()->SetTitleOffset(.9);
148 hPHp->GetXaxis()->SetTitleSize(0.05);
149 hPHp->GetYaxis()->SetTitle("<PH> (ADC ch.)");
150 hPHp->GetYaxis()->SetTitleOffset(1.3);
151 hPHp->SetLabelSize(Ls1,"xy");
152 hPHp->SetLineWidth(2);
156 hPH->GetXaxis()->SetTitle("Time bin (100 ns)");
157 hPH->GetXaxis()->SetTitleOffset(.9);
158 hPH->GetXaxis()->SetTitleSize(0.05);
159 hPH->GetYaxis()->SetTitle("Pulse Height (ADC ch.)");
160 hPH->GetYaxis()->SetTitleOffset(1.3);
161 hPH->SetLabelSize(Ls1,"xy");
162 hPH->SetLineWidth(2);
165 //tc->SaveAs(Form("Mon_run%dp%d.eps",run,pass));
166 tc->SaveAs(Form("Mon_run%d.gif",run));
169 Int_t ExtractRunNumber(TString filename){
170 TObjArray *toks = filename.Tokenize("/");
171 TObjString *file = dynamic_cast<TObjString *>(toks->At(toks->GetEntries() - 2));
172 TString &filestr = file->String();
173 TString runstr = filestr(2,9);
174 return runstr.Atoi();