}
//__________________________________________________________________________________________________________________
-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; i<copy.fArraySize; i++){
- fh1CorrFFTrackPt[i] = copy.fh1CorrFFTrackPt[i];
- fh1CorrFFZ[i] = copy.fh1CorrFFZ[i];
- fh1CorrFFXi[i] = copy.fh1CorrFFXi[i];
+ fh1CorrFFTrackPt[i] = new TH1F(*(copy.fh1CorrFFTrackPt[i]));
+ fh1CorrFFZ[i] = new TH1F(*(copy.fh1CorrFFZ[i]));
+ fh1CorrFFXi[i] = new TH1F(*(copy.fh1CorrFFXi[i]));
}
}
if(this!=&o){
TObject::operator=(o);
- fArraySize = o.fArraySize;
+ Int_t fArraySize_new = o.fArraySize;
fCorrLabel = o.fCorrLabel;
- for(Int_t i=0; i<o.fArraySize; i++){
- fh1CorrFFTrackPt[i] = o.fh1CorrFFTrackPt[i];
- fh1CorrFFZ[i] = o.fh1CorrFFZ[i];
- fh1CorrFFXi[i] = o.fh1CorrFFXi[i];
+ TH1F** fh1CorrFFTrackPt_new = new TH1F*[fArraySize_new];
+ TH1F** fh1CorrFFZ_new = new TH1F*[fArraySize_new];
+ TH1F** fh1CorrFFXi_new = new TH1F*[fArraySize_new];
+
+ for(Int_t i=0; i<fArraySize_new; i++){
+ fh1CorrFFTrackPt_new[i] = new TH1F(*(o.fh1CorrFFTrackPt[i]));
+ fh1CorrFFZ_new[i] = new TH1F(*(o.fh1CorrFFZ[i]));
+ fh1CorrFFXi_new[i] = new TH1F(*(o.fh1CorrFFXi[i]));
}
- }
+ // ---
+
+ if(fArraySize){
+ for(int i=0; i<fArraySize; i++) delete fh1CorrFFTrackPt[i];
+ for(int i=0; i<fArraySize; i++) delete fh1CorrFFZ[i];
+ for(int i=0; i<fArraySize; i++) delete fh1CorrFFXi[i];
+ }
+
+ if(fh1CorrFFTrackPt) delete[] fh1CorrFFTrackPt;
+ if(fh1CorrFFZ) delete[] fh1CorrFFZ;
+ if(fh1CorrFFXi) delete[] fh1CorrFFXi;
+
+ // ---
+
+ fArraySize = fArraySize_new;
+
+ fh1CorrFFTrackPt = fh1CorrFFTrackPt_new;
+ fh1CorrFFZ = fh1CorrFFZ_new;
+ fh1CorrFFXi = fh1CorrFFXi_new;
+
+ for(Int_t i=0; i<fArraySize; i++){
+ fh1CorrFFTrackPt[i] = fh1CorrFFTrackPt_new[i];
+ fh1CorrFFZ[i] = fh1CorrFFZ_new[i];
+ fh1CorrFFXi[i] = fh1CorrFFXi_new[i];
+ }
+ }
+
return *this;
}
{
// read raw FF - standard dir/list name
- TString strdir = "PWG4_FragmentationFunction_" + strID;
+ TString strdir = "PWGJE_FragmentationFunction_" + strID;
TString strlist = "fracfunc_" + strID;
ReadRawFF(strfile,strdir,strlist,strFFID);
{
// read raw FF - standard dir/list name
- TString strdir = "PWG4_FragmentationFunction_" + strID;
+ TString strdir = "PWGJE_FragmentationFunction_" + strID;
TString strlist = "fracfunc_" + strID;
ReadRawBgr(strfile,strdir,strlist,strBgrID,strFFID);
{
// read raw FF - standard dir/list name
- TString strdir = "PWG4_FragmentationFunction_" + strID;
+ TString strdir = "PWGJE_FragmentationFunction_" + strID;
TString strlist = "fracfunc_" + strID;
ReadRawBgrEmbedding(strfile,strdir,strlist,strFFID);
if(type == kFlagPt) hist = fCorrFF[fNCorrectionLevels-2]->GetTrackPt(i); // level -2: before unfolding, level -1: unfolded
else if(type == kFlagZ) hist = fCorrFF[fNCorrectionLevels-2]->GetZ(i); // level -2: before unfolding, level -1: unfolded
else if(type == kFlagXi) hist = fCorrFF[fNCorrectionLevels-2]->GetXi(i); // level -2: before unfolding, level -1: unfolded
+ else{
+ Printf("%s%d unknown type",(char*)__FILE__,__LINE__);
+ return;
+ }
+
+ if(!hist){
+ Printf("%s%d no histo found ",(char*)__FILE__,__LINE__);
+ return;
+ }
+
THnSparse* hnResponse = 0;
- if(type == kFlagPt) hnResponse = fhnResponsePt[i];
+ if(type == kFlagPt) hnResponse = fhnResponsePt[i];
else if(type == kFlagZ) hnResponse = fhnResponseZ[i];
else if(type == kFlagXi) hnResponse = fhnResponseXi[i];
-
TH1F* hPrior = 0;
if(type == kFlagPt && fh1FFTrackPtPrior[i] && ((TString(fh1FFTrackPtPrior[i]->GetName())).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];
- TString histNameTHn = hist->GetName();
+ TString histNameTHn;
+ histNameTHn = hist->GetName();
histNameTHn.ReplaceAll("TH1","THn");
+
TString priorNameTHn;
if(hPrior){
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");
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);
- TH1F* hUnfolded = (TH1F*) hnUnfolded->Projection(0);
- if (hist)
- hUnfolded->SetNameTitle(hist->GetName(),hist->GetTitle());
+ TH1F* hUnfolded = (TH1F*) hnUnfolded->Projection(0);
+ hUnfolded->SetNameTitle(hist->GetName(),hist->GetTitle());
if(type == kFlagPt) fCorrFF[fNCorrectionLevels-1]->AddCorrHistos(i,hUnfolded,0,0);
if(type == kFlagZ) fCorrFF[fNCorrectionLevels-1]->AddCorrHistos(i,0,hUnfolded,0);
if(type == kFlagXi) fCorrFF[fNCorrectionLevels-1]->AddCorrHistos(i,0,0,hUnfolded);
// backfolding: apply response matrix to unfolded spectrum
- TH1F* hBackFolded = ApplyResponse(hUnfolded,hnResponse);
- if (hist)
- hBackFolded->SetNameTitle(histNameBackFolded,hist->GetTitle());
+ TH1F* hBackFolded = ApplyResponse(hUnfolded,hnResponse);
+ hBackFolded->SetNameTitle(histNameBackFolded,hist->GetTitle());
if(type == kFlagPt) fh1FFTrackPtBackFolded[i] = hBackFolded;
if(type == kFlagZ) fh1FFZBackFolded[i] = hBackFolded;
// ratio unfolded to original histo
TH1F* hRatioUnfolded = (TH1F*) hUnfolded->Clone(histNameRatioFolded);
hRatioUnfolded->Reset();
- if (hist)
- hRatioUnfolded->Divide(hUnfolded,hist,1,1,"B");
+ hRatioUnfolded->Divide(hUnfolded,hist,1,1,"B");
if(type == kFlagPt) fh1FFRatioTrackPtFolded[i] = hRatioUnfolded;
if(type == kFlagZ) fh1FFRatioZFolded[i] = hRatioUnfolded;
{
// 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);
{
// 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);
{
// 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);
{
// 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);
{
// 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);
{
// 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);
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;
}
}
-
+ if(list == 0)return; // catch strlist.Lenght() == 0;
+
THnSparse* hn6ResponseJetPt = (THnSparse*) list->FindObject("fhnCorrelation");
Int_t axis6RecJetPt = 0;
{
// 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);