diff --git a/PWGUD/Tasks/flowCorrelationsUpc.cxx b/PWGUD/Tasks/flowCorrelationsUpc.cxx index fd64d11702a..df1ccb8ff41 100644 --- a/PWGUD/Tasks/flowCorrelationsUpc.cxx +++ b/PWGUD/Tasks/flowCorrelationsUpc.cxx @@ -62,9 +62,9 @@ using namespace o2::framework::expressions; struct CalcNchUpc { O2_DEFINE_CONFIGURABLE(cfgZVtxCut, float, 10.0f, "Accepted z-vertex range") - O2_DEFINE_CONFIGURABLE(cfgPtCutMin, float, 0.2f, "minimum accepted track pT") + O2_DEFINE_CONFIGURABLE(cfgPtCutMin, float, 0.1f, "minimum accepted track pT") O2_DEFINE_CONFIGURABLE(cfgPtCutMax, float, 10.0f, "maximum accepted track pT") - O2_DEFINE_CONFIGURABLE(cfgEtaCut, float, 0.8f, "Eta cut") + O2_DEFINE_CONFIGURABLE(cfgEtaCut, float, 0.9f, "Eta cut") O2_DEFINE_CONFIGURABLE(cfgMinMixEventNum, int, 5, "Minimum number of events to mix") // Added UPC Cuts @@ -89,18 +89,25 @@ struct CalcNchUpc { { AxisSpec axisNch = {100, 0, 100}; AxisSpec axisVrtx = {10, -10, 10}; - AxisSpec axisgap = {12, -6, 6}; + // AxisSpec axisgap = {12, -6, 6}; + // std::vector trueGapBins = {-2, -1, 0, 1, 2, 3}; + // AxisSpec axisgap = {trueGapBins, "true gap side"}; + + std::vector binEdges = {-1.5, -0.5, 0.5, 1.5, 2.5, 3.5}; + AxisSpec axisgap = {binEdges, "true gap side"}; + registry.add("truegap", "truegap", {HistType::kTH1D, {axisgap}}); registry.add("Ncharge", "N_{charge}", {HistType::kTH1D, {axisNch}}); registry.add("zVtx_all", "zVtx_all", {HistType::kTH1D, {axisVrtx}}); registry.add("Nch_vs_zVtx", "Nch vs zVtx", {HistType::kTH2D, {axisVrtx, axisNch}}); - registry.add("truegap", "truegap", {HistType::kTH1D, {axisgap}}); + // registry.add("truegap", "truegap", {HistType::kTH1D, {axisgap}}); } void process(UDCollisionsFull::iterator const& collision, UdTracksFull const& tracks) { multiplicityNch(tracks.size()); truegapside(sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC)); + // LOG(info) << "truegapside=" << sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC); registry.fill(HIST("Ncharge"), tracks.size()); registry.fill(HIST("truegap"), sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC)); registry.fill(HIST("zVtx_all"), collision.posZ()); @@ -113,7 +120,7 @@ struct FlowCorrelationsUpc { O2_DEFINE_CONFIGURABLE(cfgIfVertex, bool, false, "choose vertex or not") O2_DEFINE_CONFIGURABLE(cfgPtCutMin, float, 0.1f, "minimum accepted track pT") O2_DEFINE_CONFIGURABLE(cfgPtCutMax, float, 10.0f, "maximum accepted track pT") - O2_DEFINE_CONFIGURABLE(cfgEtaCut, float, 0.8f, "Eta cut") + O2_DEFINE_CONFIGURABLE(cfgEtaCut, float, 0.9f, "Eta cut") O2_DEFINE_CONFIGURABLE(cfgMinMixEventNum, int, 5, "Minimum number of events to mix") O2_DEFINE_CONFIGURABLE(cfgMinMult, int, 0, "Minimum multiplicity for collision") O2_DEFINE_CONFIGURABLE(cfgMaxMult, int, 10, "Maximum multiplicity for collision") @@ -124,7 +131,7 @@ struct FlowCorrelationsUpc { O2_DEFINE_CONFIGURABLE(cfgRadiusLow, float, 0.8, "Low radius for merging cut") O2_DEFINE_CONFIGURABLE(cfgRadiusHigh, float, 2.5, "High radius for merging cut") O2_DEFINE_CONFIGURABLE(cfgIsGoodItsLayers, bool, false, "whether choose itslayers") - O2_DEFINE_CONFIGURABLE(cfgGapSide, int, 0, "0: gapside A;1:C") + O2_DEFINE_CONFIGURABLE(cfgGapSide, int, 1, "0: gapside A;1:C") O2_DEFINE_CONFIGURABLE(cfgGapSideMerge, bool, false, "whether merge A and C side together") O2_DEFINE_CONFIGURABLE(cfgDcaxy, bool, true, "choose dcaxy") O2_DEFINE_CONFIGURABLE(cfgDcaz, bool, false, "choose dcaz") @@ -161,14 +168,22 @@ struct FlowCorrelationsUpc { // make the filters and cuts. Filter trackFilter = (aod::udtrack::isPVContributor == true); - 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)); + 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 && (aod::flowcorrupc::multiplicity > cfgMinMult) && (aod::flowcorrupc::multiplicity < cfgMaxMult)); + // 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)); + // Filter trackFilter = (aod::udtrack::isPVContributor == true); + // Filter collisionFilter = ((aod::flowcorrupc::multiplicity > cfgMinMult) && (aod::flowcorrupc::multiplicity < cfgMaxMult) && (aod::udcollision::gapSide == (uint8_t) 1) && (aod::flowcorrupc::truegapside == 1) && (aod::udcollision::occupancyInTime > 0 && aod::udcollision::occupancyInTime < cfgCutOccupancyHigh)); // Filter collisionFilter = (nabs(aod::collision::posZ) < cfgZVtxCut) && (aod::flowcorrupc::multiplicity) > cfgMinMult && (aod::flowcorrupc::multiplicity) < cfgMaxMult && (aod::evsel::sel8) == true; // Filter trackFilter = (nabs(aod::track::eta) < cfgEtaCut) && (aod::track::pt > cfgPtCutMin) && (aod::track::pt < cfgPtCutMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)); using UdTracks = soa::Filtered>; using UdTracksFull = soa::Filtered>; + using UDCollisionsFull = soa::Filtered>; + // using UdTracks = soa::Join; + // using UdTracksFull = soa::Join; + // using UDCollisionsFull = soa::Join; + // Define the outputs OutputObj same{Form("sameEvent_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult))}; OutputObj mixed{Form("mixedEvent_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult))}; @@ -177,6 +192,8 @@ struct FlowCorrelationsUpc { void init(InitContext&) { + LOG(info) << "cfgGapSide = " << cfgGapSide; + LOG(info) << "cfgGapSide value type: " << typeid(cfgGapSide).name(); LOGF(info, "Starting init"); // Make histograms to check the distributions after cuts registry.add("deltaEta_deltaPhi_same", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEta}}); // check to see the delta eta and delta phi distribution @@ -190,7 +207,11 @@ struct FlowCorrelationsUpc { registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}}); - registry.add("eventcount", "bin", {HistType::kTH1F, {{10, 0, 10, "bin"}}}); // histogram to see how many events are in the same and mixed event + registry.add("eventcount_same", "bin", {HistType::kTH1F, {{10, 0, 10, "bin"}}}); // histogram to see how many events are in the same and mixed event + registry.add("eventcount_mixed", "bin", {HistType::kTH1F, {{10, 0, 10, "bin"}}}); // histogram to see how many events are in the same and mixed event + + registry.add("trackcount_same", "bin", {HistType::kTH1F, {{10, 0, 10, "bin"}}}); // histogram to see how many tracks are in the same and mixed event + registry.add("trackcount_mixed", "bin", {HistType::kTH1F, {{10, 0, 10, "bin"}}}); // histogram to see how many tracks are in the same and mixed event std::vector corrAxis = {{axisSample, "Sample"}, {axisVertex, "z-vtx (cm)"}, @@ -352,23 +373,26 @@ struct FlowCorrelationsUpc { void processSame(UDCollisionsFull::iterator const& collision, UdTracksFull const& tracks) { + LOG(info) << "Event passed filter: truegapside=" << collision.truegapside(); // if (tracks.size() < cfgMinMult || tracks.size() > cfgMaxMult) { // return; // } - // if (cfgIsGoodItsLayers && collision.trs() == 0) { + // registry.fill(HIST("eventcount_same"), 0.5); + // if(collision.gapSide() !=0){ // return; // } - + registry.fill(HIST("eventcount_same"), 1.5); // if (cfgGapSideMerge) { // int gapSide = collision.gapSide(); // if (gapSide != 0 && gapSide != 1) { // return; // } - // int trueGapSide = sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC); - // int gapSide1 = trueGapSide; - // if (gapSide1 != 0 && gapSide1 != 1) { - // return; - // } + // int trueGapSide = sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC); + // int gapSide1 = trueGapSide; + // if (gapSide1 != 0) { + // return; + // } + registry.fill(HIST("eventcount_same"), 2.5); // } // if (!cfgGapSideMerge) { // int trueGapSide = sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC); @@ -385,9 +409,10 @@ struct FlowCorrelationsUpc { // if (cfgEvSelOccupancy && (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)) { // return; // } + registry.fill(HIST("eventcount_same"), 3.5); int runIndex = collision.runNumber(); - registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin + // registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin registry.fill(HIST("Nch_vs_zVtx"), collision.posZ(), tracks.size()); fillYield(collision, tracks); fillCorrelations(tracks, tracks, collision.posZ(), SameEvent, runIndex); // fill the SE histogram and Sparse @@ -408,14 +433,18 @@ struct FlowCorrelationsUpc { Pair pairs{binningOnVtxAndMult, cfgMinMixEventNum, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip for (auto const& [collision1, tracks1, collision2, tracks2] : pairs) { - registry.fill(HIST("eventcount"), MixedEvent); // fill the mixed event in the 3 bin + // registry.fill(HIST("eventcount"), MixedEvent); // fill the mixed event in the 3 bin // if (tracks1.size() < cfgMinMult || tracks1.size() > cfgMaxMult || tracks2.size() < cfgMinMult || tracks2.size() > cfgMaxMult) { // continue; // } - // registry.fill(HIST("eventcount"), 4.5); + registry.fill(HIST("eventcount_same"), 4.5); // if (cfgIsGoodItsLayers && (collision1.trs() == 0 || collision2.trs() == 0)) { // continue; // } + // if(collision1.gapSide() != 0 || collision2.gapSide() != 0){ + // continue; + // } + registry.fill(HIST("eventcount_same"), 5.5); // registry.fill(HIST("eventcount"), 5.5); // if (cfgGapSideMerge) { // int gapSide = collision1.gapSide(); @@ -429,22 +458,23 @@ struct FlowCorrelationsUpc { // } // } // if (!cfgGapSideMerge) { - // int trueGapSide = sgSelector.trueGap(collision1, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC); - // int gapSide1 = trueGapSide; - // if (gapSide1 != cfgGapSide) { - // continue; - // } + // int trueGapSide = sgSelector.trueGap(collision1, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC); + // int gapSide1 = trueGapSide; + // if (gapSide1 != 0) { + // continue; + // } // } // if (cfgGapSideMerge) { // int gapSide = collision2.gapSide(); // if (gapSide != 0 && gapSide != 1) { // continue; // } - // int trueGapSide = sgSelector.trueGap(collision2, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC); - // int gapSide2 = trueGapSide; - // if (gapSide2 != 0 && gapSide2 != 1) { - // continue; - // } + // trueGapSide = sgSelector.trueGap(collision2, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC); + // int gapSide2 = trueGapSide; + // if (gapSide2 != 0) { + // continue; + // } + registry.fill(HIST("eventcount_same"), 6.5); // } // if (!cfgGapSideMerge) { // int trueGapSide = sgSelector.trueGap(collision2, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC); @@ -453,7 +483,7 @@ struct FlowCorrelationsUpc { // continue; // } // } - registry.fill(HIST("eventcount"), 6.5); + // registry.fill(HIST("eventcount"), 6.5); // float vtxz = collision1.posZ(); // if (cfgIfVertex && abs(vtxz) > cfgZVtxCut) { // continue; @@ -470,7 +500,7 @@ struct FlowCorrelationsUpc { // if (cfgEvSelOccupancy && (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)) { // continue; // } - registry.fill(HIST("eventcount"), MixedFinal); + registry.fill(HIST("eventcount_same"), 7.5); fillCorrelations(tracks1, tracks2, collision1.posZ(), MixedEvent, collision1.runNumber()); // fill the ME histogram and Sparse } }