2525#include " PWGCF/Core/PairCuts.h"
2626#include " Common/Core/RecoDecay.h"
2727
28-
29-
30-
3128namespace o2 ::aod
3229{
3330} // namespace o2::aod
@@ -36,7 +33,6 @@ using namespace o2;
3633using namespace o2 ::framework;
3734using namespace o2 ::framework::expressions;
3835
39-
4036struct CorrSparse {
4137 Configurable<float > cfgZVtxCut = {" zvtxcut" , 10.0 , " Vertex z cut. Default 10 cm" };
4238 Configurable<float > cfgPtCutMin = {" minpt" , 0.2 , " Minimum accepted track pT. Default 0.2 GeV" };
@@ -48,14 +44,12 @@ struct CorrSparse {
4844
4945 Configurable<float > cfgCutChi2prTPCcls = {" chi2cut" , 2.5 , " Chi2 cut. Default 2.5" };
5046
51-
52-
5347 ConfigurableAxis axisVertex{" axisVertex" , {7 , -7 , 7 }, " vertex axis for histograms" };
5448 ConfigurableAxis axisDeltaPhi{" axisDeltaPhi" , {72 , -constants::math::PIHalf, constants::math::PIHalf * 3 }, " delta phi axis for histograms" };
5549 ConfigurableAxis axisDeltaEta{" axisDeltaEta" , {40 , -2 , 2 }, " delta eta axis for histograms" };
5650 ConfigurableAxis axisPtTrigger{" axisPtTrigger" , {VARIABLE_WIDTH, 0.5 , 1.0 , 1.5 , 2.0 , 3.0 , 4.0 , 6.0 , 10.0 }, " pt trigger axis for histograms" };
57- ConfigurableAxis axisPtAssoc{" axisPtAssoc" , {VARIABLE_WIDTH, 0.5 , 1.0 , 1.5 , 2.0 , 3.0 , 4.0 , 6.0 ,10.0 }, " pt associated axis for histograms" };
58- ConfigurableAxis axisMultiplicity{" axisMultiplicity" , {VARIABLE_WIDTH, 0 , 5 , 10 ,15 ,20 ,25 ,30 ,35 ,40 ,50 ,60 ,80 ,100 }, " multiplicity / centrality axis for histograms" };
51+ ConfigurableAxis axisPtAssoc{" axisPtAssoc" , {VARIABLE_WIDTH, 0.5 , 1.0 , 1.5 , 2.0 , 3.0 , 4.0 , 6.0 , 10.0 }, " pt associated axis for histograms" };
52+ ConfigurableAxis axisMultiplicity{" axisMultiplicity" , {VARIABLE_WIDTH, 0 , 5 , 10 , 15 , 20 , 25 , 30 , 35 , 40 , 50 , 60 , 80 , 100 }, " multiplicity / centrality axis for histograms" };
5953
6054 HistogramRegistry registry{" registry" };
6155 int logcolls = 0 ;
@@ -64,26 +58,25 @@ struct CorrSparse {
6458 void init (InitContext&)
6559 {
6660 LOGF (info, " Starting init" );
67- registry.add (" Yield" , " pT vs eta vs Nch" , {HistType::kTH3F , { {40 , 0 , 20 , " p_{T}" }, {100 , -2 , 2 , " #eta" }, {100 , 0 , 100 , " Nch" }}}); // check to see total number of tracks
68- registry.add (" etaphi_Trigger" , " eta vs phi vs Nch" , {HistType::kTH3F , { {100 , -2 , 2 , " #eta" }, {200 , 0 , 2 * M_PI, " #varphi" }, {100 , 0 , 100 , " Nch" }}});
69-
70- // Make histograms to check the distributions after cuts
71- registry.add (" deltaEta_deltaPhi_same" , " " , {HistType::kTH2D ,{axisDeltaPhi, axisDeltaEta}}); // check to see the delta eta and delta phi distribution
72- registry.add (" deltaEta_deltaPhi_mixed" , " " , {HistType::kTH2D , {axisDeltaPhi, axisDeltaEta}});
73- registry.add (" Phi" , " Phi" , {HistType::kTH1D ,{{72 , -constants::math::PIHalf, constants::math::PI * 2 , " Phi" }}});
74- registry.add (" Eta" , " Eta" , {HistType::kTH1D ,{{40 , -2 , 2 , " Eta" }}});
75- registry.add (" pT" , " pT" , {HistType::kTH1D ,{axisPtTrigger}});
76- registry.add (" Nch" , " N_{ch}" , {HistType::kTH1D ,{axisMultiplicity}});
77-
78- registry.add (" Sparse_mixed" , " " , {HistType::kTHnSparseD ,{{axisVertex, axisPtTrigger, axisPtAssoc, axisMultiplicity, axisDeltaPhi, axisDeltaEta}}}); // Make the output sparse
79- registry.add (" Sparse_same" , " " , {HistType::kTHnSparseD ,{{axisVertex, axisPtTrigger, axisPtAssoc, axisMultiplicity, axisDeltaPhi, axisDeltaEta}}});
61+ registry.add (" Yield" , " pT vs eta vs Nch" , {HistType::kTH3F , {{40 , 0 , 20 , " p_{T}" }, {100 , -2 , 2 , " #eta" }, {100 , 0 , 100 , " Nch" }}}); // check to see total number of tracks
62+ registry.add (" etaphi_Trigger" , " eta vs phi vs Nch" , {HistType::kTH3F , {{100 , -2 , 2 , " #eta" }, {200 , 0 , 2 * M_PI, " #varphi" }, {100 , 0 , 100 , " Nch" }}});
63+
64+ // Make histograms to check the distributions after cuts
65+ registry.add (" deltaEta_deltaPhi_same" , " " , {HistType::kTH2D , {axisDeltaPhi, axisDeltaEta}}); // check to see the delta eta and delta phi distribution
66+ registry.add (" deltaEta_deltaPhi_mixed" , " " , {HistType::kTH2D , {axisDeltaPhi, axisDeltaEta}});
67+ registry.add (" Phi" , " Phi" , {HistType::kTH1D , {{72 , -constants::math::PIHalf, constants::math::PI * 2 , " Phi" }}});
68+ registry.add (" Eta" , " Eta" , {HistType::kTH1D , {{40 , -2 , 2 , " Eta" }}});
69+ registry.add (" pT" , " pT" , {HistType::kTH1D , {axisPtTrigger}});
70+ registry.add (" Nch" , " N_{ch}" , {HistType::kTH1D , {axisMultiplicity}});
71+
72+ registry.add (" Sparse_mixed" , " " , {HistType::kTHnSparseD , {{axisVertex, axisPtTrigger, axisPtAssoc, axisMultiplicity, axisDeltaPhi, axisDeltaEta}}}); // Make the output sparse
73+ registry.add (" Sparse_same" , " " , {HistType::kTHnSparseD , {{axisVertex, axisPtTrigger, axisPtAssoc, axisMultiplicity, axisDeltaPhi, axisDeltaEta}}});
8074
8175 const int maxMixBin = axisMultiplicity->size () * axisVertex->size ();
82- registry.add (" eventcount" , " bin" , {HistType::kTH1F ,{{maxMixBin + 2 , -2.5 , -0.5 + maxMixBin, " bin" }}}); // histogram to see how many events are in the same and mixed event
76+ registry.add (" eventcount" , " bin" , {HistType::kTH1F , {{maxMixBin + 2 , -2.5 , -0.5 + maxMixBin, " bin" }}}); // histogram to see how many events are in the same and mixed event
8377 }
8478
85-
86- // fill multiple histograms
79+ // fill multiple histograms
8780 template <typename TCollision, typename TTracks>
8881 void fillYield (TCollision collision, float centrality, TTracks tracks) // function to fill the yield and etaphi histograms.
8982 {
@@ -94,13 +87,10 @@ struct CorrSparse {
9487 registry.fill (HIST (" Phi" ), track1.phi ());
9588 registry.fill (HIST (" Eta" ), track1.eta ());
9689 registry.fill (HIST (" pT" ), track1.pt ());
97-
98-
99-
10090 }
10191 }
10292
103- template < typename TCollision>
93+ template <typename TCollision>
10494 bool fillCollision (TCollision collision, float centrality)
10595 {
10696
@@ -110,20 +100,19 @@ struct CorrSparse {
110100
111101 return true ;
112102 }
113-
114103
115- template < typename TTracks>
116- void fillCorrelations (TTracks tracks1, TTracks tracks2, float posZ, int system, float Nch) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms
104+ template <typename TTracks>
105+ void fillCorrelations (TTracks tracks1, TTracks tracks2, float posZ, int system, float Nch) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms
117106 {
118107 // loop over all tracks
119108 for (auto & track1 : tracks1) {
120-
109+
121110 for (auto & track2 : tracks2) {
122111 if (track1 == track2) {
123112 continue ;
124113 }
125114
126- float deltaPhi = RecoDecay::constrainAngle (track1.phi () - track2.phi (),-PIHalf);
115+ float deltaPhi = RecoDecay::constrainAngle (track1.phi () - track2.phi (), -PIHalf);
127116 float deltaEta = track1.eta () - track2.eta ();
128117
129118 // fill the right sparse and histograms
@@ -138,48 +127,40 @@ void fillCorrelations(TTracks tracks1, TTracks tracks2, float posZ, int system,
138127 }
139128 }
140129
141- // make the filters and cuts.
130+ // make the filters and cuts.
142131
143- Filter collisionFilter = nabs(aod::collision::posZ) < cfgZVtxCut;
132+ Filter collisionFilter = nabs(aod::collision::posZ) < cfgZVtxCut;
144133
145- Filter trackFilter = (nabs(aod::track::eta) < cfgEtaCut) && (aod::track::pt > cfgPtCutMin) && (aod::track::pt < cfgPtCutMax)
146- && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == ( uint8_t ) true ));
147-
134+ Filter trackFilter = (nabs(aod::track::eta) < cfgEtaCut) && (aod::track::pt > cfgPtCutMin) && (aod::track::pt < cfgPtCutMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == ( uint8_t ) true ));
135+
136+ // define the filtered collisions and tracks
148137
149- // define the filtered collisions and tracks
150-
151138 using aodCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs>>;
152139 using aodTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA>>;
153140
154-
155-
156-
157-
158- void processSame (aodCollisions::iterator const & collision, aodTracks const & tracks)
141+ void processSame (aodCollisions::iterator const & collision, aodTracks const & tracks)
159142 {
160143 const auto centrality = collision.centFT0C ();
161144
162- registry.fill (HIST (" eventcount" ), -2 ); // because its same event i put it in the -2 bin
145+ registry.fill (HIST (" eventcount" ), -2 ); // because its same event i put it in the -2 bin
163146 fillYield (collision, centrality, tracks);
164- fillCorrelations ( tracks, tracks, collision.posZ (), 1 ,tracks.size ()); // fill the SE histogram and Sparse
147+ fillCorrelations (tracks, tracks, collision.posZ (), 1 , tracks.size ()); // fill the SE histogram and Sparse
165148 }
166149 PROCESS_SWITCH (CorrSparse, processSame, " Process same event" , true );
167150
168-
169-
170- // i do the event mixing (i have not changed this from the tutorial i got).
151+ // i do the event mixing (i have not changed this from the tutorial i got).
171152 std::vector<double > vtxBinsEdges{VARIABLE_WIDTH, -7 .0f , -5 .0f , -3 .0f , -1 .0f , 1 .0f , 3 .0f , 5 .0f , 7 .0f };
172153 std::vector<double > multBinsEdges{VARIABLE_WIDTH, 0 .0f , 5 .0f , 10 .0f , 20 .0f , 30 .0f , 40 .0f , 50.0 , 100 .1f };
173154 SliceCache cache;
174-
155+
175156 ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0C>
176157 bindingOnVtxAndMult{{vtxBinsEdges, multBinsEdges}, true }; // true is for 'ignore overflows' (true by default)
177158 SameKindPair<aodCollisions,
178- aodTracks,
179- ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0C>>
159+ aodTracks,
160+ ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0C>>
180161 pair{bindingOnVtxAndMult, 5 , -1 , &cache}; // indicates that 5 events should be mixed and under/overflow (-1) to be ignored
181162
182- // the process for filling the mixed events
163+ // the process for filling the mixed events
183164 void processMixed (aodCollisions& collisions, aodTracks const & tracks)
184165 {
185166 for (auto & [collision1, tracks1, collision2, tracks2] : pair) {
0 commit comments