@@ -122,10 +122,16 @@ struct AntinucleiInJets {
122122 Configurable<std::string> pathToFile{" pathToFile" , " " , " path to file with reweighting" };
123123 Configurable<std::string> histoNameWeightAntipJet{" histoNameWeightAntipJet" , " " , " reweighting histogram: antip in jet" };
124124 Configurable<std::string> histoNameWeightAntipUe{" histoNameWeightAntipUe" , " " , " reweighting histogram: antip in ue" };
125-
126125 TH2F* twoDweightsAntipJet;
127126 TH2F* twoDweightsAntipUe;
128127
128+ // jet pt unfolding
129+ Configurable<bool > applyPtUnfolding{" applyPtUnfolding" , true , " apply jet pt unfolding" };
130+ Configurable<std::string> urlToCcdbPtUnfolding{" urlToCcdbPtUnfolding" , " http://alice-ccdb.cern.ch" , " url of the personal ccdb" };
131+ Configurable<std::string> pathToFilePtUnfolding{" pathToFilePtUnfolding" , " Users/c/chpinto/My/Object/ResponseMatrix" , " path to file with pt unfolding" };
132+ Configurable<std::string> histoNamePtUnfolding{" histoNamePtUnfolding" , " detectorResponseMatrix" , " pt unfolding histogram" };
133+ TH2F* responseMatrix;
134+
129135 Service<o2::ccdb::BasicCCDBManager> ccdb;
130136 o2::ccdb::CcdbApi ccdbApi;
131137
@@ -146,6 +152,12 @@ struct AntinucleiInJets {
146152 twoDweightsAntipUe = nullptr ;
147153 }
148154
155+ if (applyPtUnfolding) {
156+ getPtUnfoldingHistogram (ccdb, TString (pathToFilePtUnfolding), TString (histoNamePtUnfolding));
157+ } else {
158+ responseMatrix = nullptr ;
159+ }
160+
149161 // binning
150162 double min = 0.0 ;
151163 double max = 6.0 ;
@@ -439,6 +451,21 @@ struct AntinucleiInJets {
439451 return ptGen;
440452 }
441453
454+ void getPtUnfoldingHistogram (o2::framework::Service<o2::ccdb::BasicCCDBManager> const & ccdbObj, TString filepath, TString histoNamePtUnfolding)
455+ {
456+ TList* l = ccdbObj->get <TList>(filepath.Data ());
457+ if (!l) {
458+ LOGP (error, " Could not open the file {}" , Form (" %s" , filepath.Data ()));
459+ return ;
460+ }
461+ responseMatrix = static_cast <TH2F*>(l->FindObject (Form (" %s" , histoNamePtUnfolding.Data ())));
462+ if (!responseMatrix) {
463+ LOGP (error, " Could not open histogram {}" , Form (" %s" , histoNamePtUnfolding.Data ()));
464+ return ;
465+ }
466+ LOGP (info, " Opened histogram {}" , Form (" %s" , histoNamePtUnfolding.Data ()));
467+ }
468+
442469 void getReweightingHistograms (o2::framework::Service<o2::ccdb::BasicCCDBManager> const & ccdbObj, TString filepath, TString histname_antip_jet, TString histname_antip_ue)
443470 {
444471 TList* l = ccdbObj->get <TList>(filepath.Data ());
@@ -533,8 +560,7 @@ struct AntinucleiInJets {
533560 // jet pt must be larger than threshold
534561 auto jetForSub = jet;
535562 fastjet::PseudoJet jetMinusBkg = backgroundSub.doRhoAreaSub (jetForSub, rhoPerp, rhoMPerp);
536- // if (getCorrectedPt(jetMinusBkg.pt()) < minJetPt) // while fixing the response matrix
537- if (jetMinusBkg.pt () < minJetPt)
563+ if (getCorrectedPt (jetMinusBkg.pt (), responseMatrix) < minJetPt)
538564 continue ;
539565 isAtLeastOneJetSelected = true ;
540566
@@ -766,8 +792,7 @@ struct AntinucleiInJets {
766792 double ptJetAfterSub = jetForSub.pt ();
767793 registryQC.fill (HIST (" jetPtDifference" ), ptJetAfterSub - ptJetBeforeSub);
768794
769- // if (getCorrectedPt(jetMinusBkg.pt()) < minJetPt) // while fixing the response matrix
770- if (jetMinusBkg.pt () < minJetPt)
795+ if (getCorrectedPt (jetMinusBkg.pt (), responseMatrix) < minJetPt)
771796 continue ;
772797 njetsHighPt++;
773798 registryQC.fill (HIST (" sumPtJet" ), jet.pt ());
@@ -1126,8 +1151,7 @@ struct AntinucleiInJets {
11261151 // jet pt must be larger than threshold
11271152 auto jetForSub = jet;
11281153 fastjet::PseudoJet jetMinusBkg = backgroundSub.doRhoAreaSub (jetForSub, rhoPerp, rhoMPerp);
1129- // if (getCorrectedPt(jetMinusBkg.pt()) < minJetPt) // while fixing the response matrix
1130- if (jetMinusBkg.pt () < minJetPt)
1154+ if (getCorrectedPt (jetMinusBkg.pt (), responseMatrix) < minJetPt)
11311155 continue ;
11321156
11331157 // perpendicular cone
@@ -1302,8 +1326,7 @@ struct AntinucleiInJets {
13021326 // jet pt must be larger than threshold
13031327 auto jetForSub = jet;
13041328 fastjet::PseudoJet jetMinusBkg = backgroundSub.doRhoAreaSub (jetForSub, rhoPerp, rhoMPerp);
1305- // if (getCorrectedPt(jetMinusBkg.pt()) < minJetPt) // while fixing the response matrix
1306- if (jetMinusBkg.pt () < minJetPt)
1329+ if (getCorrectedPt (jetMinusBkg.pt (), responseMatrix) < minJetPt)
13071330 continue ;
13081331
13091332 // get jet constituents
0 commit comments