]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSComparisonV2.C
DIPO added
[u/mrichter/AliRoot.git] / ITS / AliITSComparisonV2.C
index 39021d4996a2bece11af78a3651acfa7355d6d18..f130c939743da1dcc7cff458695265ed0f32f7b5 100644 (file)
   #include "AliRun.h"
   #include "AliESD.h"
 
-  #include "AliITS.h"
-  #include "AliITSgeom.h"
-  #include "AliITStrackV2.h"
-  #include "AliITSclusterV2.h"
+  #include "AliITSRecPoint.h"
   #include "AliITSLoader.h"
 #endif
 
@@ -49,7 +46,7 @@ static Int_t allselected=0;
 static Int_t allfound=0;
 
 Int_t AliITSComparisonV2
-(Float_t ptcutl=0.2, Float_t ptcuth=10., const Char_t *dir=".", Float_t ratio=0.0) {
+(Float_t ptcutl=0.2, Float_t ptcuth=10., const Char_t *dir=".") {
    gBenchmark->Start("AliITSComparisonV2");
 
    ::Info("AliITSComparisonV2.C","Doing comparison...");
@@ -69,11 +66,11 @@ Int_t AliITSComparisonV2
  
    TH1F *hmpt=(TH1F*)gROOT->FindObject("hmpt");
    if (!hmpt) 
-      hmpt=new TH1F("hmpt","Transverse impact parameter",30,-300,300); 
+      hmpt=new TH1F("hmpt","Transverse impact parameter",30,-777,777); 
    hmpt->SetFillColor(6);
 
    TH1F *hz=(TH1F*)gROOT->FindObject("hz");
-   if (!hz) hz=new TH1F("hz","Longitudinal impact parameter",30,-300,300); 
+   if (!hz) hz=new TH1F("hz","Longitudinal impact parameter",30,-777,777); 
 
 
 
@@ -159,9 +156,6 @@ Int_t AliITSComparisonV2
    while (esdTree->GetEvent(e)) {
      cout<<endl<<endl<<"********* Processing event number: "<<e<<"*******\n";
  
-     Float_t field=event->GetMagneticField();
-     AliKalmanTrack::SetConvConst(1000/0.299792458/field);
      Int_t nentr=event->GetNumberOfTracks();
      allfound+=nentr;
 
@@ -192,16 +186,12 @@ Int_t AliITSComparisonV2
 
         AliESDtrack *esd=0;
         Int_t cnt=0;
-        Int_t pipe=0;
         for (Int_t i=0; i<nentr; i++) {
            AliESDtrack *t=event->GetTrack(i);
           UInt_t status=t->GetStatus();
-          UInt_t flags=AliESDtrack::kTPCin|AliESDtrack::kITSin;
 
            if ((status&AliESDtrack::kITSrefit)==0) continue;
 
-           if ((status&flags)==status) pipe=1;
-
            Int_t lbl=t->GetLabel();
            if (lab==TMath::Abs(lbl)) {
              if (cnt==0) {esd=t; tlab=lbl;}
@@ -216,22 +206,15 @@ Int_t AliITSComparisonV2
            numb[nmult]=cnt; nmult++;        
         }
 
-       if (esd->GetITSFakeRatio()<ratio) tlab = TMath::Abs(tlab);
-
         if (lab==tlab) hfound->Fill(ptg);
         else {
           fake[nfake++]=lab;
           hfake->Fill(ptg); 
         }
 
-        AliITStrackV2 track(*esd);
-        if (pipe!=0) {
-           track.PropagateTo(3.,0.0028,65.19);
-           track.PropagateToVertex();  // This is not "exactly" the vertex 
-        }
-
-        Double_t xv,par[5]; track.GetExternalParameters(xv,par);
-        Float_t phi=TMath::ASin(par[2]) + track.GetAlpha();
+        Double_t alpha=esd->GetAlpha(),xv,par[5]; 
+        esd->GetExternalParameters(xv,par);
+        Float_t phi=TMath::ASin(par[2]) + alpha;
         if (phi<-TMath::Pi()) phi+=2*TMath::Pi();
         if (phi>=TMath::Pi()) phi-=2*TMath::Pi();
         Float_t lam=TMath::ATan(par[3]); 
@@ -243,16 +226,14 @@ Int_t AliITSComparisonV2
         Float_t lamg=TMath::ATan2(ref->Pz(),ptg);
         hl->Fill((lam - lamg)*1000.);
 
-        Double_t d=10000*track.GetD(ref->X(),ref->Y());
-        hmpt->Fill(d);
-
-        Double_t z=10000*(track.GetZ()-ref->Z());
-        hz->Fill(z);
+        Float_t d,z; esd->GetImpactParameters(d,z);
+        hmpt->Fill(10000*d);
+        hz->Fill(10000*z);
 
         hpt->Fill((pt_1 - 1/ptg)/(1/ptg)*100.);
 
         Float_t mom=1./(pt_1*TMath::Cos(lam));
-        Float_t dedx=track.GetdEdx();
+        Float_t dedx=esd->GetITSsignal();
         hep->Fill(mom,dedx,1.);
 
         Int_t pdg=(Int_t)ref->GetLength();  //this is particle's PDG !
@@ -399,19 +380,6 @@ Int_t GoodTracksITS(const Char_t *dir) {
    rl->LoadHeader();
    rl->LoadKinematics();
 
-   AliITS *ITS=(AliITS*)rl->GetAliRun()->GetDetector("ITS");
-   if (!ITS) {
-      ::Error("GoodTracksITS","Can't get the ITS !");
-      delete rl;
-      return 2;
-   }
-   AliITSgeom *geom=ITS->GetITSgeom();
-   if (!geom) {
-      ::Error("GoodTracksITS","Can't get the ITS geometry !"); 
-      delete rl;
-      return 3;
-   }
-
    AliITSLoader* itsl = (AliITSLoader*)rl->GetLoader("ITSLoader");
    if (itsl == 0x0) {
        ::Error("GoodTracksITS","Can not find the ITSLoader");
@@ -448,7 +416,7 @@ Int_t GoodTracksITS(const Char_t *dir) {
 
    sprintf(fname,"%s/GoodTracksITS.root",dir);
    TFile *itsFile=TFile::Open(fname,"recreate");
-   TClonesArray dummy("AliTrackReference",1000), *itsRefs=&dummy;
+   TClonesArray dummy2("AliTrackReference",1000), *itsRefs=&dummy2;
    TTree itsTree("itsTree","Tree with info about the reconstructable ITS tracks");
    itsTree.Branch("ITS",&itsRefs);
 
@@ -470,27 +438,29 @@ Int_t GoodTracksITS(const Char_t *dir) {
         delete rl;
         return 8;
      }
-     TBranch *branch=cTree->GetBranch("Clusters");
+     TBranch *branch=cTree->GetBranch("ITSRecPoints");
      if (!branch) {
         ::Error("GoodTracksITS","Can't get the clusters branch !"); 
         delete rl;
         return 9;
      }
-     TClonesArray dummy("AliITSclusterV2",10000), *clusters=&dummy;
+     TClonesArray dummy("AliITSRecPoint",10000), *clusters=&dummy;
      branch->SetAddress(&clusters);
 
      Int_t entr=(Int_t)cTree->GetEntries();
      for (k=0; k<entr; k++) {
          cTree->GetEvent(k);
          Int_t ncl=clusters->GetEntriesFast(); if (ncl==0) continue;
-         Int_t lay,lad,det;  geom->GetModuleId(k,lay,lad,det);
-         if (lay<1 || lay>6) {
-           ::Error("GoodTracksITS","Wrong layer !"); 
-            delete rl;
-            return 10;
-         }
          while (ncl--) {
-            AliITSclusterV2 *pnt=(AliITSclusterV2*)clusters->UncheckedAt(ncl);
+            AliITSRecPoint *pnt=(AliITSRecPoint*)clusters->UncheckedAt(ncl);
+
+            Int_t lay=pnt->GetLayer();
+            if (lay<0 || lay>5) {
+               ::Error("GoodTracksITS","Wrong layer !");
+               delete rl;
+               return 10;
+            }
+
             Int_t l0=pnt->GetLabel(0);
               if (l0>=np) {
 //              cerr<<"Wrong label: "<<l0<<endl;
@@ -506,7 +476,7 @@ Int_t GoodTracksITS(const Char_t *dir) {
 //              cerr<<"Wrong label: "<<l2<<endl;
                 continue;
               }
-            Int_t mask=1<<(lay-1);
+            Int_t mask=1<<lay;
             if (l0>=0) good[l0]|=mask; 
             if (l1>=0) good[l1]|=mask; 
             if (l2>=0) good[l2]|=mask;
@@ -531,9 +501,9 @@ Int_t GoodTracksITS(const Char_t *dir) {
            continue;
         }
 
-        AliTrackReference *ref=new((*itsRefs)[nt]) AliTrackReference(*tpcRef);
-        ref->SetMomentum(p->Px(),p->Py(),p->Pz());
-        ref->SetPosition(p->Vx(),p->Vy(),p->Vz());
+       AliTrackReference *ref=new((*itsRefs)[nt]) AliTrackReference(*tpcRef);
+       ref->SetMomentum(p->Px(),p->Py(),p->Pz());
+       ref->SetPosition(p->Vx(),p->Vy(),p->Vz());
         nt++;
      }
      tpcRefs->Clear();