Skip to content

Commit 76eca8f

Browse files
committed
Add time dependency study
1 parent 5a8d6d3 commit 76eca8f

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

Common/Tasks/centralityStudy.cxx

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include "Common/DataModel/Centrality.h"
2222
#include "Common/DataModel/EventSelection.h"
2323
#include "Framework/O2DatabasePDGPlugin.h"
24+
#include "CCDB/BasicCCDBManager.h"
25+
#include "DataFormatsParameters/GRPECSObject.h"
2426
#include "TH1F.h"
2527
#include "TH2F.h"
2628

@@ -32,13 +34,15 @@ using BCsWithRun3Matchings = soa::Join<aod::BCs, aod::Timestamps, aod::Run3Match
3234
struct centralityStudy {
3335
// Raw multiplicities
3436
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
37+
Service<o2::ccdb::BasicCCDBManager> ccdb;
3538

3639
// Configurables
3740
Configurable<bool> do2DPlots{"do2DPlots", true, "0 - no, 1 - yes"};
3841
Configurable<bool> doOccupancyStudyVsCentrality2d{"doOccupancyStudyVsCentrality2d", true, "0 - no, 1 - yes"};
3942
Configurable<bool> doOccupancyStudyVsRawValues2d{"doOccupancyStudyVsRawValues2d", true, "0 - no, 1 - yes"};
4043
Configurable<bool> doOccupancyStudyVsCentrality3d{"doOccupancyStudyVsCentrality3d", false, "0 - no, 1 - yes"};
4144
Configurable<bool> doOccupancyStudyVsRawValues3d{"doOccupancyStudyVsRawValues3d", false, "0 - no, 1 - yes"};
45+
Configurable<bool> doTimeStudies{"doTimeStudies", false, "0 - no, 1 - yes"};
4246
Configurable<bool> doNGlobalTracksVsRawSignals{"doNGlobalTracksVsRawSignals", true, "0 - no, 1 - yes"};
4347
Configurable<bool> applySel8{"applySel8", true, "0 - no, 1 - yes"};
4448
Configurable<bool> applyVtxZ{"applyVtxZ", true, "0 - no, 1 - yes"};
@@ -113,10 +117,10 @@ struct centralityStudy {
113117
ConfigurableAxis axisCentrality{"axisCentrality", {100, 0, 100}, "FT0C percentile"};
114118
ConfigurableAxis axisPVChi2{"axisPVChi2", {300, 0, 30}, "FT0C percentile"};
115119
ConfigurableAxis axisDeltaTime{"axisDeltaTime", {300, 0, 300}, "#Delta time"};
120+
ConfigurableAxis axisDeltaTimestamp{"axisDeltaTimestamp", {1440, 0, 24}, "#Delta timestamp - sor (hours)"};
116121

117122
// For profile Z
118123
ConfigurableAxis axisPVz{"axisPVz", {400, -20.0f, +20.0f}, "PVz (cm)"};
119-
120124
ConfigurableAxis axisZN{"axisZN", {1100, -50.0f, +500.0f}, "ZN"};
121125

122126
void init(InitContext&)
@@ -227,6 +231,21 @@ struct centralityStudy {
227231
histos.add("hFT0COccupancyVsNGlobalTracksVsCentrality", "hFT0COccupancyVsNGlobalTracksVsCentrality", kTH3F, {axisFT0COccupancy, axisMultGlobalTracks, axisCentrality});
228232
}
229233
}
234+
235+
if (doTimeStudies) {
236+
ccdb->setURL("http://alice-ccdb.cern.ch");
237+
ccdb->setCaching(true);
238+
ccdb->setLocalObjectValidityChecking();
239+
ccdb->setFatalWhenNull(false);
240+
241+
histos.add("hFT0AvsTime", "hFT0AvsTime", kTH2F, {axisDeltaTimestamp, axisMultFT0A});
242+
histos.add("hFT0CvsTime", "hFT0CvsTime", kTH2F, {{axisDeltaTimestamp, axisMultFT0C}});
243+
histos.add("hFT0MvsTime", "hFT0MvsTime", kTH2F, {{axisDeltaTimestamp, axisMultFT0M}});
244+
histos.add("hFV0AvsTime", "hFV0AvsTime", kTH2F, {{axisDeltaTimestamp, axisMultFV0A}});
245+
histos.add("hMFTTracksvsTime", "hMFTTracksvsTime", kTH2F, {{axisDeltaTimestamp, axisMultMFTTracks}});
246+
histos.add("hNGlobalVsTime", "hNGlobalVsTime", kTH2F, {{axisDeltaTimestamp, axisMultGlobalTracks}});
247+
histos.add("hNTPVContributorsvsTime", "hNTPVContributorsvsTime", kTH2F, {{axisDeltaTimestamp, axisMultPVContributors}});
248+
}
230249
}
231250

232251
template <typename TCollision>
@@ -403,19 +422,34 @@ struct centralityStudy {
403422
histos.fill(HIST("hFT0COccupancyVsNGlobalTracksVsCentrality"), collision.ft0cOccupancyInTimeRange(), collision.multNTracksGlobal(), collision.centFT0C());
404423
}
405424
}
425+
426+
if (doTimeStudies && collision.has_multBC()) {
427+
auto multbc = collision.template multBC_as<aod::MultBCs>();
428+
uint64_t timestamp_ms = multbc.timestamp();
429+
o2::parameters::GRPECSObject* grpo = ccdb->getForTimeStamp<o2::parameters::GRPECSObject>("GLO/Config/GRPECS", timestamp_ms);
430+
uint64_t timestamp_sor_ms = grpo->getTimeStart();
431+
float hoursAfterStartOfRun = static_cast<float>(timestamp_ms - timestamp_sor_ms) / 3600000.0;
432+
histos.fill(HIST("hFT0AvsTime"), hoursAfterStartOfRun, collision.multFT0A());
433+
histos.fill(HIST("hFT0CvsTime"), hoursAfterStartOfRun, collision.multFT0C());
434+
histos.fill(HIST("hFT0MvsTime"), hoursAfterStartOfRun, collision.multFT0M());
435+
histos.fill(HIST("hFV0AvsTime"), hoursAfterStartOfRun, collision.multFV0A());
436+
histos.fill(HIST("hMFTTracksvsTime"), hoursAfterStartOfRun, collision.mftNtracks());
437+
histos.fill(HIST("hNGlobalVsTime"), hoursAfterStartOfRun, collision.multNTracksGlobal());
438+
histos.fill(HIST("hNTPVContributorsvsTime"), hoursAfterStartOfRun, collision.multPVTotalContributors());
439+
}
406440
}
407441

408-
void processCollisions(soa::Join<aod::Mults, aod::MFTMults, aod::MultsExtra, aod::MultsGlobal, aod::MultSelections>::iterator const& collision)
442+
void processCollisions(soa::Join<aod::Mults, aod::MFTMults, aod::MultsExtra, aod::MultsGlobal, aod::MultSelections, aod::Mults2BC>::iterator const& collision, aod::MultBCs const&)
409443
{
410444
genericProcessCollision(collision);
411445
}
412446

413-
void processCollisionsWithCentrality(soa::Join<aod::Mults, aod::MFTMults, aod::MultsExtra, aod::MultSelections, aod::CentFT0Cs, aod::MultsGlobal>::iterator const& collision)
447+
void processCollisionsWithCentrality(soa::Join<aod::Mults, aod::MFTMults, aod::MultsExtra, aod::MultSelections, aod::CentFT0Cs, aod::MultsGlobal, aod::Mults2BC>::iterator const& collision, aod::MultBCs const&)
414448
{
415449
genericProcessCollision(collision);
416450
}
417451

418-
void processCollisionsWithCentralityWithNeighbours(soa::Join<aod::Mults, aod::MFTMults, aod::MultsExtra, aod::MultSelections, aod::CentFT0Cs, aod::MultsGlobal, aod::MultNeighs>::iterator const& collision)
452+
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&)
419453
{
420454
genericProcessCollision(collision);
421455
}

0 commit comments

Comments
 (0)