Skip to content

Commit 1a20c5a

Browse files
prottayCMTProttay Das
andauthored
[PWGLF] updated calib task with time rec. at last step (AliceO2Group#16781)
Co-authored-by: Prottay Das <prottay@alipap1.cern.ch>
1 parent ed6cc3a commit 1a20c5a

1 file changed

Lines changed: 51 additions & 6 deletions

File tree

PWGLF/TableProducer/Common/spvector.cxx

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ struct spvector {
173173
Configurable<std::string> ConfRecenterevzSp6{"ConfRecenterevzSp6", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere6"};
174174
Configurable<std::string> ConfShiftC{"ConfShiftC", "Users/p/prottay/My/Object/Testinglocaltree/shiftcallib2", "Path to shift C"};
175175
Configurable<std::string> ConfShiftA{"ConfShiftA", "Users/p/prottay/My/Object/Testinglocaltree/shiftcallib2", "Path to shift A"};
176+
Configurable<bool> useTimeRecentering{"useTimeRecentering", false, "Use residual time recentering"};
177+
Configurable<std::string> confRecentereTimeSp{"confRecentereTimeSp", "Users/p/prottay/My/Object/GCwithoutcfactorgoodVztimedep/From676541/TestDDlocal/2024PbPbpass3_23062026/recenterlast2", "Path to time recentering map"};
176178

177179
// Event selection cuts - Alex
178180
/*
@@ -276,6 +278,10 @@ struct spvector {
276278
histos.add("hpCosPsiAPsiC", "hpCosPsiAPsiC", kTProfile, {centfineAxis});
277279
histos.add("hpSinPsiAPsiC", "hpSinPsiAPsiC", kTProfile, {centfineAxis});
278280
histos.add("AvgVxy", "AvgVxy", kTProfile, {VxyAxis});
281+
histos.add("hpQxZDCAvstime", "hpQxZDCAvstime", kTProfile, {{timefineAxis}});
282+
histos.add("hpQxZDCCvstime", "hpQxZDCCvstime", kTProfile, {{timefineAxis}});
283+
histos.add("hpQyZDCAvstime", "hpQyZDCAvstime", kTProfile, {{timefineAxis}});
284+
histos.add("hpQyZDCCvstime", "hpQyZDCCvstime", kTProfile, {{timefineAxis}});
279285

280286
// Event selection cut additional - Alex
281287
/*
@@ -308,6 +314,7 @@ struct spvector {
308314
std::array<TH2F*, 6> hrecenterevzSpA; // Array of 5 histograms
309315
TProfile3D* shiftprofileA;
310316
TProfile3D* shiftprofileC;
317+
TH2F* hrecentereTimeSp = nullptr;
311318

312319
Bool_t Correctcoarse(const THnF* hrecentereSp, auto centrality, auto vx, auto vy, auto vz, auto& qxZDCA, auto& qyZDCA, auto& qxZDCC, auto& qyZDCC)
313320
{
@@ -389,6 +396,30 @@ struct spvector {
389396
return kTRUE;
390397
}
391398

399+
bool Correcttime(TH2F* hrecentereTimeSp,
400+
auto timeMin,
401+
auto& qxZDCA,
402+
auto& qyZDCA,
403+
auto& qxZDCC,
404+
auto& qyZDCC)
405+
{
406+
if (!hrecentereTimeSp) {
407+
return false;
408+
}
409+
410+
double meanxA = hrecentereTimeSp->GetBinContent(hrecentereTimeSp->FindBin(timeMin + 1.e-7, 0.5));
411+
double meanyA = hrecentereTimeSp->GetBinContent(hrecentereTimeSp->FindBin(timeMin + 1.e-7, 1.5));
412+
double meanxC = hrecentereTimeSp->GetBinContent(hrecentereTimeSp->FindBin(timeMin + 1.e-7, 2.5));
413+
double meanyC = hrecentereTimeSp->GetBinContent(hrecentereTimeSp->FindBin(timeMin + 1.e-7, 3.5));
414+
415+
qxZDCA -= meanxA;
416+
qyZDCA -= meanyA;
417+
qxZDCC -= meanxC;
418+
qyZDCC -= meanyC;
419+
420+
return true;
421+
}
422+
392423
using MyCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::FT0sCorrected, aod::CentFT0Cs>;
393424
using AllTrackCandidates = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPi, aod::pidTPCFullPr, aod::pidTPCFullKa>;
394425
Preslice<aod::Zdcs> zdcPerCollision = aod::collision::bcId;
@@ -443,7 +474,7 @@ struct spvector {
443474
runStartTime[currentRunNumber] = timestampzdc;
444475
}
445476

446-
double timeInMinutes = (timestampzdc - runStartTime[currentRunNumber]) / 60000.0; // ms -> minutes
477+
double timeMin = (timestampzdc - runStartTime[currentRunNumber]) / 60000.0; // ms -> minutes
447478

448479
auto zdc = bc.zdc();
449480
auto zncEnergy = zdc.energySectorZNC();
@@ -709,6 +740,25 @@ struct spvector {
709740
if (res == 0 && resfine == 0 && check == 0) {
710741
LOG(info) << "Histograms are null";
711742
}
743+
744+
if (useTimeRecentering && (currentRunNumber != lastRunNumber)) {
745+
hrecentereTimeSp = ccdb->getForTimeStamp<TH2F>(confRecentereTimeSp.value, bc.timestamp());
746+
}
747+
748+
bool restime = false;
749+
if (useTimeRecentering) {
750+
restime = Correcttime(hrecentereTimeSp, timeMin, qxZDCA, qyZDCA, qxZDCC, qyZDCC);
751+
}
752+
753+
if (restime == 0) {
754+
LOG(info) << "Histograms are null";
755+
}
756+
757+
histos.fill(HIST("hpQxZDCAvstime"), timeMin, qxZDCA);
758+
histos.fill(HIST("hpQxZDCCvstime"), timeMin, qxZDCC);
759+
histos.fill(HIST("hpQyZDCAvstime"), timeMin, qyZDCA);
760+
histos.fill(HIST("hpQyZDCCvstime"), timeMin, qyZDCC);
761+
712762
psiZDCC = 1.0 * TMath::ATan2(qyZDCC, qxZDCC);
713763
psiZDCA = 1.0 * TMath::ATan2(qyZDCA, qxZDCA);
714764

@@ -771,11 +821,6 @@ struct spvector {
771821
histos.fill(HIST("hvzQyZDCA"), vz, qyZDCA);
772822
histos.fill(HIST("hvzQxZDCC"), vz, qxZDCC);
773823
histos.fill(HIST("hvzQyZDCC"), vz, qyZDCC);
774-
775-
histos.fill(HIST("htimeQxZDCA"), timeInMinutes, qxZDCA);
776-
histos.fill(HIST("htimeQyZDCA"), timeInMinutes, qyZDCA);
777-
histos.fill(HIST("htimeQxZDCC"), timeInMinutes, qxZDCC);
778-
histos.fill(HIST("htimeQyZDCC"), timeInMinutes, qyZDCC);
779824
}
780825

781826
histos.fill(HIST("hpCosPsiAPsiC"), centrality, (TMath::Cos(psiZDCA - psiZDCC)));

0 commit comments

Comments
 (0)