x and y interchange
authorbnandi <bnandi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 18 Jul 2006 11:09:59 +0000 (11:09 +0000)
committerbnandi <bnandi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 18 Jul 2006 11:09:59 +0000 (11:09 +0000)
PMD/AliPMDDigitsRead.C
PMD/AliPMDHitsRead.C

index 5a97903..fbc9cc7 100644 (file)
@@ -4,24 +4,11 @@
 //                                                     //
 // ----------------------------------------------------//
 
-#include "Riostream.h"
-#include "TROOT.h"
-#include "TFile.h"
-#include "TNetFile.h"
-#include "TRandom.h"
-#include "TTree.h"
-#include "TBranch.h"
-#include "TClonesArray.h"
-#include "TStopwatch.h"
-#include <stdlib.h>
-
 void AliPMDDigitsRead(Int_t nevt = 1) 
 {
   TStopwatch timer;
   timer.Start();
   
-  //  FILE *fp = fopen("junk.dat","w");
-
   AliRunLoader *fRunLoader = AliRunLoader::Open("galice.root");
                                  
   if (!fRunLoader)
@@ -50,16 +37,17 @@ void AliPMDDigitsRead(Int_t nevt = 1)
   
   fPMDLoader->LoadDigits("READ");
   TClonesArray *fDigits; 
+  AliPMDUtility cc;
+
+  TH2F *h2 = new TH2F("h2","Y vs. X",200,-100.,100.,200,-100.,100.);
 
   // -------------------------------------------------------------- //
 
   Int_t    det = 0,smn = 0;
-  Int_t    xpos,ypos;
+  Int_t    xpos, ypos, xpad, ypad;
   Float_t  adc;
-  Int_t    isup;
-  Int_t    idet;
-  Float_t  clusdata[7];
-  
+  Float_t  xx,yy;
+
   for (Int_t ievt = 2; ievt <nevt; ievt++)
     {
       fRunLoader->GetEvent(ievt);
@@ -92,13 +80,27 @@ void AliPMDDigitsRead(Int_t nevt = 1)
              ypos   = pmddigit->GetColumn();
              adc    = pmddigit->GetADC();
              Int_t trno   = pmddigit->GetTrackNumber();
+             if(smn <12)
+               {
+                 xpad = ypos;
+                 ypad = xpos;
+               }
+             else if(smn >=12 && smn < 24)
+               {
+                 xpad = xpos;
+                 ypad = ypos;
+               }
              
-             //fprintf(fp,"%d %d %d %d %f \n ",ievt,smn,xpos,ypos,adc);
-             
+             if(det==1)
+               {
+                 cc.RectGeomCellPos(smn,xpad,ypad,xx,yy);
+                 h2->Fill(xx,yy); 
+               }
            }
        } // modules
     }
 
+  h2->Draw();
   timer.Stop();
   timer.Print();
 }
index 82463a2..6696526 100644 (file)
@@ -6,7 +6,7 @@ void AliPMDHitsRead(Int_t nevt = 1)
   
   TStopwatch timer;
   timer.Start();
-  
+  TH2F *h2 = new TH2F("h2"," Y vs. X",200,-100.,100.,200,-100.,100.); 
   //  FILE *fpw = fopen("alipmdhits.dat","w");
 
   AliRunLoader *fRunLoader = AliRunLoader::Open("galice.root");
@@ -47,17 +47,19 @@ void AliPMDHitsRead(Int_t nevt = 1)
 
   const Int_t kPi0 = 111;
   const Int_t kGamma = 22;
-  Int_t npmd;
-  Int_t trackno;
-  Int_t smnumber;
-  Int_t trackpid;
-  Int_t mtrackno;
-  Int_t mtrackpid;
-
-  Float_t xPos, yPos, zPos;
-  Int_t xpad = -1, ypad = -1;
+  Int_t   npmd;
+  Int_t   trackno;
+  Int_t   smnumber;
+  Int_t   trackpid;
+  Int_t   mtrackno;
+  Int_t   mtrackpid;
+  Int_t   xpad = -1, ypad = -1;
   Float_t edep;
   Float_t vx = -999.0, vy = -999.0, vz = -999.0;
+  Float_t xPos, yPos, zPos;
+  Float_t xx, yy;
+
+  AliPMDUtility cc;
 
   for (Int_t ievt = 0; ievt < nevt; ievt++)
     {
@@ -176,8 +178,8 @@ void AliPMDHitsRead(Int_t nevt = 1)
                  edep       = fPMDHit->GetEnergy();
                  Int_t vol1 = fPMDHit->GetVolume(1); // Column
                  Int_t vol2 = fPMDHit->GetVolume(2); // Row
-                 Int_t vol3 = fPMDHit->GetVolume(3); // UnitModule
-                 Int_t vol6 = fPMDHit->GetVolume(6); // SuperModule
+                 Int_t vol3 = fPMDHit->GetVolume(7); // UnitModule
+                 Int_t vol6 = fPMDHit->GetVolume(8); // SuperModule
                  
                  // -----------------------------------------//
                  // For Super Module 1 & 2                   //
@@ -186,31 +188,28 @@ void AliPMDHitsRead(Int_t nevt = 1)
                  //  nrow = 48, ncol = 96                    //
                  // -----------------------------------------//
                  
-                 smnumber = (vol6-1)*6 + vol3;
+                 smnumber = (vol6-1)*6 + (vol3-1);
                  
-                 if (vol6 == 1 || vol6 == 2)
-                   {
-                     xpad = vol2;
-                     ypad = vol1;
-                   }
-                 else if (vol6 == 3 || vol6 == 4)
+                 xpad = vol1 - 1;
+                 ypad = vol2 - 1;
+                 
+                 if(zPos > 361.5)
                    {
-                     xpad = vol1;
-                     ypad = vol2;
+                     cc.RectGeomCellPos(smnumber,xpad,ypad,xx,yy);
+                     h2->Fill(xx,yy);
                    }
                  
-                 //printf("Zposition = %f Edeposition = %f",zPos,edep);
-                 Float_t zposition = TMath::Abs(zPos);
-                 
                }
            }
        } // Track Loop ended
       
     }
+
+  h2->Draw();
+
   fRunLoader->UnloadgAlice();
   fRunLoader->UnloadHeader();
   fRunLoader->UnloadKinematics();
-  
   fPMDLoader->UnloadHits();
 
   timer.Stop();