@@ -40,24 +40,70 @@ struct DerivedBasicConsumer {
4040 return deltaPhi;
4141 }
4242
43+ Configurable<float > associatedMinPt{" associatedMinPt" , 4 .0f , " NSassociatedMinPt" };
44+ Configurable<float > associatedMaxPt{" associatedMaxPt" , 6 .0f , " associatedMaxPt" };
45+ Configurable<float > triggerMinPt{" triggerMinPt" , 6 .0f , " triggerMinPt" };
46+ ConfigurableAxis axisPt{" axisPt" , {200 ,0 .0f ,20 .0f }, " pt axis" };
47+
48+ SliceCache cache;
49+
50+ // define partitions
51+ Partition<aod::DrTracks> associatedTracks = aod::exampleTrackSpace::pt < associatedMaxPt && aod::exampleTrackSpace::pt > associatedMinPt;
52+ Partition<aod::DrTracks> triggerTracks = aod::exampleTrackSpace::pt > triggerMinPt;
53+
54+ Filter collZfilter = nabs(aod::collision::posZ) < 10 .0f ;
55+
4356 // Histogram registry: an object to hold your histograms
4457 HistogramRegistry histos{" histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
4558
4659 void init (InitContext const &)
4760 {
4861 // define axes you want to use
4962 const AxisSpec axisCounter{1 , 0 , +1 , " " };
50- histos.add (" eventCounter" , " eventCounter" , kTH1F , {axisCounter});
63+ const AxisSpec axisPVz{300 , -15 .0f , +15 .0f , " " };
64+ const AxisSpec axisDeltaPhi{100 , -0.5 *o2::constants::math::PI, +1.5 *o2::constants::math::PI, " #Delta#phi" };
65+ const AxisSpec axisDeltaEta{100 , -1.0 , +1.0 , " #Delta#eta" };
66+
67+ histos.add (" eventCounter" , " eventCounter" , kTH1D , {axisCounter});
68+ histos.add (" hEventPVz" , " hEventPVz" , kTH1D , {axisPVz});
69+
70+ histos.add (" ptAssoHistogram" , " ptAssoHistogram" , kTH1D , {axisPt});
71+ histos.add (" ptTrigHistogram" , " ptTrigHistogram" , kTH1D , {axisPt});
72+
73+ histos.add (" correlationFunction" , " correlationFunction" , kTH1D , {axisDeltaPhi});
74+ histos.add (" correlationFunctionO2" , " correlationFunctionO2" , kTH1D , {axisDeltaPhi});
75+
76+ histos.add (" correlationFunction2d" , " correlationFunction2d" , kTH2F , {axisDeltaPhi, axisDeltaEta});
5177 }
5278
53- void process (aod::DrCollision const & /* collision*/ )
79+ void process (soa::Filtered< aod::DrCollisions>::iterator const & collision, aod::DrTracks const & )
5480 {
5581 histos.fill (HIST (" eventCounter" ), 0.5 );
82+ histos.fill (HIST (" hEventPVz" ), collision.posZ ());
83+
84+ auto assoTracksThisCollision = associatedTracks->sliceByCached (aod::exampleTrackSpace::drCollisionId, collision.globalIndex (), cache);
85+ auto trigTracksThisCollision = triggerTracks->sliceByCached (aod::exampleTrackSpace::drCollisionId, collision.globalIndex (), cache);
86+
87+ for (auto & track : assoTracksThisCollision)
88+ histos.fill (HIST (" ptAssoHistogram" ), track.pt ());
89+ for (auto & track : trigTracksThisCollision)
90+ histos.fill (HIST (" ptTrigHistogram" ), track.pt ());
91+
92+ for (auto & trigger : trigTracksThisCollision){
93+ for (auto & associated : assoTracksThisCollision){
94+ histos.fill (HIST (" correlationFunction" ), ComputeDeltaPhi (trigger.phi (),associated.phi ()));
95+ }
96+ }
97+
98+ for (auto & [trigger, associated] : combinations (o2::soa::CombinationsFullIndexPolicy (trigTracksThisCollision, assoTracksThisCollision))) {
99+ histos.fill (HIST (" correlationFunctionO2" ), ComputeDeltaPhi (trigger.phi (),associated.phi ()));
100+ histos.fill (HIST (" correlationFunction2d" ), ComputeDeltaPhi (trigger.phi (),associated.phi ()), trigger.eta () - associated.eta ());
101+ }
56102 }
57103};
58104
59105WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
60106{
61107 WorkflowSpec workflow{adaptAnalysisTask<DerivedBasicConsumer>(cfgc, TaskName{" derived-basic-consumer" })};
62108 return workflow;
63- }
109+ }
0 commit comments