@@ -197,41 +197,47 @@ void AnomalyStudy::process(o2::globaltracking::RecoContainer& recoData)
197197 auto nROF = o2::its::study::AnomalyStudyParamConfig::Instance ().nRofTimeFrames ;
198198 auto nLayProc = o2::its::study::AnomalyStudyParamConfig::Instance ().nLayersToProcess ;
199199 auto doROFAnalysis = o2::its::study::AnomalyStudyParamConfig::Instance ().doROFAnalysis ;
200- int rofCount = 0 ;
201- auto clusRofRecords = recoData.getITSClustersROFRecords ();
202- auto compClus = recoData.getITSClusters ();
203- auto clusPatt = recoData.getITSClustersPatterns ();
204-
205- getClusterPatterns (compClus, clusPatt, *mDict );
206-
207- auto pattIt = clusPatt.begin ();
208- std::vector<ITSCluster> globalClusters;
209- o2::its::ioutils::convertCompactClusters (compClus, pattIt, globalClusters, mDict );
210-
211200 int lay, sta, ssta, mod, chipInMod;
212- for (auto & rofRecord : clusRofRecords) {
213- auto clustersInRof = rofRecord.getROFData (compClus);
214- auto patternsInRof = rofRecord.getROFData (mPatterns );
215- auto locClustersInRof = rofRecord.getROFData (globalClusters);
216- for (unsigned int clusInd{0 }; clusInd < clustersInRof.size (); clusInd++) {
217- const auto & compClus = clustersInRof[clusInd];
218- auto & locClus = locClustersInRof[clusInd];
219- auto & clusPattern = patternsInRof[clusInd];
220- auto gloC = locClus.getXYZGlo (*mGeom );
221- mChipMapping .expandChipInfoHW (compClus.getChipID (), lay, sta, ssta, mod, chipInMod);
222- if (lay >= nLayProc) {
223- continue ;
224- }
225- float phi = TMath::ATan2 (gloC.Y (), gloC.X ());
226- mTFvsPhiHist [lay]->Fill (phi, mTFCount );
227- mTFvsPhiClusSizeHist [lay]->Fill (phi, mTFCount , clusPattern.getNPixels ());
228- if (doROFAnalysis) {
229- mROFvsPhiHist [lay]->Fill (phi, (mTFCount - 1 ) * nROF + rofCount);
230- mROFvsPhiClusSizeHist [lay]->Fill (phi, (mTFCount - 1 ) * nROF + rofCount, clusPattern.getNPixels ());
201+ // in the staggered readout the clusters and their ROFs are provided per layer, every layer having its
202+ // own ROF length and numbering; all the filled histograms are per layer, hence each layer slot is
203+ // processed with its own ROF counter
204+ int nLr = recoData.getITSPerLayer () ? o2::globaltracking::MaxITSLayers : 1 ;
205+ for (int lr = 0 ; lr < nLr; lr++) { // with a single (monolithic) input all clusters are in the layer slot 0
206+ int rofCount = 0 ;
207+ auto clusRofRecords = recoData.getITSClustersROFRecords (lr);
208+ auto compClus = recoData.getITSClusters (lr);
209+ auto clusPatt = recoData.getITSClustersPatterns (lr);
210+
211+ getClusterPatterns (compClus, clusPatt, *mDict );
212+
213+ auto pattIt = clusPatt.begin ();
214+ std::vector<ITSCluster> globalClusters;
215+ o2::its::ioutils::convertCompactClusters (compClus, pattIt, globalClusters, mDict );
216+
217+ for (auto & rofRecord : clusRofRecords) {
218+ auto clustersInRof = rofRecord.getROFData (compClus);
219+ auto patternsInRof = rofRecord.getROFData (mPatterns );
220+ auto locClustersInRof = rofRecord.getROFData (globalClusters);
221+ for (unsigned int clusInd{0 }; clusInd < clustersInRof.size (); clusInd++) {
222+ const auto & compClus = clustersInRof[clusInd];
223+ auto & locClus = locClustersInRof[clusInd];
224+ auto & clusPattern = patternsInRof[clusInd];
225+ auto gloC = locClus.getXYZGlo (*mGeom );
226+ mChipMapping .expandChipInfoHW (compClus.getChipID (), lay, sta, ssta, mod, chipInMod);
227+ if (lay >= nLayProc) {
228+ continue ;
229+ }
230+ float phi = TMath::ATan2 (gloC.Y (), gloC.X ());
231+ mTFvsPhiHist [lay]->Fill (phi, mTFCount );
232+ mTFvsPhiClusSizeHist [lay]->Fill (phi, mTFCount , clusPattern.getNPixels ());
233+ if (doROFAnalysis) {
234+ mROFvsPhiHist [lay]->Fill (phi, (mTFCount - 1 ) * nROF + rofCount);
235+ mROFvsPhiClusSizeHist [lay]->Fill (phi, (mTFCount - 1 ) * nROF + rofCount, clusPattern.getNPixels ());
236+ }
231237 }
238+ ++rofCount;
232239 }
233- ++rofCount;
234- }
240+ } // loop over the layer slots
235241 mStopwatch .Stop ();
236242 LOGP (info, " Processed TF: {} in {} s" , mTFCount , mStopwatch .RealTime ());
237243}
@@ -263,10 +269,11 @@ void AnomalyStudy::getClusterPatterns(gsl::span<const o2::itsmft::CompClusterExt
263269}
264270
265271// getter
266- DataProcessorSpec getAnomalyStudy (mask_t srcClustersMask, bool useMC)
272+ DataProcessorSpec getAnomalyStudy (mask_t srcClustersMask, bool useMC, bool itsStag )
267273{
268274 std::vector<OutputSpec> outputs;
269275 auto dataRequest = std::make_shared<DataRequest>();
276+ dataRequest->setITSPerLayer (itsStag);
270277 dataRequest->requestClusters (srcClustersMask, useMC);
271278 dataRequest->requestTracks (GTrackID::getSourcesMask (" " ), useMC);
272279
0 commit comments