]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCComparison.C
doxy: TPC/stressTest/testSparse converted
[u/mrichter/AliRoot.git] / TPC / AliTPCComparison.C
index 3c40e2e680c9fd1a2cf130781e4019eba0bb6745..808179c6f902c6089d010769da3a98ada7cf57fa 100644 (file)
@@ -1,13 +1,11 @@
-/****************************************************************************
- *           Very important, delicate and rather obscure macro.             *
- *                                                                          *
- *               Creates list of "trackable" tracks,                        *
- *             calculates efficiency, resolutions etc.                      *
- *     There is a possibility to run this macro over several events.         *
- *                                                                          *
- *           Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch                 *
- * with several nice improvements by: M.Ivanov, GSI, m.ivanov@gsi.de        *
- ****************************************************************************/
+/// \file AliTPCComparison.C
+/// \brief Very important, delicate and rather obscure macro
+///
+/// Creates list of "trackable" tracks, calculates efficiency, resolutions etc.
+///
+/// There is a possibility to run this macro over several events.
+///
+/// \author I.Belikov, CERN, Jouri.Belikov@cern.ch, M.Ivanov, GSI, m.ivanov@gsi.de
 
 #if !defined(__CINT__) || defined(__MAKECINT__)
   #include <TMath.h>
   #include "AliTPCClustersRow.h"
   #include "AliTPCcluster.h"
   #include "AliTPCLoader.h"
+
+  #include "AliCDBManager.h"
+  #include "AliTPCcalibDB.h"
 #endif
 
 Int_t GoodTracksTPC(const Char_t *dir=".");
 
-extern AliRun *gAlice;
 extern TBenchmark *gBenchmark;
 extern TROOT *gROOT;
 
@@ -156,7 +156,8 @@ Int_t AliTPCComparison
    event->ReadFromTree(esdTree);
 
 
-   //******* Loop over events *********
+  // ******* Loop over events *********
+
    Int_t e=0;
    while (esdTree->GetEvent(e)) {
       cout<<endl<<endl<<"********* Processing event number: "<<e<<"*******\n";
@@ -373,12 +374,6 @@ Int_t AliTPCComparison
 
 
 Int_t GoodTracksTPC(const Char_t *dir) {
-   if (gAlice) { 
-       delete gAlice->GetRunLoader();
-       delete gAlice;//if everything was OK here it is already NULL
-       gAlice = 0x0;
-   }
-
    Char_t fname[100];
    sprintf(fname,"%s/galice.root",dir);
 
@@ -411,14 +406,17 @@ Int_t GoodTracksTPC(const Char_t *dir) {
       return 3;
    } 
 
-   rl->CdGAFile();
-   AliTPCParamSR *digp=(AliTPCParamSR*)gDirectory->Get("75x40_100x60_150x60");
+
+   AliCDBManager *man=AliCDBManager::Instance();
+   man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+   man->SetRun(0);
+   AliTPCParamSR *digp=
+   (AliTPCParamSR*)(AliTPCcalibDB::Instance()->GetParameters());
    if (!digp) { 
-     ::Error("AliTPCHits2Digits.C","TPC parameters have not been found !");
+     ::Error("AliTPCComparison.C","TPC parameters have not been found !");
      delete rl;
      return 4; 
    }
-   TPC->SetParam(digp);
 
    Int_t nrow_up=digp->GetNRowUp();
    Int_t nrows=digp->GetNRowLow()+nrow_up;
@@ -553,8 +551,9 @@ Int_t GoodTracksTPC(const Char_t *dir) {
         if (p->Pt()<0.100) continue;
         if (TMath::Abs(p->Pz()/p->Pt())>0.999) continue;
 
-        Double_t vx=p->Vx(),vy=p->Vy();
+        Double_t vx=p->Vx(),vy=p->Vy(),vz=p->Vz();
         if (TMath::Sqrt(vx*vx+vy*vy)>3.5) continue;
+        if (TMath::Abs(vz) > 50.) continue;
 
         AliTrackReference *ref=new((*refs)[nt]) AliTrackReference();