#include <TH2D.h>
#include <TROOT.h>
#include <TStyle.h>
+#include <TString.h>
#include "AliTRDQATask.h"
#include "AliESD.h"
void AliTRDQATask::CreateOutputObjects()
{
// create histograms
+
+ OpenFile(0) ;
+
fNTracks = new TH1D("ntracks", ";number of all tracks", 500, -0.5, 499.5);
fEventSize = new TH1D("evSize", ";event size (MB)", 100, 0, 5);
fXIn = new TH1D("xIn", ";X at the inner plane (cm)", 200, 50, 250);
fXOut = new TH1D("xOut", ";X at the outer plane (cm)", 300, 50, 400);
- const int nNameAlpha = 4;
- const char *namesAlpha[nNameAlpha] = {"alphaTPCi", "alphaTPCo", "alphaTRDo", "alphaTRDr"};
+ const int knNameAlpha = 4;
+ const char *namesAlpha[knNameAlpha] = {"alphaTPCi", "alphaTPCo", "alphaTRDo", "alphaTRDr"};
//TH1D *fAlpha[4];
- for(int i=0; i<nNameAlpha; i++) {
+ for(int i=0; i<knNameAlpha; i++) {
fAlpha[i] = new TH1D(namesAlpha[i], "alpha", 100, -4, 4);
}
fSectorTRD = new TH1D ("sectorTRD", ";sector TRD", 20, -0.5, 19.5);
// track parameters
- const int nbits = 6;
- const char *suf[nbits] = {"TPCi", "TPCo", "TPCz", "TRDo", "TRDr", "TRDz"};
- for(int i=0; i<nbits; i++) {
+ const int knbits = 6;
+ const char *suf[knbits] = {"TPCi", "TPCo", "TPCz", "TRDo", "TRDr", "TRDz"};
+ for(int i=0; i<knbits; i++) {
fPt[i] = new TH1D(Form("pt%s",suf[i]), ";p_{T} (GeV/c);entries TPC", 50, 0, 10);
fTheta[i] = new TH1D(Form("theta%s", suf[i]), "theta (rad)", 100, -4, 4);
fSigmaY[i] = new TH1D(Form("sigmaY%s",suf[i]), ";sigma Y (cm)", 200, 0, 1);
fOutputContainer->AddAt(fAlpha[3], counter++);
fOutputContainer->AddAt(fSectorTRD, counter++);
- for(int i=0; i<nbits; i++) {
+ for(int i=0; i<knbits; i++) {
fOutputContainer->AddAt(fPt[i], counter++);
fOutputContainer->AddAt(fTheta[i], counter++);
fOutputContainer->AddAt(fSigmaY[i], counter++);
fOutputContainer->AddAt(fTrdSigMomPID[i], counter++);
}
- AliInfo(Form("Number of histograms = %d", counter));
+ //AliInfo(Form("Number of histograms = %d", counter));
}
for(int bit=0; bit<32; bit++)
if (u<<bit & status) fTrackStatus->Fill(bit);
- const int nbits = 6;
+ const int knbits = 6;
int bit[6] = {0,0,0,0,0,0};
bit[0] = status & AliESDtrack::kTPCin;
bit[1] = status & AliESDtrack::kTPCout;
const double *val = track->GetParameter(); // parameters at the vertex
double pt = 1./TMath::Abs(val[4]);
- for(int b=0; b<nbits; b++) {
+ for(int b=0; b<knbits; b++) {
if (bit[b]) {
fPt[b]->Fill(pt);
fTheta[b]->Fill(val[3]);
// fill pid histograms
double trdr0 = 0, tpcr0 = 0;
int trdBestPid = 5, tpcBestPid = 5; // charged
- const double minPidValue = 0.9;
+ const double kminPidValue = 0.9;
double pp[5];
track->GetTPCpid(pp); // ESD inconsequence
fTrdPID[pid]->Fill(track->GetTRDpid(pid));
fTpcPID[pid]->Fill(pp[pid]);
- if (track->GetTRDpid(pid) > minPidValue) trdBestPid = pid;
- if (pp[pid] > minPidValue) tpcBestPid = pid;
+ if (track->GetTRDpid(pid) > kminPidValue) trdBestPid = pid;
+ if (pp[pid] > kminPidValue) tpcBestPid = pid;
}
fTrdPID[5]->Fill(trdr0); // check unitarity
void AliTRDQATask::Terminate(Option_t *)
{
// Processing when the event loop is ended
- AliInfo("TRD QA module");
fOutputContainer = (TObjArray*)GetOutputData(0);
int counter = 0;
fNTracks = (TH1D*)fOutputContainer->At(counter++);
fAlpha[3] = (TH1D*)fOutputContainer->At(counter++);
fSectorTRD = (TH1D*)fOutputContainer->At(counter++);
- const int nbits = 6;
- for(int i=0; i<nbits; i++) {
+ const int knbits = 6;
+ for(int i=0; i<knbits; i++) {
fPt[i] = (TH1D*)fOutputContainer->At(counter++);
fTheta[i] = (TH1D*)fOutputContainer->At(counter++);
fSigmaY[i] = (TH1D*)fOutputContainer->At(counter++);
}
// create efficiency histograms
+ Bool_t problem = kFALSE ;
+ AliInfo(Form(" *** %s Report:", GetName())) ;
CalculateEff();
-// PostData(0, fOutputContainer);
DrawESD() ;
DrawGeoESD() ;
//DrawConvESD() ;
DrawPidESD() ;
+
+ char line[1024] ;
+ sprintf(line, ".!tar -zcf %s.tar.gz *.eps", GetName()) ;
+ gROOT->ProcessLine(line);
+
+ AliInfo(Form("!!! All the eps files are in %s.tar.gz !!!", GetName())) ;
+
+ TString report ;
+ if(problem)
+ report="Problems found, please check!!!";
+ else
+ report="OK";
+
+ AliInfo(Form("*** %s Summary Report: %s\n",GetName(), report.Data())) ;
+
}
//______________________________________________________________________________
-int AliTRDQATask::GetSector(double alpha)
+const int AliTRDQATask::GetSector(const double alpha) const
{
// Gets the sector number
}
//______________________________________________________________________________
-int AliTRDQATask::CheckSector(int sector)
+const int AliTRDQATask::CheckSector(const int sector) const
{
// Checks the sector number
- const int nSec = 8;
+ const int knSec = 8;
int sec[] = {2,3,5,6,11,12,13,15};
- for(int i=0; i<nSec; i++)
+ for(int i=0; i<knSec; i++)
if (sector == sec[i]) return 1;
return 0;
}
//______________________________________________________________________________
-void AliTRDQATask::DrawESD()
+void AliTRDQATask::DrawESD() const
{
// Makes a few plots
- AliInfo("Plotting....") ;
-
TCanvas * cTRD = new TCanvas("cTRD", "TRD ESD Test", 400, 10, 600, 700) ;
cTRD->Divide(6,3) ;
// draw all
- const int nplots = 18;
- const int nover[nplots] = {1,1,1,4,1,1,1,1,1,1,2,1,1,3,1,1,1,1};
- const int nnames = 24;
- const char *names[nnames] = {
+ const int knplots = 18;
+ const int knover[knplots] = {1,1,1,4,1,1,1,1,1,1,2,1,1,3,1,1,1,1};
+ const int knnames = 24;
+ const char *names[knnames] = {
"ntracks", "kinkIndex", "trackStatus",
"ptTPCi", "ptTPCo", "ptTRDo", "ptTRDr", "ptTPCz", "ptTRDz",
"eff_TPCi_TPCo", "eff_TPCo_TRDo", "eff_TRDo_TRDr", "eff_TPCo_TRDr",
"time", "budget", "signal"
};
- const int logy[nnames] = {
+ const int klogy[knnames] = {
1,1,1,
1,1,1,
0,0,0,0,
};
int nhist=0;
- for(int i=0; i<nplots; i++) {
+ for(int i=0; i<knplots; i++) {
cTRD->cd(i+1) ;
// new TCanvas(names[i], names[nhist], 500, 300);
- gPad->SetLogy(logy[i]);
- for(int j=0; j<nover[i]; j++) {
+ for(int j=0; j<knover[i]; j++) {
TH1D *hist = dynamic_cast<TH1D*>(gDirectory->FindObject(names[nhist++]));
if (!hist) continue;
-
+ if (hist->GetMaximum() > 0 )
+ gPad->SetLogy(klogy[i]);
if (strstr(hist->GetName(), "eff")) {
hist->SetMarkerStyle(20);
hist->SetMinimum(0);
else hist->Draw("SAME");
}
}
- cTRD->Print("TRD_ESD.gif");
+ cTRD->Print("TRD_ESD.eps");
}
//______________________________________________________________________________
-void AliTRDQATask::DrawGeoESD()
+void AliTRDQATask::DrawGeoESD() const
{
// Makes a few plots
- AliInfo("Plotting....") ;
-
TCanvas * cTRDGeo = new TCanvas("cTRDGeo", "TRD ESDGeo Test", 400, 10, 600, 700) ;
cTRDGeo->Divide(4,2) ;
gStyle->SetTitleBorderSize(0);
// draw all
- const int nnames = 7;
- const char *names[nnames] = {
+ const int knnames = 7;
+ const char *names[knnames] = {
"xIn", "xOut",
"planeYZTPCo", "planeYZTPCz", "planeYZTRDo", "planeYZTRDr", "planeYZTRDz",
};
- const char *opt[nnames] = {
+ const char *opt[knnames] = {
"", "",
"colz","colz", "colz", "colz", "colz"
};
- const int logy[nnames] = {
+ const int klogy[knnames] = {
1,1,
0,0,0,0,0
};
- for(int i=0; i<nnames; i++) {
+ for(int i=0; i<knnames; i++) {
cTRDGeo->cd(i+1) ;
TH1D *hist = dynamic_cast<TH1D*>(gDirectory->FindObject(names[i]));
if (!hist) continue;
//if (i<2) new TCanvas(names[i], names[i], 500, 300);
//else new TCanvas(names[i], names[i], 300, 900);
- gPad->SetLogy(logy[i]);
+ if (hist->GetMaximum() > 0 )
+ gPad->SetLogy(klogy[i]);
if (strstr(opt[i],"colz")) gPad->SetRightMargin(0.1);
hist->Draw(opt[i]);
AliInfo(Form("%s\t%d", names[i], hist->GetEntries()));
}
- cTRDGeo->Print("TRD_Geo.gif");
+ cTRDGeo->Print("TRD_Geo.eps");
}
//______________________________________________________________________________
-void AliTRDQATask::DrawConvESD()
+void AliTRDQATask::DrawConvESD() const
{
// Makes a few plots
gStyle->SetTitleFont(62, "XYZ");
gStyle->SetPadRightMargin(0.02);
- const int nnames = 9;
- const int nplots = 5;
- const int nover[nplots] = {3,1,1,3,1};
+ const int knnames = 9;
+ const int knplots = 5;
+ const int knover[knplots] = {3,1,1,3,1};
- const char *names[nnames] = {
+ const char *names[knnames] = {
"sigmaYTPCo","sigmaYTRDo", "sigmaYTRDr", "sigmaYTPCz", "sigmaYTRDz",
"Chi2TPCo", "Chi2TRDo", "Chi2TRDr", "Chi2TRDz"
};
- const char *opt[nplots] = {
+ const char *opt[knplots] = {
"", "", "","","",
};
- const int logy[nplots] = {
+ const int klogy[knplots] = {
0,0,0,1,1
};
int nhist = 0;
- for(int i=0; i<nplots; i++) {
+ for(int i=0; i<knplots; i++) {
cTRDConv->cd(i+1) ;
//new TCanvas(names[i], names[i], 500, 300);
- gPad->SetLogy(logy[i]);
if (strstr(opt[i],"colz")) gPad->SetRightMargin(0.1);
- for(int j=0; j<nover[i]; j++) {
+ for(int j=0; j<knover[i]; j++) {
TH1D *hist = dynamic_cast<TH1D*>(gDirectory->FindObject(names[nhist++]));
+ if ( hist->GetMaximum() > 0 )
+ gPad->SetLogy(klogy[i]);
if (!j) hist->Draw(opt[i]);
else hist->Draw("same");
}
}
//______________________________________________________________________________
-void AliTRDQATask::DrawPidESD()
+void AliTRDQATask::DrawPidESD() const
{
// Makes a few plots
- AliInfo("Plotting....") ;
TCanvas * cTRDPid = new TCanvas("cTRDPid", "TRD ESDPid Test", 400, 10, 600, 700) ;
cTRDPid->Divide(9,3) ;
// draw all
- const int nnames = 27;
- const char *names[nnames] = {
+ const int knnames = 27;
+ const char *names[knnames] = {
"signal", "trdSigMom", "tpcSigMom",
};
- const char *opt[nnames] = {
+ const char *opt[knnames] = {
"", "colz", "colz",
"colz", "colz", "colz", "colz", "colz", "colz"
};
- const int logy[nnames] = {
+ const int klogy[knnames] = {
0,0,0,
0,0,0,0,0,0
};
- for(int i=0; i<nnames; i++) {
+ for(int i=0; i<knnames; i++) {
cTRDPid->cd(i+1) ;
TH1D *hist = dynamic_cast<TH1D*>(gDirectory->FindObject(names[i]));
if (!hist) continue;
//new TCanvas(names[i], names[i], 500, 300);
- gPad->SetLogy(logy[i]);
+ if ( hist->GetMaximum() > 0 )
+ gPad->SetLogy(klogy[i]);
if (strstr(opt[i],"colz")) gPad->SetRightMargin(0.1);
if (strstr(names[i],"sigMom")) gPad->SetLogz(1);
hist->Draw(opt[i]);
AliInfo(Form("%s\t%d", names[i], hist->GetEntries()));
}
- cTRDPid->Print("TRD_Pid.gif");
+ cTRDPid->Print("TRD_Pid.eps");
}