@@ -48,9 +48,12 @@ namespace flowcorrupc
4848DECLARE_SOA_COLUMN (Multiplicity, multiplicity, int );
4949DECLARE_SOA_COLUMN (Truegapside, truegapside, int );
5050} // namespace flowcorrupc
51+ DECLARE_SOA_COLUMN (Truegapside, truegapside, int );
52+ } // namespace flowcorrupc
5153DECLARE_SOA_TABLE (Multiplicity, " AOD" , " MULTIPLICITY" ,
5254 flowcorrupc::Multiplicity);
5355DECLARE_SOA_TABLE (Truegapside, " AOD" , " TRUEGAPSIDE" , flowcorrupc::Truegapside);
56+ DECLARE_SOA_TABLE (Truegapside, " AOD" , " TRUEGAPSIDE" , flowcorrupc::Truegapside);
5457} // namespace o2::aod
5558
5659using namespace o2 ;
@@ -62,9 +65,9 @@ using namespace o2::framework::expressions;
6265
6366struct CalcNchUpc {
6467 O2_DEFINE_CONFIGURABLE (cfgZVtxCut, float , 10 .0f , " Accepted z-vertex range" )
65- O2_DEFINE_CONFIGURABLE (cfgPtCutMin, float , 0 .2f , " minimum accepted track pT" )
68+ O2_DEFINE_CONFIGURABLE (cfgPtCutMin, float , 0 .1f , " minimum accepted track pT" )
6669 O2_DEFINE_CONFIGURABLE (cfgPtCutMax, float , 10 .0f , " maximum accepted track pT" )
67- O2_DEFINE_CONFIGURABLE (cfgEtaCut, float , 0 .8f , " Eta cut" )
70+ O2_DEFINE_CONFIGURABLE (cfgEtaCut, float , 0 .9f , " Eta cut" )
6871 O2_DEFINE_CONFIGURABLE (cfgMinMixEventNum, int , 5 , " Minimum number of events to mix" )
6972
7073 // Added UPC Cuts
@@ -74,6 +77,13 @@ struct CalcNchUpc {
7477 Configurable<float > cfgCutFT0C{" cfgCutFT0C" , 50 ., " FT0C threshold" };
7578 Configurable<float > cfgCutZDC{" cfgCutZDC" , 10 ., " ZDC threshold" };
7679
80+ // Added UPC Cuts
81+ SGSelector sgSelector;
82+ Configurable<float > cfgCutFV0{" cfgCutFV0" , 50 ., " FV0A threshold" };
83+ Configurable<float > cfgCutFT0A{" cfgCutFT0A" , 150 ., " FT0A threshold" };
84+ Configurable<float > cfgCutFT0C{" cfgCutFT0C" , 50 ., " FT0C threshold" };
85+ Configurable<float > cfgCutZDC{" cfgCutZDC" , 10 ., " ZDC threshold" };
86+
7787 // Filter trackFilter = (nabs(aod::track::eta) < cfgEtaCut) && (aod::track::pt > cfgPtCutMin) && (aod::track::pt < cfgPtCutMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true));
7888
7989 using UdTracks = soa::Join<aod::UDTracks, aod::UDTracksExtra, aod::UDTracksPID>;
@@ -82,29 +92,39 @@ struct CalcNchUpc {
8292
8393 Produces<aod::Multiplicity> multiplicityNch;
8494 Produces<aod::Truegapside> truegapside;
95+ Produces<aod::Truegapside> truegapside;
8596
8697 HistogramRegistry registry{" registry" };
8798
8899 void init (InitContext&)
89100 {
90101 AxisSpec axisNch = {100 , 0 , 100 };
91102 AxisSpec axisVrtx = {10 , -10 , 10 };
92- AxisSpec axisgap = {12 , -6 , 6 };
103+ // AxisSpec axisgap = {12, -6, 6};
104+ // std::vector<AxisSpec> trueGapBins = {-2, -1, 0, 1, 2, 3};
105+ // AxisSpec axisgap = {trueGapBins, "true gap side"};
106+
107+ std::vector<double > binEdges = {-1.5 , -0.5 , 0.5 , 1.5 , 2.5 , 3.5 };
108+ AxisSpec axisgap = {binEdges, " true gap side" };
109+ registry.add (" truegap" , " truegap" , {HistType::kTH1D , {axisgap}});
93110
94111 registry.add (" Ncharge" , " N_{charge}" , {HistType::kTH1D , {axisNch}});
95112 registry.add (" zVtx_all" , " zVtx_all" , {HistType::kTH1D , {axisVrtx}});
96113 registry.add (" Nch_vs_zVtx" , " Nch vs zVtx" , {HistType::kTH2D , {axisVrtx, axisNch}});
97- registry.add (" truegap" , " truegap" , {HistType::kTH1D , {axisgap}});
114+ // registry.add("truegap", "truegap", {HistType::kTH1D, {axisgap}});
98115 }
99116
100117 void process (UDCollisionsFull::iterator const & collision, UdTracksFull const & tracks)
101118 {
102119 multiplicityNch (tracks.size ());
103120 truegapside (sgSelector.trueGap (collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC));
121+ // LOG(info) << "truegapside=" << sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
104122 registry.fill (HIST (" Ncharge" ), tracks.size ());
105123 registry.fill (HIST (" truegap" ), sgSelector.trueGap (collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC));
124+ registry.fill (HIST (" truegap" ), sgSelector.trueGap (collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC));
106125 registry.fill (HIST (" zVtx_all" ), collision.posZ ());
107126 registry.fill (HIST (" Nch_vs_zVtx" ), collision.posZ (), tracks.size ());
127+ registry.fill (HIST (" Nch_vs_zVtx" ), collision.posZ (), tracks.size ());
108128 }
109129};
110130
@@ -113,7 +133,7 @@ struct FlowCorrelationsUpc {
113133 O2_DEFINE_CONFIGURABLE (cfgIfVertex, bool , false , " choose vertex or not" )
114134 O2_DEFINE_CONFIGURABLE (cfgPtCutMin, float , 0 .1f , " minimum accepted track pT" )
115135 O2_DEFINE_CONFIGURABLE (cfgPtCutMax, float , 10 .0f , " maximum accepted track pT" )
116- O2_DEFINE_CONFIGURABLE (cfgEtaCut, float , 0 .8f , " Eta cut" )
136+ O2_DEFINE_CONFIGURABLE (cfgEtaCut, float , 0 .9f , " Eta cut" )
117137 O2_DEFINE_CONFIGURABLE (cfgMinMixEventNum, int , 5 , " Minimum number of events to mix" )
118138 O2_DEFINE_CONFIGURABLE (cfgMinMult, int , 0 , " Minimum multiplicity for collision" )
119139 O2_DEFINE_CONFIGURABLE (cfgMaxMult, int , 10 , " Maximum multiplicity for collision" )
@@ -124,7 +144,7 @@ struct FlowCorrelationsUpc {
124144 O2_DEFINE_CONFIGURABLE (cfgRadiusLow, float , 0.8 , " Low radius for merging cut" )
125145 O2_DEFINE_CONFIGURABLE (cfgRadiusHigh, float , 2.5 , " High radius for merging cut" )
126146 O2_DEFINE_CONFIGURABLE (cfgIsGoodItsLayers, bool , false , " whether choose itslayers" )
127- O2_DEFINE_CONFIGURABLE (cfgGapSide, int , 0 , " 0: gapside A;1:C" )
147+ O2_DEFINE_CONFIGURABLE (cfgGapSide, int , 1 , " 0: gapside A;1:C" )
128148 O2_DEFINE_CONFIGURABLE (cfgGapSideMerge, bool , false , " whether merge A and C side together" )
129149 O2_DEFINE_CONFIGURABLE (cfgDcaxy, bool , true , " choose dcaxy" )
130150 O2_DEFINE_CONFIGURABLE (cfgDcaz, bool , false , " choose dcaz" )
@@ -161,12 +181,11 @@ struct FlowCorrelationsUpc {
161181
162182 // make the filters and cuts.
163183 Filter trackFilter = (aod::udtrack::isPVContributor == true );
164- Filter collisionFilter = (((cfgGapSideMerge == true && (aod::udcollision::gapSide == (uint8_t )1 || aod::udcollision::gapSide == (uint8_t )0 )) || aod::udcollision::gapSide == (uint8_t )cfgGapSide) && (cfgIfVertex == false || aod::collision::posZ < cfgZVtxCut) && (aod::udcollision::occupancyInTime > 0 && aod::udcollision::occupancyInTime < cfgCutOccupancyHigh) && ((cfgGapSideMerge == true && (aod::flowcorrupc::truegapside == 0 || aod::flowcorrupc::truegapside == 1 )) || aod::flowcorrupc::truegapside == cfgGapSide) && (aod::flowcorrupc::multiplicity > cfgMinMult) && (aod::flowcorrupc::multiplicity < cfgMaxMult));
165- // Filter collisionFilter = (nabs(aod::collision::posZ) < cfgZVtxCut) && (aod::flowcorrupc::multiplicity) > cfgMinMult && (aod::flowcorrupc::multiplicity) < cfgMaxMult && (aod::evsel::sel8) == true;
166- // Filter trackFilter = (nabs(aod::track::eta) < cfgEtaCut) && (aod::track::pt > cfgPtCutMin) && (aod::track::pt < cfgPtCutMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true));
184+ Filter collisionFilter = (aod::udcollision::gapSide == (uint8_t )cfgGapSide && (cfgIfVertex == false || aod::collision::posZ < cfgZVtxCut) && (aod::udcollision::occupancyInTime > 0 && aod::udcollision::occupancyInTime < cfgCutOccupancyHigh) && aod::flowcorrupc::truegapside == 1 );
167185
168186 using UdTracks = soa::Filtered<soa::Join<aod::UDTracks, aod::UDTracksExtra, aod::UDTracksPID>>;
169187 using UdTracksFull = soa::Filtered<soa::Join<aod::UDTracks, aod::UDTracksPID, aod::UDTracksExtra, aod::UDTracksFlags, aod::UDTracksDCA>>;
188+
170189 using UDCollisionsFull = soa::Filtered<soa::Join<aod::UDCollisions, aod::SGCollisions, aod::UDCollisionsSels, aod::UDZdcsReduced, aod::Multiplicity, aod::Truegapside, aod::UDCollisionSelExtras>>;
171190
172191 // Define the outputs
@@ -177,6 +196,8 @@ struct FlowCorrelationsUpc {
177196
178197 void init (InitContext&)
179198 {
199+ LOG (info) << " cfgGapSide = " << cfgGapSide;
200+ LOG (info) << " cfgGapSide value type: " << typeid (cfgGapSide).name ();
180201 LOGF (info, " Starting init" );
181202 // Make histograms to check the distributions after cuts
182203 registry.add (" deltaEta_deltaPhi_same" , " " , {HistType::kTH2D , {axisDeltaPhi, axisDeltaEta}}); // check to see the delta eta and delta phi distribution
@@ -187,10 +208,16 @@ struct FlowCorrelationsUpc {
187208 registry.add (" Nch" , " N_{ch}" , {HistType::kTH1D , {axisMultiplicity}});
188209 registry.add (" zVtx" , " zVtx" , {HistType::kTH1D , {axisVertex}});
189210 registry.add (" Nch_vs_zVtx" , " Nch vs zVtx" , {HistType::kTH2D , {axisVertex, axisMultiplicity}});
211+ registry.add (" Nch_same" , " Nch same event" , {HistType::kTH1D , {axisMultiplicity}});
212+ registry.add (" Nch_mixed" , " Nch mixed event" , {HistType::kTH1D , {axisMultiplicity}});
190213
191214 registry.add (" Trig_hist" , " " , {HistType::kTHnSparseF , {{axisSample, axisVertex, axisPtTrigger}}});
192215
193- registry.add (" eventcount" , " bin" , {HistType::kTH1F , {{10 , 0 , 10 , " bin" }}}); // histogram to see how many events are in the same and mixed event
216+ registry.add (" eventcount_same" , " bin" , {HistType::kTH1F , {{10 , 0 , 10 , " bin" }}}); // histogram to see how many events are in the same and mixed event
217+ registry.add (" eventcount_mixed" , " bin" , {HistType::kTH1F , {{10 , 0 , 10 , " bin" }}}); // histogram to see how many events are in the same and mixed event
218+
219+ registry.add (" trackcount_same" , " bin" , {HistType::kTH1F , {{10 , 0 , 10 , " bin" }}}); // histogram to see how many tracks are in the same and mixed event
220+ registry.add (" trackcount_mixed" , " bin" , {HistType::kTH1F , {{10 , 0 , 10 , " bin" }}}); // histogram to see how many tracks are in the same and mixed event
194221
195222 std::vector<AxisSpec> corrAxis = {{axisSample, " Sample" },
196223 {axisVertex, " z-vtx (cm)" },
@@ -212,6 +239,8 @@ struct FlowCorrelationsUpc {
212239 SameEvent = 1 ,
213240 MixedEvent = 3 ,
214241 MixedFinal = 9
242+ MixedEvent = 3 ,
243+ MixedFinal = 9
215244 };
216245
217246 template <typename TTrack>
@@ -352,42 +381,14 @@ struct FlowCorrelationsUpc {
352381
353382 void processSame (UDCollisionsFull::iterator const & collision, UdTracksFull const & tracks)
354383 {
355- // if (tracks.size() < cfgMinMult || tracks.size() > cfgMaxMult) {
356- // return;
357- // }
358- // if (cfgIsGoodItsLayers && collision.trs() == 0) {
359- // return;
360- // }
361-
362- // if (cfgGapSideMerge) {
363- // int gapSide = collision.gapSide();
364- // if (gapSide != 0 && gapSide != 1) {
365- // return;
366- // }
367- // int trueGapSide = sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
368- // int gapSide1 = trueGapSide;
369- // if (gapSide1 != 0 && gapSide1 != 1) {
370- // return;
371- // }
372- // }
373- // if (!cfgGapSideMerge) {
374- // int trueGapSide = sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
375- // int gapSide1 = trueGapSide;
376- // if (gapSide1 != cfgGapSide) {
377- // return;
378- // }
379- // }
380- // float vtxz = collision.posZ();
381- // if (cfgIfVertex && abs(vtxz) > cfgZVtxCut) {
382- // return;
383- // }
384- // int occupancy = collision.occupancyInTime();
385- // if (cfgEvSelOccupancy && (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)) {
386- // return;
387- // }
384+ LOG (info) << " Event passed filter: truegapside=" << collision.truegapside ();
385+ if (tracks.size () < cfgMinMult || tracks.size () > cfgMaxMult) {
386+ return ;
387+ }
388+ registry.fill (HIST (" eventcount_same" ), 3.5 );
388389 int runIndex = collision.runNumber ();
389390
390- registry.fill (HIST (" eventcount" ), SameEvent); // because its same event i put it in the 1 bin
391+ // registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin
391392 registry.fill (HIST (" Nch_vs_zVtx" ), collision.posZ (), tracks.size ());
392393 fillYield (collision, tracks);
393394 fillCorrelations<CorrelationContainer::kCFStepReconstructed >(tracks, tracks, collision.posZ (), SameEvent, runIndex); // fill the SE histogram and Sparse
@@ -398,6 +399,7 @@ struct FlowCorrelationsUpc {
398399
399400 SliceCache cache;
400401 // using MixedBinning = FlexibleBinningPolicy<std::tuple<aod::flowcorrupc::Multiplicity>, aod::collision::PosZ, aod::flowcorrupc::Multiplicity>;
402+ // using MixedBinning = FlexibleBinningPolicy<std::tuple<aod::flowcorrupc::Multiplicity>, aod::collision::PosZ, aod::flowcorrupc::Multiplicity>;
401403 using MixedBinning = ColumnBinningPolicy<aod::collision::PosZ, aod::flowcorrupc::Multiplicity>;
402404
403405 // the process for filling the mixed events
@@ -406,71 +408,15 @@ struct FlowCorrelationsUpc {
406408 MixedBinning binningOnVtxAndMult{{vtxMix, multMix}, true }; // true is for 'ignore overflows' (true by default)
407409 auto tracksTuple = std::make_tuple (tracks, tracks);
408410 Pair<UDCollisionsFull, UdTracksFull, UdTracksFull, MixedBinning> pairs{binningOnVtxAndMult, cfgMinMixEventNum, -1 , collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip
411+ auto tracksTuple = std::make_tuple (tracks, tracks);
412+ Pair<UDCollisionsFull, UdTracksFull, UdTracksFull, MixedBinning> pairs{binningOnVtxAndMult, cfgMinMixEventNum, -1 , collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip
409413
410414 for (auto const & [collision1, tracks1, collision2, tracks2] : pairs) {
411- registry.fill (HIST (" eventcount" ), MixedEvent); // fill the mixed event in the 3 bin
412- // if (tracks1.size() < cfgMinMult || tracks1.size() > cfgMaxMult || tracks2.size() < cfgMinMult || tracks2.size() > cfgMaxMult) {
413- // continue;
414- // }
415- // registry.fill(HIST("eventcount"), 4.5);
416- // if (cfgIsGoodItsLayers && (collision1.trs() == 0 || collision2.trs() == 0)) {
417- // continue;
418- // }
419- // registry.fill(HIST("eventcount"), 5.5);
420- // if (cfgGapSideMerge) {
421- // int gapSide = collision1.gapSide();
422- // if (gapSide != 0 && gapSide != 1) {
423- // continue;
424- // }
425- // int trueGapSide = sgSelector.trueGap(collision1, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
426- // int gapSide1 = trueGapSide;
427- // if (gapSide1 != 0 && gapSide1 != 1) {
428- // continue;
429- // }
430- // }
431- // if (!cfgGapSideMerge) {
432- // int trueGapSide = sgSelector.trueGap(collision1, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
433- // int gapSide1 = trueGapSide;
434- // if (gapSide1 != cfgGapSide) {
435- // continue;
436- // }
437- // }
438- // if (cfgGapSideMerge) {
439- // int gapSide = collision2.gapSide();
440- // if (gapSide != 0 && gapSide != 1) {
441- // continue;
442- // }
443- // int trueGapSide = sgSelector.trueGap(collision2, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
444- // int gapSide2 = trueGapSide;
445- // if (gapSide2 != 0 && gapSide2 != 1) {
446- // continue;
447- // }
448- // }
449- // if (!cfgGapSideMerge) {
450- // int trueGapSide = sgSelector.trueGap(collision2, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC);
451- // int gapSide2 = trueGapSide;
452- // if (gapSide2 != cfgGapSide) {
453- // continue;
454- // }
455- // }
456- registry.fill (HIST (" eventcount" ), 6.5 );
457- // float vtxz = collision1.posZ();
458- // if (cfgIfVertex && abs(vtxz) > cfgZVtxCut) {
459- // continue;
460- // }
461- // int occupancy = collision1.occupancyInTime();
462- // if (cfgEvSelOccupancy && (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)) {
463- // continue;
464- // }
465- // vtxz = collision2.posZ();
466- // if (cfgIfVertex && abs(vtxz) > cfgZVtxCut) {
467- // continue;
468- // }
469- // occupancy = collision2.occupancyInTime();
470- // if (cfgEvSelOccupancy && (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)) {
471- // continue;
472- // }
473- registry.fill (HIST (" eventcount" ), MixedFinal);
415+ // registry.fill(HIST("eventcount"), MixedEvent); // fill the mixed event in the 3 bin
416+ if (tracks1.size () < cfgMinMult || tracks1.size () > cfgMaxMult || tracks2.size () < cfgMinMult || tracks2.size () > cfgMaxMult) {
417+ continue ;
418+ }
419+ registry.fill (HIST (" eventcount_same" ), 4.5 );
474420 fillCorrelations<CorrelationContainer::kCFStepReconstructed >(tracks1, tracks2, collision1.posZ (), MixedEvent, collision1.runNumber ()); // fill the ME histogram and Sparse
475421 }
476422 }
0 commit comments