AliVEventHandler(),
fIsStandard(kTRUE),
fFillAOD(kTRUE),
+ fFillAODRun(kTRUE),
fNeedsHeaderReplication(kFALSE),
fNeedsTracksBranchReplication(kFALSE),
fNeedsVerticesBranchReplication(kFALSE),
fNeedsV0sBranchReplication(kFALSE),
+ fNeedsCascadesBranchReplication(kFALSE),
fNeedsTrackletsBranchReplication(kFALSE),
fNeedsPMDClustersBranchReplication(kFALSE),
fNeedsJetsBranchReplication(kFALSE),
fNeedsFMDClustersBranchReplication(kFALSE),
fNeedsCaloClustersBranchReplication(kFALSE),
fNeedsMCParticlesBranchReplication(kFALSE),
+ fNeedsDimuonsBranchReplication(kFALSE),
fAODIsReplicated(kFALSE),
fAODEvent(NULL),
fMCEventH(NULL),
AliVEventHandler(name, title),
fIsStandard(kTRUE),
fFillAOD(kTRUE),
+ fFillAODRun(kTRUE),
fNeedsHeaderReplication(kFALSE),
fNeedsTracksBranchReplication(kFALSE),
fNeedsVerticesBranchReplication(kFALSE),
fNeedsV0sBranchReplication(kFALSE),
+ fNeedsCascadesBranchReplication(kFALSE),
fNeedsTrackletsBranchReplication(kFALSE),
fNeedsPMDClustersBranchReplication(kFALSE),
fNeedsJetsBranchReplication(kFALSE),
fNeedsFMDClustersBranchReplication(kFALSE),
fNeedsCaloClustersBranchReplication(kFALSE),
fNeedsMCParticlesBranchReplication(kFALSE),
+ fNeedsDimuonsBranchReplication(kFALSE),
fAODIsReplicated(kFALSE),
fAODEvent(NULL),
fMCEventH(NULL),
// Initialize IO
//
// Create the AODevent object
- if(!fAODEvent){
+
+ Bool_t createStdAOD = fIsStandard || fFillAOD;
+ if(!fAODEvent && createStdAOD){
fAODEvent = new AliAODEvent();
if (fIsStandard) fAODEvent->CreateStdContent();
}
// File opening according to execution mode
TString option(opt);
option.ToLower();
- TDirectory *owd = gDirectory;
- if (option.Contains("proof")) {
- // proof
- // Merging via files. Need to access analysis manager via interpreter.
- gROOT->ProcessLine(Form("AliAnalysisDataContainer *c_common_out = AliAnalysisManager::GetAnalysisManager()->GetCommonOutputContainer();"));
- gROOT->ProcessLine(Form("AliAnalysisManager::GetAnalysisManager()->OpenProofFile(c_common_out, \"RECREATE\");"));
- fFileA = gFile;
- } else {
- // local and grid
- fFileA = new TFile(fFileName.Data(), "RECREATE");
- }
- CreateTree(1);
- owd->cd();
+ if (createStdAOD) {
+ TDirectory *owd = gDirectory;
+ if (option.Contains("proof")) {
+ // proof
+ // Merging via files. Need to access analysis manager via interpreter.
+ gROOT->ProcessLine(Form("AliAnalysisDataContainer *c_common_out = AliAnalysisManager::GetAnalysisManager()->GetCommonOutputContainer();"));
+ gROOT->ProcessLine(Form("AliAnalysisManager::GetAnalysisManager()->OpenProofFile(c_common_out, \"RECREATE\");"));
+ fFileA = gFile;
+ } else {
+ // local and grid
+ fFileA = new TFile(fFileName.Data(), "RECREATE");
+ }
+ CreateTree(1);
+ owd->cd();
+ }
if (fExtensions) {
TIter next(fExtensions);
AliAODExtension *ext;
// has to passed to the AOD Handler by this task
// (doing this in the steering macro would not work on PROOF)
+ if (!fAODEvent) return;
TClonesArray *mcarray = (TClonesArray*)fAODEvent->FindListObject(AliAODMCParticle::StdBranchName());
if(!mcarray)return;
- mcarray->Delete();
AliAODMCHeader *mcHeader = (AliAODMCHeader*)fAODEvent->FindListObject(AliAODMCHeader::StdBranchName());
if(!mcHeader)return;
- mcHeader->Reset();
-
// Get the MC Infos.. Handler needs to be set before
// while adding the branch
// This needs to be done, not to depend on the AnalysisManager
Bool_t AliAODHandler::FinishEvent()
{
// Fill data structures
- if(fFillAOD){
- fAODEvent->MakeEntriesReferencable();
- // StoreMCParticles();
- FillTree();
- if (fExtensions) {
- TIter next(fExtensions);
- AliAODExtension *ext;
- while ((ext=(AliAODExtension*)next())) ext->FinishEvent();
- }
- if (fFilters) {
- TIter nextf(fFilters);
- AliAODExtension *ext;
- while ((ext=(AliAODExtension*)nextf())) {
-// ext->SetEvent(fAODEvent);
- ext->FinishEvent();
- }
- }
+ if(fFillAOD && fFillAODRun && fAODEvent){
+ fAODEvent->MakeEntriesReferencable();
+ fTreeA->BranchRef();
+ FillTree();
}
+
+ if (fFillAOD) {
+ if (fExtensions) {
+ TIter next(fExtensions);
+ AliAODExtension *ext;
+ while ((ext=(AliAODExtension*)next())) ext->FinishEvent();
+ }
+ if (fFilters) {
+ TIter nextf(fFilters);
+ AliAODExtension *ext;
+ while ((ext=(AliAODExtension*)nextf())) {
+ ext->FinishEvent();
+ }
+ }
+ }
if (fIsStandard) fAODEvent->ResetStd();
+ TClonesArray *mcarray = (TClonesArray*)fAODEvent->FindListObject(AliAODMCParticle::StdBranchName());
+ if(mcarray) mcarray->Delete();
+
+ AliAODMCHeader *mcHeader = (AliAODMCHeader*)fAODEvent->FindListObject(AliAODMCHeader::StdBranchName());
+ if(!mcHeader) mcHeader->Reset();
+
// Reset AOD replication flag
fAODIsReplicated = kFALSE;
return kTRUE;
{
// Terminate IO
if (fFileA) {
+ fFileA->Write();
fFileA->Close();
delete fFileA;
fFileA = 0;
//______________________________________________________________________________
void AliAODHandler::FillTree()
{
+
// Fill the AOD Tree
- fTreeA->Fill();
+ fTreeA->Fill();
}
//______________________________________________________________________________
void AliAODHandler::AddAODtoTreeUserInfo()
{
// Add aod event to tree user info
- fTreeA->GetUserInfo()->Add(fAODEvent);
+ if (fTreeA) fTreeA->GetUserInfo()->Add(fAODEvent);
// Now the tree owns our fAODEvent...
fAODEvent = 0;
}
fTreeA->Bronch(obj->GetName(), cname, fAODEvent->GetList()->GetObjectRef(obj),
kBufsize, kSplitlevel - 1);
- // fTreeA->Branch(obj->GetName(), cname, addobj);
}
owd->cd();
}
if (!fTreeE->FindBranch(obj->GetName())) {
// Do the same as if we book via
// TTree::Branch(TCollection*)
-
fTreeE->Bronch(obj->GetName(), cname, fAODEvent->GetList()->GetObjectRef(obj),
kBufsize, kSplitlevel - 1);
- // fTreeA->Branch(obj->GetName(), cname, addobj);
}
owd->cd();
}
}
fTreeE = new TTree("aodTree", "AliAOD tree");
fTreeE->Branch(fAODEvent->GetList());
+ fTreeE->BranchRef();
owd->cd();
return kTRUE;
}