// Macro redoFinish.C is typically used after the merging macros (mergeOutput.C or // mergeOutputOnGrid.C) have been used to produce the merged, large statistics // file of flow analysis. Results stored in merged file are WRONG because after // merging the results from small statistics files are trivially summed up in all // histograms. This is taken into account and corrected for with macro redoFinish.C. // Another typical use of the macro redoFinish.C is to repeat the call to Finish() // in all classes, but with different values of some settings which might modify // the final results (Example: redo the Finish() and apply correction for detector // effects in QC code because by default this correction is switched off). // Name of the merged, large statistics file obtained with the merging macros: TString mergedFileName = "outputCentralityTrain.root"; // Final output file name holding correct final results for large statistics sample: TString outputFileName = "AnalysisResults.root"; // Methods for which the flow analysis will be redone: const Int_t nMethods = 12; TString method[nMethods] = {"MCEP","SP","GFC","QC","FQD","LYZ1SUM","LYZ1PROD","LYZ2SUM","LYZ2PROD","LYZEP","MH","NL"}; // Methods for which some settings can be modified before redoing Finish(): // QC: Bool_t bApplyCorrectionForNUA = kFALSE; // apply correction for non-uniform acceptance Bool_t bApplyCorrectionForNUAVsM = kFALSE; // apply correction for non-uniform acceptance in each multiplicity bin independently Bool_t bPropagateErrorAlsoFromNIT = kFALSE; // propagate error also from non-isotropic terms Bool_t bMinimumBiasReferenceFlow = kTRUE; // store in CRH for reference flow the result obtained wihout rebinning in multiplicity (kTRUE) enum libModes {mLocal,mLocalSource}; void redoFinish(TString type="ESD global", Int_t mode=mLocal) { // type: type of analysis can be ESD, AOD, MC, .... // (if type="" output files are from simulation 'on the fly') // mode: if mode = mLocal: analyze data on your computer using aliroot // if mode = mLocalSource: analyze data on your computer using root + source files // Load needed libraries: LoadLibrariesRF(mode); // Accessing : TString mergedFileFullPathName(gSystem->pwd()); mergedFileFullPathName+="/"; mergedFileFullPathName+=mergedFileName.Data(); TFile *mergedFile = NULL; if(gSystem->AccessPathName(mergedFileFullPathName.Data(),kFileExists)) { cout<pwd()<<" !!!!"< if neccessary: if(!(mergedFileName == outputFileName)) { TSystemFile *fileTemp = new TSystemFile(mergedFileFullPathName.Data(),"."); fileTemp->Copy("mergedAnalysisResultsTemp.root"); delete fileTemp; } // Access : mergedFile = TFile::Open(mergedFileFullPathName.Data(),"UPDATE"); } // Access from the merged TDirectoryFile's for each method and from them the lists holding histograms: for(Int_t i=0; iFindObjectAny(directoryName.Data()); // Form a list name for each method: if(!directory) { cout<<" WARNING: Couldn't find a TDirectory "<GetListOfKeys(); if (!listTemp) { cout<<" WARNING: Accessing TList from TDirectoryFile failed for method "<GetEntries(); icent++) { TList* list = dynamic_cast(directory->Get(listTemp->At(icent)->GetName())); if (!list) continue; //////////////////// if(TString(list->GetName()).Contains("cobjMCEP")) { AliFlowAnalysisWithMCEventPlane* mcep = new AliFlowAnalysisWithMCEventPlane(); mcep->GetOutputHistograms(list); mcep->Finish(); directory->Add(list,kTRUE); directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete); } // SP: else if(TString(list->GetName()).Contains("cobjSP")) { AliFlowAnalysisWithScalarProduct* sp = new AliFlowAnalysisWithScalarProduct(); sp->GetOutputHistograms(list); sp->Finish(); directory->Add(list,kTRUE); directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete); } // GFC: else if(TString(list->GetName()).Contains("cobjGFC")) { AliFlowAnalysisWithCumulants* gfc = new AliFlowAnalysisWithCumulants(); gfc->GetOutputHistograms(list); gfc->Finish(); directory->Add(list,kTRUE); directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete); } // QC: else if(TString(list->GetName()).Contains("cobjQC")) { AliFlowAnalysisWithQCumulants* qc = new AliFlowAnalysisWithQCumulants(); qc->GetOutputHistograms(list); qc->GetIntFlowFlags()->SetBinContent(3,(Int_t)bApplyCorrectionForNUA); qc->GetIntFlowFlags()->SetBinContent(8,(Int_t)bApplyCorrectionForNUAVsM); qc->GetIntFlowFlags()->SetBinContent(9,(Int_t)bPropagateErrorAlsoFromNIT); qc->GetIntFlowFlags()->SetBinContent(11,(Int_t)bMinimumBiasReferenceFlow); qc->Finish(); directory->Add(list,kTRUE); directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete); } // FQD: else if(TString(list->GetName()).Contains("cobjFQD")) { AliFlowAnalysisWithFittingQDistribution* fqd = new AliFlowAnalysisWithFittingQDistribution(); fqd->GetOutputHistograms(list); fqd->Finish(kTRUE); directory->Add(list,kTRUE); directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete); } // LYZ1SUM: else if(TString(list->GetName()).Contains("cobjLYZ1SUM")) { AliFlowAnalysisWithLeeYangZeros* lyz1sum = new AliFlowAnalysisWithLeeYangZeros(); lyz1sum->SetFirstRun(kTRUE); lyz1sum->SetUseSum(kTRUE); lyz1sum->GetOutputHistograms(list); lyz1sum->Finish(); directory->Add(list,kTRUE); directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete); } // LYZ2SUM: else if(TString(list->GetName()).Contains("cobjLYZ2SUM")) { AliFlowAnalysisWithLeeYangZeros* lyz2sum = new AliFlowAnalysisWithLeeYangZeros(); lyz2sum->SetFirstRun(kFALSE); lyz2sum->SetUseSum(kTRUE); lyz2sum->GetOutputHistograms(list); lyz2sum->Finish(); directory->Add(list,kTRUE); directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete); } // LYZ1PROD: else if(TString(list->GetName()).Contains("cobjLYZ1PROD")) { AliFlowAnalysisWithLeeYangZeros* lyz1prod = new AliFlowAnalysisWithLeeYangZeros(); lyz1prod->SetFirstRun(kTRUE); lyz1prod->SetUseSum(kFALSE); lyz1prod->GetOutputHistograms(list); lyz1prod->Finish(); directory->Add(list,kTRUE); directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete); } // LYZ2PROD: else if(TString(list->GetName()).Contains("cobjLYZ2PROD")) { AliFlowAnalysisWithLeeYangZeros* lyz2prod = new AliFlowAnalysisWithLeeYangZeros(); lyz2prod->SetFirstRun(kFALSE); lyz2prod->SetUseSum(kFALSE); lyz2prod->GetOutputHistograms(list); lyz2prod->Finish(); directory->Add(list,kTRUE); directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete); } // LYZEP: else if(TString(list->GetName()).Contains("cobjLYZEP")) { AliFlowAnalysisWithLYZEventPlane* lyzep = new AliFlowAnalysisWithLYZEventPlane(); lyzep->GetOutputHistograms(list); lyzep->Finish(); directory->Add(list,kTRUE); directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete); } // MH: else if(TString(list->GetName()).Contains("cobjMH")) { AliFlowAnalysisWithMixedHarmonics* mh = new AliFlowAnalysisWithMixedHarmonics(); mh->GetOutputHistograms(list); mh->Finish(); directory->Add(list,kTRUE); directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete); } // NL: else if(TString(list->GetName()).Contains("cobjNL")) { AliFlowAnalysisWithNestedLoops* nl = new AliFlowAnalysisWithNestedLoops(); nl->GetOutputHistograms(list); nl->Finish(); directory->Add(list,kTRUE); directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete); } }//for icent }// end of for(Int_t i=0;iRename(outputFileName.Data()); delete outputFileFinal; TSystemFile *mergedFileFinal = new TSystemFile("mergedAnalysisResultsTemp.root","."); mergedFileFinal->Rename(mergedFileName.Data()); delete mergedFileFinal; } // end of if(!(mergedFileName == outputFileName)) cout<Load("libTree"); gSystem->Load("libGeom"); gSystem->Load("libVMC"); gSystem->Load("libXMLIO"); gSystem->Load("libPhysics"); //---------------------------------------------------------- // >>>>>>>>>>> Local mode <<<<<<<<<<<<<< //---------------------------------------------------------- if (mode==mLocal) { //-------------------------------------------------------- // If you want to use already compiled libraries // in the aliroot distribution //-------------------------------------------------------- //================================================================================== //load needed libraries: gSystem->AddIncludePath("-I$ROOTSYS/include"); //gSystem->Load("libTree"); // for AliRoot gSystem->AddIncludePath("-I$ALICE_ROOT/include"); gSystem->Load("libANALYSIS"); gSystem->Load("libPWG2flowCommon"); //cerr<<"libPWG2flowCommon loaded ..."<LoadMacro("AliFlowCommon/AliFlowCommonConstants.cxx+"); gROOT->LoadMacro("AliFlowCommon/AliFlowLYZConstants.cxx+"); // Flow event gROOT->LoadMacro("AliFlowCommon/AliFlowVector.cxx+"); gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimple.cxx+"); gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimpleCuts.cxx+"); gROOT->LoadMacro("AliFlowCommon/AliFlowEventSimple.cxx+"); // Output histograms gROOT->LoadMacro("AliFlowCommon/AliFlowCommonHist.cxx+"); gROOT->LoadMacro("AliFlowCommon/AliFlowCommonHistResults.cxx+"); gROOT->LoadMacro("AliFlowCommon/AliFlowLYZHist1.cxx+"); gROOT->LoadMacro("AliFlowCommon/AliFlowLYZHist2.cxx+"); // Functions needed for various methods gROOT->LoadMacro("AliFlowCommon/AliCumulantsFunctions.cxx+"); gROOT->LoadMacro("AliFlowCommon/AliFlowLYZEventPlane.cxx+"); // Flow Analysis code for various methods gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithMCEventPlane.cxx+"); gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithScalarProduct.cxx+"); gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithLYZEventPlane.cxx+"); gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithLeeYangZeros.cxx+"); gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithCumulants.cxx+"); gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithQCumulants.cxx+"); gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithFittingQDistribution.cxx+"); gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithMixedHarmonics.cxx+"); gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithNestedLoops.cxx+"); cout << "finished loading macros!" << endl; } // end of else if (mode==mLocalSource) } // end of void LoadLibrariesRF(const libModes mode)