]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGJE/AliFragmentationFunctionCorrections.cxx
tracking efficiency add task macro for LEGO train
[u/mrichter/AliRoot.git] / PWGJE / AliFragmentationFunctionCorrections.cxx
index 3f2b4b09ea67aaa02c17f4c829dc231e90a75a29..7d3a577ad3bf7f2b4a148dee17a608e1ab99e914 100644 (file)
@@ -907,7 +907,7 @@ void AliFragmentationFunctionCorrections::SetHistoBins(const Int_t jetPtSlice, c
 }
 
 //_____________________________________________________________________________________________________________________________________
-TArrayD* AliFragmentationFunctionCorrections::GetHistoBins(const Int_t jetPtSlice,  const Int_t type)
+TArrayD* AliFragmentationFunctionCorrections::GetHistoBins(const Int_t& jetPtSlice, const Int_t& type)
 { 
   // set histo bins for jet pt slice
   // if binning undefined for any slice, original binning will be used
@@ -2871,21 +2871,21 @@ void AliFragmentationFunctionCorrections::WriteJetSecCorr(TString strInfile, TSt
 
 //________________________________________________________________________________________________________________
 void AliFragmentationFunctionCorrections::WriteBgrJetSecCorr(TString strInfile, TString strBgrID, TString strID, TString strOutfile, 
-                                                            Bool_t updateOutfile, TString strOutDir)
+                                                            Bool_t updateOutfile, TString strOutDir,Double_t scaleFacBgrRec)
 { 
   // read task ouput from MC and write secondary correction - standard dir/list 
      
   TString strdir  = "PWGJE_FragmentationFunction_" + strID;
   TString strlist = "fracfunc_" + strID;
     
-  WriteJetSecCorr(strInfile,strdir,strlist,strOutfile,updateOutfile, strOutDir,kTRUE,strBgrID);
+  WriteJetSecCorr(strInfile,strdir,strlist,strOutfile,updateOutfile, strOutDir,kTRUE,strBgrID,scaleFacBgrRec);
 }
 
 
 //___________________________________________________________________________________________________________________________________
 void AliFragmentationFunctionCorrections::WriteJetSecCorr(TString strInfile, TString strdir, TString strlist, 
                                                          TString strOutfile, Bool_t updateOutfile, TString strOutDir,
-                                                         Bool_t writeBgr, TString strBgrID)
+                                                         Bool_t writeBgr, TString strBgrID,Double_t scaleFacBgrRec)
 {
   // read task output from MC and write secondary correction in jet pt slices as function of pt, z, xi
   // argument strlist optional - read from directory strdir if not specified
@@ -3160,9 +3160,12 @@ void AliFragmentationFunctionCorrections::WriteJetSecCorr(TString strInfile, TSt
     hdNdzMCSecRecSsc[i]->SetNameTitle(strNameFFZSecRecSsc,"");
     hdNdxiMCSecRecSsc[i]->SetNameTitle(strNameFFXiSecRecSsc,"");
     
-    // normalize
+    // normalize 
     Double_t nJetsBin = fh1FFJetPtRecEffRec->Integral(binLo,binUp);
 
+    // scale fac for perp2 bgr
+    if(writeBgr && scaleFacBgrRec && (scaleFacBgrRec != 1)) nJetsBin /= scaleFacBgrRec;
+
     NormalizeTH1(hdNdptTracksMCPrimRec[i],nJetsBin); 
     NormalizeTH1(hdNdzMCPrimRec[i],nJetsBin); 
     NormalizeTH1(hdNdxiMCPrimRec[i],nJetsBin); 
@@ -4193,8 +4196,8 @@ void AliFragmentationFunctionCorrections::WriteJetSpecResponse(TString strInfile
   
 
   Int_t    nBinsResponse[4]  = {nBinsRecPt,nBinsTrackPt,nBinsGenPt,nBinsTrackPt};
-  Double_t binMinResponse[4] = {loLimRecPt,loLimTrackPt,loLimGenPt,loLimTrackPt};
-  Double_t binMaxResponse[4] = {upLimRecPt,upLimTrackPt,upLimGenPt,upLimTrackPt};
+  Double_t binMinResponse[4] = { static_cast<Double_t>(loLimRecPt), static_cast<Double_t>(loLimTrackPt), static_cast<Double_t>(loLimGenPt), static_cast<Double_t>(loLimTrackPt)};
+  Double_t binMaxResponse[4] = { static_cast<Double_t>(upLimRecPt), static_cast<Double_t>(upLimTrackPt), static_cast<Double_t>(upLimGenPt), static_cast<Double_t>(upLimTrackPt)};
 
   const char* labelsResponseSinglePt[4] = {"rec jet p_{T} (GeV/c)", "rec track p_{T} (GeV/c)", "gen jet p_{T} (GeV/c)", "gen track p_{T} (GeV/c)"};
   
@@ -4597,7 +4600,7 @@ void AliFragmentationFunctionCorrections::dNdz2dNdxi()
 //________________________________________________________________________________________________________________
 void AliFragmentationFunctionCorrections::WriteBinShiftCorr(TString strInfile, TString strIDGen,  TString strIDRec,  
                                                            TString strOutfile, Bool_t updateOutfile, Bool_t useRecPrim, 
-                                                           TString strOutDir)
+                                                           TString strOutDir,Double_t scaleFacBgrRec)
 { 
   TString strdirGen  = "PWGJE_FragmentationFunction_" + strIDGen;
   TString strlistGen = "fracfunc_" + strIDGen;
@@ -4605,13 +4608,13 @@ void AliFragmentationFunctionCorrections::WriteBinShiftCorr(TString strInfile, T
   TString strdirRec  = "PWGJE_FragmentationFunction_" + strIDRec;
   TString strlistRec = "fracfunc_" + strIDRec;
   
-  WriteBinShiftCorr(strInfile,strdirGen,strlistGen,strdirRec,strlistRec,strOutfile,updateOutfile,useRecPrim, strOutDir, kFALSE, "");
+  WriteBinShiftCorr(strInfile,strdirGen,strlistGen,strdirRec,strlistRec,strOutfile,updateOutfile,useRecPrim, strOutDir, kFALSE, "",scaleFacBgrRec);
 }
 
 //________________________________________________________________________________________________________________
 void AliFragmentationFunctionCorrections::WriteBgrBinShiftCorr(TString strInfile, TString strBgrID, TString strIDGen,  TString strIDRec,  
                                                               TString strOutfile, Bool_t updateOutfile, Bool_t useRecPrim, 
-                                                              TString strOutDir)
+                                                              TString strOutDir,Double_t scaleFacBgrRec)
 { 
   TString strdirGen  = "PWGJE_FragmentationFunction_" + strIDGen;
   TString strlistGen = "fracfunc_" + strIDGen;
@@ -4619,14 +4622,14 @@ void AliFragmentationFunctionCorrections::WriteBgrBinShiftCorr(TString strInfile
   TString strdirRec  = "PWGJE_FragmentationFunction_" + strIDRec;
   TString strlistRec = "fracfunc_" + strIDRec;
   
-  WriteBinShiftCorr(strInfile,strdirGen,strlistGen,strdirRec,strlistRec,strOutfile,updateOutfile,useRecPrim, strOutDir, kTRUE, strBgrID);
+  WriteBinShiftCorr(strInfile,strdirGen,strlistGen,strdirRec,strlistRec,strOutfile,updateOutfile,useRecPrim, strOutDir, kTRUE, strBgrID,scaleFacBgrRec);
 }
 
 //___________________________________________________________________________________________________________________________________
 void AliFragmentationFunctionCorrections::WriteBinShiftCorr(TString strInfile, TString strdirGen, TString strlistGen, 
                                                            TString strdirRec, TString strlistRec, 
                                                            TString strOutfile, Bool_t updateOutfile, Bool_t useRecPrim, 
-                                                           TString strOutDir,  Bool_t writeBgr, TString strBgrID)
+                                                           TString strOutDir,  Bool_t writeBgr, TString strBgrID, Double_t scaleFacBgrRec)
 {
  
   if((writeBgr && strBgrID.Length() == 0) || (!writeBgr && strBgrID.Length()>0) ){
@@ -4874,6 +4877,9 @@ void AliFragmentationFunctionCorrections::WriteBinShiftCorr(TString strInfile, T
     Double_t nJetsBinGen = fh1FFJetPtMCGen->Integral(binLo,binUp);
     Double_t nJetsBinRec = fh1FFJetPtMCRec->Integral(binLo,binUp);
 
+    // scale fac for perp2 bgr
+     if(useRecPrim && writeBgr && scaleFacBgrRec && (scaleFacBgrRec != 1)) nJetsBinRec /= scaleFacBgrRec;
+
     NormalizeTH1(hdNdptTracksMCGen[i],nJetsBinGen); 
     NormalizeTH1(hdNdzMCGen[i],nJetsBinGen); 
     NormalizeTH1(hdNdxiMCGen[i],nJetsBinGen);