]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliReconstruction.cxx
Transient pointer of ESDtrack back to the event introduced.
[u/mrichter/AliRoot.git] / STEER / AliReconstruction.cxx
index 9774d7f53870ca7f2339deba945bfacb71861476..88c6f08632cc17ab97d30b3093b7c08944a2f290 100644 (file)
@@ -986,8 +986,6 @@ Bool_t AliReconstruction::InitGRP() {
     AliError("GRP/GRP/Data entry:  missing value for the beam energy ! Using 0");
     beamEnergy = 0;
   }
-  // LHC: "multiply by 120 to get the energy in MeV"
-  beamEnergy *= 0.120;
 
   TString runType = fGRPData->GetRunType();
   if (runType==AliGRPObject::GetInvalidString()) {
@@ -1497,7 +1495,7 @@ void AliReconstruction::SlaveBegin(TTree*)
   ftree = new TTree("esdTree", "Tree with ESD objects");
   fesd = new AliESDEvent();
   fesd->CreateStdContent();
-
+  if (fesd->GetESDRun()) ((AliESDRun*)fesd->GetESDRun())->SetBeamEnergyIsSqrtSHalfGeV();
   // add a so far non-std object to the ESD, this will
   // become part of the std content
   fesd->AddObject(new AliESDHLTDecision);
@@ -1523,7 +1521,7 @@ void AliReconstruction::SlaveBegin(TTree*)
   fhlttree = new TTree("HLTesdTree", "Tree with HLT ESD objects");
   fhltesd = new AliESDEvent();
   fhltesd->CreateStdContent();
-
+  if (fhltesd->GetESDRun()) ((AliESDRun*)fhltesd->GetESDRun())->SetBeamEnergyIsSqrtSHalfGeV();
   // read the ESD template from CDB
   // HLT is allowed to put non-std content to its ESD, the non-std
   // objects need to be created before invocation of WriteToTree in
@@ -1608,8 +1606,15 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent)
   // run the reconstruction over a single event
   // The event loop is steered in Run method
 
+
+  static Long_t oldMres=0;
+  static Long_t oldMvir=0;
+  static Float_t oldCPU=0;
+
   AliCodeTimerAuto("",0);
 
+  AliESDpid PID;
+
   if (iEvent >= fRunLoader->GetNumberOfEvents()) {
     fRunLoader->SetEventNumber(iEvent);
     fRunLoader->GetHeader()->Reset(fRawReader->GetRunNumber(), 
@@ -1623,14 +1628,13 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent)
     return kTRUE;
   }
 
-  AliInfo(Form("processing event %d", iEvent));
 
   fRunLoader->GetEvent(iEvent);
 
   // Fill Event-info object
   GetEventInfo();
   fRecoParam.SetEventSpecie(fRunInfo,fEventInfo,fListOfCosmicTriggers);
-  AliInfo(Form("Current event specie: %s",fRecoParam.PrintEventSpecie()));
+  AliInfo(Form("================================= Processing event %d of type %-10s ==================================", iEvent,fRecoParam.PrintEventSpecie()));
 
   // Set the reco-params
   {
@@ -1641,6 +1645,7 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent)
       if (reconstructor && fRecoParam.GetDetRecoParamArray(iDet)) {
         const AliDetectorRecoParam *par = fRecoParam.GetDetRecoParam(iDet);
         reconstructor->SetRecoParam(par);
+       reconstructor->GetPidSettings(&PID);
        reconstructor->SetEventInfo(&fEventInfo);
         if (fRunQA) {
           AliQAManager::QAManager()->SetRecoParam(iDet, par) ; 
@@ -1648,6 +1653,9 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent)
         }
       }
     }
+    const AliDetectorRecoParam *grppar = fRecoParam.GetDetRecoParam(kNDetectors);
+    AliQAManager::QAManager()->SetRecoParam(AliQAv1::kGLOBAL, grppar) ; 
+    AliQAManager::QAManager()->SetEventSpecie(AliRecoParam::Convert(grppar->GetEventSpecie())) ;
   }
 
     // QA on single raw 
@@ -1674,6 +1682,11 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent)
       }
     }
 
+  
+    // fill Event header information from the RawEventHeader
+    if (fRawReader){FillRawEventHeaderESD(fesd);}
+    if (fRawReader){FillRawEventHeaderESD(fhltesd);}
+
     fesd->SetRunNumber(fRunLoader->GetHeader()->GetRun());
     fhltesd->SetRunNumber(fRunLoader->GetHeader()->GetRun());
     fesd->SetEventNumberInFile(fRunLoader->GetHeader()->GetEventNrInRun());
@@ -1736,7 +1749,7 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent)
 
     // barrel tracking
     if (!fRunTracking.IsNull()) {
-      if (!RunTracking(fesd)) {
+      if (!RunTracking(fesd,PID)) {
        if (fStopOnError) {CleanUp(); return kFALSE;}
       }
     }
@@ -1764,13 +1777,9 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent)
        if (fStopOnError) {CleanUp(); return kFALSE;}
       }
     }
-  
-    // fill Event header information from the RawEventHeader
-    if (fRawReader){FillRawEventHeaderESD(fesd);}
-    if (fRawReader){FillRawEventHeaderESD(fhltesd);}
-
     // combined PID
-    AliESDpid::MakePID(fesd);
+    PID.MakePID(fesd);
 
     if (fFillTriggerESD) {
       if (!FillTriggerESD(fesd)) {
@@ -1961,7 +1970,12 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent)
  
     ProcInfo_t procInfo;
     gSystem->GetProcInfo(&procInfo);
-    AliInfo(Form("Event %d -> Current memory usage %d %d",iEvent, procInfo.fMemResident, procInfo.fMemVirtual));
+    AliInfo(Form("========================= End Event %d: memory res %d(%3d) vir %d(%3d) CPU %5.2f =====================",
+                iEvent, procInfo.fMemResident/1024, (procInfo.fMemResident-oldMres)/1024, 
+                procInfo.fMemVirtual/1024,(procInfo.fMemVirtual-oldMvir)/1024,procInfo.fCpuUser+procInfo.fCpuSys-oldCPU));
+    oldMres=procInfo.fMemResident;
+    oldMvir=procInfo.fMemVirtual;
+    oldCPU=procInfo.fCpuUser+procInfo.fCpuSys;
   
     fEventInfo.Reset();
     for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
@@ -2409,7 +2423,7 @@ Bool_t AliReconstruction::RunMuonTracking(AliESDEvent*& esd)
 
 
 //_____________________________________________________________________________
-Bool_t AliReconstruction::RunTracking(AliESDEvent*& esd)
+Bool_t AliReconstruction::RunTracking(AliESDEvent*& esd,AliESDpid &PID)
 {
 // run the barrel tracking
   static Int_t eventNr=0;
@@ -2459,7 +2473,7 @@ Bool_t AliReconstruction::RunTracking(AliESDEvent*& esd)
     // preliminary PID in TPC needed by the ITS tracker
     if (iDet == 1) {
       GetReconstructor(1)->FillESD((TTree*)NULL, (TTree*)NULL, esd);
-      AliESDpid::MakePID(esd);
+      PID.MakePID(esd,kTRUE);
     } 
     AliSysInfo::AddStamp(Form("Tracking0%s_%d",fgkDetectorName[iDet],eventNr), iDet,3,eventNr);
   }
@@ -2510,8 +2524,9 @@ Bool_t AliReconstruction::RunTracking(AliESDEvent*& esd)
     }
     // updated PID in TPC needed by the ITS tracker -MI
     if (iDet == 1) {
-      GetReconstructor(1)->FillESD((TTree*)NULL, (TTree*)NULL, esd);
-      AliESDpid::MakePID(esd);
+      //GetReconstructor(1)->FillESD((TTree*)NULL, (TTree*)NULL, esd);
+      //AliESDpid::MakePID(esd);
+      PID.MakePID(esd,kTRUE);
     }
     AliSysInfo::AddStamp(Form("Tracking1%s_%d",fgkDetectorName[iDet],eventNr), iDet,3, eventNr);
   }