diff --git a/PWGEM/Dilepton/Tasks/testPV.cxx b/PWGEM/Dilepton/Tasks/testPV.cxx index 5684d2cc0f7..a525a2ef5fd 100644 --- a/PWGEM/Dilepton/Tasks/testPV.cxx +++ b/PWGEM/Dilepton/Tasks/testPV.cxx @@ -30,29 +30,24 @@ #include -using namespace o2; -using namespace o2::soa; -using namespace o2::framework; -using namespace o2::framework::expressions; - struct testPV { // Configurables - Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "eventCut"; - Configurable cfgEventGeneratorId{"cfgEventGeneratorId", -1, "event generator index. e.g. select gap/signal events"}; - Configurable cfgChi2PerNcontribMax{"cfgChi2PerNcontribMax", 1e+10, "max. chi2/Ncontrib of PV"}; - Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; - Configurable cfgZvtxMax{"cfgZvtxMax", 10.f, "max. Zvtx"}; - Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND"}; - Configurable cfgRequireNoTFB{"cfgRequireNoTFB", true, "require No time frame border"}; - Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border"}; - Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; - Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; - Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. - Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. + o2::framework::Configurable cfgEventGeneratorId{"cfgEventGeneratorId", -1, "event generator index. e.g. select gap/signal events"}; + o2::framework::Configurable cfgChi2PerNcontribMax{"cfgChi2PerNcontribMax", 1e+10, "max. chi2/Ncontrib of PV"}; + o2::framework::Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; + o2::framework::Configurable cfgZvtxMax{"cfgZvtxMax", 10.f, "max. Zvtx"}; + o2::framework::Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND"}; + o2::framework::Configurable cfgRequireNoTFB{"cfgRequireNoTFB", true, "require No time frame border"}; + o2::framework::Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border"}; + o2::framework::Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; + o2::framework::Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; + o2::framework::Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. + o2::framework::Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. // for RCT o2::framework::Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", true, "require good detector flag in run condtion table"}; @@ -62,14 +57,14 @@ struct testPV { } eventCut; // for zorro - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "zorroGroup"; - Configurable cfgTriggerName{"cfgTriggerName", "fGlobalDimuon", "desired software trigger name"}; - Configurable ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "EventFiltering/Zorro/", "ccdb path for ZORRO objects"}; - Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; + o2::framework::Configurable cfgTriggerName{"cfgTriggerName", "fGlobalDimuon", "desired software trigger name"}; + o2::framework::Configurable ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "EventFiltering/Zorro/", "ccdb path for ZORRO objects"}; + o2::framework::Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; } zorroGroup; - HistogramRegistry fRegistry{"fRegistry"}; + o2::framework::HistogramRegistry fRegistry{"fRegistry"}; Zorro zorro; void init(o2::framework::InitContext&) @@ -85,7 +80,7 @@ struct testPV { } int mRunNumber{0}; - Service ccdb; + o2::framework::Service ccdb; template void initCCDB(TBC const& bc) @@ -105,26 +100,26 @@ struct testPV { void addHistograms() { - auto hCollisionCounter = fRegistry.add("hCollisionCounter", "collision counter", kTH1D, {{2, 0.5f, 2.5f}}, false); + auto hCollisionCounter = fRegistry.add("hCollisionCounter", "collision counter", o2::framework::HistType::kTH1D, {{2, 0.5f, 2.5f}}, false); hCollisionCounter->GetXaxis()->SetBinLabel(1, "all"); hCollisionCounter->GetXaxis()->SetBinLabel(2, "accepted"); - fRegistry.add("Vertex/hZvtx", "vertex z; Z_{vtx} (cm)", kTH1F, {{100, -50, +50}}, false); - fRegistry.add("Vertex/hNContrib", "Number of PV contributors;N_{contrib}", kTH1F, {{101, -0.5, 100.5}}, false); - fRegistry.add("Vertex/hChi2", "vertex chi2;#chi^{2}/N_{contrib}", kTH1F, {{100, 0, 10}}, false); - fRegistry.add("Vertex/hChi2vsNContrib", "vertex #chi^{2}/N_{contrib} vs. N_{contrib};N_{contrib};#chi^{2}/N_{contrib}", kTH2F, {{101, -0.5, 100.5}, {100, 0, 10}}, false); + fRegistry.add("Vertex/hZvtx", "vertex z; Z_{vtx} (cm)", o2::framework::HistType::kTH1F, {{100, -50, +50}}, false); + fRegistry.add("Vertex/hNContrib", "Number of PV contributors;N_{contrib}", o2::framework::HistType::kTH1F, {{101, -0.5, 100.5}}, false); + fRegistry.add("Vertex/hChi2", "vertex chi2;#chi^{2}/N_{contrib}", o2::framework::HistType::kTH1F, {{100, 0, 10}}, false); + fRegistry.add("Vertex/hChi2vsNContrib", "vertex #chi^{2}/N_{contrib} vs. N_{contrib};N_{contrib};#chi^{2}/N_{contrib}", o2::framework::HistType::kTH2F, {{101, -0.5, 100.5}, {100, 0, 10}}, false); - fRegistry.add("Vertex/hSigmaX", "vertex #sigma_{X} vs. N_{contrib};N_{contrib};#sigma_{X} (#mum)", kTH2F, {{101, -0.5, 100.5}, {1000, 0, 100}}, false); - fRegistry.add("Vertex/hSigmaY", "vertex #sigma_{Y} vs. N_{contrib};N_{contrib};#sigma_{Y} (#mum)", kTH2F, {{101, -0.5, 100.5}, {1000, 0, 100}}, false); - fRegistry.add("Vertex/hSigmaZ", "vertex #sigma_{Z} vs. N_{contrib};N_{contrib};#sigma_{Z} (#mum)", kTH2F, {{101, -0.5, 100.5}, {1000, 0, 100}}, false); + fRegistry.add("Vertex/hSigmaX", "vertex #sigma_{X} vs. N_{contrib};N_{contrib};#sigma_{X} (#mum)", o2::framework::HistType::kTH2F, {{101, -0.5, 100.5}, {1000, 0, 100}}, false); + fRegistry.add("Vertex/hSigmaY", "vertex #sigma_{Y} vs. N_{contrib};N_{contrib};#sigma_{Y} (#mum)", o2::framework::HistType::kTH2F, {{101, -0.5, 100.5}, {1000, 0, 100}}, false); + fRegistry.add("Vertex/hSigmaZ", "vertex #sigma_{Z} vs. N_{contrib};N_{contrib};#sigma_{Z} (#mum)", o2::framework::HistType::kTH2F, {{101, -0.5, 100.5}, {1000, 0, 100}}, false); - fRegistry.add("Vertex/hCollisionTime", "vertex time;N_{contrib};collision time (ns)", kTH2F, {{101, -0.5, 100.5}, {500, -25, 25}}, false); - fRegistry.add("Vertex/hCollisionTimeRes", "vertex time resolution;N_{contrib};collision time resolution (ns)", kTH2F, {{101, -0.5, 100.5}, {250, 0, 25}}, false); + fRegistry.add("Vertex/hCollisionTime", "vertex time;N_{contrib};collision time (ns)", o2::framework::HistType::kTH2F, {{101, -0.5, 100.5}, {500, -25, 25}}, false); + fRegistry.add("Vertex/hCollisionTimeRes", "vertex time resolution;N_{contrib};collision time resolution (ns)", o2::framework::HistType::kTH2F, {{101, -0.5, 100.5}, {250, 0, 25}}, false); if (doprocessMC) { - fRegistry.add("Vertex/hDeltaX", "vertex #DeltaX vs. N_{contrib};N_{contrib};#DeltaX = (X_{rec} #minus X_{gen})/#sigma_{X}", kTH2F, {{101, -0.5, 100.5}, {200, -10, 10}}, false); - fRegistry.add("Vertex/hDeltaY", "vertex #DeltaY vs. N_{contrib};N_{contrib};#DeltaY = (Y_{rec} #minus Y_{gen})/#sigma_{Y}", kTH2F, {{101, -0.5, 100.5}, {200, -10, 10}}, false); - fRegistry.add("Vertex/hDeltaZ", "vertex #DeltaZ vs. N_{contrib};N_{contrib};#DeltaZ = (Z_{rec} #minus Z_{gen})/#sigma_{Z}", kTH2F, {{101, -0.5, 100.5}, {200, -10, 10}}, false); + fRegistry.add("Vertex/hDeltaX", "vertex #DeltaX vs. N_{contrib};N_{contrib};#DeltaX = (X_{rec} #minus X_{gen})/#sigma_{X}", o2::framework::HistType::kTH2F, {{101, -0.5, 100.5}, {200, -10, 10}}, false); + fRegistry.add("Vertex/hDeltaY", "vertex #DeltaY vs. N_{contrib};N_{contrib};#DeltaY = (Y_{rec} #minus Y_{gen})/#sigma_{Y}", o2::framework::HistType::kTH2F, {{101, -0.5, 100.5}, {200, -10, 10}}, false); + fRegistry.add("Vertex/hDeltaZ", "vertex #DeltaZ vs. N_{contrib};N_{contrib};#DeltaZ = (Z_{rec} #minus Z_{gen})/#sigma_{Z}", o2::framework::HistType::kTH2F, {{101, -0.5, 100.5}, {200, -10, 10}}, false); } } @@ -218,13 +213,13 @@ struct testPV { } // end of collision loop } - using MyCollisions = soa::Join; - using MyCollisionsMC = soa::Join; - using MyBCs = soa::Join; + using MyCollisions = o2::soa::Join; + using MyCollisionsMC = o2::soa::Join; + using MyBCs = o2::soa::Join; - Filter collisionFilter_evsel = eventCut.cfgZvtxMin < o2::aod::collision::posZ && o2::aod::collision::posZ < eventCut.cfgZvtxMax; - using FilteredMyCollisions = soa::Filtered; - using FilteredMyCollisionsMC = soa::Filtered; + o2::framework::expressions::Filter collisionFilter_evsel = eventCut.cfgZvtxMin < o2::aod::collision::posZ && o2::aod::collision::posZ < eventCut.cfgZvtxMax; + using FilteredMyCollisions = o2::soa::Filtered; + using FilteredMyCollisionsMC = o2::soa::Filtered; void processData(FilteredMyCollisions const& collisions, MyBCs const& bcs) { @@ -236,9 +231,9 @@ struct testPV { { run(bcs, collisions, nullptr, nullptr); } - PROCESS_SWITCH(testPV, processTriggeredData, "processTriggeredData", true); + PROCESS_SWITCH(testPV, processTriggeredData, "processTriggeredData", false); - void processMC(FilteredMyCollisionsMC const& collisions, MyBCs const& bcs, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + void processMC(FilteredMyCollisionsMC const& collisions, MyBCs const& bcs, o2::aod::McCollisions const& mcCollisions, o2::aod::McParticles const& mcParticles) { run(bcs, collisions, mcCollisions, mcParticles); } @@ -247,7 +242,7 @@ struct testPV { void processDummy(MyCollisions const&) {} PROCESS_SWITCH(testPV, processDummy, "processDummy", false); }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"test-pv"})}; + return o2::framework::WorkflowSpec{adaptAnalysisTask(cfgc, o2::framework::TaskName{"test-pv"})}; }