Skip to content

Commit

Permalink
Corrected tag names
Browse files Browse the repository at this point in the history
  • Loading branch information
hristov committed Feb 2, 2010
2 parents 68be95b + 9873850 commit 64e34b3
Show file tree
Hide file tree
Showing 149 changed files with 2,849 additions and 6,685 deletions.
21 changes: 5 additions & 16 deletions ANALYSIS/AliAnalysisManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,8 @@ void AliAnalysisManager::PackOutput(TList *target)
if (strlen(filename) && !isManagedByHandler) {
// Backup current folder
TDirectory *opwd = gDirectory;
// File resident outputs.
// Check first if the file exists.
TString open_option = "RECREATE";
if (!gSystem->AccessPathName(output->GetFileName())) open_option = "UPDATE";
TFile *file = AliAnalysisManager::OpenFile(output, open_option, kTRUE);
// File resident outputs
TFile *file = AliAnalysisManager::OpenFile(output, "RECREATE", kTRUE);
// Clear file list to release object ownership to user.
file->Clear();
// Save data to file, then close.
Expand Down Expand Up @@ -754,28 +751,20 @@ void AliAnalysisManager::Terminate()
if (fOutputEventHandler) fOutputEventHandler ->TerminateIO();
if (fMCtruthEventHandler) fMCtruthEventHandler->TerminateIO();
TIter next1(fOutputs);
TString handlerFile = "";
if (fOutputEventHandler) {
handlerFile = fOutputEventHandler->GetOutputFileName();
}
while ((output=(AliAnalysisDataContainer*)next1())) {
// Special outputs or grid files have the files already closed and written.
if (fMode == kGridAnalysis) continue;
if (fMode == kProofAnalysis) {
if (output->IsSpecialOutput() || output->IsRegisterDataset()) continue;
}
const char *filename = output->GetFileName();
TString open_option = "RECREATE";
if (!(strcmp(filename, "default"))) continue;
if (!strlen(filename)) continue;
if (!output->GetData()) continue;
TDirectory *opwd = gDirectory;
TFile *file = output->GetFile();
if (!file) file = (TFile*)gROOT->GetListOfFiles()->FindObject(filename);
if (!file) {
if (handlerFile == filename && !gSystem->AccessPathName(filename)) open_option = "UPDATE";
file = new TFile(filename, open_option);
}
if (!file) file = new TFile(filename, "RECREATE");
if (file->IsZombie()) {
Error("Terminate", "Cannot open output file %s", filename);
continue;
Expand Down Expand Up @@ -1294,7 +1283,7 @@ TFile *AliAnalysisManager::OpenFile(AliAnalysisDataContainer *cont, const char *
TString opt(option);
opt.ToUpper();
if ((opt=="UPDATE") && (opt!=f->GetOption()))
::Info("AliAnalysisManager::OpenFile", "File %s already opened in %s mode!", cont->GetFileName(), f->GetOption());
::Fatal("AliAnalysisManager::OpenFile", "File %s already opened, but not in UPDATE mode!", cont->GetFileName());
} else {
f = TFile::Open(filename, option);
}
Expand Down Expand Up @@ -1338,7 +1327,7 @@ TFile *AliAnalysisManager::OpenProofFile(AliAnalysisDataContainer *cont, const c
TString opt(option);
opt.ToUpper();
if ((opt=="UPDATE") && (opt!=f->GetOption()))
::Info("OpenProofFile", "File %s already opened in %s mode!", cont->GetFileName(), f->GetOption());
Fatal("OpenProofFile", "File %s already opened, but not in UPDATE mode!", cont->GetFileName());
} else {
f = new TFile(filename, option);
}
Expand Down
15 changes: 4 additions & 11 deletions ANALYSIS/AliAnalysisTaskSE.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -280,20 +280,12 @@ void AliAnalysisTaskSE::Exec(Option_t* option)
//
// Exec analysis of one event
if (fDebug > 1) AliInfo("AliAnalysisTaskSE::Exec() \n");
//
AliAODHandler* handler = (AliAODHandler*)
((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
AliAODInputHandler* aodH = dynamic_cast<AliAODInputHandler*>(fInputHandler);
//
// Was event selected ?

Bool_t isSelected = kTRUE;
if( fInputHandler ) {
isSelected = fInputHandler->IsEventSelected();
fEntry = fInputHandler->GetReadEntry();
}

if (handler) handler->SetFillAOD(isSelected);


// Notify the change of run number
if (InputEvent()->GetRunNumber() != fCurrentRunNumber) {
Expand All @@ -306,8 +298,9 @@ void AliAnalysisTaskSE::Exec(Option_t* option)
if ( !((Entry()-1)%100) && fDebug > 0)
AliInfo(Form("%s ----> Processing event # %lld", CurrentFileName(), Entry()));



AliAODHandler* handler = (AliAODHandler*)
((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
AliAODInputHandler* aodH = dynamic_cast<AliAODInputHandler*>(fInputHandler);

if (handler && aodH) {
fMCEvent = aodH->MCEvent();
Expand Down
Loading

0 comments on commit 64e34b3

Please sign in to comment.