#include "AliTriggerRunScalers.h"
#include "AliCTPTimeParams.h"
#include "AliESDHLTDecision.h"
-
+#include "AliTriggerInput.h"
ClassImp(AliReconstruction)
//_____________________________________________________________________________
fhltesd(NULL),
fesdf(NULL),
ffile(NULL),
+ ffileF(NULL),
ftree(NULL),
+ ftreeF(NULL),
fhlttree(NULL),
ftVertexer(NULL),
fIsNewRunLoader(kFALSE),
fhltesd(NULL),
fesdf(NULL),
ffile(NULL),
+ ffileF(NULL),
ftree(NULL),
+ ftreeF(NULL),
fhlttree(NULL),
ftVertexer(NULL),
fIsNewRunLoader(rec.fIsNewRunLoader),
fhltesd = NULL;
fesdf = NULL;
ffile = NULL;
+ ffileF = NULL;
ftree = NULL;
+ ftreeF = NULL;
fhlttree = NULL;
ftVertexer = NULL;
fIsNewRunLoader = rec.fIsNewRunLoader;
}
}
+ // Additional check if ITS is on
+ fRunVertexFinder = fRunLocalReconstruction && IsSelected("ITS",fRunLocalReconstruction);
+
AliInfo("===================================================================================");
AliInfo(Form("Running local reconstruction for detectors: %s",fRunLocalReconstruction.Data()));
AliInfo(Form("Running tracking for detectors: %s",fRunTracking.Data()));
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);
fesd->WriteToTree(ftree);
if (fWriteESDfriend) {
- // careful:
- // Since we add the branch manually we must
- // book and add it after WriteToTree
- // otherwise it is created twice,
- // once via writetotree and once here.
- // The case for AliESDfriend is now
- // caught also in AlIESDEvent::WriteToTree but
- // be careful when changing the name (AliESDfriend is not
- // a TNamed so we had to hardwire it)
- fesdf = new AliESDfriend();
- TBranch *br=ftree->Branch("ESDfriend.","AliESDfriend", &fesdf);
- br->SetFile("AliESDfriends.root");
+ ffileF = TFile::Open("AliESDfriends.root", "RECREATE");
+ ftreeF = new TTree("esdFriendTree", "Tree with ESD Friend objects");
+ fesdf = new AliESDfriend();
+ ftreeF->Branch("ESDfriend.","AliESDfriend", &fesdf);
fesd->AddObject(fesdf);
+ ffile->cd();
}
ftree->GetUserInfo()->Add(fesd);
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
// 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;
+ static Long_t aveDMres=0;
+ static Long_t aveDMvir=0;
+ static Float_t aveDCPU=0;
AliCodeTimerAuto("",0);
+ AliESDpid PID;
+
if (iEvent >= fRunLoader->GetNumberOfEvents()) {
fRunLoader->SetEventNumber(iEvent);
fRunLoader->GetHeader()->Reset(fRawReader->GetRunNumber(),
// Fill Event-info object
GetEventInfo();
fRecoParam.SetEventSpecie(fRunInfo,fEventInfo,fListOfCosmicTriggers);
+
+ ProcInfo_t procInfo;
+ if(iEvent==fFirstEvent) {
+ gSystem->GetProcInfo(&procInfo);
+ oldMres=procInfo.fMemResident;
+ oldMvir=procInfo.fMemVirtual;
+ oldCPU=procInfo.fCpuUser+procInfo.fCpuSys;
+ }
AliInfo(Form("================================= Processing event %d of type %-10s ==================================", iEvent,fRecoParam.PrintEventSpecie()));
// Set the reco-params
if (reconstructor && fRecoParam.GetDetRecoParamArray(iDet)) {
const AliDetectorRecoParam *par = fRecoParam.GetDetRecoParam(iDet);
reconstructor->SetRecoParam(par);
- reconstructor->SetEventInfo(&fEventInfo);
+ reconstructor->GetPidSettings(&PID);
+ reconstructor->SetEventInfo(&fEventInfo);
if (fRunQA) {
AliQAManager::QAManager()->SetRecoParam(iDet, par) ;
- AliQAManager::QAManager()->SetEventSpecie(AliRecoParam::Convert(par->GetEventSpecie())) ;
+ if (par) AliQAManager::QAManager()->SetEventSpecie(AliRecoParam::Convert(par->GetEventSpecie())) ;
}
}
}
- const AliDetectorRecoParam *grppar = fRecoParam.GetDetRecoParam(kNDetectors);
- AliQAManager::QAManager()->SetRecoParam(AliQAv1::kGLOBAL, grppar) ;
- AliQAManager::QAManager()->SetEventSpecie(AliRecoParam::Convert(grppar->GetEventSpecie())) ;
+ if (fRunQA) {
+ const AliDetectorRecoParam *grppar = fRecoParam.GetDetRecoParam(kNDetectors);
+ AliQAManager::QAManager()->SetRecoParam(AliQAv1::kGLOBAL, grppar) ;
+ AliQAManager::QAManager()->SetEventSpecie(AliRecoParam::Convert(grppar->GetEventSpecie())) ;
+ }
}
// QA on single raw
fesd->SetMagneticField(AliTracker::GetBz());
fhltesd->SetMagneticField(AliTracker::GetBz());
//
+ ((AliESDRun*)fesd->GetESDRun())->SetBeamEnergyIsSqrtSHalfGeV();
+ ((AliESDRun*)fhltesd->GetESDRun())->SetBeamEnergyIsSqrtSHalfGeV();
+ //
AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
if (fld) { // set info needed for field initialization
fesd->SetCurrentL3(fld->GetCurrentSol());
// barrel tracking
if (!fRunTracking.IsNull()) {
- if (!RunTracking(fesd)) {
+ if (!RunTracking(fesd,PID)) {
if (fStopOnError) {CleanUp(); return kFALSE;}
}
}
}
// combined PID
- AliESDpid::MakePID(fesd);
+ PID.MakePID(fesd);
if (fFillTriggerESD) {
if (!FillTriggerESD(fesd)) {
pHLTSrc->Copy(*pHLTTgt);
}
- if (fWriteESDfriend) {
- // fesdf->~AliESDfriend();
- // new (fesdf) AliESDfriend(); // Reset...
+ if (fWriteESDfriend)
fesd->GetESDfriend(fesdf);
- }
+
ftree->Fill();
+ if (fWriteESDfriend) ftreeF->Fill();
// Auto-save the ESD tree in case of prompt reco @P2
if (fRawReader && fRawReader->UseAutoSaveESD()) {
ftree->AutoSave("SaveSelf");
+ if (fWriteESDfriend) ftreeF->AutoSave("SaveSelf");
TFile *friendfile = (TFile *)(gROOT->GetListOfFiles()->FindObject("AliESDfriends.root"));
if (friendfile) friendfile->Save();
}
new (fesdf) AliESDfriend(); // Reset...
}
- ProcInfo_t procInfo;
gSystem->GetProcInfo(&procInfo);
- 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));
+ Long_t dMres=(procInfo.fMemResident-oldMres)/1024;
+ Long_t dMvir=(procInfo.fMemVirtual-oldMvir)/1024;
+ Float_t dCPU=procInfo.fCpuUser+procInfo.fCpuSys-oldCPU;
+ aveDMres+=(dMres-aveDMres)/(iEvent-fFirstEvent+1);
+ aveDMvir+=(dMvir-aveDMvir)/(iEvent-fFirstEvent+1);
+ aveDCPU+=(dCPU-aveDCPU)/(iEvent-fFirstEvent+1);
+ AliInfo(Form("======================= End Event %d: Res %d(%3d <%3d>) Vir %d(%3d <%3d>) CPU %5.2f <%5.2f> ===================",
+ iEvent, procInfo.fMemResident/1024, dMres, aveDMres, procInfo.fMemVirtual/1024, dMvir, aveDMvir, dCPU, aveDCPU));
oldMres=procInfo.fMemResident;
oldMvir=procInfo.fMemVirtual;
oldCPU=procInfo.fCpuUser+procInfo.fCpuSys;
ffile->cd();
- if (fWriteESDfriend)
- ftree->SetBranchStatus("ESDfriend*",0);
// we want to have only one tree version number
ftree->Write(ftree->GetName(),TObject::kOverwrite);
fhlttree->Write(fhlttree->GetName(),TObject::kOverwrite);
+ if (fWriteESDfriend) {
+ ffileF->cd();
+ ftreeF->Write(ftreeF->GetName(),TObject::kOverwrite);
+ }
+
// Finish with Plane Efficiency evaluation: before of CleanUp !!!
if (fRunPlaneEff && !FinishPlaneEff()) {
AliWarning("Finish PlaneEff evaluation failed");
fSPDTrackleter->SetVertex(vtxPos, vtxErr);
// run trackleting
if (fSPDTrackleter->Clusters2Tracks(esd) != 0) {
- AliError("AliITSTrackleterSPDEff Clusters2Tracks failed");
+ AliWarning("AliITSTrackleterSPDEff Clusters2Tracks failed");
// fLoader[0]->UnloadRecPoints();
return kFALSE;
}
//_____________________________________________________________________________
-Bool_t AliReconstruction::RunTracking(AliESDEvent*& esd)
+Bool_t AliReconstruction::RunTracking(AliESDEvent*& esd,AliESDpid &PID)
{
// run the barrel tracking
static Int_t eventNr=0;
// 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);
}
}
// 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);
}
static Int_t eventNr=0;
TString detStr = detectors;
+ AliSysInfo::AddStamp(Form("FillESDb%d",eventNr), -19,-19, eventNr);
for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
AliReconstructor* reconstructor = GetReconstructor(iDet);
detStr.Data()));
if (fStopOnError) return kFALSE;
}
- AliSysInfo::AddStamp(Form("FillESD%d",eventNr), 0,1, eventNr);
+ AliSysInfo::AddStamp(Form("FillESDe%d",eventNr), -20,-20, eventNr);
eventNr++;
return kTRUE;
}
}
fEventInfo.SetTriggerClasses(trclasses);
+ // Write names of active trigger inputs in ESD Header
+ const TObjArray& inputsArray = config->GetInputs();
+ Int_t ninputs = inputsArray.GetEntriesFast();
+ for( Int_t iinput=0; iinput < ninputs; iinput++ ) {
+ AliTriggerInput* trginput = (AliTriggerInput*)inputsArray.At(iinput);
+ if (trginput) {
+ Int_t inputIndex = (Int_t)TMath::Nint(TMath::Log2(trginput->GetMask()));
+ AliESDHeader* headeresd = fesd->GetHeader();
+ Int_t trglevel = (Int_t)trginput->GetLevel();
+ if (trglevel == 0) headeresd->SetActiveTriggerInputs(trginput->GetInputName(), inputIndex);
+ if (trglevel == 1) headeresd->SetActiveTriggerInputs(trginput->GetInputName(), inputIndex+24);
+ if (trglevel == 2) headeresd->SetActiveTriggerInputs(trginput->GetInputName(), inputIndex+48);
+ }
+ }
+
// Set the information in ESD
fesd->SetTriggerMask(trmask);
fesd->SetTriggerCluster(clustmask);