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++);
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
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++);
}
//______________________________________________________________________________
-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
// 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);
- 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(logy[i]);
+ gPad->SetLogy(klogy[i]);
if (strstr(hist->GetName(), "eff")) {
hist->SetMarkerStyle(20);
hist->SetMinimum(0);
}
//______________________________________________________________________________
-void AliTRDQATask::DrawGeoESD()
+void AliTRDQATask::DrawGeoESD() const
{
// Makes a few plots
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;
//else new TCanvas(names[i], names[i], 300, 900);
if (hist->GetMaximum() > 0 )
- gPad->SetLogy(logy[i]);
+ gPad->SetLogy(klogy[i]);
if (strstr(opt[i],"colz")) gPad->SetRightMargin(0.1);
hist->Draw(opt[i]);
}
//______________________________________________________________________________
-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);
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(logy[i]);
+ 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
// 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]));
//new TCanvas(names[i], names[i], 500, 300);
if ( hist->GetMaximum() > 0 )
- gPad->SetLogy(logy[i]);
+ gPad->SetLogy(klogy[i]);
if (strstr(opt[i],"colz")) gPad->SetRightMargin(0.1);
if (strstr(names[i],"sigMom")) gPad->SetLogz(1);
#ifndef ALITRDQATASK_H
+#define ALITRDQATASK_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
//______________________________________________________________________________
// An analysis task to check the TRD data in simulated data
-//
+// Starting from ESD
+// Producing Histograms and plots
+// Part of an analysis Train
//*-- Sylwester Radomski
//////////////////////////////////////////////////////////////////////////////
-#include <TTree.h>
#include "AliAnalysisTask.h"
+class TTree;
class AliESD;
class TH1D;
class TH2D;
public:
AliTRDQATask(const char *name);
+ AliTRDQATask(AliTRDQATask& trd) { new AliTRDQATask(trd.GetName());}
virtual ~AliTRDQATask() {}
virtual void Exec(Option_t * opt = "");
private:
- int GetSector(double alpha);
- int CheckSector(int sector);
+ const int GetSector(const double alpha) const;
+ const int CheckSector(const int sector) const;
void CalculateEff();
- void DrawESD() ;
- void DrawGeoESD() ;
- void DrawConvESD() ;
- void DrawPidESD() ;
+ void DrawESD() const ;
+ void DrawGeoESD() const ;
+ void DrawConvESD() const ;
+ void DrawPidESD() const ;
TTree * fChain; //!pointer to the analyzed TTree or TChain
AliESD * fESD; //! Declaration of leave types
TObjArray * fOutputContainer; //! output data container
// options
- int fConfSM;
+ int fConfSM; //!Super Module Configuration
// Histograms
- TH1D *fNTracks;
- TH1D *fEventSize;
- TH1D *fTrackStatus;
+ TH1D *fNTracks; // Number of tracks
+ TH1D *fEventSize; // Event size
+ TH1D *fTrackStatus; // Status of tracks
- TH1D *fParIn;
- TH1D *fParOut;
- TH1D *fKinkIndex;
+ TH1D *fParIn; // Par In
+ TH1D *fParOut; // Par out
+ TH1D *fKinkIndex; // Kink Index
// TPC clusters histograms
//TH1D *fTpcNCls;
//TH1D *fTpcRCls;
// last measurement X plane
- TH1D *fXIn;
- TH1D *fXOut;
+ TH1D *fXIn; // input Xplane
+ TH1D *fXOut; // output Xplane
// sector
- TH1D *fAlpha[4];
- TH1D *fSectorTRD;
+ TH1D *fAlpha[4]; // alpha sectors
+ TH1D *fSectorTRD; // TRD sectors
//static const int knbits = 5;
// track parameters
- TH1D *fPt[6];
- TH1D *fTheta[6];
- TH1D *fSigmaY[6];
- TH1D *fChi2[6];
- TH2D *fPlaneYZ[6];
+ TH1D *fPt[6]; // Transverse momentum
+ TH1D *fTheta[6]; // Theta distribution
+ TH1D *fSigmaY[6]; // Sigma Y
+ TH1D *fChi2[6]; // Chi 2
+ TH2D *fPlaneYZ[6]; // YZ Plane
- TH1D *fEffPt[4];
+ TH1D *fEffPt[4]; // Eff transverse momentum
// track features
- TH1D *fClustersTRD[3];
+ TH1D *fClustersTRD[3]; // Clusters
// for good refitted tracks only
- TH1D *fTime;
- TH1D *fBudget;
- TH1D *fQuality;
- TH1D *fSignal;
+ TH1D *fTime; // time
+ TH1D *fBudget; // Budget
+ TH1D *fQuality; // Quality
+ TH1D *fSignal; // Signal
// PID for TPC and TRD
- TH2D *fTrdSigMom;
- TH2D *fTpcSigMom;
+ TH2D *fTrdSigMom; // Sig TRD
+ TH2D *fTpcSigMom; // Sig TPC
- TH1D *fTrdPID[6];
- TH2D *fTrdSigMomPID[6];
+ TH1D *fTrdPID[6]; // Pid TRD
+ TH2D *fTrdSigMomPID[6];// Pid TRD
- TH1D *fTpcPID[6];
- TH2D *fTpcSigMomPID[6];
+ TH1D *fTpcPID[6]; // Pid TPC
+ TH2D *fTpcSigMomPID[6];// Pid TPC
ClassDef(AliTRDQATask, 0); // a TRD analysis task