]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDtrackingAnalysis.cxx
corrected test macro: use AliHLTEsdManager::New/Delete;suppress debug messages
[u/mrichter/AliRoot.git] / TRD / AliTRDtrackingAnalysis.cxx
index 696a8339a42bff183db5ef873e7667ffa0c09b11..0f160f442ec33b646c94133f8a1134d6fd48c4ec 100644 (file)
 #include "AliRunLoader.h"
 #include "AliTRDgeometry.h"
 #include "AliRun.h"
-#include "AliESD.h"
+#include "AliESDEvent.h"
 #include "AliESDtrack.h"
 #include "AliTrackReference.h"
+#include "AliTracker.h"
 
 #include "AliTRDcluster.h"
 #include "AliTRDpadPlane.h"
 #include "AliTRDcalibDB.h"
-#include "AliTracker.h"
 #include "AliTRDtracker.h"
 //#include "AliTRDtracklet.h"
 
@@ -260,7 +260,7 @@ void AliTRDtrackingAnalysis::DrawResolutionPt(int startEvent, int stopEvent)
 
       if (!(status & AliESDtrack::kTRDout)) continue;
       if (!(status & AliESDtrack::kTRDrefit)) continue;
-      if (TMath::Abs(esdTrack->GetOuterParam()->GetPt()) < 1.0) continue;
+      if (esdTrack->GetOuterParam()->Pt() < 1.0) continue;
 
       int ch=0;
       while(param->GetX() > fGeo->GetTime0(ch)+2) ch++;
@@ -287,7 +287,7 @@ void AliTRDtrackingAnalysis::DrawResolutionPt(int startEvent, int stopEvent)
        AliExternalTrackParam out(*param);
        out.PropagateTo(aRef->LocalX(),bz);
        
-       double dp = aRef->Pt() + out.GetPt();
+       double dp = aRef->Pt() + out.GetSignedPt();
        double dy = 10. * (aRef->LocalY() - out.GetY()); // in mm
 
        fDeltaPt->Fill(100. * dp / aRef->Pt());
@@ -424,10 +424,10 @@ void  AliTRDtrackingAnalysis::DrawRecPointResolution(int startEvent, int stopEve
 
        AliTRDcluster *cls = (AliTRDcluster*)module->At(j);
        if (cls->GetQ() < 10) continue;
-       fTracker->Transform(cls);
+       //fTracker->Transform(cls);
        fClPos->Fill(cls->GetZ(), cls->GetY());
                
-       int plane = fGeo->GetPlane(cls->GetDetector());
+       int layer = fGeo->GetLayer(cls->GetDetector());
        
        int nl = 0;
        for(int k=0; k<3; k++) if (cls->GetLabel(k) > -1) nl++;
@@ -440,7 +440,7 @@ void  AliTRDtrackingAnalysis::DrawRecPointResolution(int startEvent, int stopEve
        fClZXcl->Fill(cls->GetZ(), cls->GetX());
        fClZXref->Fill(zref, cls->GetX());
 
-       AliTRDpadPlane *padPlane = fGeo->GetPadPlane(plane,0);
+       AliTRDpadPlane *padPlane = fGeo->GetPadPlane(layer,0);
        Double_t h01   = TMath::Tan(-TMath::Pi() / 180.0 * padPlane->GetTiltingAngle());
        
        //double dz = zref - padPlane->GetRow0();
@@ -457,7 +457,7 @@ void  AliTRDtrackingAnalysis::DrawRecPointResolution(int startEvent, int stopEve
        fClZZ->Fill(zref, cls->GetZ());
        fClZ->Fill(dz);
        fTgPhi->Fill(tgphi);
-       fClYX->Fill(cls->GetY(), cls->GetX() - fGeo->GetTime0(plane));
+       fClYX->Fill(cls->GetY(), cls->GetX() - fGeo->GetTime0(layer));
       }
     }    
   }
@@ -651,7 +651,7 @@ void  AliTRDtrackingAnalysis::CheckFiles()
   }
   
   fEsdTree = (TTree*)esdFile->Get("esdTree"); 
-  fESD = new AliESD();
+  fESD = new AliESDEvent();
   fESD->ReadFromTree(fEsdTree);
   //fEsdTree->SetBranchAddress("ESD", &fESD);
 }
@@ -674,26 +674,21 @@ void  AliTRDtrackingAnalysis::LoadRefs()
   //AliStack* stack = gAlice->Stack();
   TTree *refTree = fLoader->TreeTR();
     
-  const int kNBranch = 2;
-  const char *brName[] = {"TPC", "TRD"};
   TClonesArray *clRefs = new TClonesArray("AliTrackReference");
-  
-  for(int b=0; b<kNBranch; b++) {
       
-    TBranch *branch = refTree->GetBranch(brName[b]);
-    refTree->SetBranchAddress(brName[b],&clRefs);
+  TBranch *branch = refTree->GetBranch("TrackReferences");
+  refTree->SetBranchAddress("TrackReferences",&clRefs);
     
-    int nEntries = branch->GetEntries();      
-    for(int iTrack = 0; iTrack < nEntries; iTrack++) {
+  int nEntries = branch->GetEntries();      
+  for(int iTrack = 0; iTrack < nEntries; iTrack++) {
        
-      refTree->GetEvent(iTrack);
-      int nPoints =  clRefs->GetEntries();
-      for(int iPoint=0; iPoint<nPoints; iPoint++) {
-       AliTrackReference *ref = (AliTrackReference*)clRefs->At(iPoint);
-       if (b == 0) fRefTPC->Add(new AliTrackReference(*ref));
-       if (b == 1) fRefTRD->Add(new AliTrackReference(*ref));    
-      }        
-    }
+    refTree->GetEvent(iTrack);
+    int nPoints =  clRefs->GetEntries();
+    for(int iPoint=0; iPoint<nPoints; iPoint++) {
+      AliTrackReference *ref = (AliTrackReference*)clRefs->At(iPoint);
+       if (ref->DetectorId() == AliTrackReference::kTPC) fRefTPC->Add(new AliTrackReference(*ref));
+       if (ref->DetectorId() == AliTrackReference::kTRD) fRefTRD->Add(new AliTrackReference(*ref));      
+    }  
   }
   
   fRefTPC->Sort();