2222#include " Framework/HistogramRegistry.h"
2323#include " Framework/runDataProcessing.h"
2424
25+ #include " CCDB/BasicCCDBManager.h"
2526#include " Common/Core/RecoDecay.h"
2627#include " Common/Core/TrackSelection.h"
2728#include " Common/Core/TrackSelectionDefaults.h"
3132#include " Common/DataModel/Multiplicity.h"
3233#include " Common/DataModel/PIDResponse.h"
3334#include " CommonConstants/PhysicsConstants.h"
35+
36+ #include " EventFiltering/Zorro.h"
37+ #include " EventFiltering/ZorroSummary.h"
38+
3439#include " ReconstructionDataFormats/Track.h"
3540
3641#include " PWGLF/DataModel/LFParticleIdentification.h"
3742
3843#include " PWGJE/Core/FastJetUtilities.h"
3944#include " PWGJE/Core/JetDerivedDataUtilities.h"
4045#include " PWGJE/DataModel/Jet.h"
46+ #include " PWGJE/DataModel/JetReducedDataSelector.h"
4147
4248using namespace o2 ;
4349using namespace o2 ::framework;
@@ -140,6 +146,9 @@ struct nucleiInJets {
140146
141147 ConfigurableAxis binsPtZHe{" binsPtZHe" , {VARIABLE_WIDTH, 0.5 , 0.625 , 0.75 , 0.875 , 1.0 , 1.125 , 1.25 , 1.375 , 1.5 , 1.625 , 1.75 , 1.875 , 2.0 , 2.25 , 2.5 , 3.0 , 3.5 , 4.0 }, " " };
142148
149+ Configurable<bool > applySkim{" applySkim" , false , " Apply skimming" };
150+ Configurable<std::string> cfgSkim{" cfgSkim" , " fHighFt0Mult" , " Configurable for skimming" };
151+
143152 static constexpr float gMassProton = 0 .93827208f ;
144153 static constexpr float gMassDeuteron = 1 .87561f ;
145154 static constexpr float gMassTriton = 2 .80892f ;
@@ -170,6 +179,11 @@ struct nucleiInJets {
170179 SliceCache cache;
171180 HistogramRegistry jetHist{" jetHist" , {}, OutputObjHandlingPolicy::AnalysisObject};
172181
182+ Zorro zorro;
183+ OutputObj<ZorroSummary> zorroSummary{" zorroSummary" };
184+
185+ Service<o2::ccdb::BasicCCDBManager> ccdb;
186+
173187 void init (o2::framework::InitContext&)
174188 {
175189 const AxisSpec PtAxis = {100 , 0 , 10.0 };
@@ -188,6 +202,15 @@ struct nucleiInJets {
188202 const AxisSpec massTrAxis{binsMassTr, " " };
189203 const AxisSpec massHeAxis{binsMassHe, " " };
190204
205+ if (applySkim) {
206+ jetHist.add (" hNEvents" , " hNEvents" , {HistType::kTH1D , {{6 , 0 .f , 6 .f }}});
207+ jetHist.get <TH1>(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (1 , " All" );
208+ jetHist.get <TH1>(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (2 , " Skimmed" );
209+ jetHist.get <TH1>(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (3 , " |Vz|<10" );
210+ jetHist.get <TH1>(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (4 , " Sel8+|Vz|<10" );
211+ jetHist.get <TH1>(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (5 , " nJets>0" );
212+ }
213+
191214 // jet property
192215 jetHist.add (" jet/h1JetPt" , " jet_{p_{T}}" , kTH1F , {PtJetAxis});
193216 jetHist.add (" jet/h1JetEvents" , " NumbeOfJetEvents" , kTH1F , {{1 , 0 , 1 }});
@@ -508,6 +531,14 @@ struct nucleiInJets {
508531 }
509532 }
510533
534+ template <typename BCType>
535+ void initCCDB (const BCType& bc)
536+ {
537+ if (applySkim) {
538+ zorro.initCCDB (ccdb.service , bc.runNumber (), bc.timestamp (), cfgSkim.value );
539+ zorro.populateHistRegistry (jetHist, bc.runNumber ());
540+ }
541+ }
511542 std::array<float , 2 > getPerpendicuarPhi (float jetPhi)
512543 {
513544 std::array<float , 2 > PerpendicularConeAxisPhi = {-999 .0f , -999 .0f };
@@ -932,13 +963,28 @@ struct nucleiInJets {
932963 // //////////////////////////////////////
933964 }
934965
935- void processJetTracksData (aod::JetCollision const & collision, chargedJetstrack const & chargedjets, soa::Join<aod::JetTracks, aod::JTrackPIs> const & tracks, TrackCandidates const &)
966+ void processJetTracksData (soa::Join<aod::JetCollisions, aod::JCollisionBCs>::iterator const & collision, chargedJetstrack const & chargedjets, soa::Join<aod::JetTracks, aod::JTrackPIs> const & tracks, TrackCandidates const &,
967+ TrackCandidatesLfPid const &, aod::JBCs const &)
936968 {
969+ auto bc = collision.bc_as <aod::JBCs>();
970+ initCCDB (bc);
971+
972+ if (applySkim) {
973+ jetHist.fill (HIST (" hNEvents" ), 0.5 );
974+ bool zorroSelected = zorro.isSelected (bc.globalBC ());
975+ if (!zorroSelected) {
976+ return ;
977+ }
978+ jetHist.fill (HIST (" hNEvents" ), 1.5 );
979+ }
937980
938981 if (fabs (collision.posZ ()) > 10 )
939982 return ;
983+
984+ jetHist.fill (HIST (" hNEvents" ), 2.5 );
940985 if (!jetderiveddatautilities::selectCollision (collision, jetderiveddatautilities::initialiseEventSelectionBits (" sel8" )))
941986 return ;
987+ jetHist.fill (HIST (" hNEvents" ), 3.5 );
942988
943989 int nJets = 0 ;
944990 std::vector<float > leadingJetWithPtEtaPhi (3 );
@@ -959,13 +1005,16 @@ struct nucleiInJets {
9591005 jetHist.fill (HIST (" jet/nJetsPerEvent" ), nJets);
9601006 jetHist.fill (HIST (" vertexZ" ), collision.posZ ());
9611007
962- if (nJets > 0 )
1008+ if (nJets > 0 ) {
9631009 jetHist.fill (HIST (" jet/vertexZ" ), collision.posZ ());
964- else
1010+ jetHist.fill (HIST (" hNEvents" ), 4.5 );
1011+ } else {
9651012 jetHist.fill (HIST (" jetOut/vertexZ" ), collision.posZ ());
1013+ }
9661014
9671015 if (isWithJetEvents && nJets == 0 )
9681016 return ;
1017+
9691018 jetHist.fill (HIST (" jet/h1JetEvents" ), 0.5 );
9701019
9711020 for (auto & track : tracks) {
@@ -1299,7 +1348,7 @@ struct nucleiInJets {
12991348 } // process
13001349
13011350 PROCESS_SWITCH (nucleiInJets, processJetTracksData, " nuclei in Jets data" , true );
1302- PROCESS_SWITCH (nucleiInJets, processMCRec, " nuclei in Jets for detectorlevel Jets" , true );
1351+ PROCESS_SWITCH (nucleiInJets, processMCRec, " nuclei in Jets for detectorlevel Jets" , false );
13031352 PROCESS_SWITCH (nucleiInJets, processMCGen, " nuclei in Jets MC particlelevel Jets" , false );
13041353 PROCESS_SWITCH (nucleiInJets, processRecMatched, " nuclei in Jets rec matched" , false );
13051354 PROCESS_SWITCH (nucleiInJets, processGenMatched, " nuclei in Jets gen matched" , false );
0 commit comments