X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PWGJE%2FAliFragmentationFunctionCorrections.cxx;h=1e61118c693ecfcf7de1b6ae315edfa8daa153aa;hb=d6cdb093e599ea5dc9a7bea28ef3dbe5464ef38c;hp=0fdae23fe07339ce4181679ac0e9ec69666e1662;hpb=692c4f057454667e31c885e798857553d67e5d04;p=u%2Fmrichter%2FAliRoot.git diff --git a/PWGJE/AliFragmentationFunctionCorrections.cxx b/PWGJE/AliFragmentationFunctionCorrections.cxx index 0fdae23fe07..1e61118c693 100644 --- a/PWGJE/AliFragmentationFunctionCorrections.cxx +++ b/PWGJE/AliFragmentationFunctionCorrections.cxx @@ -303,19 +303,24 @@ AliFragmentationFunctionCorrections::AliFragFuncCorrHistos::AliFragFuncCorrHisto } //__________________________________________________________________________________________________________________ -AliFragmentationFunctionCorrections::AliFragFuncCorrHistos::AliFragFuncCorrHistos(const AliFragFuncCorrHistos& copy) +AliFragmentationFunctionCorrections::AliFragFuncCorrHistos::AliFragFuncCorrHistos(const AliFragmentationFunctionCorrections::AliFragFuncCorrHistos& copy) : TObject() ,fArraySize(copy.fArraySize) - ,fh1CorrFFTrackPt(copy.fh1CorrFFTrackPt) - ,fh1CorrFFZ(copy.fh1CorrFFZ) - ,fh1CorrFFXi(copy.fh1CorrFFXi) + ,fh1CorrFFTrackPt(0) + ,fh1CorrFFZ(0) + ,fh1CorrFFXi(0) ,fCorrLabel(copy.fCorrLabel) { // copy constructor + + fh1CorrFFTrackPt = new TH1F*[copy.fArraySize]; + fh1CorrFFZ = new TH1F*[copy.fArraySize]; + fh1CorrFFXi = new TH1F*[copy.fArraySize]; + for(Int_t i=0; iGetName())).Length() > 0) ) hPrior = fh1FFTrackPtPrior[i]; - else if(type == kFlagZ && fh1FFZPrior[i] && ((TString(fh1FFZPrior[i]->GetName())).Length() > 0) ) hPrior = fh1FFZPrior[i]; - else if(type == kFlagXi && fh1FFXiPrior[i] && ((TString(fh1FFXiPrior[i]->GetName())).Length() > 0) ) hPrior = fh1FFXiPrior[i]; - else{ - Printf("%s%d unknown type",(char*)__FILE__,__LINE__); - return; - } + else if(type == kFlagZ && fh1FFZPrior[i] && ((TString(fh1FFZPrior[i]->GetName())).Length() > 0) ) hPrior = fh1FFZPrior[i]; + else if(type == kFlagXi && fh1FFXiPrior[i] && ((TString(fh1FFXiPrior[i]->GetName())).Length() > 0) ) hPrior = fh1FFXiPrior[i]; - TString histNameTHn = hist->GetName(); + TString histNameTHn; + histNameTHn = hist->GetName(); histNameTHn.ReplaceAll("TH1","THn"); + TString priorNameTHn; if(hPrior){ @@ -1449,14 +1483,18 @@ void AliFragmentationFunctionCorrections::UnfoldHistos(const Int_t nIter, const priorNameTHn.ReplaceAll("TH1","THn"); } - TString histNameBackFolded = hist->GetName(); + TString histNameBackFolded; + histNameBackFolded = hist->GetName(); histNameBackFolded.Append("_backfold"); - - TString histNameRatioFolded = hist->GetName(); + + TString histNameRatioFolded; + histNameRatioFolded = hist->GetName(); histNameRatioFolded.ReplaceAll("fh1FF","hRatioFF"); + histNameRatioFolded.Append("_unfold"); - TString histNameRatioBackFolded = hist->GetName(); + TString histNameRatioBackFolded; + histNameRatioBackFolded = hist->GetName(); histNameRatioBackFolded.ReplaceAll("fh1FF","hRatioFF"); histNameRatioBackFolded.Append("_backfold"); @@ -1464,7 +1502,7 @@ void AliFragmentationFunctionCorrections::UnfoldHistos(const Int_t nIter, const THnSparse* hnFlatEfficiency = TH1toSparse(hist,"fhnEfficiency","eff",kTRUE); // could optionally also use real eff THnSparse* hnPrior = 0; if(hPrior) hnPrior = TH1toSparse(hPrior,priorNameTHn,hPrior->GetTitle()); - + THnSparse* hnUnfolded = Unfold(hnHist,hnResponse,hnFlatEfficiency,nIter,useCorrelatedErrors,hnPrior); @@ -2008,7 +2046,7 @@ void AliFragmentationFunctionCorrections::WriteSingleTrackEff(TString strInfile, { // read task ouput from MC and write single track eff - standard dir/list - TString strdir = "PWG4_FragmentationFunction_" + strID; + TString strdir = "PWGJE_FragmentationFunction_" + strID; TString strlist = "fracfunc_" + strID; WriteSingleTrackEff(strInfile,strdir,strlist,strOutfile,updateOutfile,strOutDir,strPostfix); @@ -2163,7 +2201,7 @@ void AliFragmentationFunctionCorrections::WriteSingleTrackSecCorr(TString strInf { // read task ouput from MC and write single track eff - standard dir/list - TString strdir = "PWG4_FragmentationFunction_" + strID; + TString strdir = "PWGJE_FragmentationFunction_" + strID; TString strlist = "fracfunc_" + strID; WriteSingleTrackSecCorr(strInfile,strdir,strlist,strOutfile,updateOutfile,strOutDir); @@ -2302,7 +2340,7 @@ void AliFragmentationFunctionCorrections::WriteSingleResponse(TString strInfile, { // read task ouput from MC and write single track eff - standard dir/list - TString strdir = "PWG4_FragmentationFunction_" + strID; + TString strdir = "PWGJE_FragmentationFunction_" + strID; TString strlist = "fracfunc_" + strID; WriteSingleResponse(strInfile,strdir,strlist,strOutfile,updateOutfile,strOutDir); @@ -2394,7 +2432,7 @@ void AliFragmentationFunctionCorrections::WriteJetTrackEff(TString strInfile, TS { // read task ouput from MC and write single track eff - standard dir/list - TString strdir = "PWG4_FragmentationFunction_" + strID; + TString strdir = "PWGJE_FragmentationFunction_" + strID; TString strlist = "fracfunc_" + strID; WriteJetTrackEff(strInfile,strdir,strlist,strOutfile,updateOutfile); @@ -2613,7 +2651,7 @@ void AliFragmentationFunctionCorrections::WriteJetSecCorr(TString strInfile, TSt { // read task ouput from MC and write secondary correction - standard dir/list - TString strdir = "PWG4_FragmentationFunction_" + strID; + TString strdir = "PWGJE_FragmentationFunction_" + strID; TString strlist = "fracfunc_" + strID; WriteJetSecCorr(strInfile,strdir,strlist,strOutfile,updateOutfile); @@ -2826,7 +2864,7 @@ void AliFragmentationFunctionCorrections::WriteJetResponse(TString strInfile, TS { // read task ouput from MC and write single track eff - standard dir/list - TString strdir = "PWG4_FragmentationFunction_" + strID; + TString strdir = "PWGJE_FragmentationFunction_" + strID; TString strlist = "fracfunc_" + strID; WriteJetResponse(strInfile,strdir,strlist,strOutfile,updateOutfile); @@ -3603,7 +3641,7 @@ void AliFragmentationFunctionCorrections::RebinHisto(const Int_t jetPtSlice, con TH1F* hist = 0; - if(type == kFlagPt) hist = fCorrFF[fNCorrectionLevels-1]->GetTrackPt(jetPtSlice); + if(type == kFlagPt) hist = fCorrFF[fNCorrectionLevels-1]->GetTrackPt(jetPtSlice); else if(type == kFlagZ) hist = fCorrFF[fNCorrectionLevels-1]->GetZ(jetPtSlice); else if(type == kFlagXi) hist = fCorrFF[fNCorrectionLevels-1]->GetXi(jetPtSlice); else if(type == kFlagSinglePt) hist = fCorrSinglePt[fNCorrectionLevelsSinglePt-1]->GetTrackPt(0); @@ -3655,23 +3693,16 @@ void AliFragmentationFunctionCorrections::WriteJetSpecResponse(TString strInfile TList* list = 0; - if(strlist && strlist.Length()){ - + if(strlist && strlist.Length()){ if(!(list = (TList*) gDirectory->Get(strlist))){ Printf("%s:%d -- error retrieving list %s from directory %s", (char*)__FILE__,__LINE__,strlist.Data(),strdir.Data()); return; } } - - THnSparse* hn6ResponseJetPt; - - if(list){ - hn6ResponseJetPt = (THnSparse*) list->FindObject("fhnCorrelation"); - } - else{ - hn6ResponseJetPt = (THnSparse*) list->FindObject("fhnCorrelation"); - } - + if(list == 0)return; // catch strlist.Lenght() == 0; + + THnSparse* hn6ResponseJetPt = (THnSparse*) list->FindObject("fhnCorrelation"); + Int_t axis6RecJetPt = 0; Int_t axis6GenJetPt = 3; @@ -3809,7 +3840,7 @@ void AliFragmentationFunctionCorrections::ReadRawPtSpec(TString strInfile, TStri { // read track pt spec from task ouput - standard dir/list - TString strdir = "PWG4_FragmentationFunction_" + strID; + TString strdir = "PWGJE_FragmentationFunction_" + strID; TString strlist = "fracfunc_" + strID; ReadRawPtSpec(strInfile,strdir,strlist);