Fixing the coding conventions.
authorbelikov <belikov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Jun 2009 14:22:15 +0000 (14:22 +0000)
committerbelikov <belikov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Jun 2009 14:22:15 +0000 (14:22 +0000)
PWG1/comparison/AliTPCComparisonTask.cxx
PWG1/comparison/AliTPCComparisonTask.h

index b0cb745..e4cfc93 100644 (file)
@@ -1,3 +1,10 @@
+//-------------------------------------------------------------------------
+//
+// This is the PROOF-enabled version of TPC/AliTPCComparison.C macro.
+// Origin:  Andrei.Zalite@cern.ch
+//
+//-------------------------------------------------------------------------
+
 #include "TChain.h"
 #include "TTree.h"
 #include "TH1F.h"
@@ -9,10 +16,6 @@
 #include "TLine.h"
 #include "TText.h"
 #include "TFile.h"
-#include "TBenchmark.h"
-
-#include "AliAnalysisTask.h"
-#include "AliAnalysisManager.h"
 
 #include "AliLog.h"
 #include "AliVEvent.h"
@@ -21,6 +24,7 @@
 #include "AliESDtrack.h"
 #include "AliTrackReference.h"
 #include "AliMCComparisonTrack.h"
+#include "AliMCComparisonTrack.cxx"
 
 #include "AliTPCComparisonTask.h"
 
@@ -30,17 +34,17 @@ ClassImp(AliTPCComparisonTask)
 AliTPCComparisonTask::AliTPCComparisonTask()
   : AliAnalysisTaskSE("AliTPCComparisonTask"),
     fListOfHistos(0),
-    hgood(0),
-    hfound(0),
-    hfake(0),
-    hp(0),
-    hl(0),
-    hpt(0),
-    hmpt(0),
-    he(0),
-    hep(0),
-    hgoodPhi(0),
-    hfoundPhi(0)
+    fGood(0),
+    fFound(0),
+    fFake(0),
+    fP(0),
+    fL(0),
+    fPt(0),
+    fHmpt(0),
+    fE(0),
+    fEp(0),
+    fGoodPhi(0),
+    fFoundPhi(0)
 {
   // Default constructor
   AliInfo("Default constructor AliTPCComparisonTask");
@@ -55,17 +59,17 @@ AliTPCComparisonTask::AliTPCComparisonTask()
 AliTPCComparisonTask::AliTPCComparisonTask(const char* name)
   : AliAnalysisTaskSE(name),
     fListOfHistos(0),
-    hgood(0),
-    hfound(0),
-    hfake(0),
-    hp(0),
-    hl(0),
-    hpt(0),
-    hmpt(0),
-    he(0),
-    hep(0),
-    hgoodPhi(0),
-    hfoundPhi(0)
+    fGood(0),
+    fFound(0),
+    fFake(0),
+    fP(0),
+    fL(0),
+    fPt(0),
+    fHmpt(0),
+    fE(0),
+    fEp(0),
+    fGoodPhi(0),
+    fFoundPhi(0)
 {
   // Constructor
   AliInfo("Constructor AliTPCComparisonTask");
@@ -85,29 +89,29 @@ void AliTPCComparisonTask::UserCreateOutputObjects()
   // Create output container
   fListOfHistos = new TList();
   
-  hgood = new TH1F("hgood", "Pt for good tracks", 34, 0.2, 7.0);
-  hfound = new TH1F("hfound", "Pt for found tracks", 34, 0.2, 7.0);
-  hfake = new TH1F("hfake",  "Pt for fake tracks", 34, 0.2, 7.0);
-  hp = new TH1F("hp", "PHI resolution", 50, -20., 20.);
-  hl = new TH1F("hl", "LAMBDA resolution", 50, -20., 20.);
-  hpt = new TH1F("hpt", "Relative Pt resolution", 30, -10., 10.);
-  hmpt = new TH1F("hmpt", "Relative Pt resolution (pt>4GeV/c)", 30, -60., 60.);
-  he = new TH1F("he", "dE/dX for pions with 0.4<p<0.5 GeV/c", 50, 0., 100.);
-  hep = new TH2F("hep", "dE/dX vs momentum", 50, 0., 2., 50, 0., 400.);
-  hgoodPhi = new TH1F("hgoodPhi", "Phi for good tracks", 90, 0., 2.*TMath::Pi());
-  hfoundPhi = new TH1F("hfoundPhi", "Phi for found tracks", 90, 0., 2.*TMath::Pi());
+  fGood = new TH1F("fGood", "Pt for good tracks", 34, 0.2, 7.0);
+  fFound = new TH1F("fFound", "Pt for found tracks", 34, 0.2, 7.0);
+  fFake = new TH1F("fFake",  "Pt for fake tracks", 34, 0.2, 7.0);
+  fP = new TH1F("fP", "PHI resolution", 50, -20., 20.);
+  fL = new TH1F("fL", "LAMBDA resolution", 50, -20., 20.);
+  fPt = new TH1F("fPt", "Relative Pt resolution", 30, -10., 10.);
+  fHmpt = new TH1F("fHmpt", "Relative Pt resolution (pt>4GeV/c)", 30, -60., 60.);
+  fE = new TH1F("fE", "dE/dX for pions with 0.4<p<0.5 GeV/c", 50, 0., 100.);
+  fEp = new TH2F("fEp", "dE/dX vs momentum", 50, 0., 2., 50, 0., 400.);
+  fGoodPhi = new TH1F("fGoodPhi", "Phi for good tracks", 90, 0., 2.*TMath::Pi());
+  fFoundPhi = new TH1F("fFoundPhi", "Phi for found tracks", 90, 0., 2.*TMath::Pi());
   
-  fListOfHistos->Add(hgood);
-  fListOfHistos->Add(hfound);
-  fListOfHistos->Add(hfake);
-  fListOfHistos->Add(hp);
-  fListOfHistos->Add(hl);
-  fListOfHistos->Add(hpt);
-  fListOfHistos->Add(hmpt);
-  fListOfHistos->Add(he);
-  fListOfHistos->Add(hep);
-  fListOfHistos->Add(hgoodPhi);
-  fListOfHistos->Add(hfoundPhi);
+  fListOfHistos->Add(fGood);
+  fListOfHistos->Add(fFound);
+  fListOfHistos->Add(fFake);
+  fListOfHistos->Add(fP);
+  fListOfHistos->Add(fL);
+  fListOfHistos->Add(fPt);
+  fListOfHistos->Add(fHmpt);
+  fListOfHistos->Add(fE);
+  fListOfHistos->Add(fEp);
+  fListOfHistos->Add(fGoodPhi);
+  fListOfHistos->Add(fFoundPhi);
 }
 
 
@@ -165,12 +169,12 @@ void AliTPCComparisonTask::UserExec(Option_t *)
       Int_t pdg = particle->GetPdgCode();
       ref->SetPDG(pdg); 
       ref->SetPz(trackRef->Pz());
-      Float_t Pt = trackRef->Pt();
-      ref->SetPt(Pt);
-      hgood->Fill(Pt);
+      Float_t pt = trackRef->Pt();
+      ref->SetPt(pt);
+      fGood->Fill(pt);
       Float_t phig = trackRef->Phi();
       ref->SetPhi(phig);
-      hgoodPhi->Fill(phig);
+      fGoodPhi->Fill(phig);
       nt++;  
     }    
   } //track loop 
@@ -190,12 +194,12 @@ void AliTPCComparisonTask::UserExec(Option_t *)
   Int_t nfake = 0;
   Int_t nlost = 0;
   
-  Int_t MCgoods = refs->GetEntriesFast();
+  Int_t mcGoods = refs->GetEntriesFast();
   
-  for (Int_t k = 0; k < MCgoods; k++) {
+  for (Int_t k = 0; k < mcGoods; k++) {
     AliMCComparisonTrack* ref = (AliMCComparisonTrack*)refs->UncheckedAt(k);
     if (!ref) continue;
-    Int_t MCLabel = ref->GetLabel();
+    Int_t mcLabel = ref->GetLabel();
     Float_t ptg = ref->GetPt();
     Float_t Phig = ref->GetPhi();
 
@@ -209,16 +213,16 @@ void AliTPCComparisonTask::UserExec(Option_t *)
       
       if (! track->IsOn(AliESDtrack::kTPCrefit)) continue;     
       
-      Int_t TPCLabel =  track->GetTPCLabel();      
-      if (MCLabel == TMath::Abs(TPCLabel)) {     
-        if (MCLabel == TPCLabel) {
+      Int_t tpcLabel =  track->GetTPCLabel();      
+      if (mcLabel == TMath::Abs(tpcLabel)) {     
+        if (mcLabel == tpcLabel) {
          nfound++;
-         hfound->Fill(ptg);
-         hfoundPhi->Fill(Phig);
+         fFound->Fill(ptg);
+         fFoundPhi->Fill(Phig);
        } 
        else {
          nfake++;
-         hfake->Fill(ptg);
+         fFake->Fill(ptg);
        }
        iFound = kTRUE;
        
@@ -228,26 +232,26 @@ void AliTPCComparisonTask::UserExec(Option_t *)
        if (phi < 0) phi += 2*TMath::Pi();
         Double_t pt = TMath::Sqrt(pxpypz[0]*pxpypz[0]+pxpypz[1]*pxpypz[1]);
         Float_t lam = TMath::ATan2(pxpypz[2],pt); 
-        Float_t pt_1 = 1/pt;
+        Float_t pt1 = 1/pt;
 
         Int_t pdg = ref->GetPDG();  
         if (TMath::Abs(pdg) == 11 && ptg>4.) {
          //high momentum electrons
-          hmpt->Fill((pt_1 - 1/ptg)/(1/ptg)*100.);
+          fHmpt->Fill((pt1 - 1/ptg)/(1/ptg)*100.);
         } 
        else {
-          hp->Fill((phi - Phig)*1000.);          
+          fP->Fill((phi - Phig)*1000.);          
          Float_t lamg = TMath::ATan2(ref->GetPz(),ptg);
-          hl->Fill((lam - lamg)*1000.);
-          hpt->Fill((pt_1 - 1/ptg)/(1/ptg)*100.);
+          fL->Fill((lam - lamg)*1000.);
+          fPt->Fill((pt1 - 1/ptg)/(1/ptg)*100.);
         }
        
        Float_t mom = pt/TMath::Cos(lam);
         Float_t dedx = track->GetTPCsignal();
-        hep->Fill(mom, dedx, 1.);
+        fEp->Fill(mom, dedx, 1.);
         if (TMath::Abs(pdg) == 211) { // pions
          if (mom > 0.4 && mom < 0.5) {
-            he->Fill(dedx,1.);
+            fE->Fill(dedx,1.);
           }
        }   
           
@@ -280,17 +284,17 @@ void AliTPCComparisonTask::Terminate(Option_t *)
     return;
   }
 
-  hgood = dynamic_cast<TH1F*>(fListOfHistos->At(0));
-  hfound = dynamic_cast<TH1F*>(fListOfHistos->At(1));
-  hfake = dynamic_cast<TH1F*>(fListOfHistos->At(2));  
-  hp = dynamic_cast<TH1F*>(fListOfHistos->At(3));
-  hl = dynamic_cast<TH1F*>(fListOfHistos->At(4));
-  hpt = dynamic_cast<TH1F*>(fListOfHistos->At(5));
-  hmpt = dynamic_cast<TH1F*>(fListOfHistos->At(6));
-  he = dynamic_cast<TH1F*>(fListOfHistos->At(7));
-  hep = dynamic_cast<TH2F*>(fListOfHistos->At(8));
-  hgoodPhi = dynamic_cast<TH1F*>(fListOfHistos->At(9));
-  hfoundPhi = dynamic_cast<TH1F*>(fListOfHistos->At(10));
+  fGood = dynamic_cast<TH1F*>(fListOfHistos->At(0));
+  fFound = dynamic_cast<TH1F*>(fListOfHistos->At(1));
+  fFake = dynamic_cast<TH1F*>(fListOfHistos->At(2));  
+  fP = dynamic_cast<TH1F*>(fListOfHistos->At(3));
+  fL = dynamic_cast<TH1F*>(fListOfHistos->At(4));
+  fPt = dynamic_cast<TH1F*>(fListOfHistos->At(5));
+  fHmpt = dynamic_cast<TH1F*>(fListOfHistos->At(6));
+  fE = dynamic_cast<TH1F*>(fListOfHistos->At(7));
+  fEp = dynamic_cast<TH2F*>(fListOfHistos->At(8));
+  fGoodPhi = dynamic_cast<TH1F*>(fListOfHistos->At(9));
+  fFoundPhi = dynamic_cast<TH1F*>(fListOfHistos->At(10));
 
   gStyle->SetOptStat(111110);
   gStyle->SetOptFit(1);
@@ -301,31 +305,31 @@ void AliTPCComparisonTask::Terminate(Option_t *)
   
   TPad* p1 = new TPad("p1", "", 0., 0.3, 0.5, 0.6); p1->Draw();
   p1->cd(); p1->SetFillColor(42); p1->SetFrameFillColor(10);
-  hp->SetFillColor(4); hp->SetXTitle("(mrad)");
-  if (hp->GetEntries() < minc) hp->Draw(); else hp->Fit("gaus"); c1->cd();
+  fP->SetFillColor(4); fP->SetXTitle("(mrad)");
+  if (fP->GetEntries() < minc) fP->Draw(); else fP->Fit("gaus"); c1->cd();
 
   TPad* p2 = new TPad("p2", "", 0.5, 0.3, 1, 0.6); p2->Draw();
   p2->cd(); p2->SetFillColor(42); p2->SetFrameFillColor(10);
-  hl->SetFillColor(4); hl->SetXTitle("(mrad)");
-  if (hl->GetEntries() < minc) hl->Draw(); else hl->Fit("gaus"); c1->cd();
+  fL->SetFillColor(4); fL->SetXTitle("(mrad)");
+  if (fL->GetEntries() < minc) fL->Draw(); else fL->Fit("gaus"); c1->cd();
   
   TPad* p3 = new TPad("p3", "", 0., 0., 0.5, 0.3); p3->Draw();
   p3->cd(); p3->SetFillColor(42); p3->SetFrameFillColor(10);
-  hpt->SetFillColor(2); hpt->SetXTitle("(%)");
-  if (hpt->GetEntries() < minc) hpt->Draw(); else hpt->Fit("gaus"); c1->cd();
+  fPt->SetFillColor(2); fPt->SetXTitle("(%)");
+  if (fPt->GetEntries() < minc) fPt->Draw(); else fPt->Fit("gaus"); c1->cd();
   
   TPad* p4 = new TPad("p4", "", 0.5, 0., 1., 0.3); p4->Draw();
   p4->cd(); p4->SetFillColor(42); p4->SetFrameFillColor(10);
-  hmpt->SetFillColor(6); hmpt->SetXTitle("(%)");
-  if (hmpt->GetEntries() < minc) hmpt->Draw(); else hmpt->Fit("gaus"); c1->cd(); 
+  fHmpt->SetFillColor(6); fHmpt->SetXTitle("(%)");
+  if (fHmpt->GetEntries() < minc) fHmpt->Draw(); else fHmpt->Fit("gaus"); c1->cd(); 
   
   TPad* p5 = new TPad("p5", "", 0., 0.6, 1., 1.); p5->Draw(); p5->cd();
   p5->SetFillColor(41); p5->SetFrameFillColor(10);
-  hfound->Sumw2(); hgood->Sumw2(); hfake->Sumw2();
+  fFound->Sumw2(); fGood->Sumw2(); fFake->Sumw2();
   TH1F* hg = new TH1F("hg", "Efficiency for good tracks", 34, 0.2, 7.0);
   TH1F* hf = new TH1F("hf", "Efficiency for fake tracks", 34, 0.2, 7.0);
-  hg->Divide(hfound, hgood, 1., 1., "B");
-  hf->Divide(hfake, hgood, 1., 1., "B");
+  hg->Divide(fFound, fGood, 1., 1., "B");
+  hf->Divide(fFake, fGood, 1., 1., "B");
   hg->SetLineColor(4); hg->SetLineWidth(2);
   hg->SetMaximum(1.4);
   hg->SetYTitle("Tracking efficiency");
@@ -353,24 +357,24 @@ void AliTPCComparisonTask::Terminate(Option_t *)
   
   TPad* p6 = new TPad("p6", "", 0., 0., 1., 0.5); p6->Draw();
   p6->cd(); p6->SetFillColor(42); p6->SetFrameFillColor(10);
-  he->SetFillColor(2); he->SetFillStyle(3005);
-  he->SetXTitle("Arbitrary Units");
-  if (he->GetEntries() < minc) he->Draw(); else he->Fit("gaus"); c2->cd();
+  fE->SetFillColor(2); fE->SetFillStyle(3005);
+  fE->SetXTitle("Arbitrary Units");
+  if (fE->GetEntries() < minc) fE->Draw(); else fE->Fit("gaus"); c2->cd();
   
   TPad* p7 = new TPad("p7", "", 0., 0.5, 1., 1.); p7->Draw();
   p7->cd(); p7->SetFillColor(42); p7->SetFrameFillColor(10);
-  hep->SetFillColor(2); hep->SetFillStyle(3005);
-  hep->SetMarkerStyle(8);
-  hep->SetMarkerSize(0.4);
-  hep->SetXTitle("p (GeV/c)"); hep->SetYTitle("dE/dX (Arb. Units)");
-  hep->Draw(); c1->cd();
+  fEp->SetFillColor(2); fEp->SetFillStyle(3005);
+  fEp->SetMarkerStyle(8);
+  fEp->SetMarkerSize(0.4);
+  fEp->SetXTitle("p (GeV/c)"); fEp->SetYTitle("dE/dX (Arb. Units)");
+  fEp->Draw(); c1->cd();
   
   TCanvas* c3 = new TCanvas("c3", "", 10, 10, 510, 510);
   c3->SetFillColor(42); c3->SetFrameFillColor(10);
-  hfoundPhi->Sumw2(); hgoodPhi->Sumw2();
+  fFoundPhi->Sumw2(); fGoodPhi->Sumw2();
   TH1F* hgphi = new TH1F("hgphi", "Efficiency for good tracks (Phi)", 
                         90, 0., 2.*TMath::Pi());
-  hgphi->Divide(hfoundPhi, hgoodPhi, 1., 1., "B"); 
+  hgphi->Divide(fFoundPhi, fGoodPhi, 1., 1., "B"); 
   hgphi->SetYTitle("Tracking efficiency");
   hgphi->SetXTitle("Phi (rad)");
   hgphi->Draw();
index a32c4b6..40e3b56 100644 (file)
@@ -1,5 +1,12 @@
-#ifndef AliTPCComparisonTask_cxx
-#define AliTPCComparisonTask_cxx
+#ifndef ALITPCCOMPARISONTASK_H
+#define ALITPCCOMPARISONTASK_H
+
+//-------------------------------------------------------------------------
+//
+// This is the PROOF-enabled version of TPC/AliTPCComparison.C macro.
+// Origin:  Andrei.Zalite@cern.ch
+//
+//-------------------------------------------------------------------------
 
 class TList;
 class TH1F;
@@ -24,19 +31,19 @@ class AliTPCComparisonTask: public AliAnalysisTaskSE
     virtual void Terminate(Option_t *);
   
   private:
-    TList* fListOfHistos;
+    TList* fListOfHistos; // the list of the output histos
     
-    TH1F* hgood;
-    TH1F* hfound;
-    TH1F* hfake;
-    TH1F* hp;
-    TH1F* hl;
-    TH1F* hpt;
-    TH1F* hmpt;
-    TH1F* he;
-    TH2F* hep;
-    TH1F* hgoodPhi;
-    TH1F* hfoundPhi;
+    TH1F* fGood;          // good tracks
+    TH1F* fFound;         // found tracks
+    TH1F* fFake;          // fake tracks
+    TH1F* fP;             // phi resolution 
+    TH1F* fL;             // lambda resolution
+    TH1F* fPt;            // pt resolution
+    TH1F* fHmpt;          // high-pt resolution
+    TH1F* fE;             // dE/dx for MIP
+    TH2F* fEp;            // dE/dx vs momentum
+    TH1F* fGoodPhi;       // phi for good tracks
+    TH1F* fFoundPhi;      // phi for found tracks
     
     AliTPCComparisonTask(const AliTPCComparisonTask&); // not implemented
     AliTPCComparisonTask& operator=(const AliTPCComparisonTask&); // not implemented