1313// Run 3 Pb-Pb centrality selections in 2023 data. It is compatible with
1414// derived data.
1515
16- #include " Framework/runDataProcessing.h"
17- #include " Framework/AnalysisTask.h"
18- #include " Framework/AnalysisDataModel.h"
19- #include " Common/DataModel/McCollisionExtra.h"
20- #include " Common/DataModel/Multiplicity.h"
2116#include " Common/DataModel/Centrality.h"
2217#include " Common/DataModel/EventSelection.h"
18+ #include " Common/DataModel/McCollisionExtra.h"
19+ #include " Common/DataModel/Multiplicity.h"
20+
21+ #include " CCDB/BasicCCDBManager.h"
22+ #include " DataFormatsParameters/GRPECSObject.h"
23+ #include " Framework/AnalysisDataModel.h"
24+ #include " Framework/AnalysisTask.h"
2325#include " Framework/O2DatabasePDGPlugin.h"
26+ #include " Framework/runDataProcessing.h"
27+
2428#include " TH1F.h"
2529#include " TH2F.h"
2630
@@ -32,13 +36,15 @@ using BCsWithRun3Matchings = soa::Join<aod::BCs, aod::Timestamps, aod::Run3Match
3236struct centralityStudy {
3337 // Raw multiplicities
3438 HistogramRegistry histos{" Histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
39+ Service<o2::ccdb::BasicCCDBManager> ccdb;
3540
3641 // Configurables
3742 Configurable<bool > do2DPlots{" do2DPlots" , true , " 0 - no, 1 - yes" };
3843 Configurable<bool > doOccupancyStudyVsCentrality2d{" doOccupancyStudyVsCentrality2d" , true , " 0 - no, 1 - yes" };
3944 Configurable<bool > doOccupancyStudyVsRawValues2d{" doOccupancyStudyVsRawValues2d" , true , " 0 - no, 1 - yes" };
4045 Configurable<bool > doOccupancyStudyVsCentrality3d{" doOccupancyStudyVsCentrality3d" , false , " 0 - no, 1 - yes" };
4146 Configurable<bool > doOccupancyStudyVsRawValues3d{" doOccupancyStudyVsRawValues3d" , false , " 0 - no, 1 - yes" };
47+ Configurable<bool > doTimeStudies{" doTimeStudies" , false , " 0 - no, 1 - yes" };
4248 Configurable<bool > doNGlobalTracksVsRawSignals{" doNGlobalTracksVsRawSignals" , true , " 0 - no, 1 - yes" };
4349 Configurable<bool > applySel8{" applySel8" , true , " 0 - no, 1 - yes" };
4450 Configurable<bool > applyVtxZ{" applyVtxZ" , true , " 0 - no, 1 - yes" };
@@ -113,10 +119,10 @@ struct centralityStudy {
113119 ConfigurableAxis axisCentrality{" axisCentrality" , {100 , 0 , 100 }, " FT0C percentile" };
114120 ConfigurableAxis axisPVChi2{" axisPVChi2" , {300 , 0 , 30 }, " FT0C percentile" };
115121 ConfigurableAxis axisDeltaTime{" axisDeltaTime" , {300 , 0 , 300 }, " #Delta time" };
122+ ConfigurableAxis axisDeltaTimestamp{" axisDeltaTimestamp" , {1440 , 0 , 24 }, " #Delta timestamp - sor (hours)" };
116123
117124 // For profile Z
118125 ConfigurableAxis axisPVz{" axisPVz" , {400 , -20 .0f , +20 .0f }, " PVz (cm)" };
119-
120126 ConfigurableAxis axisZN{" axisZN" , {1100 , -50 .0f , +500 .0f }, " ZN" };
121127
122128 void init (InitContext&)
@@ -227,6 +233,21 @@ struct centralityStudy {
227233 histos.add (" hFT0COccupancyVsNGlobalTracksVsCentrality" , " hFT0COccupancyVsNGlobalTracksVsCentrality" , kTH3F , {axisFT0COccupancy, axisMultGlobalTracks, axisCentrality});
228234 }
229235 }
236+
237+ if (doTimeStudies) {
238+ ccdb->setURL (" http://alice-ccdb.cern.ch" );
239+ ccdb->setCaching (true );
240+ ccdb->setLocalObjectValidityChecking ();
241+ ccdb->setFatalWhenNull (false );
242+
243+ histos.add (" hFT0AvsTime" , " hFT0AvsTime" , kTH2F , {axisDeltaTimestamp, axisMultFT0A});
244+ histos.add (" hFT0CvsTime" , " hFT0CvsTime" , kTH2F , {{axisDeltaTimestamp, axisMultFT0C}});
245+ histos.add (" hFT0MvsTime" , " hFT0MvsTime" , kTH2F , {{axisDeltaTimestamp, axisMultFT0M}});
246+ histos.add (" hFV0AvsTime" , " hFV0AvsTime" , kTH2F , {{axisDeltaTimestamp, axisMultFV0A}});
247+ histos.add (" hMFTTracksvsTime" , " hMFTTracksvsTime" , kTH2F , {{axisDeltaTimestamp, axisMultMFTTracks}});
248+ histos.add (" hNGlobalVsTime" , " hNGlobalVsTime" , kTH2F , {{axisDeltaTimestamp, axisMultGlobalTracks}});
249+ histos.add (" hNTPVContributorsvsTime" , " hNTPVContributorsvsTime" , kTH2F , {{axisDeltaTimestamp, axisMultPVContributors}});
250+ }
230251 }
231252
232253 template <typename TCollision>
@@ -403,19 +424,34 @@ struct centralityStudy {
403424 histos.fill (HIST (" hFT0COccupancyVsNGlobalTracksVsCentrality" ), collision.ft0cOccupancyInTimeRange (), collision.multNTracksGlobal (), collision.centFT0C ());
404425 }
405426 }
427+
428+ if (doTimeStudies && collision.has_multBC ()) {
429+ auto multbc = collision.template multBC_as <aod::MultBCs>();
430+ uint64_t bcTimestamp = multbc.timestamp ();
431+ o2::parameters::GRPECSObject* grpo = ccdb->getForTimeStamp <o2::parameters::GRPECSObject>(" GLO/Config/GRPECS" , bcTimestamp);
432+ uint64_t startOfRunTimestamp = grpo->getTimeStart ();
433+ float hoursAfterStartOfRun = static_cast <float >(bcTimestamp - startOfRunTimestamp) / 3600000.0 ;
434+ histos.fill (HIST (" hFT0AvsTime" ), hoursAfterStartOfRun, collision.multFT0A ());
435+ histos.fill (HIST (" hFT0CvsTime" ), hoursAfterStartOfRun, collision.multFT0C ());
436+ histos.fill (HIST (" hFT0MvsTime" ), hoursAfterStartOfRun, collision.multFT0M ());
437+ histos.fill (HIST (" hFV0AvsTime" ), hoursAfterStartOfRun, collision.multFV0A ());
438+ histos.fill (HIST (" hMFTTracksvsTime" ), hoursAfterStartOfRun, collision.mftNtracks ());
439+ histos.fill (HIST (" hNGlobalVsTime" ), hoursAfterStartOfRun, collision.multNTracksGlobal ());
440+ histos.fill (HIST (" hNTPVContributorsvsTime" ), hoursAfterStartOfRun, collision.multPVTotalContributors ());
441+ }
406442 }
407443
408- void processCollisions (soa::Join<aod::Mults, aod::MFTMults, aod::MultsExtra, aod::MultsGlobal, aod::MultSelections>::iterator const & collision)
444+ void processCollisions (soa::Join<aod::Mults, aod::MFTMults, aod::MultsExtra, aod::MultsGlobal, aod::MultSelections, aod::Mults2BC >::iterator const & collision, aod::MultBCs const & )
409445 {
410446 genericProcessCollision (collision);
411447 }
412448
413- void processCollisionsWithCentrality (soa::Join<aod::Mults, aod::MFTMults, aod::MultsExtra, aod::MultSelections, aod::CentFT0Cs, aod::MultsGlobal>::iterator const & collision)
449+ void processCollisionsWithCentrality (soa::Join<aod::Mults, aod::MFTMults, aod::MultsExtra, aod::MultSelections, aod::CentFT0Cs, aod::MultsGlobal, aod::Mults2BC >::iterator const & collision, aod::MultBCs const & )
414450 {
415451 genericProcessCollision (collision);
416452 }
417453
418- void processCollisionsWithCentralityWithNeighbours (soa::Join<aod::Mults, aod::MFTMults, aod::MultsExtra, aod::MultSelections, aod::CentFT0Cs, aod::MultsGlobal, aod::MultNeighs>::iterator const & collision)
454+ void processCollisionsWithCentralityWithNeighbours (soa::Join<aod::Mults, aod::MFTMults, aod::MultsExtra, aod::MultSelections, aod::CentFT0Cs, aod::MultsGlobal, aod::MultNeighs, aod::Mults2BC >::iterator const & collision, aod::MultBCs const & )
419455 {
420456 genericProcessCollision (collision);
421457 }
0 commit comments