1414// /
1515// / \author Josue Martinez Garcia, josuem@cern.ch
1616
17- #include < utility>
18- #include < map>
19- #include < string>
20- #include < vector>
21-
22- #include " Framework/runDataProcessing.h"
23- #include " Framework/AnalysisTask.h"
24- #include " Framework/AnalysisDataModel.h"
17+ #include " Common/CCDB/EventSelectionParams.h"
2518#include " Common/DataModel/EventSelection.h"
2619#include " Common/DataModel/TrackSelectionTables.h"
27- #include " Framework/ASoAHelpers.h"
20+
21+ #include " CCDB/BasicCCDBManager.h"
22+ #include " CommonDataFormat/BunchFilling.h"
2823#include " DataFormatsFDD/Digit.h"
2924#include " DataFormatsFT0/Digit.h"
3025#include " DataFormatsFV0/Digit.h"
31- #include " Framework/ASoA.h"
32- #include " Common/CCDB/EventSelectionParams.h"
33- #include " CCDB/BasicCCDBManager.h"
34- #include " CommonDataFormat/BunchFilling.h"
35- #include " DataFormatsParameters/GRPLHCIFData.h"
3626#include " DataFormatsParameters/GRPECSObject.h"
27+ #include " DataFormatsParameters/GRPLHCIFData.h"
28+ #include " Framework/ASoA.h"
29+ #include " Framework/ASoAHelpers.h"
30+ #include " Framework/AnalysisDataModel.h"
31+ #include " Framework/AnalysisTask.h"
32+ #include " Framework/runDataProcessing.h"
33+
34+ #include < map>
35+ #include < string>
36+ #include < utility>
37+ #include < vector>
3738
3839using namespace o2 ;
3940using namespace o2 ::framework;
@@ -110,6 +111,7 @@ struct LumiStabilityTask {
110111
111112 // histo about triggers
112113 histos.add (" FDD/hCounts" , " 0 FDDCount - 1 FDDVertexCount - 2 FDDPPVertexCount - 3 FDDCoincidencesVertexCount - 4 FDDPPCoincidencesVertexCount - 5 FDDPPBotSidesCount; Number; counts" , kTH1F , {axisCounts});
114+ histos.add (" FDD/bcVertexTriggerCTP" , " vertex trigger per BC (FDD);BC in FDD; counts" , kTH1F , {axisTrigger});
113115 histos.add (" FDD/bcVertexTrigger" , " vertex trigger per BC (FDD);BC in FDD; counts" , kTH1F , {axisTrigger});
114116 histos.add (" FDD/bcVertexTriggerPP" , " vertex trigger per BC (FDD);BC in FDD; counts" , kTH1F , {axisTrigger});
115117 histos.add (" FDD/bcVertexTriggerCoincidence" , " vertex trigger per BC (FDD) with coincidences;BC in FDD; counts" , kTH1F , {axisTrigger});
@@ -164,9 +166,12 @@ struct LumiStabilityTask {
164166 histos.add (" FDD/hValidTimevsBC" , " Valid Time vs BC id;BC in FT0;valid time counts" , kTH1F , {axisTrigger});
165167 histos.add (" FDD/hInvTimevsBC" , " Invalid Time vs BC id;BC in FT0;invalid time counts" , kTH1F , {axisTrigger});
166168 histos.add (" FDD/hTimeForRate" , " Counts by time in FDD;t (in seconds) in FDD; counts" , kTH1F , {axisTimeRate});
169+ histos.add (" FDD/hTimeForRateCTP" , " Counts by time in FDD;t (in seconds) in FDD; counts" , kTH1F , {axisTimeRate});
167170 histos.add (" FDD/hTimeForRateLeadingBC" , " Counts by time in FDD;t (in seconds) in FDD; counts" , kTH1F , {axisTimeRate});
171+ histos.add (" FDD/hTimeForRateLeadingBCCTP" , " Counts by time in FDD;t (in seconds) in FDD; counts" , kTH1F , {axisTimeRate});
168172
169173 histos.add (" FT0/hCounts" , " 0 FT0Count - 1 FT0VertexCount - 2 FT0PPVertexCount - 3 FT0PPBothSidesCount; Number; counts" , kTH1F , {axisCounts});
174+ histos.add (" FT0/bcVertexTriggerCTP" , " vertex trigger per BC (FT0);BC in FT0; counts" , kTH1F , {axisTrigger});
170175 histos.add (" FT0/bcVertexTrigger" , " vertex trigger per BC (FT0);BC in FT0; counts" , kTH1F , {axisTrigger});
171176 histos.add (" FT0/bcVertexTriggerPP" , " vertex trigger per BC (FT0) with Past Protection;BC in FT0; counts" , kTH1F , {axisTrigger});
172177 histos.add (" FT0/bcVertexTriggerBothSidesPP" , " vertex per BC (FDD) with coincidences, at least one side trigger and Past Protection;BC in FDD; counts" , kTH1F , {axisTrigger});
@@ -195,9 +200,12 @@ struct LumiStabilityTask {
195200 histos.add (" FT0/hValidTimevsBC" , " Valid Time vs BC id;BC in FT0;valid time counts" , kTH1F , {axisTrigger});
196201 histos.add (" FT0/hInvTimevsBC" , " Invalid Time vs BC id;BC in FT0;invalid time counts" , kTH1F , {axisTrigger});
197202 histos.add (" FT0/hTimeForRate" , " Counts by time in FT0;t (in seconds) in FT0; counts" , kTH1F , {axisTimeRate});
203+ histos.add (" FT0/hTimeForRateCTP" , " Counts by time in FT0;t (in seconds) in FT0; counts" , kTH1F , {axisTimeRate});
198204 histos.add (" FT0/hTimeForRateLeadingBC" , " Counts by time in FT0;t (in seconds) in FT0; counts" , kTH1F , {axisTimeRate});
205+ histos.add (" FT0/hTimeForRateLeadingBCCTP" , " Counts by time in FT0;t (in seconds) in FT0; counts" , kTH1F , {axisTimeRate});
199206
200207 histos.add (" FV0/hCounts" , " 0 CountCentralFV0 - 1 CountPFPCentralFV0 - 2 CountPFPOutInFV0 - 3 CountPPCentralFV0 - 4 CountPPOutInFV0; Number; counts" , kTH1F , {axisV0Counts});
208+ histos.add (" FV0/bcChargeTriggerCTP" , " Out trigger per BC (FV0);BC in V0; counts" , kTH1F , {axisTrigger});
201209 histos.add (" FV0/bcOutTrigger" , " Out trigger per BC (FV0);BC in V0; counts" , kTH1F , {axisTrigger});
202210 histos.add (" FV0/bcInTrigger" , " In trigger per BC (FV0);BC in V0; counts" , kTH1F , {axisTrigger});
203211 histos.add (" FV0/bcSCenTrigger" , " SCen trigger per BC (FV0);BC in V0; counts" , kTH1F , {axisTrigger});
@@ -214,6 +222,8 @@ struct LumiStabilityTask {
214222 histos.add (" FV0/timeAbcA" , " time bcA ; A (ns)" , kTH1F , {{300 , -15 , 15 }});
215223 histos.add (" FV0/timeAbcC" , " time bcC ; A (ns)" , kTH1F , {{300 , -15 , 15 }});
216224 histos.add (" FV0/timeAbcE" , " time bcE ; A (ns)" , kTH1F , {{300 , -15 , 15 }});
225+ histos.add (" FV0/hTimeForRateCTP" , " Counts by time in FV0;t (in seconds) in FV0; counts" , kTH1F , {axisTimeRate});
226+ histos.add (" FV0/hTimeForRateLeadingBCCTP" , " Counts by time in FV0;t (in seconds) in FV0; counts" , kTH1F , {axisTimeRate});
217227 }
218228
219229 bool checkAnyCoincidence (const std::vector<int >& channels)
@@ -332,6 +342,54 @@ struct LumiStabilityTask {
332342 // histos.add("hOrbitFV0Central", "", kTH1F, {axisOrbits});
333343 }
334344
345+ for (auto & bc : bcs) {
346+ if (bc.timestamp () == 0 ) {
347+ continue ;
348+ }
349+ std::bitset<64 > ctpInputMask (bc.inputMask ());
350+ bool trgFDD = ctpInputMask[15 ];
351+ bool trgFT0 = ctpInputMask[2 ];
352+ bool trgFV0 = ctpInputMask[9 ];
353+
354+ int64_t globalBC = bc.globalBC ();
355+ int localBC = globalBC % nBCsPerOrbit;
356+
357+ if (bcPatternB[localBC]) {
358+ if (trgFDD) {
359+ histos.fill (HIST (" FDD/bcVertexTriggerCTP" ), localBC);
360+ histos.fill (HIST (" FDD/hTimeForRateCTP" ), (bc.timestamp () - tsSOR) * 1 .e -3 ); // Converting ms into seconds
361+ }
362+ if (trgFT0) {
363+ histos.fill (HIST (" FT0/bcVertexTriggerCTP" ), localBC);
364+ histos.fill (HIST (" FT0/hTimeForRateCTP" ), (bc.timestamp () - tsSOR) * 1 .e -3 ); // Converting ms into seconds
365+ }
366+ if (trgFV0) {
367+ histos.fill (HIST (" FV0/bcChargeTriggerCTP" ), localBC);
368+ histos.fill (HIST (" FV0/hTimeForRateCTP" ), (bc.timestamp () - tsSOR) * 1 .e -3 ); // Converting ms into seconds
369+ }
370+ bool isLeadBC = true ;
371+ for (int jbit = localBC - minEmpty; jbit < localBC; jbit++) {
372+ int kbit = jbit;
373+ if (kbit < 0 )
374+ kbit += nbin;
375+ if (bcPatternB[kbit]) {
376+ isLeadBC = false ;
377+ break ;
378+ }
379+ }
380+ if (isLeadBC)
381+ if (trgFDD) {
382+ histos.fill (HIST (" FDD/hTimeForRateLeadingBCCTP" ), (bc.timestamp () - tsSOR) * 1 .e -3 );
383+ }
384+ if (trgFT0) {
385+ histos.fill (HIST (" FT0/hTimeForRateLeadingBCCTP" ), (bc.timestamp () - tsSOR) * 1 .e -3 );
386+ }
387+ if (trgFV0) {
388+ histos.fill (HIST (" FV0/hTimeForRateLeadingBCCTP" ), (bc.timestamp () - tsSOR) * 1 .e -3 );
389+ }
390+ }
391+ } // loop over bcs
392+
335393 for (auto const & fdd : fdds) {
336394 auto bc = fdd.bc_as <BCsWithTimestamps>();
337395 if (bc.timestamp () == 0 ) {
0 commit comments