diff --git a/PWGUD/Tasks/upcEventITSROFcounter.cxx b/PWGUD/Tasks/upcEventITSROFcounter.cxx index 1da6fbfd26c..51241be5d69 100644 --- a/PWGUD/Tasks/upcEventITSROFcounter.cxx +++ b/PWGUD/Tasks/upcEventITSROFcounter.cxx @@ -9,12 +9,23 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file upcEventITSROFcounter.cxx +/// \brief Personal task to analyze tau events from UPC collisions +/// +/// \author Roman Lavicka , Austrian Academy of Sciences & SMI +/// \since 09.08.2024 + +#include +#include + #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" #include "ITSMFTBase/DPLAlpideParam.h" #include "CCDB/BasicCCDBManager.h" +#include "ReconstructionDataFormats/Vertex.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/EventSelection.h" #include "PWGUD/DataModel/UDTables.h" @@ -25,6 +36,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; +using namespace o2::dataformats; using BCsWithRun3Matchings = soa::Join; using CCs = soa::Join; @@ -39,10 +51,10 @@ struct UpcEventITSROFcounter { Configurable nTracksForUPCevent{"nTracksForUPCevent", 16, {"Maximum of tracks defining a UPC collision"}}; Configurable useTrueGap{"useTrueGap", true, {"Calculate gapSide for a given FV0/FT0/ZDC thresholds"}}; - Configurable cutMyGapSideFV0{"FV0", -1, "FV0A threshold for SG selector"}; - Configurable cutMyGapSideFT0A{"FT0A", 150., "FT0A threshold for SG selector"}; - Configurable cutMyGapSideFT0C{"FT0C", 50., "FT0C threshold for SG selector"}; - Configurable cutMyGapSideZDC{"ZDC", 10., "ZDC threshold for SG selector"}; + Configurable cutMyGapSideFV0{"cutMyGapSideFV0", -1, "FV0A threshold for SG selector"}; + Configurable cutMyGapSideFT0A{"cutMyGapSideFT0A", 150., "FT0A threshold for SG selector"}; + Configurable cutMyGapSideFT0C{"cutMyGapSideFT0C", 50., "FT0C threshold for SG selector"}; + Configurable cutMyGapSideZDC{"cutMyGapSideZDC", 10., "ZDC threshold for SG selector"}; ConfigurableAxis axisRunNumbers{"axisRunNumbers", {1400, 544000.5, 545400.5}, "Range of run numbers"}; void init(InitContext&) @@ -53,6 +65,9 @@ struct UpcEventITSROFcounter { histos.add("Events/hCountCollisionsInROFborderMatching", ";;Number of collision (-)", HistType::kTH1D, {{11, -0.5, 10.5}}); histos.add("Events/hCountUPCcollisionsInROFborderMatching", ";;Number of UPC (mult < 17) collision (-)", HistType::kTH1D, {{11, -0.5, 10.5}}); + histos.add("Events/hPVcontribsVsCollisionsPerITSROFstd", "Collisions reconstructed with standard mode;Number of vertex contributors (-); Number of collisions in one ITSROF (-)", HistType::kTH2D, {{101, -0.5, 100.5}, {11, -0.5, 10.5}}); + histos.add("Events/hPVcontribsVsCollisionsPerITSROFupc", "Collisions reconstructed with upc mode;Number of vertex contributors (-); Number of collisions in one ITSROF (-)", HistType::kTH2D, {{101, -0.5, 100.5}, {11, -0.5, 10.5}}); + histos.add("Runs/hStdModeCollDG", ";Run number;Number of events (-)", HistType::kTH1D, {axisRunNumbers}); histos.add("Runs/hUpcModeCollDG", ";Run number;Number of events (-)", HistType::kTH1D, {axisRunNumbers}); histos.add("Runs/hStdModeCollSG1", ";Run number;Number of events (-)", HistType::kTH1D, {axisRunNumbers}); @@ -78,7 +93,7 @@ struct UpcEventITSROFcounter { int64_t ts = bcs.iteratorAt(0).timestamp(); auto alppar = ccdb->getForTimeStamp>("ITS/Config/AlpideParam", ts); - for (auto bc : bcs) { + for (const auto& bc : bcs) { uint64_t globalBC = bc.globalBC(); uint64_t globalIndex = bc.globalIndex(); if (isFirst) { @@ -98,7 +113,7 @@ struct UpcEventITSROFcounter { previousBCinITSROF = bcInITSROF; previousBCglobalIndex = globalIndex; // next is based on exact matching of bc and collision - for (auto& collision : collisions) { + for (const auto& collision : collisions) { if (collision.has_foundBC()) { if (collision.foundBCId() == bc.globalIndex()) { nAllColls++; @@ -113,16 +128,16 @@ struct UpcEventITSROFcounter { } } } // end loop over collisions - } // end loop over bcs + } // end loop over bcs int arrAllColls[1000] = {0}; int arrUPCcolls[1000] = {0}; // next is based on matching of collision bc within ITSROF range in bcs - for (auto& itsrofBorder : vecITSROFborders) { + for (const auto& itsrofBorder : vecITSROFborders) { int nAllCollsInROF = 0; int nUpcCollsInROF = 0; - for (auto& collision : collisions) { + for (const auto& collision : collisions) { if ((itsrofBorder.first < collision.bcId()) && (collision.bcId() < itsrofBorder.second)) { nAllCollsInROF++; if (collision.numContrib() < nTracksForUPCevent + 1) { @@ -138,6 +153,30 @@ struct UpcEventITSROFcounter { histos.get(HIST("Events/hCountCollisionsInROFborderMatching"))->Fill(ncol, arrAllColls[ncol]); histos.get(HIST("Events/hCountUPCcollisionsInROFborderMatching"))->Fill(ncol, arrUPCcolls[ncol]); } + + // TEST vertex contributors per reconstruction flag (std vs upc) + // matching of collision bc within ITSROF range in bcs + for (const auto& itsrofBorder : vecITSROFborders) { + std::vector vecNumContribsStd; + std::vector vecNumContribsUpc; + for (const auto& collision : collisions) { + if ((itsrofBorder.first < collision.bcId()) && (collision.bcId() < itsrofBorder.second)) { + if (collision.flags() & dataformats::Vertex>::Flags::UPCMode) { + vecNumContribsUpc.push_back(collision.numContrib()); + } else { + vecNumContribsStd.push_back(collision.numContrib()); + } + } + } // end loop over collisions + + for (const auto& numContribs : vecNumContribsStd) { + histos.get(HIST("Events/hPVcontribsVsCollisionsPerITSROFstd"))->Fill(numContribs, vecNumContribsStd.size()); + } + for (const auto& numContribs : vecNumContribsUpc) { + histos.get(HIST("Events/hPVcontribsVsCollisionsPerITSROFupc"))->Fill(numContribs, vecNumContribsUpc.size()); + } + + } // end loop over ITSROFs } void processCounterPerRun(FullSGUDCollision const& coll) @@ -179,5 +218,5 @@ struct UpcEventITSROFcounter { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc, TaskName{"upc-event-itsrof-counter"})}; + adaptAnalysisTask(cfgc)}; }