]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDanalyzeHits.C
Update macros
[u/mrichter/AliRoot.git] / TRD / AliTRDanalyzeHits.C
index 1124d3631d62f4064b5c9a89a83236fd28685302..39e907f78df11bcaad44208fb5f2c243dab2d580 100644 (file)
@@ -38,7 +38,7 @@ Int_t AliTRDanalyzeHits()
 
   Float_t rmin   = geo->Rmin();
   Float_t rmax   = geo->Rmax();
-  Float_t length = geo->GetChamberLengthI(0);
+  Float_t length = geo->GetChamberLength(0,2);
   Float_t width  = geo->GetChamberWidth(0);
   Int_t   ncol   = geo->GetColMax(0);
   Int_t   nrow   = geo->GetRowMax(0,2,13);
@@ -86,15 +86,13 @@ Int_t AliTRDanalyzeHits()
     Int_t nTotE  = 0;
     Int_t nTotP  = 0;    
 
-    // Get the number of hits in the TRD created by this particle
-    Int_t nHit = trd->Hits()->GetEntriesFast();
-
     // Loop through the TRD hits  
-    for (Int_t iHit = 0; iHit < nHit; iHit++) {
+    Int_t iHit = 0;
+    AliTRDhit *hit = (AliTRDhit *) trd->FirstHit(-1);
+    while (hit) {
 
       countHits++;
-
-      AliTRDhit *hit = (AliTRDhit *) trd->Hits()->UncheckedAt(iHit);
+      iHit++;
 
       Float_t x     = hit->X();
       Float_t y     = hit->Y();
@@ -104,20 +102,20 @@ Int_t AliTRDanalyzeHits()
       Int_t   det   = hit->GetDetector();
       Int_t   plane = geo->GetPlane(det);
 
-      if      (hit->FromDrift()) {
+      if      (q > 0) {
         hQdedx->Fill(q);
         hZY->Fill(z,y);
         if (plane == 0) {
           hXZ->Fill(x,z);
        }
       }
-      else if (hit->FromTRphoton()) {
+      else if (q < 0) {
         hQtr->Fill(TMath::Abs(q));
       }
 
       TParticle *part = gAlice->Particle(track);
 
-      if ((plane == 0) && (hit->FromDrift())) {
+      if ((plane == 0) && (q > 0)) {
 
         // 3 GeV electrons
         if ((part->GetPdgCode() ==   11) && 
@@ -135,12 +133,14 @@ Int_t AliTRDanalyzeHits()
 
       }
 
+      hit = (AliTRDhit *) trd->NextHit();         
+
     }
 
-    if (nPrimE > 0) hNprimE->Fill(((Double_t) nPrimE)/3.);
-    if (nPrimP > 0) hNprimP->Fill(((Double_t) nPrimP)/3.);
-    if (nTotE  > 0) hNtotE->Fill(((Double_t) nTotE)/3.);
-    if (nTotP  > 0) hNtotP->Fill(((Double_t) nTotP)/3.);
+    if (nPrimE > 0) hNprimE->Fill(((Double_t) nPrimE)/3.7);
+    if (nPrimP > 0) hNprimP->Fill(((Double_t) nPrimP)/3.7);
+    if (nTotE  > 0) hNtotE->Fill(((Double_t) nTotE)/3.7);
+    if (nTotP  > 0) hNtotP->Fill(((Double_t) nTotP)/3.7);
 
   }