From: kaamodt Date: Wed, 11 Nov 2009 01:47:18 +0000 (+0000) Subject: Changed to new output format for the trains and added extra protection for the cases... X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=61374d9793bc48322d1f1aeb00b9c77dc424a9db;p=u%2Fmrichter%2FAliRoot.git Changed to new output format for the trains and added extra protection for the cases when one do not have MC information. --- diff --git a/PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx b/PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx index b34c5fdda1d..b26bcfa3a24 100644 --- a/PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx +++ b/PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx @@ -359,6 +359,7 @@ void AliAnalysisTaskGammaConversion::ConnectInputData(Option_t */*option*/){ // Write warning here cuts and so on are default if this ever happens } fV0Reader->Initialize(); + fDoMCTruth = fV0Reader->GetDoMCTruth(); } diff --git a/PWG4/GammaConv/AliV0Reader.cxx b/PWG4/GammaConv/AliV0Reader.cxx index 2e892d1b878..9e5b1f7ca31 100644 --- a/PWG4/GammaConv/AliV0Reader.cxx +++ b/PWG4/GammaConv/AliV0Reader.cxx @@ -203,15 +203,17 @@ void AliV0Reader::Initialize(){ fMCTruth = (AliMCEventHandler*)((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler()); if(fMCTruth == NULL){ //print warning here + fDoMC = kFALSE; } //Get pointer to the mc stack - fMCStack = fMCTruth->MCEvent()->Stack(); - if(fMCStack == NULL){ - //print warning here + if(fMCTruth){ + fMCStack = fMCTruth->MCEvent()->Stack(); + if(fMCStack == NULL){ + //print warning here + } } - // for CF //Get pointer to the mc event if(fDoCF){ diff --git a/PWG4/GammaConv/AliV0Reader.h b/PWG4/GammaConv/AliV0Reader.h index 6c777df4a1e..d85fcc3379b 100644 --- a/PWG4/GammaConv/AliV0Reader.h +++ b/PWG4/GammaConv/AliV0Reader.h @@ -536,6 +536,11 @@ class AliV0Reader : public TObject { * Sets the flag to enable/disable the usage of MC information. */ void SetDoMCTruth(Bool_t doMC){fDoMC = doMC;} + + /* + * Sets the flag to enable/disable the usage of MC information. + */ + Bool_t GetDoMCTruth(){return fDoMC;} /* * Sets the flag to enable/disable the cut dedx N sigma diff --git a/PWG4/macros/ConfigGammaConversion.C b/PWG4/macros/ConfigGammaConversion.C index 52694ea0703..bf474e88aa8 100644 --- a/PWG4/macros/ConfigGammaConversion.C +++ b/PWG4/macros/ConfigGammaConversion.C @@ -1015,11 +1015,14 @@ AliAnalysisTaskGammaConversion* ConfigGammaConversion(TString arguments,AliAnaly if(kGCoutputFileAppendix.Contains(".root")){ kGCoutputFileAppendix.ReplaceAll(".root",""); } - TString fileOut = kGCoutputFileName + kGCoutputFileAppendix + ".root"; + //TString fileOut = kGCoutputFileName + kGCoutputFileAppendix + ".root"; + + TString outputfile = AliAnalysisManager::GetCommonFileName(); + outputfile += ":PWG4GammaConversion"; - AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("histogramsAliGammaConversion", TList::Class(),AliAnalysisManager::kOutputContainer, fileOut); + AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("histogramsAliGammaConversion", TList::Class(),AliAnalysisManager::kOutputContainer, outputfile); // for CF - AliAnalysisDataContainer *coutput3 = mgr->CreateContainer("ccontainer0",AliCFContainer::Class(),AliAnalysisManager::kOutputContainer,fileOut); + AliAnalysisDataContainer *coutput3 = mgr->CreateContainer("ccontainer0",AliCFContainer::Class(),AliAnalysisManager::kOutputContainer,outputfile); //------------------------ END: Define input/output handlers ---------------------------------------------------