From 6067d3530db0f82b8fbd2d2b78732332cd4daf23 Mon Sep 17 00:00:00 2001 From: Prottay Das Date: Thu, 28 Nov 2024 18:32:36 +0100 Subject: [PATCH] added shift callibration --- PWGLF/TableProducer/Common/spvector.cxx | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/PWGLF/TableProducer/Common/spvector.cxx b/PWGLF/TableProducer/Common/spvector.cxx index 5309156b345..a5a3a03d9d1 100644 --- a/PWGLF/TableProducer/Common/spvector.cxx +++ b/PWGLF/TableProducer/Common/spvector.cxx @@ -126,6 +126,8 @@ struct spvector { Configurable lfinebinCent{"lfinebinCent", 0.0, "lower bin value in cent fine histograms"}; Configurable hfinebinCent{"hfinebinCent", 80.0, "higher bin value in cent fine histograms"}; Configurable QA{"QA", false, "QA histograms"}; + Configurable useShift{"useShift", false, "shift histograms"}; + Configurable nshift{"nshift", 10, "no. of iterations in shifting"}; Configurable ispolarization{"ispolarization", false, "Flag to check polarization"}; Configurable finecorrection{"finecorrection", false, "Flag to check fine correction"}; Configurable rejbadevent{"rejbadevent", true, "Flag to check bad events"}; @@ -150,6 +152,8 @@ struct spvector { Configurable ConfRecenterevySp{"ConfRecenterevySp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere"}; Configurable ConfRecenterevzSp{"ConfRecenterevzSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere"}; Configurable ConfRecenteresqSp{"ConfRecenteresqSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recenteresq"}; + Configurable ConfShiftC{"ConfShiftC", "Users/p/prottay/My/Object/Testinglocaltree/shiftcallib2", "Path to shift C"}; + Configurable ConfShiftA{"ConfShiftA", "Users/p/prottay/My/Object/Testinglocaltree/shiftcallib2", "Path to shift A"}; // Event selection cuts - Alex TF1* fMultPVCutLow = nullptr; @@ -197,6 +201,8 @@ struct spvector { AxisSpec vxfineAxis = {VxfineNbins, lfinebinVx, hfinebinVx, "vxfine"}; AxisSpec vyfineAxis = {VyfineNbins, lfinebinVy, hfinebinVy, "vyfine"}; AxisSpec centfineAxis = {CentfineNbins, lfinebinCent, hfinebinCent, "V0M (%) fine"}; + AxisSpec shiftAxis = {10, 0, 10, "shift"}; + AxisSpec basisAxis = {2, 0, 2, "basis"}; histos.add("hCentrality", "hCentrality", kTH1F, {{centfineAxis}}); histos.add("hpQxZDCAC", "hpQxZDCAC", kTProfile, {centfineAxis}); @@ -246,6 +252,8 @@ struct spvector { histos.add("ZDCAmp", "ZDCAmp", kTProfile2D, {channelZDCAxis, vzfineAxis}); histos.add("ZDCAmpCommon", "ZDCAmpCommon", kTProfile2D, {{2, 0.0, 2.0}, vzfineAxis}); // histos.add("ZDCAmpCommon", "ZDCAmpCommon", kTProfile3D, {{2,0.0,2.0}, vzfineAxis, centfineAxis}); + histos.add("ShiftZDCC", "ShiftZDCC", kTProfile3D, {centfineAxis, basisAxis, shiftAxis}); + histos.add("ShiftZDCA", "ShiftZDCA", kTProfile3D, {centfineAxis, basisAxis, shiftAxis}); if (QA) { histos.add("Vz", "Vz", kTH1F, {vzfineAxis}); @@ -283,6 +291,8 @@ struct spvector { TH2F* hrecenterevySp; TH2F* hrecenterevzSp; THnF* hrecenteresqSp; + TProfile3D* shiftprofileA; + TProfile3D* shiftprofileC; // Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; // Filter centralityFilter = (nabs(aod::cent::centFT0C) < cfgCutCentralityMax && nabs(aod::cent::centFT0C) > cfgCutCentralityMin); @@ -422,6 +432,11 @@ struct spvector { qxZDCC = qxZDCC / sumC; qyZDCC = qyZDCC / sumC; } + } else { + qxZDCA = qxZDCA; + qxZDCC = qxZDCC; + qyZDCA = qyZDCA; + qyZDCC = qyZDCC; } if (sumA <= 1e-4 || sumC <= 1e-4) { qxZDCA = 0.0; @@ -654,6 +669,32 @@ struct spvector { psiZDCC = 1.0 * TMath::ATan2(qyZDCC, qxZDCC); psiZDCA = 1.0 * TMath::ATan2(qyZDCA, qxZDCA); + if (useShift && (currentRunNumber != lastRunNumber)) { + shiftprofileC = ccdb->getForTimeStamp(ConfShiftC.value, bc.timestamp()); + shiftprofileA = ccdb->getForTimeStamp(ConfShiftA.value, bc.timestamp()); + } + if (useShift) { + auto deltapsiZDCC = 0.0; + auto deltapsiZDCA = 0.0; + for (int ishift = 1; ishift <= nshift; ishift++) { + auto coeffshiftxZDCC = shiftprofileC->GetBinContent(shiftprofileC->FindBin(centrality, 0.5, ishift - 0.5)); + auto coeffshiftyZDCC = shiftprofileC->GetBinContent(shiftprofileC->FindBin(centrality, 1.5, ishift - 0.5)); + auto coeffshiftxZDCA = shiftprofileA->GetBinContent(shiftprofileA->FindBin(centrality, 0.5, ishift - 0.5)); + auto coeffshiftyZDCA = shiftprofileA->GetBinContent(shiftprofileA->FindBin(centrality, 1.5, ishift - 0.5)); + deltapsiZDCC = deltapsiZDCC + ((2 / (1.0 * ishift)) * (-coeffshiftxZDCC * TMath::Cos(ishift * 1.0 * psiZDCC) + coeffshiftyZDCC * TMath::Sin(ishift * 1.0 * psiZDCC))); + deltapsiZDCA = deltapsiZDCA + ((2 / (1.0 * ishift)) * (-coeffshiftxZDCA * TMath::Cos(ishift * 1.0 * psiZDCA) + coeffshiftyZDCA * TMath::Sin(ishift * 1.0 * psiZDCA))); + } + psiZDCC = psiZDCC + deltapsiZDCC; + psiZDCA = psiZDCA + deltapsiZDCA; + } + + for (int ishift = 1; ishift <= nshift; ishift++) { + histos.fill(HIST("ShiftZDCC"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 1.0 * psiZDCC)); + histos.fill(HIST("ShiftZDCC"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 1.0 * psiZDCC)); + histos.fill(HIST("ShiftZDCA"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 1.0 * psiZDCA)); + histos.fill(HIST("ShiftZDCA"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 1.0 * psiZDCA)); + } + histos.fill(HIST("hpQxZDCAC"), centrality, (qxZDCA * qxZDCC)); histos.fill(HIST("hpQyZDCAC"), centrality, (qyZDCA * qyZDCC)); histos.fill(HIST("hpQxZDCAQyZDCC"), centrality, (qxZDCA * qyZDCC));