diff --git a/Detectors/ITSMFT/ITS/postprocessing/studies/include/ITSStudies/ITSStudiesConfigParam.h b/Detectors/ITSMFT/ITS/postprocessing/studies/include/ITSStudies/ITSStudiesConfigParam.h index 8399d01d818fb..fa3ef14007b5e 100644 --- a/Detectors/ITSMFT/ITS/postprocessing/studies/include/ITSStudies/ITSStudiesConfigParam.h +++ b/Detectors/ITSMFT/ITS/postprocessing/studies/include/ITSStudies/ITSStudiesConfigParam.h @@ -73,6 +73,12 @@ struct ITSAvgClusSizeParamConfig : public o2::conf::ConfigurableParamHelper { + std::string outFileName = "its_occupancy.root"; + + O2ParamDef(ITSOccupancyParamConfig, "ITSOccupancyParam"); +}; + struct ITSImpactParameterParamConfig : public o2::conf::ConfigurableParamHelper { std::string outFileName = "its_ImpParameter.root"; int minNumberOfContributors = 0; diff --git a/Detectors/ITSMFT/ITS/postprocessing/studies/include/ITSStudies/Occupancy.h b/Detectors/ITSMFT/ITS/postprocessing/studies/include/ITSStudies/Occupancy.h index 6254c88ac2c5b..1ce3d04ed6513 100644 --- a/Detectors/ITSMFT/ITS/postprocessing/studies/include/ITSStudies/Occupancy.h +++ b/Detectors/ITSMFT/ITS/postprocessing/studies/include/ITSStudies/Occupancy.h @@ -24,7 +24,7 @@ namespace study { using mask_t = o2::dataformats::GlobalTrackID::mask_t; -o2::framework::DataProcessorSpec getOcccupancy() +o2::framework::DataProcessorSpec getOccupancyStudy(mask_t srcTracksMask, mask_t srcClustersMask, bool useMC); } // namespace study } // namespace its } // namespace o2 diff --git a/Detectors/ITSMFT/ITS/postprocessing/studies/src/Occupancy.cxx b/Detectors/ITSMFT/ITS/postprocessing/studies/src/Occupancy.cxx index 95179bc6f8861..83196e91394bf 100644 --- a/Detectors/ITSMFT/ITS/postprocessing/studies/src/Occupancy.cxx +++ b/Detectors/ITSMFT/ITS/postprocessing/studies/src/Occupancy.cxx @@ -70,8 +70,7 @@ class Occupancy : public Task public: Occupancy(std::shared_ptr dr, std::shared_ptr gr, - bool isMC, - std::shared_ptr kineReader) : mDataRequest{dr}, mGGCCDBRequest(gr), mUseMC(isMC), mKineReader(kineReader){}; + bool isMC) : mDataRequest{dr}, mGGCCDBRequest(gr), mUseMC(isMC){}; ~Occupancy() final = default; void init(InitContext& ic) final; void run(ProcessingContext&) final; @@ -85,8 +84,8 @@ class Occupancy : public Task // Helper functions void prepareOutput(); void updateTimeDependentParams(ProcessingContext& pc); - void fillIBmap(TH2F *histo, int sta, int chipInMod, float weight); - void fillOBmap(TH2F *histo, int sta, int chipInMod, float weight, int ssta); + void fillIBmap(TH2F* histo, int sta, int chipInMod, float weight); + void fillOBmap(TH2F* histo, int sta, int chipInMod, float weight, int ssta, int mod); void getClusters(const gsl::span, float weight); void saveHistograms(); @@ -116,25 +115,22 @@ void Occupancy::init(InitContext& ic) void Occupancy::prepareOutput() { - auto& params = o2::its::study::ITSAvgClusSizeParamConfig::Instance(); - mOutName = params.outFileName; - mDBGOut = std::make_unique(mOutName.c_str(), "recreate"); - - std::vector nStaves{12, 16, 20, 24, 30, 42, 48}; - - for (int layer{0}; layer < 7; layer++) { - if (layer < 3) - { - mOccupancyHistos.push_back(new TH2F(Form("Occupancy chip map L%i", layer), "; Chip ID; Stave ID; # Hits / # PVs", 9, -0.5, 8.5, nStaves[layer], -0.5, nStaves[layer] - 0.5)); - } - else { - mOccupancyHistos.push:back(new TH2F(Form("Occupancy chip map L%i", layer), "; Chip ID; Stave ID; #LT Cluster size #GT", 49, -0.5, 48.5, 4 * nStaves[layer], -0.5, 4 * nStaves[layer] - 0.5)); - } - mOccupancyHistos[layer]->SetDirectory(nullptr); + auto& params = o2::its::study::ITSOccupancyParamConfig::Instance(); + mOutName = params.outFileName; + mDBGOut = std::make_unique(mOutName.c_str(), "recreate"); + + std::vector nStaves{12, 16, 20, 24, 30, 42, 48}; + + for (int layer{0}; layer < 7; layer++) { + if (layer < 3) { + mOccupancyHistos.push_back(new TH2F(Form("Occupancy chip map L%i", layer), "; Chip ID; Stave ID; # Hits / # PVs", 9, -0.5, 8.5, nStaves[layer], -0.5, nStaves[layer] - 0.5)); + } else { + mOccupancyHistos.push_back(new TH2F(Form("Occupancy chip map L%i", layer), "; Chip ID; Stave ID; #LT Cluster size #GT", 49, -0.5, 48.5, 4 * nStaves[layer], -0.5, 4 * nStaves[layer] - 0.5)); } + mOccupancyHistos[layer]->SetDirectory(nullptr); + } } - void Occupancy::run(ProcessingContext& pc) { o2::globaltracking::RecoContainer recoData; @@ -148,39 +144,39 @@ void Occupancy::getClusters(const gsl::span IT for (unsigned int iClus{0}; iClus < ITSclus.size(); ++iClus) { auto& clus = ITSclus[iClus]; o2::itsmft::ChipMappingITS chipMapping; + auto chipID = clus.getChipID(); int layer, sta, ssta, mod, chipInMod; chipMapping.expandChipInfoHW(chipID, layer, sta, ssta, mod, chipInMod); if (layer < 3) { fillIBmap(mOccupancyHistos[layer], sta, chipInMod, weight); } else { - fillOBmap(mOccupancyHistos[layer], sta, chipInMod, weight, ssta); + fillOBmap(mOccupancyHistos[layer], sta, chipInMod, weight, ssta, mod); } } } -void Occupancy::fillIBmap(TH2F *histo, int sta, int chipInMod, float weight) +void Occupancy::fillIBmap(TH2F* histo, int sta, int chipInMod, float weight) { - histo->Fill(chipInMod, sta, weight); + histo->Fill(chipInMod, sta, weight); } -void Occupancy::fillOBmap(TH2F *histo, int sta, int chipInMod, float weight, int ssta) +void Occupancy::fillOBmap(TH2F* histo, int sta, int chipInMod, float weight, int ssta, int mod) { - auto xCoord = chipInMod < 7 ? (mod - 1) * 7 + chipInMod : (mod - 1) * 7 + 14 - chipInMod; - auto yCoord = 4 * sta + ssta * 2 + 1 * (chipInMod < 7); - histo->Fill(xCoord, yCoord, weight); + auto xCoord = chipInMod < 7 ? (mod - 1) * 7 + chipInMod : (mod - 1) * 7 + 14 - chipInMod; + auto yCoord = 4 * sta + ssta * 2 + 1 * (chipInMod < 7); + histo->Fill(xCoord, yCoord, weight); } void Occupancy::process(o2::globaltracking::RecoContainer& recoData) { - auto& params = o2::its::study::ITSAvgClusSizeParamConfig::Instance(); + auto& params = o2::its::study::ITSOccupancyParamConfig::Instance(); bool isMCTarget = false; PVertex pv; auto compClus = recoData.getITSClusters(); getClusters(compClus, 1.); // Default weight is 1 saveHistograms(); - } void Occupancy::updateTimeDependentParams(ProcessingContext& pc) @@ -218,7 +214,7 @@ void Occupancy::finaliseCCDB(ConcreteDataMatcher& matcher, void* obj) } } -DataProcessorSpec getOccupancy(mask_t srcTracksMask, mask_t srcClustersMask, bool useMC, std::shared_ptr kineReader) +DataProcessorSpec getOccupancyStudy(mask_t srcTracksMask, mask_t srcClustersMask, bool useMC) { std::vector outputs; auto dataRequest = std::make_shared(); @@ -238,7 +234,7 @@ DataProcessorSpec getOccupancy(mask_t srcTracksMask, mask_t srcClustersMask, boo "its-study-Occupancy", dataRequest->inputs, outputs, - AlgorithmSpec{adaptFromTask(dataRequest, ggRequest, useMC, kineReader)}, + AlgorithmSpec{adaptFromTask(dataRequest, ggRequest, useMC)}, Options{}}; } } // namespace study diff --git a/Detectors/ITSMFT/ITS/postprocessing/workflow/standalone-postprocessing-workflow.cxx b/Detectors/ITSMFT/ITS/postprocessing/workflow/standalone-postprocessing-workflow.cxx index 5b3e6e5d9a125..a4b8666b968a3 100644 --- a/Detectors/ITSMFT/ITS/postprocessing/workflow/standalone-postprocessing-workflow.cxx +++ b/Detectors/ITSMFT/ITS/postprocessing/workflow/standalone-postprocessing-workflow.cxx @@ -91,7 +91,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) } if (configcontext.options().get("occupancy-study")) { anyStudy = true; - specs.emplace_back(o2::its::study::getOccupancyStudy(srcTrc, srcCls, useMC, mcKinematicsReader)); + specs.emplace_back(o2::its::study::getOccupancyStudy(srcTrc, srcCls, useMC)); } if (!anyStudy) { LOGP(info, "No study selected, dryrunning");