Skip to content

Commit 27fbc27

Browse files
authored
[PWGLF] PWGMM:Lumi: Changes onn rate histo axis (#10815)
1 parent 743ce90 commit 27fbc27

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

PWGMM/Lumi/Tasks/lumiStability.cxx

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ struct LumiStabilityTask {
8787
const AxisSpec axisTimeFDD{1000, -20, 100};
8888
const AxisSpec axisCountsTime{2, -0.5, 1.5};
8989
const AxisSpec axisOrbits{static_cast<int>(nOrbits / nOrbitsPerTF), 0., static_cast<double>(nOrbits), ""};
90-
const AxisSpec axisTimeRate{1440, 0., 86400, ""}; // t in seconds. Histo for 24 hrs. Each bin contain 1 min.
90+
const AxisSpec axisTimeRate{int(double(43200) / (nOrbitsPerTF * 89e-6)), 0., 43200, ""}; // t in seconds. Histo for 12 hrs. Each bin contain one time frame (128/32 orbits for Run2/3).
9191

9292
histos.add("hBcA", "BC pattern A; BC ; It is present", kTH1F, {axisTrigger});
9393
histos.add("hBcC", "BC pattern C; BC ; It is present", kTH1F, {axisTrigger});
@@ -162,6 +162,7 @@ struct LumiStabilityTask {
162162
histos.add("FDD/hValidTimevsBC", "Valid Time vs BC id;BC in FT0;valid time counts", kTH1F, {axisTrigger});
163163
histos.add("FDD/hInvTimevsBC", "Invalid Time vs BC id;BC in FT0;invalid time counts", kTH1F, {axisTrigger});
164164
histos.add("FDD/hTimeForRate", "Counts by time in FDD;t (in seconds) in FDD; counts", kTH1F, {axisTimeRate});
165+
histos.add("FDD/hTimeForRateLeadingBC", "Counts by time in FDD;t (in seconds) in FDD; counts", kTH1F, {axisTimeRate});
165166

166167
histos.add("FT0/hCounts", "0 FT0Count - 1 FT0VertexCount - 2 FT0PPVertexCount - 3 FT0PPBothSidesCount; Number; counts", kTH1F, {axisCounts});
167168
histos.add("FT0/bcVertexTrigger", "vertex trigger per BC (FT0);BC in FT0; counts", kTH1F, {axisTrigger});
@@ -191,7 +192,8 @@ struct LumiStabilityTask {
191192
histos.add("FT0/hInvTimeCvsBC", "Invalid Time C vs BC id;BC in FT0;invalid time counts", kTH1F, {axisTrigger});
192193
histos.add("FT0/hValidTimevsBC", "Valid Time vs BC id;BC in FT0;valid time counts", kTH1F, {axisTrigger});
193194
histos.add("FT0/hInvTimevsBC", "Invalid Time vs BC id;BC in FT0;invalid time counts", kTH1F, {axisTrigger});
194-
histos.add("FT0/hTimeForRate", "Counts by time in FT0;t (in seconds) in FDD; counts", kTH1F, {axisTimeRate});
195+
histos.add("FT0/hTimeForRate", "Counts by time in FT0;t (in seconds) in FT0; counts", kTH1F, {axisTimeRate});
196+
histos.add("FT0/hTimeForRateLeadingBC", "Counts by time in FT0;t (in seconds) in FT0; counts", kTH1F, {axisTimeRate});
195197

196198
histos.add("FV0/hCounts", "0 CountCentralFV0 - 1 CountPFPCentralFV0 - 2 CountPFPOutInFV0 - 3 CountPPCentralFV0 - 4 CountPPOutInFV0; Number; counts", kTH1F, {axisV0Counts});
197199
histos.add("FV0/bcOutTrigger", "Out trigger per BC (FV0);BC in V0; counts", kTH1F, {axisTrigger});
@@ -363,7 +365,22 @@ struct LumiStabilityTask {
363365
histos.fill(HIST("FDD/bcVertexTrigger"), localBC);
364366
histos.fill(HIST("FDD/hCounts"), 1);
365367
histos.fill(HIST("hOrbitFDDVertex"), orbit - minOrbit);
366-
histos.fill(HIST("FDD/hTimeForRate"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds
368+
369+
if (bcPatternB[localBC]) {
370+
histos.fill(HIST("FDD/hTimeForRate"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds
371+
bool isLeadBC = true;
372+
for (int jbit = localBC - minEmpty; jbit < localBC; jbit++) {
373+
int kbit = jbit;
374+
if (kbit < 0)
375+
kbit += nbin;
376+
if (bcPatternB[kbit]) {
377+
isLeadBC = false;
378+
break;
379+
}
380+
}
381+
if (isLeadBC)
382+
histos.fill(HIST("FDD/hTimeForRateLeadingBC"), (bc.timestamp() - tsSOR) * 1.e-3);
383+
}
367384

368385
int deltaIndex = 0; // backward move counts
369386
int deltaBC = 0; // current difference wrt globalBC
@@ -610,7 +627,6 @@ struct LumiStabilityTask {
610627
if (vertex) {
611628
histos.fill(HIST("FT0/bcVertexTrigger"), localBC);
612629
histos.fill(HIST("hOrbitFT0vertex"), orbit - minOrbit);
613-
histos.fill(HIST("FT0/hTimeForRate"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds
614630

615631
if (bcPatternA[localBC]) {
616632
histos.fill(HIST("FT0/timeACbcA"), ft0.timeA(), ft0.timeC());
@@ -623,6 +639,7 @@ struct LumiStabilityTask {
623639
if (bcPatternB[localBC]) {
624640
histos.fill(HIST("FT0/timeACbcB"), ft0.timeA(), ft0.timeC());
625641
histos.fill(HIST("FT0/hBcB"), localBC);
642+
histos.fill(HIST("FT0/hTimeForRate"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds
626643
bool isLeadBC = true;
627644
for (int jbit = localBC - minEmpty; jbit < localBC; jbit++) {
628645
int kbit = jbit;
@@ -633,8 +650,10 @@ struct LumiStabilityTask {
633650
break;
634651
}
635652
}
636-
if (isLeadBC)
653+
if (isLeadBC) {
654+
histos.fill(HIST("FT0/hTimeForRateLeadingBC"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds
637655
histos.fill(HIST("FT0/hBcBL"), localBC);
656+
}
638657
histos.fill(HIST("FT0/hTimeA"), ft0.timeA());
639658
histos.fill(HIST("FT0/hTimeC"), ft0.timeC());
640659

0 commit comments

Comments
 (0)