* provided "as is" without express or implied warranty. *
**************************************************************************/
+///////////////////////////////////////////////
+// TRD alignment task
+//
+// Some documentation
+//
+// Authors :
+//
+////////////////////////////////////////////////
+
#include "TTreeStream.h"
#include "TROOT.h"
#include "TH1.h"
//________________________________________________________
void AliTRDalignmentTask::Exec(Option_t *opt)
{
+// Documentation to come
+
AliTRDrecoTask::Exec(opt);
PostData(1, fTree);
}
//________________________________________________________
TH1* AliTRDalignmentTask::PlotTrackPoints(const AliTRDtrackV1 *track)
{
+// Documentation to come
+
if(track) fTrack = track;
if(!fTrack){
AliWarning("No Track defined.");
//________________________________________________________
void AliTRDalignmentTask::Terminate(Option_t *)
{
+// Documentation to come
+
if(fDebugStream){
delete fDebugStream;
fDebugStream = 0x0;
}
-//________________________________________________________
-TObjArray* AliTRDalignmentTask::Histos()
-{
- return 0x0;
-/* if(fContainer) return fContainer;
-
- fContainer = new TObjArray(3);
-
- TH1 *h = 0x0;
-
- if(!(h = (TH1D*)gROOT->FindObject("cuttra"))){
- h = new TH1D("cuttra","cuttra",20,0.5,20.5);
- } else h->Reset();
-
- if(!(h = (TH1D*)gROOT->FindObject("cutpoi"))){
- h = new TH1D("cutpoi","cutpoi",20,0.5,20.5);
- } else h->Reset();
-
- if(!(h = (TH2D*)gROOT->FindObject("modpop"))){
- h = new TH2D("modpop","modpop",90,-0.5,89.5,30,-0.5,29.5);
- h->SetXTitle("module nr");
- h->SetYTitle("layer nr");
- } else h->Reset();*/
-}
-
//________________________________________________________
-Bool_t AliTRDalignmentTask::IsIdenticalWithOneOf(AliTrackPoint *p, AliTrackPointArray *parray, int nmax) {
+Bool_t AliTRDalignmentTask::IsIdenticalWithOneOf(AliTrackPoint * const p, AliTrackPointArray *parray, int nmax) {
// Is the point p identical with one of the points on the list parray?
// This is a fix for aliroot 4-16-Rev-01 (and before) writing some
-#ifndef AliTRDALIGNMENTTASK_H
-#define AliTRDALIGNMENTTASK_H
+#ifndef ALITRDALIGNMENTTASK_H
+#define ALITRDALIGNMENTTASK_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
void CreateOutputObjects();
void Exec(Option_t *opt);
- TObjArray* Histos();
TH1* PlotTrackPoints(const AliTRDtrackV1 *track=0x0);
Bool_t PostProcess(){return kTRUE;}
void Terminate(Option_t *);
private:
- Bool_t IsIdenticalWithOneOf(AliTrackPoint *p, AliTrackPointArray *parray, int nmax);
+ Bool_t IsIdenticalWithOneOf(AliTrackPoint * const p, AliTrackPointArray *parray, int nmax);
AliTRDalignmentTask(const AliTRDalignmentTask&);
AliTRDalignmentTask& operator=(const AliTRDalignmentTask&);
+////////////////////////////////////////////////////////////////////////////
+// //
+// //
+// Basic checks for tracking and detector performance //
+//
+// For the moment (15.10.2009) the following checks are implemented //
+// - Number of clusters/track
+// - Number of clusters/tracklet
+// - Number of tracklets/track from different sources (Barrel, StandAlone)
+// - Number of findable tracklets
+// - Number of tracks per event and TRD sector
+// - <PH>
+// - Chi2 distribution for tracks
+// - Charge distribution per cluster and tracklet
+// - Number of events and tracks per trigger source
+// - Trigger purity
+// - Track and Tracklet propagation status
+//
+// Authors: //
+// Anton Andronic <A.Andronic@gsi.de> //
+// Alexandru Bercuci <A.Bercuci@gsi.de> //
+// Markus Fasel <M.Fasel@gsi.de> //
+// //
+////////////////////////////////////////////////////////////////////////////
+
#include <TAxis.h>
#include <TCanvas.h>
#include <TFile.h>
#include <cstdio>
#include <iostream>
-////////////////////////////////////////////////////////////////////////////
-// //
-// Reconstruction QA //
-// //
-// Task doing basic checks for tracking and detector performance //
-// //
-// Authors: //
-// Anton Andronic <A.Andronic@gsi.de> //
-// Alexandru Bercuci <A.Bercuci@gsi.de> //
-// Markus Fasel <M.Fasel@gsi.de> //
-// //
-////////////////////////////////////////////////////////////////////////////
+ClassImp(AliTRDcheckDET)
//_______________________________________________________
AliTRDcheckDET::AliTRDcheckDET():
Float_t momentum = 0.;
Int_t pdg = 0;
Int_t kinkIndex = fESD ? fESD->GetKinkIndex() : 0;
- UShort_t TPCncls = fESD ? fESD->GetTPCncls() : 0;
+ UShort_t nclsTPC = fESD ? fESD->GetTPCncls() : 0;
if(fMC){
if(fMC->GetTrackRef()) momentum = fMC->GetTrackRef()->P();
pdg = fMC->GetPDG();
<< "theta=" << theta
<< "phi=" << phi
<< "kinkIndex=" << kinkIndex
- << "TPCncls=" << TPCncls
+ << "TPCncls=" << nclsTPC
<< "nclusters=" << nclusters
<< "\n";
}
// a distance epsilon in the direction that we want to fit
//
const Float_t epsilon = 0.01; // dead area tolerance
- const Float_t epsilon_R = 1; // shift in radial direction of the anode wire position (Kalman filter only)
- const Float_t delta_y = 0.7; // Tolerance in the track position in y-direction
- const Float_t delta_z = 7.0; // Tolerance in the track position in z-direction (Padlength)
- Double_t x_anode[AliTRDgeometry::kNlayer] = {300.2, 312.8, 325.4, 338.0, 350.6, 363.2}; // Take the default X0
+ const Float_t epsilonR = 1; // shift in radial direction of the anode wire position (Kalman filter only)
+ const Float_t deltaY = 0.7; // Tolerance in the track position in y-direction
+ const Float_t deltaZ = 7.0; // Tolerance in the track position in z-direction (Padlength)
+ Double_t xAnode[AliTRDgeometry::kNlayer] = {300.2, 312.8, 325.4, 338.0, 350.6, 363.2}; // Take the default X0
if(track) fTrack = track;
if(!fTrack){
if(((fESD->GetStatus() & AliESDtrack::kTRDout) > 0) && !((fESD->GetStatus() & AliESDtrack::kTRDin) > 0)){
// stand alone track
for(Int_t il = 0; il < AliTRDgeometry::kNlayer; il++){
- xyz[0] = x_anode[il];
+ xyz[0] = xAnode[il];
points[il].SetXYZ(xyz);
}
AliTRDtrackerV1::FitRiemanTilt(const_cast<AliTRDtrackV1 *>(fTrack), 0x0, kTRUE, 6, points);
// 2 Steps:
// -> Kalman inwards
// -> Kalman outwards
- AliTRDtrackV1 copy_track(*fTrack); // Do Kalman on a (non-constant) copy of the track
- AliTrackPoint points_inward[6], points_outward[6];
+ AliTRDtrackV1 copyTrack(*fTrack); // Do Kalman on a (non-constant) copy of the track
+ AliTrackPoint pointsInward[6], pointsOutward[6];
for(Int_t il = AliTRDgeometry::kNlayer; il--;){
// In order to avoid complications in the Kalman filter if the track points have the same radial
// position like the tracklets, we have to shift the radial postion of the anode wire by epsilon
// in the direction we want to go
// The track points have to be in reverse order for the Kalman Filter inwards
- xyz[0] = x_anode[AliTRDgeometry::kNlayer - il - 1] - epsilon_R;
- points_inward[il].SetXYZ(xyz);
- xyz[0] = x_anode[il] + epsilon_R;
- points_outward[il].SetXYZ(xyz);
+ xyz[0] = xAnode[AliTRDgeometry::kNlayer - il - 1] - epsilonR;
+ pointsInward[il].SetXYZ(xyz);
+ xyz[0] = xAnode[il] + epsilonR;
+ pointsOutward[il].SetXYZ(xyz);
}
/*for(Int_t ipt = 0; ipt < AliTRDgeometry::kNlayer; ipt++)
printf("%d. X = %f\n", ipt, points[ipt].GetX());*/
// Kalman inwards
- AliTRDtrackerV1::FitKalman(©_track, 0x0, kFALSE, 6, points_inward);
- memcpy(points, points_inward, sizeof(AliTrackPoint) * 6); // Preliminary store the inward results in the Array points
+ AliTRDtrackerV1::FitKalman(©Track, 0x0, kFALSE, 6, pointsInward);
+ memcpy(points, pointsInward, sizeof(AliTrackPoint) * 6); // Preliminary store the inward results in the Array points
// Kalman outwards
- AliTRDtrackerV1::FitKalman(©_track, 0x0, kTRUE, 6, points_inward);
- memcpy(points, points_outward, sizeof(AliTrackPoint) * AliTRDgeometry::kNlayer);
+ AliTRDtrackerV1::FitKalman(©Track, 0x0, kTRUE, 6, pointsInward);
+ memcpy(points, pointsOutward, sizeof(AliTrackPoint) * AliTRDgeometry::kNlayer);
}
for(Int_t il = 0; il < AliTRDgeometry::kNlayer; il++){
y = points[il].GetY();
zmin = pp->GetRowEnd() + epsilon;
zmax = pp->GetRow0() - epsilon;
// ignore y-crossing (material)
- if((z + delta_z > zmin && z - delta_z < zmax) && (y + delta_y > ymin && y - delta_y < ymax)) nFindable++;
+ if((z + deltaZ > zmin && z - deltaZ < zmax) && (y + deltaY > ymin && y - deltaY < ymax)) nFindable++;
if(fDebugLevel > 3){
- Double_t pos_tracklet[2] = {tracklet ? tracklet->GetYfit(0) : 0, tracklet ? tracklet->GetZfit(0) : 0};
+ Double_t posTracklet[2] = {tracklet ? tracklet->GetYfit(0) : 0, tracklet ? tracklet->GetZfit(0) : 0};
Int_t hasTracklet = tracklet ? 1 : 0;
(*fDebugStream) << "FindableTracklets"
<< "layer=" << il
- << "ytracklet=" << pos_tracklet[0]
+ << "ytracklet=" << posTracklet[0]
<< "ytrack=" << y
- << "ztracklet=" << pos_tracklet[1]
+ << "ztracklet=" << posTracklet[1]
<< "ztrack=" << z
<< "tracklet=" << hasTracklet
<< "\n";
while((c = tracklet->NextCluster())){
if(!c->IsInChamber()) continue;
Int_t localtime = c->GetLocalTimeBin();
- Double_t absolute_charge = TMath::Abs(c->GetQ());
- h->Fill(localtime, absolute_charge);
+ Double_t absoluteCharge = TMath::Abs(c->GetQ());
+ h->Fill(localtime, absoluteCharge);
if(fDebugLevel > 3){
Double_t distance[2];
GetDistanceToTracklet(distance, tracklet, c);
<< "Detector=" << detector
<< "crossing=" << crossing
<< "Timebin=" << localtime
- << "Charge=" << absolute_charge
+ << "Charge=" << absoluteCharge
<< "momentum=" << momentum
<< "pdg=" << pdg
<< "theta=" << theta
}
AliTRDseedV1 *tracklet = 0x0;
AliTRDcluster *c = 0x0;
- Double_t Qtot = 0;
+ Double_t qTot = 0;
Int_t nTracklets =fTrack->GetNumberOfTracklets();
for(Int_t itl = 0x0; itl < AliTRDgeometry::kNlayer; itl++){
if(!(tracklet = fTrack->GetTracklet(itl)) || !tracklet->IsOK()) continue;
- Qtot = 0.;
+ qTot = 0.;
for(Int_t ic = AliTRDseedV1::kNclusters; ic--;){
if(!(c = tracklet->GetClusters(ic))) continue;
- Qtot += TMath::Abs(c->GetQ());
+ qTot += TMath::Abs(c->GetQ());
}
- h->Fill(Qtot);
+ h->Fill(qTot);
if(fDebugLevel > 3){
Int_t crossing = (Int_t)tracklet->IsRowCross();
Int_t detector = tracklet->GetDetector();
Float_t momentum = 0.;
Int_t pdg = 0;
Int_t kinkIndex = fESD ? fESD->GetKinkIndex() : 0;
- UShort_t TPCncls = fESD ? fESD->GetTPCncls() : 0;
+ UShort_t nclsTPC = fESD ? fESD->GetTPCncls() : 0;
if(fMC){
if(fMC->GetTrackRef()) momentum = fMC->GetTrackRef()->P();
pdg = fMC->GetPDG();
<< "theta=" << theta
<< "phi=" << phi
<< "kinkIndex=" << kinkIndex
- << "TPCncls=" << TPCncls
- << "QT=" << Qtot
+ << "TPCncls=" << nclsTPC
+ << "QT=" << qTot
<< "\n";
}
}
}
//________________________________________________________
-void AliTRDcheckDET::GetDistanceToTracklet(Double_t *dist, AliTRDseedV1 *tracklet, AliTRDcluster *c)
+void AliTRDcheckDET::GetDistanceToTracklet(Double_t *dist, AliTRDseedV1 * const tracklet, AliTRDcluster * const c)
{
Float_t x = c->GetX();
dist[0] = c->GetY() - tracklet->GetYat(x);
#ifndef ALITRDRECOTASK_H
#include "AliTRDrecoTask.h"
#endif
+////////////////////////////////////////////////////////////////////////////
+// Basic checks for tracking and detector performance //
+// //
+// Authors: //
+// Anton Andronic <A.Andronic@gsi.de> //
+// Alexandru Bercuci <A.Bercuci@gsi.de> //
+// Markus Fasel <M.Fasel@gsi.de> //
+////////////////////////////////////////////////////////////////////////////
+
class TObjArray;
class TH1;
virtual void ConnectInputData(const Option_t *);
virtual void CreateOutputObjects();
- virtual void Exec(Option_t *);
- virtual void Terminate(Option_t *);
+ virtual void Exec(Option_t *opt);
+ virtual void Terminate(Option_t *opt);
virtual TObjArray *Histos();
private:
AliTRDcheckDET(const AliTRDcheckDET &);
AliTRDcheckDET& operator=(const AliTRDcheckDET &);
- void GetDistanceToTracklet(Double_t *dist, AliTRDseedV1 *tracklet, AliTRDcluster *c);
+ void GetDistanceToTracklet(Double_t *dist, AliTRDseedV1 * const tracklet, AliTRDcluster * const c);
TH1* MakePlotChi2();
TH1* MakePlotNTracklets();
TH1* MakePlotPulseHeight();
* provided "as is" without express or implied warranty. *
**************************************************************************/
+/////////////////////////////////////////////////////
+//
+// Check basic detector results at ESD level
+// - Geometrical efficiency
+// - Tracking efficiency
+// - PID efficiency
+// - Refit efficiency
+//
+// Author
+// Alex Bercuci <A.Bercuci@gsi.de>
+//
+//////////////////////////////////////////////////////
#include <TClonesArray.h>
#include <TObjArray.h>
ClassImp(AliTRDcheckESD)
-const Int_t AliTRDcheckESD::fgkNgraphs = 4;
const Float_t AliTRDcheckESD::fgkxTPC = 290.;
const Float_t AliTRDcheckESD::fgkxTOF = 365.;
FILE* AliTRDcheckESD::fgFile = 0x0;
//____________________________________________________________________
AliTRDcheckESD::~AliTRDcheckESD()
{
+// Destructor
if(fHistos){
//fHistos->Delete();
delete fHistos;
//____________________________________________________________________
TGraphErrors* AliTRDcheckESD::GetGraph(Int_t id, Option_t *opt)
{
+// Retrieve graph with "id"
+// Possible options are :
+// "b" - build graph if none found
+// "c" - clear existing graph
+
Bool_t kBUILD = strstr(opt, "b"), // build graph if none found
kCLEAR = strstr(opt, "c"); // clear existing graph
,"TRD refit efficiency (TRDrefit/TRDin)"
};
const Int_t ngr = sizeof(name)/sizeof(Char_t*);
- if(ngr != fgkNgraphs){
+ if(ngr != kNgraphs){
AliWarning("No of graphs defined different from definition");
return 0x0;
}
}
}
}
- Bool_t TRDin(0), TRDout(0), TRDpid(0);
+ Bool_t bTRDin(0), bTRDout(0), bTRDpid(0);
AliESDtrack *esdTrack = 0x0;
for(Int_t itrk = 0; itrk < fESD->GetNumberOfTracks(); itrk++){
- TRDin=0;TRDout=0;TRDpid=0;
+ bTRDin=0;bTRDout=0;bTRDpid=0;
esdTrack = fESD->GetTrack(itrk);
// if(esdTrack->GetNcls(1)) nTPC++;
if(ref->LocalX() > fgkxTOF){ // track skipping TRD fiducial volume
ref = mcParticle->GetTrackReference(TMath::Max(iref-1, 0));
} else {
- TRDin=1;
- if(esdTrack->GetNcls(2)) TRDout=1;
- if(esdTrack->GetTRDntrackletsPID()>=4) TRDpid=1;
+ bTRDin=1;
+ if(esdTrack->GetNcls(2)) bTRDout=1;
+ if(esdTrack->GetTRDntrackletsPID()>=4) bTRDpid=1;
}
} else { // track stopped in TPC
ref = mcParticle->GetTrackReference(TMath::Max(iref-1, 0));
TH2 *h = (TH2I*)fHistos->At(kTRDstat);
if(status & AliESDtrack::kTPCout) h->Fill(pt, kTPCout);
- if(/*status & AliESDtrack::k*/TRDin) h->Fill(pt, kTRDin);
- if(/*status & AliESDtrack::k*/TRDout){
+ if(/*status & AliESDtrack::k*/bTRDin) h->Fill(pt, kTRDin);
+ if(/*status & AliESDtrack::k*/bTRDout){
((TH1*)fHistos->At(kNCl))->Fill(esdTrack->GetNcls(2));
h->Fill(pt, kTRDout);
}
- if(/*status & AliESDtrack::k*/TRDpid) h->Fill(pt, kTRDpid);
+ if(/*status & AliESDtrack::k*/bTRDpid) h->Fill(pt, kTRDpid);
if(status & AliESDtrack::kTRDrefit) h->Fill(pt, kTRDref);
}
PostData(0, fHistos);
//____________________________________________________________________
TObjArray* AliTRDcheckESD::Histos()
{
+// Retrieve histograms array if already build or build it
+
if(fHistos) return fHistos;
fHistos = new TObjArray(kNhistos);
//____________________________________________________________________
Bool_t AliTRDcheckESD::Load(const Char_t *filename, const Char_t *name)
{
+// Load data from performance file
+
if(!TFile::Open(filename)){
AliWarning(Form("Couldn't open file %s.", filename));
return kFALSE;
//_______________________________________________________
Bool_t AliTRDcheckESD::PutTrendValue(const Char_t *name, Double_t val, Double_t err)
{
+// Dump trending value to default file
+
if(!fgFile){
fgFile = fopen("TRD.Performance.txt", "at");
}
//____________________________________________________________________
void AliTRDcheckESD::Terminate(Option_t *)
{
+// Steer post-processing
+
TObjArray *res = 0x0;
if(!(res = (TObjArray*)fHistos->At(kResults))){
AliWarning("Graph container missing.");
return;
}
- if(!res->GetEntriesFast()) res->Expand(fgkNgraphs);
+ if(!res->GetEntriesFast()) res->Expand(kNgraphs);
// geometrical efficiency
TH2I *h2 = (TH2I*)fHistos->At(kTRDstat);
//____________________________________________________________________
void AliTRDcheckESD::Process(TH1 **h1, TGraphErrors *g)
{
+// Generic function to process one reference plot
+
Int_t n1 = 0, n2 = 0, ip=0;
Double_t eff = 0.;
//____________________________________________________________________
void AliTRDcheckESD::PrintStatus(ULong_t status)
{
+// Dump track status to stdout
+
printf("ITS[i(%d) o(%d) r(%d)] TPC[i(%d) o(%d) r(%d) p(%d)] TRD[i(%d) o(%d) r(%d) p(%d) s(%d)] HMPID[o(%d) p(%d)]\n"
,Bool_t(status & AliESDtrack::kITSin)
,Bool_t(status & AliESDtrack::kITSout)
-#ifndef AliTRDcheckESD_H
-#define AliTRDcheckESD_H
+#ifndef ALITRDCHECKESD_H
+#define ALITRDCHECKESD_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id: AliTRDcheckESD.h 27496 2008-07-22 08:35:45Z cblume $ */
-////////////////////////////////////////////////////////////////////////////
-// //
-// Reconstruction QA //
-// //
-////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////
+//
+// Check basic detector results at ESD level
+//
+// Author
+// Alex Bercuci <A.Bercuci@gsi.de>
+//
+//////////////////////////////////////////////////////
#ifndef ALIANALYSISTASK_H
#include "AliAnalysisTask.h"
,kTRDstat // TRD tracks status
,kResults // graphs as results
,kNhistos = 3 // number of histograms
+ ,kNgraphs = 4 // number of graphs
};
enum ETRDcheckESDbits {
kTPCout = 1 // track left TPC
Bool_t PutTrendValue(const Char_t *name, Double_t val, Double_t err);
void Terminate(Option_t *);
- static const Int_t fgkNgraphs;
- static const Float_t fgkxTPC;
- static const Float_t fgkxTOF;
-
private:
+ static const Float_t fgkxTPC; // end radial position of TPC
+ static const Float_t fgkxTOF; // start radial position of TOF
+
AliTRDcheckESD(const AliTRDcheckESD&);
AliTRDcheckESD& operator=(const AliTRDcheckESD&);
void Process(TH1 **h, TGraphErrors *g);
+//////////////////////////////////////////////////////
+//
+// PID performance checker of the TRD
+//
+// Performs checks of ESD information for TRD-PID and recalculate PID based on OCDB information
+// Also provides performance plots on detector based on the PID information - for the moment only
+// MC source is used but V0 is also possible. Here is a list of detector performance checks
+// - Integrated dE/dx per chamber
+// - <PH> as function of time bin and local radial position
+// - number of clusters/tracklet
+// - number of tracklets/track
+//
+// Author : Alex Wilk <wilka@uni-muenster.de>
+// Alex Bercuci <A.Bercuci@gsi.de>
+// Markus Fasel <M.Fasel@gsi.de>
+//
+///////////////////////////////////////////////////////
+
#include "TAxis.h"
#include "TROOT.h"
#include "TPDGCode.h"
#include "AliTRDcheckPID.h"
#include "info/AliTRDtrackInfo.h"
-// calculate pion efficiency at 90% electron efficiency for 11 momentum bins
-// this task should be used with simulated data only
-
ClassImp(AliTRDcheckPID)
//________________________________________________________________________
if(!(h = (TH2F*)gROOT->FindObject("NClus"))){
h = new TH2F("NClus", "",
xBins, -0.5, xBins - 0.5,
- AliTRDtrackerV1::GetNTimeBins(), -0.5, AliTRDtrackerV1::GetNTimeBins() - 0.5);
+ 50, -0.5, 49.5);
} else h->Reset();
fContainer->AddAt(h, kNClus);
//________________________________________________________________________
-Bool_t AliTRDcheckPID::CheckTrackQuality(const AliTRDtrackV1* track)
+Bool_t AliTRDcheckPID::CheckTrackQuality(const AliTRDtrackV1* track) const
{
//
// Check if the track is ok for PID
//________________________________________________________________________
Int_t AliTRDcheckPID::CalcPDG(AliTRDtrackV1* track)
{
+// Documentation to come
track -> SetReconstructor(fReconstructor);
(const_cast<AliTRDrecoParam*>(fReconstructor->GetRecoParam()))->SetPIDNeuralNetwork();
}
if(!IsInRange(momentum)) return 0x0;
- (const_cast<AliTRDrecoParam*>(fReconstructor->GetRecoParam()))->SetPIDNeuralNetwork(/*kFALSE*/);
+ (const_cast<AliTRDrecoParam*>(fReconstructor->GetRecoParam()))->SetPIDNeuralNetwork(kFALSE);
cTrack.CookPID();
if(cTrack.GetNumberOfTrackletsPID() < fMinNTracklets) return 0x0;
Int_t species = AliTRDpidUtil::Pdg2Pid(pdg);
if(!IsInRange(momentum)) return 0x0;
- (const_cast<AliTRDrecoParam*>(fReconstructor->GetRecoParam()))->SetPIDNeuralNetwork(/*kFALSE*/);
- Float_t SumdEdx = 0;
+ (const_cast<AliTRDrecoParam*>(fReconstructor->GetRecoParam()))->SetPIDNeuralNetwork(kFALSE);
+ Float_t sumdEdx = 0;
Int_t iBin = FindBin(species, momentum);
AliTRDseedV1 *tracklet = 0x0;
for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){
- SumdEdx = 0;
+ sumdEdx = 0;
tracklet = cTrack.GetTracklet(iChamb);
if(!tracklet) continue;
tracklet -> CookdEdx(AliTRDpidUtil::kLQslices);
- for(Int_t i = 3; i--;) SumdEdx += tracklet->GetdEdx()[i];
- hdEdx -> Fill(iBin, SumdEdx);
+ for(Int_t i = 3; i--;) sumdEdx += tracklet->GetdEdx()[i];
+ hdEdx -> Fill(iBin, sumdEdx);
}
return hdEdx;
}
}
if(!IsInRange(momentum)) return 0x0;
- (const_cast<AliTRDrecoParam*>(fReconstructor->GetRecoParam()))->SetPIDNeuralNetwork(/*kFALSE*/);
+ (const_cast<AliTRDrecoParam*>(fReconstructor->GetRecoParam()))->SetPIDNeuralNetwork(kFALSE);
Int_t iMomBin = fMomentumAxis->FindBin(momentum);
Int_t species = AliTRDpidUtil::Pdg2Pid(pdg);
Float_t *fdEdx;
//________________________________________________________
Bool_t AliTRDcheckPID::GetRefFigure(Int_t ifig)
{
- Bool_t FIRST = kTRUE;
+// Steering function to retrieve performance plots
+
+ Bool_t kFIRST = kTRUE;
TGraphErrors *g = 0x0;
TAxis *ax = 0x0;
TObjArray *arr = 0x0;
TVirtualPad *pad = ((TVirtualPad*)l->At(0));pad->cd();
pad->SetMargin(0.1, 0.01, 0.1, 0.01);
- TLegend *legEff = new TLegend(.7, .7, .98, .98);
+ TLegend *legEff = new TLegend(.65, .75, .98, .98);
legEff->SetBorderSize(1);
+ legEff->SetFillColor(0);
+ h=new TH1S("hEff", "", 1, .5, 11.);
+ h->SetLineColor(1);h->SetLineWidth(1);
+ ax = h->GetXaxis();
+ ax->SetTitle("p [GeV/c]");
+ ax->SetRangeUser(.5, 11.);
+ ax->SetMoreLogLabels();
+ ax = h->GetYaxis();
+ ax->SetTitle("#epsilon_{#pi} [%]");
+ ax->CenterTitle();
+ ax->SetRangeUser(1.e-2, 10.);
+ h->Draw();
content = (TList *)fGraph->FindObject("Efficiencies");
if(!(g = (TGraphErrors*)content->At(AliTRDpidUtil::kLQ))) break;
if(!g->GetN()) break;
- legEff->SetHeader("PID Method");
- g->Draw("apl");
- ax = g->GetHistogram()->GetXaxis();
- ax->SetTitle("p (GeV/c)");
- ax->SetRangeUser(.5, 11.);
- ax->SetMoreLogLabels();
- ax = g->GetHistogram()->GetYaxis();
- ax->SetTitle("#epsilon_{#pi}");
- ax->SetRangeUser(1.e-3, 1.e-1);
- legEff->AddEntry(g, "2D LQ", "pl");
+ legEff->SetHeader("PID Source");
+ g->Draw("pc"); legEff->AddEntry(g, "LQ 2D", "pl");
if(! (g = (TGraphErrors*)content->At(AliTRDpidUtil::kNN))) break;
- g->Draw("pl");
- legEff->AddEntry(g, "NN", "pl");
+ g->Draw("pc"); legEff->AddEntry(g, "NN", "pl");
if(! (g = (TGraphErrors*)content->At(AliTRDpidUtil::kESD))) break;
- g->Draw("p");
- legEff->AddEntry(g, "ESD", "pl");
+ g->Draw("p"); legEff->AddEntry(g, "ESD", "pl");
legEff->Draw();
gPad->SetLogy();
gPad->SetLogx();
pad = ((TVirtualPad*)l->At(1));pad->cd();
pad->SetMargin(0.1, 0.01, 0.1, 0.01);
+ h=new TH1S("hThr", "", 1, .5, 11.);
+ h->SetLineColor(1);h->SetLineWidth(1);
+ ax = h->GetXaxis();
+ ax->SetTitle("p [GeV/c]");
+ ax->SetMoreLogLabels();
+ ax = h->GetYaxis();
+ ax->SetTitle("Threshold [%]");
+ ax->SetRangeUser(5.e-2, 1.);
+ h->Draw();
content = (TList *)fGraph->FindObject("Thresholds");
if(!(g = (TGraphErrors*)content->At(AliTRDpidUtil::kLQ))) break;
if(!g->GetN()) break;
- g->Draw("apl");
- ax = g->GetHistogram()->GetXaxis();
- ax->SetTitle("p (GeV/c)");
- ax->SetRangeUser(.5, 11.5);
- ax->SetMoreLogLabels();
- ax = g->GetHistogram()->GetYaxis();
- ax->SetTitle("threshold (%)");
- ax->SetRangeUser(5.e-2, 1.);
+ g->Draw("pc");
if(!(g = (TGraphErrors*)content->At(AliTRDpidUtil::kNN))) break;
- g->Draw("pl");
+ g->Draw("pc");
if(!(g = (TGraphErrors*)content->At(AliTRDpidUtil::kESD))) break;
g->Draw("p");
gPad->SetLogx();
// save 2.0 GeV projection as reference
TLegend *legdEdx = new TLegend(.7, .7, .98, .98);
legdEdx->SetBorderSize(1);
- FIRST = kTRUE;
+ kFIRST = kTRUE;
if(!(h2 = (TH2F*)(fContainer->At(kdEdx)))) break;
legdEdx->SetHeader("Particle Species");
gPad->SetMargin(0.1, 0.01, 0.1, 0.01);
if(!h1->GetEntries()) continue;
h1->Scale(1./h1->Integral());
h1->SetLineColor(AliTRDCalPID::GetPartColor(is));
- if(FIRST){
+ if(kFIRST){
h1->GetXaxis()->SetTitle("dE/dx (a.u.)");
h1->GetYaxis()->SetTitle("<Entries>");
}
- h = (TH1F*)h1->DrawClone(FIRST ? "c" : "samec");
+ h = (TH1F*)h1->DrawClone(kFIRST ? "c" : "samec");
legdEdx->AddEntry(h, Form("%s", AliTRDCalPID::GetPartName(is)), "l");
- FIRST = kFALSE;
+ kFIRST = kFALSE;
}
- if(FIRST) break;
+ if(kFIRST) break;
legdEdx->Draw();
gPad->SetLogy();
gPad->SetLogx(0);
TVirtualPad *pad = ((TVirtualPad*)l->At(0));pad->cd();
pad->SetMargin(0.1, 0.01, 0.1, 0.01);
- FIRST = kTRUE;
+ kFIRST = kTRUE;
for(Int_t is=0; is<AliPID::kSPECIES; is++){
Int_t bin = FindBin(is, 2.);
h1 = h2->ProjectionY(Form("pyt%d", is), bin, bin);
h1->SetMarkerStyle(24);
h1->SetMarkerColor(AliTRDCalPID::GetPartColor(is));
h1->SetLineColor(AliTRDCalPID::GetPartColor(is));
- if(FIRST){
+ if(kFIRST){
h1->GetXaxis()->SetTitle("t_{drift} [100*ns]");
h1->GetYaxis()->SetTitle("<dQ/dt> [a.u.]");
}
- h = (TH1F*)h1->DrawClone(FIRST ? "c" : "samec");
+ h = (TH1F*)h1->DrawClone(kFIRST ? "c" : "samec");
legPH->AddEntry(h, Form("%s", AliTRDCalPID::GetPartName(is)), "pl");
- FIRST = kFALSE;
+ kFIRST = kFALSE;
}
pad = ((TVirtualPad*)l->At(1));pad->cd();
pad->SetMargin(0.1, 0.01, 0.1, 0.01);
if(!(h2 = (TProfile2D*)(arr->At(1)))) break;
- FIRST = kTRUE;
+ kFIRST = kTRUE;
for(Int_t is=0; is<AliPID::kSPECIES; is++){
Int_t bin = FindBin(is, 2.);
h1 = h2->ProjectionY(Form("pyx%d", is), bin, bin);
h1->SetMarkerStyle(24);
h1->SetMarkerColor(AliTRDCalPID::GetPartColor(is));
h1->SetLineColor(AliTRDCalPID::GetPartColor(is));
- if(FIRST){
+ if(kFIRST){
h1->GetXaxis()->SetTitle("x_{drift} [cm]");
h1->GetYaxis()->SetTitle("<dQ/dl> [a.u./cm]");
}
- h = (TH1F*)h1->DrawClone(FIRST ? "c" : "samec");
- FIRST = kFALSE;
+ h = (TH1F*)h1->DrawClone(kFIRST ? "c" : "samec");
+ kFIRST = kFALSE;
}
- if(FIRST) break;
+ if(kFIRST) break;
legPH->Draw();
gPad->SetLogy(0);
gPad->SetLogx(0);
}
case kNClus:{
// save 2.0 GeV projection as reference
- TLegend *legNClus = new TLegend(.4, .7, .68, .98);
+ TLegend *legNClus = new TLegend(.13, .7, .4, .98);
legNClus->SetBorderSize(1);
- FIRST = kTRUE;
+ legNClus->SetFillColor(0);
+
+ kFIRST = kTRUE;
if(!(h2 = (TH2F*)(fContainer->At(kNClus)))) break;
legNClus->SetHeader("Particle Species");
for(Int_t is=0; is<AliPID::kSPECIES; is++){
//h1->SetMarkerStyle(24);
//h1->SetMarkerColor(AliTRDCalPID::GetPartColor(is));
h1->SetLineColor(AliTRDCalPID::GetPartColor(is));
- if(FIRST) h1->GetXaxis()->SetTitle("N^{cl}/tracklet");
- if(FIRST) h1->GetYaxis()->SetTitle("Prob. [%]");
- h = (TH1F*)h1->DrawClone(FIRST ? "c" : "samec");
+ if(kFIRST){
+ h1->GetXaxis()->SetTitle("N^{cl}/tracklet");
+ h1->GetYaxis()->SetTitle("Prob. [%]");
+ h = (TH1F*)h1->DrawClone("c");
+ h->SetMaximum(55.);
+ h->GetXaxis()->SetRangeUser(0., 35.);
+ kFIRST = kFALSE;
+ } else h = (TH1F*)h1->DrawClone("samec");
+
legNClus->AddEntry(h, Form("%s", AliTRDCalPID::GetPartName(is)), "l");
- FIRST = kFALSE;
}
- if(FIRST) break;
+ if(kFIRST) break;
legNClus->Draw();
gPad->SetLogy(0);
gPad->SetLogx(0);
case kNTracklets:{
TLegend *legNClus = new TLegend(.4, .7, .68, .98);
legNClus->SetBorderSize(1);
- FIRST = kTRUE;
+ kFIRST = kTRUE;
if(!(h2 = (TH2F*)(fContainer->At(kNTracklets)))) break;
legNClus->SetHeader("Particle Species");
for(Int_t is=0; is<AliPID::kSPECIES; is++){
//h1->SetMarkerStyle(24);
//h1->SetMarkerColor(AliTRDCalPID::GetPartColor(is));
h1->SetLineColor(AliTRDCalPID::GetPartColor(is));
- if(FIRST){
+ if(kFIRST){
h1->GetXaxis()->SetTitle("N^{trklt}/track");
h1->GetXaxis()->SetRangeUser(1.,6.);
h1->GetYaxis()->SetTitle("Prob. [%]");
}
- h = (TH1F*)h1->DrawClone(FIRST ? "c" : "samec");
+ h = (TH1F*)h1->DrawClone(kFIRST ? "c" : "samec");
legNClus->AddEntry(h, Form("%s", AliTRDCalPID::GetPartName(is)), "l");
- FIRST = kFALSE;
+ kFIRST = kFALSE;
}
- if(FIRST) break;
+ if(kFIRST) break;
legNClus->Draw();
gPad->SetLogy(0);
gPad->SetLogx(0);
}
//________________________________________________________________________
-void AliTRDcheckPID::EvaluatePionEfficiency(TObjArray *histoContainer, TObjArray *results, Float_t electron_efficiency){
- fUtil->SetElectronEfficiency(electron_efficiency);
+void AliTRDcheckPID::EvaluatePionEfficiency(TObjArray * const histoContainer, TObjArray *results, Float_t electronEfficiency){
+// Process PID information for pion efficiency
+
+ fUtil->SetElectronEfficiency(electronEfficiency);
Color_t colors[3] = {kBlue, kGreen+2, kRed};
Int_t markerStyle[3] = {7, 7, 24};
- TString MethodName[3] = {"LQ", "NN", "ESD"};
+ TString methodName[3] = {"LQ", "NN", "ESD"};
// efficiency graphs
TGraphErrors *g, *gPtrEff[3], *gPtrThres[3];
TObjArray *eff = new TObjArray(3); eff->SetOwner(); eff->SetName("Efficiencies");
results->AddAt(eff, 0);
for(Int_t iMethod = 0; iMethod < 3; iMethod++){
eff->AddAt(g = gPtrEff[iMethod] = new TGraphErrors(), iMethod);
- g->SetName(Form("efficiency_%s", MethodName[iMethod].Data()));
+ g->SetName(Form("efficiency_%s", methodName[iMethod].Data()));
g->SetLineColor(colors[iMethod]);
g->SetMarkerColor(colors[iMethod]);
g->SetMarkerStyle(markerStyle[iMethod]);
results->AddAt(thres, 1);
for(Int_t iMethod = 0; iMethod < 3; iMethod++){
thres->AddAt(g = gPtrThres[iMethod] = new TGraphErrors(), iMethod);
- g->SetName(Form("threshold_%s", MethodName[iMethod].Data()));
+ g->SetName(Form("threshold_%s", methodName[iMethod].Data()));
g->SetLineColor(colors[iMethod]);
g->SetMarkerColor(colors[iMethod]);
g->SetMarkerStyle(markerStyle[iMethod]);
}
Float_t mom = 0.;
- TH1D *Histo1=0x0, *Histo2=0x0;
+ TH1D *histo1=0x0, *histo2=0x0;
TH2F *hPtr[3];
hPtr[0] = (TH2F*)histoContainer->At(AliTRDpidUtil::kLQ);
binPi = fMomentumAxis->GetNbins() * AliPID::kPion + iMom + 1;
for(Int_t iMethod = 0; iMethod < 3; iMethod++){
// Calculate the Pion Efficiency at 90% electron efficiency for each Method
- Histo1 = hPtr[iMethod] -> ProjectionY(Form("%s_ele", MethodName[iMethod].Data()), binEl, binEl);
- Histo2 = hPtr[iMethod] -> ProjectionY(Form("%s_pio", MethodName[iMethod].Data()), binPi, binPi);
+ histo1 = hPtr[iMethod] -> ProjectionY(Form("%s_ele", methodName[iMethod].Data()), binEl, binEl);
+ histo2 = hPtr[iMethod] -> ProjectionY(Form("%s_pio", methodName[iMethod].Data()), binPi, binPi);
- if(!fUtil->CalculatePionEffi(Histo1, Histo2)) continue;
+ if(!fUtil->CalculatePionEffi(histo1, histo2)) continue;
- gPtrEff[iMethod]->SetPoint(iMom, mom, fUtil->GetPionEfficiency());
- gPtrEff[iMethod]->SetPointError(iMom, 0., fUtil->GetError());
+ gPtrEff[iMethod]->SetPoint(iMom, mom, 1.e2*fUtil->GetPionEfficiency());
+ gPtrEff[iMethod]->SetPointError(iMom, 0., 1.e2*fUtil->GetError());
gPtrThres[iMethod]->SetPoint(iMom, mom, fUtil->GetThreshold());
gPtrThres[iMethod]->SetPointError(iMom, 0., 0.);
- if(fDebugLevel>=2) Printf(Form("Pion Efficiency for 2-dim LQ is : %f +/- %f\n\n", MethodName[iMethod].Data()), fUtil->GetPionEfficiency(), fUtil->GetError());
+ if(fDebugLevel>=2) Printf(Form("Pion Efficiency for 2-dim LQ is : %f +/- %f\n\n", methodName[iMethod].Data()), fUtil->GetPionEfficiency(), fUtil->GetError());
}
}
}
//////////////////////////////////////////////////////
//
-// Task to check PID performance of the TRD
+// PID performance checker of the TRD
//
// Author : Alex Wilk <wilka@uni-muenster.de>
// Alex Bercuci <A.Bercuci@gsi.de>
class AliTRDpidUtil;
class AliTRDcheckPID : public AliTRDrecoTask
{
+public:
// Plots registered for this task
enum{
kEfficiency = 0 // pi Efficiency plot
,kNTracklets = 7 // Number of tracklets per track
,kNPlots = 8 // Number of plots for this tasks
};
-public:
AliTRDcheckPID();
virtual ~AliTRDcheckPID();
void SetRequireMinNTracklets(Int_t mintracklets) { fMinNTracklets = mintracklets; }
void SetRequireMaxNTracklets(Int_t maxtracklets) { fMaxNTracklets = maxtracklets; }
- TObjArray *GetGraphs() { return fGraph; };
+ TObjArray *GetGraphs() const { return fGraph; };
//TObjArray *GetHistos() { return fContainer; };
virtual TObjArray *Histos();
- void EvaluatePionEfficiency(TObjArray *histoContainer, TObjArray *results, Float_t electron_efficiency);
+ void EvaluatePionEfficiency(TObjArray * const histoContainer, TObjArray *results, Float_t electronEfficiency);
inline void SetMomentumBinning(Int_t nBins, Double_t *bins);
inline Int_t FindBin(Int_t species, Double_t momentum);
inline Bool_t IsInRange(Double_t momentum);
AliTRDcheckPID& operator=(const AliTRDcheckPID&); // not implemented
Int_t CalcPDG(AliTRDtrackV1* track = 0x0);
- Bool_t CheckTrackQuality(const AliTRDtrackV1* track = 0x0);
+ Bool_t CheckTrackQuality(const AliTRDtrackV1* track = 0x0) const;
AliTRDReconstructor *fReconstructor; //! reconstructor needed for recalculation the PID
AliTRDpidUtil *fUtil; //! utility class for PID calculations
,fDet(-1)
,fExB(0.)
,fVdrift(0.)
- ////////////
,fLy(0)
,fX(0.)
,fY(0.)
,fZ(0.)
{
+// Constructor
+
memset(fR, 0, 4*sizeof(Float_t));
memset(fP, 0, 4*sizeof(Float_t));
// time drift axis
//_______________________________________________________
AliTRDclusterResolution::~AliTRDclusterResolution()
{
+// Destructor
+
if(fCanvas) delete fCanvas;
if(fAt) delete fAt;
if(fResults){
//_______________________________________________________
Bool_t AliTRDclusterResolution::GetRefFigure(Int_t ifig)
{
+// Steering function to retrieve performance plots
+
if(!fResults) return kFALSE;
TLegend *leg = 0x0;
TList *l = 0x0;
//_______________________________________________________
TObjArray* AliTRDclusterResolution::Histos()
{
+// Retrieve histograms array if already build or build it
+
if(fContainer) return fContainer;
fContainer = new TObjArray(kNtasks);
//fContainer->SetOwner(kTRUE);
//_______________________________________________________
void AliTRDclusterResolution::Exec(Option_t *)
{
+// Fill container histograms
+
if(!HasExB()) AliWarning("ExB was not set. Call SetExB() before running the task.");
Int_t det, t;
if(TMath::Abs(dydx-fExB) < kDtgPhi){
h3 = (TH3S*)fContainer->At(kQRes);
h3->Fill(TMath::Log(q), dy, dy/TMath::Sqrt(covcl[0]));
+
+ printf("q=%f Log(q)=%f dy=%f pull=%f\n",q, TMath::Log(q), dy, dy/TMath::Sqrt(covcl[0]));
}
// do not use problematic clusters in resolution analysis
#ifndef ALITRDCLUSTERRESOLUTION_H
#define ALITRDCLUSTERRESOLUTION_H
+///////////////////////////////////////////////////////////////////////////////
+// //
+// TRD cluster error parameterization
+// Authors: //
+// Alexandru Bercuci <A.Bercuci@gsi.de> //
+////////////////////////////////////////////////////////////////////////////
#ifndef ALITRDRECOTASK_H
#include "AliTRDrecoTask.h"
// //res->SetMCdata();
// //res->SetVerbose();
// //res->SetVisual();
-// res->Load("TRD.TaskResolution.root");
+// res->Load();
// if(!res->PostProcess()) return;
// res->GetRefFigure(0);
// }
////////////////////////////////////////////////////////////////////////////
// //
-// Resolution QA //
+// TRD Resolution performance //
// //
-////////////////////////////////////////////////////////////////////////////
+// Authors: //
+// Alexandru Bercuci <A.Bercuci@gsi.de> //
+// Markus Fasel <M.Fasel@gsi.de> //
+// // ////////////////////////////////////////////////////////////////////////////
#ifndef ALITRDRECOTASK_H
#include "AliTRDrecoTask.h"
// Alex Bercuci (A.Bercuci@gsi.de)
// Markus Fasel (m.Fasel@gsi.de)
-#ifndef __CINT__
+#if ! defined (__CINT__) || defined (__MAKECINT__)
+//#ifndef __CINT__
#include <Riostream.h>
#include "TStopwatch.h"
#include "TRD/AliTRDtrackerV1.h"
#include "TRD/AliTRDcalibDB.h"
+#include "TRD/qaRec/macros/AliTRDperformanceTrain.h"
#include "TRD/qaRec/macros/AddTRDcheckESD.C"
#include "TRD/qaRec/macros/AddTRDinfoGen.C"
#include "TRD/qaRec/macros/AddTRDcheckDET.C"
#include "PWG1/macros/AddPerformanceTask.C"
#endif
-#include "TRD/qaRec/macros/AliTRDperformanceTrain.h"
-#include "PWG1/macros/AddPerformanceTask.h"
+//#include "PWG1/macros/AddPerformanceTask.h"
Bool_t MEM = kFALSE;