defects fixed
authorbasanta <basanta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 3 Oct 2010 14:52:08 +0000 (14:52 +0000)
committerbasanta <basanta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 3 Oct 2010 14:52:08 +0000 (14:52 +0000)
PMD/AliPMDQADataMakerRec.cxx
PMD/AliPMDQADataMakerSim.cxx
PMD/AliPMDtracker.cxx
PMD/AliPMDv0.cxx
PMD/AliPMDv2008.cxx

index d94dfaf..673e1ba 100644 (file)
@@ -360,20 +360,19 @@ void AliPMDQADataMakerRec::MakeDigits(TTree * digitTree)
     fDigitsArray = new TClonesArray("AliPMDdigit", 1000) ; 
   
   TBranch * branch = digitTree->GetBranch("PMDDigit") ;
-  branch->SetAddress(&fDigitsArray) ;
-  
   if ( ! branch )
     {
-    AliWarning("PMD branch in Digit Tree not found") ; 
+      AliWarning("PMD branch in Digit Tree not found") ; 
     }
   else
     {
-    for (Int_t ient = 0; ient < branch->GetEntries(); ient++)
-      {
-           branch->GetEntry(ient) ; 
-           MakeDigits() ; 
-      }
-    
+      branch->SetAddress(&fDigitsArray) ;
+      for (Int_t ient = 0; ient < branch->GetEntries(); ient++)
+       {
+         branch->GetEntry(ient) ; 
+         MakeDigits() ; 
+       }
+      
     }
 }
 
@@ -383,81 +382,82 @@ void AliPMDQADataMakerRec::MakeRecPoints(TTree * clustersTree)
     // makes data from RecPoints
 
   Int_t multDdl0 = 0, multDdl1 = 0, multDdl2 = 0;
-    Int_t multDdl3 = 0, multDdl4 = 0, multDdl5 = 0;
-
-    AliPMDrecpoint1 * recpoint; 
-
+  Int_t multDdl3 = 0, multDdl4 = 0, multDdl5 = 0;
+  
+  AliPMDrecpoint1 * recpoint; 
+  
   if (fRecPointsArray) 
     fRecPointsArray->Clear() ; 
   else 
     fRecPointsArray = new TClonesArray("AliPMDrecpoint1", 1000) ; 
-    
-    TBranch * branch = clustersTree->GetBranch("PMDRecpoint") ;
-    branch->SetAddress(&fRecPointsArray) ;
+  
+  TBranch * branch = clustersTree->GetBranch("PMDRecpoint") ;
 
-    if ( ! branch )
+  if ( ! branch )
     {
-       AliWarning("PMD branch in Recpoints Tree not found") ; 
+      AliWarning("PMD branch in Recpoints Tree not found") ; 
     }
-    else
+  else
     {
-       for (Int_t imod = 0; imod < branch->GetEntries(); imod++)
+      branch->SetAddress(&fRecPointsArray) ;
+      
+      for (Int_t imod = 0; imod < branch->GetEntries(); imod++)
        {
-           branch->GetEntry(imod) ;
-
-           TIter next(fRecPointsArray) ; 
-
-           while ( (recpoint = dynamic_cast<AliPMDrecpoint1 *>(next())) )
-             {
-               //Float_t xpos = recpoint->GetClusX();
-               //Float_t ypos = recpoint->GetClusY();
-               //Int_t smn = recpoint->GetSMNumber();
-               
-                 if(recpoint->GetDetector() == 0)
-                 {
-                   if(recpoint->GetSMNumber() >= 0 && recpoint->GetSMNumber() < 6)
-                     {
-                       GetRecPointsData(0)->Fill(recpoint->GetClusCells());
-                       multDdl0++;
-                     }
-                   if(recpoint->GetSMNumber() >= 6 && recpoint->GetSMNumber() < 12)
-                     {
-                       GetRecPointsData(1)->Fill(recpoint->GetClusCells());
-                       multDdl1++;
-                     }
-                   if(recpoint->GetSMNumber() >= 12 && recpoint->GetSMNumber() < 18)
-                     {
-                       GetRecPointsData(2)->Fill(recpoint->GetClusCells());
-                       multDdl2++;
-                     }
-                   if(recpoint->GetSMNumber() >= 18 && recpoint->GetSMNumber() < 24)
-                     {
-                       GetRecPointsData(3)->Fill(recpoint->GetClusCells());
-                       multDdl3++;
-                     }
-                 }
-
-               if(recpoint->GetDetector() == 1)
-                 {
-                   if((recpoint->GetSMNumber() >= 0 && recpoint->GetSMNumber() < 6) || 
-                      (recpoint->GetSMNumber() >= 18 && recpoint->GetSMNumber() < 24))
-                     {
-                       GetRecPointsData(4)->Fill(recpoint->GetClusCells());
-                       multDdl4++;
-                     }
-                   if(recpoint->GetSMNumber() >= 6 && recpoint->GetSMNumber() < 18 )
-                     {
-                       GetRecPointsData(5)->Fill(recpoint->GetClusCells());
-                       multDdl5++;
-                     }
-                 }
-             } 
+         branch->GetEntry(imod) ;
+         
+         TIter next(fRecPointsArray) ; 
+         
+         while ( (recpoint = dynamic_cast<AliPMDrecpoint1 *>(next())) )
+           {
+             //Float_t xpos = recpoint->GetClusX();
+             //Float_t ypos = recpoint->GetClusY();
+             //Int_t smn = recpoint->GetSMNumber();
+             
+             if(recpoint->GetDetector() == 0)
+               {
+                 if(recpoint->GetSMNumber() >= 0 && recpoint->GetSMNumber() < 6)
+                   {
+                     GetRecPointsData(0)->Fill(recpoint->GetClusCells());
+                     multDdl0++;
+                   }
+                 if(recpoint->GetSMNumber() >= 6 && recpoint->GetSMNumber() < 12)
+                   {
+                     GetRecPointsData(1)->Fill(recpoint->GetClusCells());
+                     multDdl1++;
+                   }
+                 if(recpoint->GetSMNumber() >= 12 && recpoint->GetSMNumber() < 18)
+                   {
+                     GetRecPointsData(2)->Fill(recpoint->GetClusCells());
+                     multDdl2++;
+                   }
+                 if(recpoint->GetSMNumber() >= 18 && recpoint->GetSMNumber() < 24)
+                   {
+                     GetRecPointsData(3)->Fill(recpoint->GetClusCells());
+                     multDdl3++;
+                   }
+               }
+             
+             if(recpoint->GetDetector() == 1)
+               {
+                 if((recpoint->GetSMNumber() >= 0 && recpoint->GetSMNumber() < 6) || 
+                    (recpoint->GetSMNumber() >= 18 && recpoint->GetSMNumber() < 24))
+                   {
+                     GetRecPointsData(4)->Fill(recpoint->GetClusCells());
+                     multDdl4++;
+                   }
+                 if(recpoint->GetSMNumber() >= 6 && recpoint->GetSMNumber() < 18 )
+                   {
+                     GetRecPointsData(5)->Fill(recpoint->GetClusCells());
+                     multDdl5++;
+                   }
+               }
+           } 
        }
     }
-    
-    GetRecPointsData(6)->Fill(multDdl0,multDdl1);
-    GetRecPointsData(7)->Fill(multDdl2,multDdl3);
-    GetRecPointsData(8)->Fill(multDdl4,multDdl5);
+  
+  GetRecPointsData(6)->Fill(multDdl0,multDdl1);
+  GetRecPointsData(7)->Fill(multDdl2,multDdl3);
+  GetRecPointsData(8)->Fill(multDdl4,multDdl5);
 }
 
 //____________________________________________________________________________
index 8bc6367..df37e19 100644 (file)
@@ -146,56 +146,56 @@ void AliPMDQADataMakerSim::MakeHits()
     //make QA data from Hits
 
   Int_t premul = 0, cpvmul = 0;
-    Float_t edepkev = 0.;
-    TIter next(fHitsArray); 
-    AliPMDhit * hit; 
+  Float_t edepkev = 0.;
+  TIter next(fHitsArray); 
+  AliPMDhit * hit; 
     
-    while ( (hit = dynamic_cast<AliPMDhit *>(next())) )
-      {
-       if (hit->Z() > 361.5)
-         {
-           edepkev = (hit->GetEnergy())/1000.;
-           GetHitsData(0)->Fill(edepkev);
-           premul++;
-         }
-       else if (hit->Z() < 361.5)
-         {
-           edepkev = (hit->GetEnergy())/1000.;
-           GetHitsData(1)->Fill(edepkev);
-           cpvmul++;
-         }
+  while ( (hit = dynamic_cast<AliPMDhit *>(next())) )
+    {
+      if (hit->Z() > 361.5)
+       {
+         edepkev = (hit->GetEnergy())/1000.;
+         GetHitsData(0)->Fill(edepkev);
+         premul++;
+       }
+      else if (hit->Z() < 361.5)
+       {
+         edepkev = (hit->GetEnergy())/1000.;
+         GetHitsData(1)->Fill(edepkev);
+         cpvmul++;
+       }
     }
-
-    if(premul <= 0)
+  
+  if(premul <= 0)
     {
-       GetHitsData(2)->Fill(-1.); 
+      GetHitsData(2)->Fill(-1.); 
     }
-    else
+  else
     {
-       GetHitsData(2)->Fill(premul); 
+      GetHitsData(2)->Fill(premul); 
     }
-
-    if(cpvmul <= 0)
+  
+  if(cpvmul <= 0)
     {
-       GetHitsData(3)->Fill(-1.); 
+      GetHitsData(3)->Fill(-1.); 
     }
-    else
+  else
     {
-       GetHitsData(3)->Fill(cpvmul); 
+      GetHitsData(3)->Fill(cpvmul); 
     }
-
+  
 }
 
 //____________________________________________________________________________
 void AliPMDQADataMakerSim::MakeHits(TTree * hitTree)
 {
-    // make QA data from Hit Tree
-
-    TBranch * branch = hitTree->GetBranch("PMD") ;
-    if ( ! branch )
+  // make QA data from Hit Tree
+  
+  TBranch * branch = hitTree->GetBranch("PMD") ;
+  if ( ! branch )
     {
-       AliWarning("PMD branch in Hit Tree not found") ;
-       return;
+      AliWarning("PMD branch in Hit Tree not found") ;
+      return;
     }
 
   if (fHitsArray) 
@@ -217,19 +217,19 @@ void AliPMDQADataMakerSim::MakeSDigits()
     // makes data from SDigits
 
   Int_t cpvmul = 0, premul = 0;
-    Float_t edepkev = 0.;
-
-    TIter next(fSDigitsArray) ; 
-    AliPMDsdigit * sdigit ; 
-    while ( (sdigit = dynamic_cast<AliPMDsdigit *>(next())) )
+  Float_t edepkev = 0.;
+  
+  TIter next(fSDigitsArray) ; 
+  AliPMDsdigit * sdigit ; 
+  while ( (sdigit = dynamic_cast<AliPMDsdigit *>(next())) )
     {
-       if(sdigit->GetDetector() == 0)
+      if(sdigit->GetDetector() == 0)
        {
          edepkev = (sdigit->GetCellEdep())/1000.;
          GetSDigitsData(0)->Fill(edepkev);
          premul++;
        }
-       if(sdigit->GetDetector() == 1)
+      if(sdigit->GetDetector() == 1)
        {
          edepkev = (sdigit->GetCellEdep())/1000.;
          GetSDigitsData(1)->Fill(edepkev);
@@ -237,29 +237,31 @@ void AliPMDQADataMakerSim::MakeSDigits()
        }
        
     } 
-    if (premul > 0) GetSDigitsData(2)->Fill(premul);
-    if (cpvmul > 0) GetSDigitsData(3)->Fill(cpvmul);
-    
+  if (premul > 0) GetSDigitsData(2)->Fill(premul);
+  if (cpvmul > 0) GetSDigitsData(3)->Fill(cpvmul);
+  
 }
 
 //____________________________________________________________________________
 void AliPMDQADataMakerSim::MakeSDigits(TTree * sdigitTree)
 {
     // makes data from SDigit Tree
-
+  
   if (fSDigitsArray) 
     fSDigitsArray->Clear() ; 
   else 
     fSDigitsArray = new TClonesArray("AliPMDsdigit", 1000) ; 
     
-    TBranch * branch = sdigitTree->GetBranch("PMDSDigit") ;
-    branch->SetAddress(&fSDigitsArray) ;
-
-    if ( ! branch ){
+  TBranch * branch = sdigitTree->GetBranch("PMDSDigit") ;
+  if ( ! branch )
+    {
       AliWarning("PMD branch in SDigit Tree not found") ; 
-    } else {
-           branch->GetEntry(0) ;
-           MakeSDigits() ; 
+    }
+  else
+    {
+      branch->SetAddress(&fSDigitsArray) ;
+      branch->GetEntry(0) ;
+      MakeSDigits() ; 
     }
 }
 
@@ -269,27 +271,27 @@ void AliPMDQADataMakerSim::MakeDigits()
     // makes data from Digits
 
   Int_t cpvmul = 0, premul = 0;
-
-    TIter next(fDigitsArray) ; 
-    AliPMDdigit * digit ; 
-    while ( (digit = dynamic_cast<AliPMDdigit *>(next())) )
+  
+  TIter next(fDigitsArray) ; 
+  AliPMDdigit * digit ; 
+  while ( (digit = dynamic_cast<AliPMDdigit *>(next())) )
     {
-       if(digit->GetDetector() == 0)
+      if(digit->GetDetector() == 0)
        {
-           GetDigitsData(0)->Fill( digit->GetADC()) ;
-           premul++;
+         GetDigitsData(0)->Fill( digit->GetADC()) ;
+         premul++;
        }
-       if(digit->GetDetector() == 1)
+      if(digit->GetDetector() == 1)
        {
-           GetDigitsData(1)->Fill( digit->GetADC());
-           cpvmul++;
+         GetDigitsData(1)->Fill( digit->GetADC());
+         cpvmul++;
        }
     }  
-
-    if (premul > 0) GetDigitsData(2)->Fill(premul);
-    if (cpvmul > 0) GetDigitsData(3)->Fill(cpvmul);
-
-
+  
+  if (premul > 0) GetDigitsData(2)->Fill(premul);
+  if (cpvmul > 0) GetDigitsData(3)->Fill(cpvmul);
+  
+  
 }
 
 //____________________________________________________________________________
@@ -301,22 +303,22 @@ void AliPMDQADataMakerSim::MakeDigits(TTree * digitTree)
     fDigitsArray->Clear() ; 
   else 
     fDigitsArray = new TClonesArray("AliPMDdigit", 1000) ; 
-    
-    TBranch * branch = digitTree->GetBranch("PMDDigit") ;
-    branch->SetAddress(&fDigitsArray) ;
+  
+  TBranch * branch = digitTree->GetBranch("PMDDigit") ;
 
-    if ( ! branch )
+  if ( ! branch )
     {
-       AliWarning("PMD branch in Digit Tree not found") ; 
+      AliWarning("PMD branch in Digit Tree not found") ; 
     }
-    else
+  else
     {
-       for (Int_t ient = 0; ient < branch->GetEntries(); ient++)
+      branch->SetAddress(&fDigitsArray) ;
+      for (Int_t ient = 0; ient < branch->GetEntries(); ient++)
        {
-    branch->GetEntry(ient) ; 
-    MakeDigits() ; 
-    fDigitsArray->Clear() ; 
-    
+         branch->GetEntry(ient) ; 
+         MakeDigits() ; 
+         fDigitsArray->Clear() ; 
+         
        }
       
     }
index 9d9da19..27ef93a 100644 (file)
@@ -212,6 +212,14 @@ void AliPMDtracker::Clusters2Tracks(AliESDEvent *event)
              
              for (Int_t ient1 = 0; ient1 < nenbr1; ient1++)
                {
+                 irow[ient1] = -99;
+                 icol[ient1] = -99;
+                 itra[ient1] = -99;
+                 ipid[ient1] = -99;
+                 cadc[ient1] = 0.;
+               }
+             for (Int_t ient1 = 0; ient1 < nenbr1; ient1++)
+               {
                  rechit = (AliPMDrechit*)fRechits->UncheckedAt(ient1);
                  //irow[ient1] = rechit->GetCellX();
                  //icol[ient1] = rechit->GetCellY();
@@ -473,6 +481,9 @@ void AliPMDtracker::AssignTrPidToCluster(Int_t nentry, Int_t *itra,
       delete [] sortcoord;
       
     }   // end of ngtrack >= 1
+
+  delete [] phentry;
+  delete [] hadentry;
   
 }
 //--------------------------------------------------------------------//
index 7b3a02b..8747b84 100644 (file)
@@ -887,50 +887,32 @@ void AliPMDv0::StepManager()
   // Called at each step in the PMD
   //
   Int_t   copy;
-  Float_t hits[4], destep;
+  Float_t hits[5], destep;
   Float_t center[3] = {0,0,0};
-  Int_t   vol[5];
+  Int_t   vol[6];
   //char *namep;
   
   if(gMC->CurrentMedium() == fMedSens && (destep = gMC->Edep())) {
   
     gMC->CurrentVolID(copy);
-
-    //namep=gMC->CurrentVolName();
-    //printf("Current vol is %s \n",namep);
-
-    vol[0]=copy;
+    vol[0] = copy;
     gMC->CurrentVolOffID(1,copy);
-
-    //namep=gMC->CurrentVolOffName(1);
-    //printf("Current vol 11 is %s \n",namep);
-
-    vol[1]=copy;
+    vol[1] = copy;
     gMC->CurrentVolOffID(2,copy);
-
-    //namep=gMC->CurrentVolOffName(2);
-    //printf("Current vol 22 is %s \n",namep);
-
-    vol[2]=copy;
-
-    // if(strncmp(namep,"EHC1",4))vol[2]=1;
-
+    vol[2] = copy;
     gMC->CurrentVolOffID(3,copy);
-
-    //namep=gMC->CurrentVolOffName(3);
-    //printf("Current vol 33 is %s \n",namep);
-
-    vol[3]=copy;
+    vol[3] = copy;
     gMC->CurrentVolOffID(4,copy);
-
-    //namep=gMC->CurrentVolOffName(4);
-    //printf("Current vol 44 is %s \n",namep);
-
-    vol[4]=copy;
-    //printf("volume number %d,%d,%d,%d,%d,%f \n",vol[0],vol[1],vol[2],vol[3],vol[4],destep*1000000);
+    vol[4] = copy;
+    gMC->CurrentVolOffID(5,copy);
+    vol[5] = copy;
 
     gMC->Gdtom(center,hits,1);
     hits[3] = destep*1e9; //Number in eV
+
+   // this is for pile-up events
+    hits[4] = gMC->TrackTime();
+
     AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
   }
 }
index 8cb63f5..20e487d 100644 (file)
@@ -1508,71 +1508,37 @@ void AliPMDv2008::StepManager()
   //
 
   Int_t   copy;
-  Float_t hits[4], destep;
+  Float_t hits[5], destep;
   Float_t center[3] = {0,0,0};
-  Int_t   vol[10];
-  //  const char *namep;
+  Int_t   vol[6];
   
   if(gMC->CurrentMedium() == fMedSens && (destep = gMC->Edep())) {
   
     gMC->CurrentVolID(copy);
-    //     namep=gMC->CurrentVolName();
-    // printf("Current vol  is %s \n",namep);
-    vol[0]=copy;
+    vol[0] = copy;
 
     gMC->CurrentVolOffID(1,copy);
-    //namep=gMC->CurrentVolOffName(1);
-    // printf("Current vol 11 is %s \n",namep);
-    vol[1]=copy;
+    vol[1] = copy;
 
     gMC->CurrentVolOffID(2,copy);
-    //namep=gMC->CurrentVolOffName(2);
-    //printf("Current vol 22 is %s \n",namep);
-    vol[2]=copy;
-
-    // if(strncmp(namep,"EHC1",4))vol[2]=1;
+    vol[2] = copy;
 
     gMC->CurrentVolOffID(3,copy);
-    // namep=gMC->CurrentVolOffName(3);
-    //printf("Current vol 33 is %s \n",namep);
-    vol[3]=copy;
+    vol[3] = copy;
 
     gMC->CurrentVolOffID(4,copy);
-    // namep=gMC->CurrentVolOffName(4);
-    // printf("Current vol 44 is %s \n",namep);
-    vol[4]=copy;
+    vol[4] = copy;
 
     gMC->CurrentVolOffID(5,copy);
-    // namep=gMC->CurrentVolOffName(5);
-    // printf("Current vol 55 is %s \n",namep);
-    vol[5]=copy;
-
-    gMC->CurrentVolOffID(6,copy);
-    // namep=gMC->CurrentVolOffName(6);
-    // printf("Current vol 66 is %s \n",namep);
-    vol[6]=copy;
-
-    gMC->CurrentVolOffID(7,copy);
-    //  namep=gMC->CurrentVolOffName(7);
-    // printf("Current vol 77 is %s \n",namep);
-    vol[7]=copy;
-
-    gMC->CurrentVolOffID(8,copy);
-    // namep=gMC->CurrentVolOffName(8);
-    // printf("Current vol 88 is %s \n",namep);
-    vol[8]=copy;
+    vol[5] = copy;
 
 
-    gMC->CurrentVolOffID(9,copy);
-    // namep=gMC->CurrentVolOffName(9);
-    // printf("Current vol 99 is %s \n",namep);
-    vol[9]=copy;
-
-
-    // printf("volume number %4d %4d %4d %4d %4d %4d %4d %4d %4d %4d %10.3f \n",vol[0],vol[1],vol[2],vol[3],vol[4],vol[5],vol[6],vol[7],vol[8],vol[9],destep*1000000);
-    
     gMC->Gdtom(center,hits,1);
     hits[3] = destep*1e9; //Number in eV
+
+    // this is for pile-up events
+    hits[4] = gMC->TrackTime();
+
     AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
 
   }