fix coding convention errors
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Oct 2009 12:30:56 +0000 (12:30 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Oct 2009 12:30:56 +0000 (12:30 +0000)
13 files changed:
TRD/qaRec/AliTRDalignmentTask.cxx
TRD/qaRec/AliTRDalignmentTask.h
TRD/qaRec/AliTRDcheckDET.cxx
TRD/qaRec/AliTRDcheckDET.h
TRD/qaRec/AliTRDcheckESD.cxx
TRD/qaRec/AliTRDcheckESD.h
TRD/qaRec/AliTRDcheckPID.cxx
TRD/qaRec/AliTRDcheckPID.h
TRD/qaRec/AliTRDclusterResolution.cxx
TRD/qaRec/AliTRDclusterResolution.h
TRD/qaRec/AliTRDresolution.cxx
TRD/qaRec/AliTRDresolution.h
TRD/qaRec/run.C

index f169b61c1afddce676b3a83382bb857251a4b193..e3ccc0f048f1793b3e2591ce3622dc3f86414022 100644 (file)
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/
 
+///////////////////////////////////////////////
+// TRD alignment task
+//
+// Some documentation
+//
+// Authors :
+//
+////////////////////////////////////////////////
+
 #include "TTreeStream.h"
 #include "TROOT.h"
 #include "TH1.h"
@@ -62,6 +71,8 @@ void AliTRDalignmentTask::CreateOutputObjects()
 //________________________________________________________
 void AliTRDalignmentTask::Exec(Option_t *opt)
 {
+// Documentation to come
+
   AliTRDrecoTask::Exec(opt);
   PostData(1, fTree);
 }
@@ -70,6 +81,8 @@ void AliTRDalignmentTask::Exec(Option_t *opt)
 //________________________________________________________
 TH1* AliTRDalignmentTask::PlotTrackPoints(const AliTRDtrackV1 *track)
 {
+// Documentation to come 
+
   if(track) fTrack = track;
   if(!fTrack){
     AliWarning("No Track defined.");
@@ -114,6 +127,8 @@ TH1* AliTRDalignmentTask::PlotTrackPoints(const AliTRDtrackV1 *track)
 //________________________________________________________
 void AliTRDalignmentTask::Terminate(Option_t *)
 {
+// Documentation to come
+
   if(fDebugStream){ 
     delete fDebugStream;
     fDebugStream = 0x0;
@@ -123,34 +138,9 @@ void AliTRDalignmentTask::Terminate(Option_t *)
 }
 
 
-//________________________________________________________
-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 
index 35fd08687073845a438ec950d0f0fcb51d1be1dd..e88da8b10d77338e59684e008ea491e68e5a0ba1 100644 (file)
@@ -1,5 +1,5 @@
-#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                               */
 
@@ -28,13 +28,12 @@ public:
   
   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&);
 
index e81adc76b6881bdf19e29d362b8f38391a42c6f5..673dc7410b07e7033330c09e19a285f5d596ca15 100644 (file)
@@ -1,3 +1,28 @@
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+//                                                                        //
+//  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():
@@ -521,7 +535,7 @@ TH1 *AliTRDcheckDET::PlotNClustersTrack(const AliTRDtrackV1 *track){
       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();
@@ -534,7 +548,7 @@ TH1 *AliTRDcheckDET::PlotNClustersTrack(const AliTRDtrackV1 *track){
         << "theta="                    << theta
         << "phi="                              << phi
         << "kinkIndex="        << kinkIndex
-        << "TPCncls="          << TPCncls
+        << "TPCncls="          << nclsTPC
         << "nclusters=" << nclusters
         << "\n";
     }
@@ -642,10 +656,10 @@ TH1 *AliTRDcheckDET::PlotFindableTracklets(const AliTRDtrackV1 *track){
   // 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){
@@ -678,7 +692,7 @@ TH1 *AliTRDcheckDET::PlotFindableTracklets(const AliTRDtrackV1 *track){
   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);
@@ -688,26 +702,26 @@ TH1 *AliTRDcheckDET::PlotFindableTracklets(const AliTRDtrackV1 *track){
     // 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(&copy_track, 0x0, kFALSE, 6, points_inward);
-    memcpy(points, points_inward, sizeof(AliTrackPoint) * 6); // Preliminary store the inward results in the Array points
+    AliTRDtrackerV1::FitKalman(&copyTrack, 0x0, kFALSE, 6, pointsInward);
+    memcpy(points, pointsInward, sizeof(AliTrackPoint) * 6); // Preliminary store the inward results in the Array points
     // Kalman outwards
-    AliTRDtrackerV1::FitKalman(&copy_track, 0x0, kTRUE, 6, points_inward);
-    memcpy(points, points_outward, sizeof(AliTrackPoint) * AliTRDgeometry::kNlayer);
+    AliTRDtrackerV1::FitKalman(&copyTrack, 0x0, kTRUE, 6, pointsInward);
+    memcpy(points, pointsOutward, sizeof(AliTrackPoint) * AliTRDgeometry::kNlayer);
   }
   for(Int_t il = 0; il < AliTRDgeometry::kNlayer; il++){
     y = points[il].GetY();
@@ -719,15 +733,15 @@ TH1 *AliTRDcheckDET::PlotFindableTracklets(const AliTRDtrackV1 *track){
     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";
@@ -788,8 +802,8 @@ TH1 *AliTRDcheckDET::PlotPHt(const AliTRDtrackV1 *track){
     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);
@@ -807,7 +821,7 @@ TH1 *AliTRDcheckDET::PlotPHt(const AliTRDtrackV1 *track){
           << "Detector="       << detector
           << "crossing="       << crossing
           << "Timebin="                << localtime
-          << "Charge="         << absolute_charge
+          << "Charge="         << absoluteCharge
           << "momentum="       << momentum
           << "pdg="                            << pdg
           << "theta="                  << theta
@@ -904,16 +918,16 @@ TH1 *AliTRDcheckDET::PlotChargeTracklet(const AliTRDtrackV1 *track){
   }
   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();
@@ -922,7 +936,7 @@ TH1 *AliTRDcheckDET::PlotChargeTracklet(const AliTRDtrackV1 *track){
       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();
@@ -936,8 +950,8 @@ TH1 *AliTRDcheckDET::PlotChargeTracklet(const AliTRDtrackV1 *track){
         << "theta="                    << theta
         << "phi="                              << phi
         << "kinkIndex="        << kinkIndex
-        << "TPCncls="          << TPCncls
-        << "QT="        << Qtot
+        << "TPCncls="          << nclsTPC
+        << "QT="        << qTot
         << "\n";
     }
   }
@@ -983,7 +997,7 @@ void AliTRDcheckDET::SetRecoParam(AliTRDrecoParam *r)
 }
 
 //________________________________________________________
-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);
index 7b5fbcc5567d15c9d3ae188645185aa3c53e331a..0a9253142545f3c9855c5df05dd8cc83a7e0b774 100644 (file)
@@ -4,6 +4,15 @@
 #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;
@@ -44,8 +53,8 @@ public:
 
   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();
 
@@ -72,7 +81,7 @@ public:
 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();
index 5e88ac16ac3c60d78e4b8c3b9294d8c5005cd769..06e09f7b8f6353a9ef3cb690a1cbc36439a23898 100644 (file)
 * 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>
@@ -43,7 +55,6 @@
 
 ClassImp(AliTRDcheckESD)
 
-const Int_t   AliTRDcheckESD::fgkNgraphs = 4;
 const Float_t AliTRDcheckESD::fgkxTPC = 290.;
 const Float_t AliTRDcheckESD::fgkxTOF = 365.;
 FILE* AliTRDcheckESD::fgFile = 0x0;
@@ -67,6 +78,7 @@ AliTRDcheckESD::AliTRDcheckESD():
 //____________________________________________________________________
 AliTRDcheckESD::~AliTRDcheckESD()
 {
+// Destructor
   if(fHistos){
     //fHistos->Delete();
     delete fHistos;
@@ -103,6 +115,11 @@ void AliTRDcheckESD::CreateOutputObjects()
 //____________________________________________________________________
 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
 
@@ -116,7 +133,7 @@ TGraphErrors* AliTRDcheckESD::GetGraph(Int_t id, Option_t *opt)
     ,"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;
   }
@@ -168,11 +185,11 @@ void AliTRDcheckESD::Exec(Option_t *){
       }
     }
   }
-  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++;
@@ -236,9 +253,9 @@ void AliTRDcheckESD::Exec(Option_t *){
       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));
@@ -248,12 +265,12 @@ void AliTRDcheckESD::Exec(Option_t *){
 
     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);
@@ -262,6 +279,8 @@ void AliTRDcheckESD::Exec(Option_t *){
 //____________________________________________________________________
 TObjArray* AliTRDcheckESD::Histos()
 {
+// Retrieve histograms array if already build or build it
+
   if(fHistos) return fHistos;
 
   fHistos = new TObjArray(kNhistos);
@@ -296,6 +315,8 @@ TObjArray* AliTRDcheckESD::Histos()
 //____________________________________________________________________
 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;
@@ -313,6 +334,8 @@ Bool_t AliTRDcheckESD::Load(const Char_t *filename, const Char_t *name)
 //_______________________________________________________
 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");
   }
@@ -323,12 +346,14 @@ Bool_t AliTRDcheckESD::PutTrendValue(const Char_t *name, Double_t val, Double_t
 //____________________________________________________________________
 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);
@@ -360,6 +385,8 @@ void AliTRDcheckESD::Terminate(Option_t *)
 //____________________________________________________________________
 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.;
 
@@ -378,6 +405,8 @@ void AliTRDcheckESD::Process(TH1 **h1, TGraphErrors *g)
 //____________________________________________________________________
 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)
index 95dc9a732eb7eeb96fcc53d2f774e44a49f72422..6c5b64decc4178cbdb49e8825482cfc209185864 100644 (file)
@@ -1,15 +1,18 @@
-#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"
@@ -30,6 +33,7 @@ public:
    ,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
@@ -54,11 +58,10 @@ public:
   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);
index 7152c9a9d06da05286ddee277be49aecd3747f1b..d6ccdf8c8c39a1da5bb69f2a84889b3d56fe34e7 100644 (file)
@@ -1,3 +1,21 @@
+//////////////////////////////////////////////////////
+//
+// 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"
@@ -32,9 +50,6 @@
 #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)
 
 //________________________________________________________________________
@@ -164,7 +179,7 @@ TObjArray * AliTRDcheckPID::Histos(){
   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);
 
@@ -193,7 +208,7 @@ TObjArray * AliTRDcheckPID::Histos(){
 
 
 //________________________________________________________________________
-Bool_t AliTRDcheckPID::CheckTrackQuality(const AliTRDtrackV1* track) 
+Bool_t AliTRDcheckPID::CheckTrackQuality(const AliTRDtrackV1* track) const
 {
   //
   // Check if the track is ok for PID
@@ -210,6 +225,7 @@ Bool_t AliTRDcheckPID::CheckTrackQuality(const AliTRDtrackV1* track)
 //________________________________________________________________________
 Int_t AliTRDcheckPID::CalcPDG(AliTRDtrackV1* track) 
 {
+// Documentation to come
 
   track -> SetReconstructor(fReconstructor);
   (const_cast<AliTRDrecoParam*>(fReconstructor->GetRecoParam()))->SetPIDNeuralNetwork();
@@ -283,7 +299,7 @@ TH1 *AliTRDcheckPID::PlotLQ(const AliTRDtrackV1 *track)
   }
   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;
 
@@ -446,17 +462,17 @@ TH1 *AliTRDcheckPID::PlotdEdx(const AliTRDtrackV1 *track)
   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;
 }
@@ -497,7 +513,7 @@ TH1 *AliTRDcheckPID::PlotdEdxSlice(const AliTRDtrackV1 *track)
   }
   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;
@@ -740,7 +756,9 @@ TH1 *AliTRDcheckPID::PlotMomBin(const AliTRDtrackV1 *track)
 //________________________________________________________
 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;
@@ -754,27 +772,29 @@ Bool_t AliTRDcheckPID::GetRefFigure(Int_t ifig)
     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();
@@ -783,19 +803,21 @@ Bool_t AliTRDcheckPID::GetRefFigure(Int_t ifig)
 
     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();
@@ -807,7 +829,7 @@ Bool_t AliTRDcheckPID::GetRefFigure(Int_t ifig)
     // 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);
@@ -817,15 +839,15 @@ Bool_t AliTRDcheckPID::GetRefFigure(Int_t ifig)
       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);
@@ -848,7 +870,7 @@ Bool_t AliTRDcheckPID::GetRefFigure(Int_t ifig)
 
     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);
@@ -856,19 +878,19 @@ Bool_t AliTRDcheckPID::GetRefFigure(Int_t ifig)
       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);
@@ -876,15 +898,15 @@ Bool_t AliTRDcheckPID::GetRefFigure(Int_t ifig)
       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);
@@ -894,9 +916,11 @@ Bool_t AliTRDcheckPID::GetRefFigure(Int_t ifig)
   }
   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++){
@@ -907,13 +931,18 @@ Bool_t AliTRDcheckPID::GetRefFigure(Int_t ifig)
       //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);
@@ -927,7 +956,7 @@ Bool_t AliTRDcheckPID::GetRefFigure(Int_t ifig)
   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++){
@@ -938,16 +967,16 @@ Bool_t AliTRDcheckPID::GetRefFigure(Int_t ifig)
       //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);
@@ -984,19 +1013,21 @@ Bool_t AliTRDcheckPID::PostProcess()
 }
 
 //________________________________________________________________________
-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]);
@@ -1007,14 +1038,14 @@ void AliTRDcheckPID::EvaluatePionEfficiency(TObjArray *histoContainer, TObjArray
   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);
@@ -1028,17 +1059,17 @@ void AliTRDcheckPID::EvaluatePionEfficiency(TObjArray *histoContainer, TObjArray
          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());
     }
   }
 }
index a4821e768cb3e23552d19856411d2acf5b31daa2..b8d06f36da0f07a886004d2d6f8fca8658074d88 100644 (file)
@@ -3,7 +3,7 @@
 
 //////////////////////////////////////////////////////
 //
-// 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>
@@ -23,6 +23,7 @@ class AliTRDReconstructor;
 class AliTRDpidUtil;
 class AliTRDcheckPID : public AliTRDrecoTask 
 {
+public:
   // Plots registered for this task
   enum{
      kEfficiency     =  0     // pi Efficiency plot
@@ -35,7 +36,6 @@ class AliTRDcheckPID : public AliTRDrecoTask
     ,kNTracklets     =  7     // Number of tracklets per track
     ,kNPlots         =  8     // Number of plots for this tasks 
   };
-public:
   AliTRDcheckPID();
   virtual ~AliTRDcheckPID();
   
@@ -58,10 +58,10 @@ public:
   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);
@@ -71,7 +71,7 @@ private:
   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
index c25d4bb9c0c0654e448fd499b8595185a2be7e7b..fc8d264396f1f4c8006d9a43a1ed41a3f4062789 100644 (file)
@@ -210,12 +210,13 @@ AliTRDclusterResolution::AliTRDclusterResolution(const char *name, const char *t
   ,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
@@ -232,6 +233,8 @@ AliTRDclusterResolution::AliTRDclusterResolution(const char *name, const char *t
 //_______________________________________________________
 AliTRDclusterResolution::~AliTRDclusterResolution()
 {
+// Destructor
+
   if(fCanvas) delete fCanvas;
   if(fAt) delete fAt;
   if(fResults){
@@ -256,6 +259,8 @@ void AliTRDclusterResolution::CreateOutputObjects()
 //_______________________________________________________
 Bool_t AliTRDclusterResolution::GetRefFigure(Int_t ifig)
 {
+// Steering function to retrieve performance plots
+
   if(!fResults) return kFALSE;
   TLegend *leg = 0x0;
   TList *l = 0x0;
@@ -381,6 +386,8 @@ Bool_t AliTRDclusterResolution::GetRefFigure(Int_t ifig)
 //_______________________________________________________
 TObjArray* AliTRDclusterResolution::Histos()
 {
+// Retrieve histograms array if already build or build it
+
   if(fContainer) return fContainer;
   fContainer = new TObjArray(kNtasks);
   //fContainer->SetOwner(kTRUE);
@@ -467,6 +474,8 @@ TObjArray* AliTRDclusterResolution::Histos()
 //_______________________________________________________
 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;
@@ -494,6 +503,8 @@ void AliTRDclusterResolution::Exec(Option_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
index 2c923f3ade62e9c84242c7fb448ed0b269ca1854..94907d859a5ec6e61e92c766efa055d3c3f9184e 100644 (file)
@@ -1,6 +1,12 @@
 #ifndef ALITRDCLUSTERRESOLUTION_H
 #define ALITRDCLUSTERRESOLUTION_H
 
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  TRD cluster error parameterization                  
+//  Authors:                                                              //
+//    Alexandru Bercuci <A.Bercuci@gsi.de>                                //
+////////////////////////////////////////////////////////////////////////////
 
 #ifndef ALITRDRECOTASK_H
 #include "AliTRDrecoTask.h"
index f2a96fc7ef9125e9f2ac2e65341fd20fb57a5b9e..a287ab12edd7f864e73ecd57d912282b33f427e9 100644 (file)
@@ -37,7 +37,7 @@
 //   //res->SetMCdata();
 //   //res->SetVerbose();
 //   //res->SetVisual();
-//   res->Load("TRD.TaskResolution.root");
+//   res->Load();
 //   if(!res->PostProcess()) return;
 //   res->GetRefFigure(0);
 // }  
index e8ad8620fd2c2e7400e76b20d8dcaf31c7b35e9c..1922fbfff56485deaefeaba091686af98c84bc02 100644 (file)
@@ -7,9 +7,12 @@
 
 ////////////////////////////////////////////////////////////////////////////
 //                                                                        //
-//  Resolution QA                                                     //
+//  TRD Resolution performance                                            //
 //                                                                        //
-////////////////////////////////////////////////////////////////////////////
+//  Authors:                                                              //
+//    Alexandru Bercuci <A.Bercuci@gsi.de>                                //
+//    Markus Fasel <M.Fasel@gsi.de>                                       //
+//                                                                        //                ////////////////////////////////////////////////////////////////////////////
 
 #ifndef ALITRDRECOTASK_H
 #include "AliTRDrecoTask.h"
index d0847054248d444cc4e81d831894a1496895d09d..9de72450f582de149f36e145fbbcc7cdd597ad24 100644 (file)
@@ -32,7 +32,8 @@
 //   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"
@@ -64,6 +65,7 @@
 #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"
@@ -74,8 +76,7 @@
 #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;