]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSReconstructor.cxx
Charged jets (pPb): Improved trackcut analysis
[u/mrichter/AliRoot.git] / PHOS / AliPHOSReconstructor.cxx
index 6d6a5c039baa25f99cfff86da042b35ed762c592..3dc6b251233cc0b969eeb6ec194d214076d4ce49 100644 (file)
@@ -169,38 +169,35 @@ void AliPHOSReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
 
   emcbranch->SetAddress(&fgEMCRecPoints);
   emcbranch->GetEntry(0);
-
-
+  
+  
   // Trigger
-
-  TBranch *tbranch = digitsTree->GetBranch("TPHOS");
-  if (!tbranch) { 
-    AliError("can't get the branch with the PHOS trigger digits !");
-    return;
-  }
-
-  tbranch->SetAddress(&fgTriggerDigits);
-  tbranch->GetEntry(0);
-
-  AliESDCaloTrigger* trgESD = esd->GetCaloTrigger("PHOS");
   
-  if (trgESD) {
-    trgESD->Allocate(fgTriggerDigits->GetEntriesFast());
-
-    for (Int_t i = 0; i < fgTriggerDigits->GetEntriesFast(); i++) {
-      AliPHOSTriggerRawDigit* tdig = (AliPHOSTriggerRawDigit*)fgTriggerDigits->At(i);
-
-      Int_t mod,modX,modZ;
-      tdig->GetModXZ(mod,modX,modZ);
-
-      const Int_t relId[4] = {5-mod,0,modX+1,modZ+1};
-      Int_t absId;
+  TBranch *tbranch = digitsTree->GetBranch("TPHOS");
+  if (tbranch) { 
+    
+    tbranch->SetAddress(&fgTriggerDigits);
+    tbranch->GetEntry(0);
+    
+    AliESDCaloTrigger* trgESD = esd->GetCaloTrigger("PHOS");
+    
+    if (trgESD) {
+      trgESD->Allocate(fgTriggerDigits->GetEntriesFast());
       
-      fGeom->RelToAbsNumbering(relId,absId);
-      trgESD->Add(mod,absId,tdig->GetAmp(),0.,(Int_t*)NULL,0,0,0);
-    }
+      for (Int_t i = 0; i < fgTriggerDigits->GetEntriesFast(); i++) {
+       AliPHOSTriggerRawDigit* tdig = (AliPHOSTriggerRawDigit*)fgTriggerDigits->At(i);
+       
+       Int_t mod,modX,modZ;
+       tdig->GetModXZ(mod,modX,modZ);
+       
+       const Int_t relId[4] = {5-mod,0,modX+1,modZ+1};
+       Int_t absId;
+       
+       fGeom->RelToAbsNumbering(relId,absId);
+       trgESD->Add(mod,absId,tdig->GetAmp(),0.,(Int_t*)NULL,0,0,0);
+      }
+    }  
   }
   
 //   //#########Calculate trigger and set trigger info###########
 
@@ -275,8 +272,11 @@ void AliPHOSReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
     const AliPHOSDigit * dig = (const AliPHOSDigit*)fgDigitsArray->At(idig);
     if(dig->GetId() <= knEMC && 
        Calibrate(dig->GetEnergy(),dig->GetId()) > GetRecoParam()->GetEMCMinE() ){
+      Int_t primary = dig->GetPrimary(1) ;
       phsCells.SetCell(idignew,dig->GetId(), Calibrate(dig->GetEnergy(),dig->GetId()),
-                                             CalibrateT(dig->GetTime(),dig->GetId()));   
+                                             CalibrateT(dig->GetTime(),dig->GetId(),dig->IsLG()),
+                                             primary,0.,!dig->IsLG()) ;
+                                            
       idignew++;
     }
   }
@@ -384,7 +384,7 @@ void AliPHOSReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
     delete [] fracList;
     delete [] absIdList;
   }
-  fgDigitsArray ->Clear();
+  fgDigitsArray ->Clear("C");
   fgEMCRecPoints->Clear("C");
   recParticles  ->Clear();
 
@@ -512,7 +512,7 @@ Float_t AliPHOSReconstructor::Calibrate(Float_t amp, Int_t absId)const{
   }
 }
 //==================================================================================
-Float_t AliPHOSReconstructor::CalibrateT(Float_t time, Int_t absId)const{
+Float_t AliPHOSReconstructor::CalibrateT(Float_t time, Int_t absId,Bool_t isLG)const{
   // Calibrate EMC digit, i.e. multiply its Amp by a factor read from CDB
 
   const AliPHOSGeometry *geom = AliPHOSGeometry::GetInstance() ;
@@ -527,7 +527,10 @@ Float_t AliPHOSReconstructor::CalibrateT(Float_t time, Int_t absId)const{
     return 0. ;
   }
   else{ //EMC
-    time += fgCalibData->GetTimeShiftEmc(module,column,row);
+    if(isLG)
+      time += fgCalibData->GetLGTimeShiftEmc(module,column,row);
+    else
+      time += fgCalibData->GetTimeShiftEmc(module,column,row);
     return time ;
   }
 }