diff --git a/PWGCF/Flow/Tasks/flowEventPlane.cxx b/PWGCF/Flow/Tasks/flowEventPlane.cxx index 1605f2a0836..6630c8d3b59 100644 --- a/PWGCF/Flow/Tasks/flowEventPlane.cxx +++ b/PWGCF/Flow/Tasks/flowEventPlane.cxx @@ -76,7 +76,7 @@ DECLARE_SOA_COLUMN(ZncEnergyCommon, zncEnergyCommon, float); DECLARE_SOA_COLUMN(ZnaEnergy, znaEnergy, std::vector); DECLARE_SOA_COLUMN(ZncEnergy, zncEnergy, std::vector); } // namespace colspcalib -DECLARE_SOA_TABLE(ColSpCalib, "AOD", "COLSPCALIB", o2::soa::Index<>, +DECLARE_SOA_TABLE(ColSpCalibs, "AOD", "COLSPCALIB", o2::soa::Index<>, colspcalib::RunNumber, colspcalib::Timestamp, colspcalib::Cent, @@ -88,6 +88,18 @@ DECLARE_SOA_TABLE(ColSpCalib, "AOD", "COLSPCALIB", o2::soa::Index<>, colspcalib::ZnaEnergy, colspcalib::ZncEnergy); +using ColSpCalib = ColSpCalibs::iterator; + +namespace trackspcalib +{ +DECLARE_SOA_INDEX_COLUMN(ColSpCalib, colSpCalib); +} // namespace trackspcalib +DECLARE_SOA_TABLE(TrackSpCalib, "AOD", "TRACKSPCALIB", o2::soa::Index<>, + trackspcalib::ColSpCalibId, + aod::track::Pt, + aod::track::Eta, + aod::track::Phi); + namespace colspext { DECLARE_SOA_COLUMN(SelColFlag, selColFlag, bool); @@ -159,7 +171,8 @@ enum V0Type { struct SpCalibTableProducer { // Table producer - Produces colSpCalibTable; + Produces colSpCalibTable; + Produces trackSPCalibTable; // Configurables // Collisions @@ -171,13 +184,23 @@ struct SpCalibTableProducer { Configurable cSel8Trig{"cSel8Trig", true, "Sel8 (T0A + T0C) Selection Run3"}; Configurable cPileupReject{"cPileupReject", true, "Pileup rejection"}; Configurable cZVtxTimeDiff{"cZVtxTimeDiff", true, "z-vtx time diff selection"}; + Configurable cNoCollInTimeRangeStd{"cNoCollInTimeRangeStd", true, "No of collision in time range standard"}; + Configurable cIsITSTPCVtx{"cIsITSTPCVtx", true, "ITS-TPC Vertex"}; Configurable cIsGoodITSLayers{"cIsGoodITSLayers", true, "Good ITS Layers All"}; Configurable cMinOccupancy{"cMinOccupancy", 0, "Minimum FT0C Occupancy"}; - Configurable cMaxOccupancy{"cMaxOccupancy", 1e6, "Maximum FT0C Occupancy"}; + Configurable cMaxOccupancy{"cMaxOccupancy", 1e4, "Maximum FT0C Occupancy"}; Configurable capplyTdcCut{"capplyTdcCut", false, "Flag for TDC cut"}; Configurable ctdcZnMin{"ctdcZnMin", -2.5, "Min ZN TDC cut"}; Configurable ctdcZnMax{"ctdcZnMax", 2.5, "Max ZN TDC cut"}; + // Tracks + Configurable cTrackMinPt{"cTrackMinPt", 0.1, "p_{T} minimum"}; + Configurable cTrackMaxPt{"cTrackMaxPt", 10.0, "p_{T} maximum"}; + Configurable cTrackEtaCut{"cTrackEtaCut", 0.8, "Pseudorapidity cut"}; + Configurable cTrackGlobal{"cTrackGlobal", true, "Global Track"}; + Configurable cTrackDcaXYCut{"cTrackDcaXYCut", 0.1, "DcaXY Cut"}; + Configurable cTrackDcaZCut{"cTrackDcaZCut", 1., "DcaXY Cut"}; + // Histogram Registry. HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -187,9 +210,10 @@ struct SpCalibTableProducer { void init(InitContext const&) { - // Histogram collision + // Histogram collisions and tracks histos.add("hCent", "Centrality", kTH1F, {{cCentBins, 0., 100., "FT0C%"}}); histos.add("hVz", "V_{z}", kTH1F, {{100, -10., 10., "V_{z}(cm)"}}); + histos.add("hPt", "pT", kTH1F, {{200, 0, 20, "p_{T}(GeV/#it{c})"}}); } template @@ -208,7 +232,7 @@ struct SpCalibTableProducer { return false; } - if (col.ft0cOccupancyInTimeRange() < cMinOccupancy || col.ft0cOccupancyInTimeRange() > cMaxOccupancy) { // Occupancy cut + if (col.trackOccupancyInTimeRange() < cMinOccupancy || col.trackOccupancyInTimeRange() > cMaxOccupancy) { // Occupancy cut return false; } @@ -220,6 +244,14 @@ struct SpCalibTableProducer { return false; } + if (cNoCollInTimeRangeStd && !col.selection_bit(aod::evsel::kNoCollInTimeRangeStandard)) { // No collision in standard time range + return false; + } + + if (cIsITSTPCVtx && !col.selection_bit(aod::evsel::kIsVertexITSTPC)) { // ITS+TPC vertex + return false; + } + if (cIsGoodITSLayers && !col.selection_bit(aod::evsel::kIsGoodITSLayersAll)) { // All ITS layer active return false; } @@ -244,8 +276,27 @@ struct SpCalibTableProducer { return true; } - template - void analyzeCollision(B const& bc, C const& collision) + // Track Selection + template + bool selectTrack(T const& track) + { + if (track.pt() <= cTrackMinPt || track.pt() >= cTrackMaxPt || std::abs(track.eta()) >= cTrackEtaCut) { + return false; + } + + if (cTrackGlobal && !track.isGlobalTrackWoDCA()) { + return false; + } + + if (std::abs(track.dcaXY()) >= cTrackDcaXYCut || std::abs(track.dcaZ()) >= cTrackDcaZCut) { + return false; + } + + return true; + } + + template + void analyzeCollision(B const& bc, C const& collision, T const& tracks) { // Check zdc if (!bc.has_zdc()) { @@ -282,22 +333,31 @@ struct SpCalibTableProducer { histos.fill(HIST("hCent"), cent); histos.fill(HIST("hVz"), posZ); colSpCalibTable(runNum, timestamp, cent, posX, posY, posZ, znaEnergyCommon, zncEnergyCommon, znaEnergy, zncEnergy); + + for (auto const& track : tracks) { + if (!selectTrack(track)) { + continue; + } + histos.fill(HIST("hPt"), track.pt()); + trackSPCalibTable(colSpCalibTable.lastIndex(), track.pt(), track.eta(), track.phi()); + } } using BCsRun3 = soa::Join; using CollisionsRun3 = soa::Join; + using Tracks = soa::Join; void processDummy(CollisionsRun3::iterator const&) {} PROCESS_SWITCH(SpCalibTableProducer, processDummy, "Dummy process", true); - void processFEP(CollisionsRun3::iterator const& collision, BCsRun3 const&, aod::Zdcs const&) + void processFEP(CollisionsRun3::iterator const& collision, BCsRun3 const&, aod::Zdcs const&, Tracks const& tracks) { // Get bunch crossing auto bc = collision.template foundBC_as(); runNum = collision.template foundBC_as().runNumber(); timestamp = collision.template foundBC_as().timestamp(); - analyzeCollision(bc, collision); + analyzeCollision(bc, collision, tracks); } PROCESS_SWITCH(SpCalibTableProducer, processFEP, "Flow Event Plane Table Producer", false); @@ -318,9 +378,11 @@ struct SpectatorPlaneTableProducer { Configurable cSel8Trig{"cSel8Trig", true, "Sel8 (T0A + T0C) Selection Run3"}; Configurable cPileupReject{"cPileupReject", true, "Pileup rejection"}; Configurable cZVtxTimeDiff{"cZVtxTimeDiff", true, "z-vtx time diff selection"}; + Configurable cNoCollInTimeRangeStd{"cNoCollInTimeRangeStd", true, "No of collision in time range standard"}; + Configurable cIsITSTPCVtx{"cIsITSTPCVtx", true, "ITS-TPC Vertex"}; Configurable cIsGoodITSLayers{"cIsGoodITSLayers", true, "Good ITS Layers All"}; Configurable cMinOccupancy{"cMinOccupancy", 0, "Minimum FT0C Occupancy"}; - Configurable cMaxOccupancy{"cMaxOccupancy", 1e6, "Maximum FT0C Occupancy"}; + Configurable cMaxOccupancy{"cMaxOccupancy", 1e4, "Maximum FT0C Occupancy"}; Configurable capplyTdcCut{"capplyTdcCut", false, "Flag for TDC cut"}; Configurable ctdcZnMin{"ctdcZnMin", -2.5, "Min ZN TDC cut"}; Configurable ctdcZnMax{"ctdcZnMax", 2.5, "Max ZN TDC cut"}; @@ -516,7 +578,7 @@ struct SpectatorPlaneTableProducer { return false; } - if (col.ft0cOccupancyInTimeRange() < cMinOccupancy || col.ft0cOccupancyInTimeRange() > cMaxOccupancy) { // Occupancy cut + if (col.trackOccupancyInTimeRange() < cMinOccupancy || col.trackOccupancyInTimeRange() > cMaxOccupancy) { // Occupancy cut return false; } @@ -528,6 +590,14 @@ struct SpectatorPlaneTableProducer { return false; } + if (cNoCollInTimeRangeStd && !col.selection_bit(aod::evsel::kNoCollInTimeRangeStandard)) { // No collision in standard time range + return false; + } + + if (cIsITSTPCVtx && !col.selection_bit(aod::evsel::kIsVertexITSTPC)) { // ITS+TPC vertex + return false; + } + if (cIsGoodITSLayers && !col.selection_bit(aod::evsel::kIsGoodITSLayersAll)) { // All ITS layer active return false; }