@@ -137,8 +137,6 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx)
137137 auto clusPatternArr = ctx.inputs ().get <gsl::span<unsigned char >>(" patterns" );
138138 auto pattIt = clusPatternArr.begin ();
139139
140- int ChipIDprev = -1 ;
141-
142140 // Reset this histo to have the latest picture
143141 hEmptyLaneFractionGlobal->Reset (" ICES" );
144142
@@ -153,34 +151,44 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx)
153151 const auto & ROF = clusRofArr[iROF];
154152 const auto bcdata = ROF.getBCData ();
155153 int nClustersForBunchCrossing = 0 ;
154+ int nLongClusters[ChipBoundary[NLayerIB]] = { 0 };
155+ int nHitsFromClusters[ChipBoundary[NLayerIB]] = { 0 }; // only IB is implemented at the moment
156+
156157 for (int icl = ROF.getFirstEntry (); icl < ROF.getFirstEntry () + ROF.getNEntries (); icl++) {
157158
158159 auto & cluster = clusArr[icl];
159160 auto ChipID = cluster.getSensorID ();
160161 int ClusterID = cluster.getPatternID (); // used for normal (frequent) cluster shapes
161162 int lay, sta, ssta, mod, chip, lane;
162163
163- if (ChipID != ChipIDprev ) {
164+ if (ChipID != - 1 ) { // TODO: is this needed?
164165 mGeom ->getChipId (ChipID, lay, sta, ssta, mod, chip);
165166 mod = mod + (ssta * (mNHicPerStave [lay] / 2 ));
166167 int chipIdLocal = (ChipID - ChipBoundary[lay]) % (14 * mNHicPerStave [lay]);
167168 lane = (chipIdLocal % (14 * mNHicPerStave [lay])) / (14 / 2 );
168169 }
169170 int npix = -1 ;
171+ int colspan = -1 ;
172+ int rowspan = -1 ;
170173 int isGrouped = -1 ;
171174
172175 o2::math_utils::Point3D<float > locC; // local coordinates
173176
174177 if (ClusterID != o2::itsmft::CompCluster::InvalidPatternID) { // Normal (frequent) cluster shapes
175178 if (!mDict ->isGroup (ClusterID)) {
176179 npix = mDict ->getNpixels (ClusterID);
180+ // to do: is there way other than calling the pattern?
181+ colspan = mDict ->getPattern (ClusterID).getColumnSpan ();
182+ rowspan = mDict ->getPattern (ClusterID).getRowSpan ();
177183 if (mDoPublishDetailedSummary == 1 ) {
178184 locC = mDict ->getClusterCoordinates (cluster);
179185 }
180186 isGrouped = 0 ;
181187 } else {
182188 o2::itsmft::ClusterPattern patt (pattIt);
183189 npix = patt.getNPixels ();
190+ colspan = patt.getColumnSpan ();
191+ rowspan = patt.getRowSpan ();
184192 if (mDoPublishDetailedSummary == 1 ) {
185193 locC = mDict ->getClusterCoordinates (cluster, patt, true );
186194 }
@@ -190,6 +198,8 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx)
190198 } else { // invalid pattern
191199 o2::itsmft::ClusterPattern patt (pattIt);
192200 npix = patt.getNPixels ();
201+ colspan = patt.getColumnSpan ();
202+ rowspan = patt.getRowSpan ();
193203 isGrouped = 0 ;
194204 if (mDoPublishDetailedSummary == 1 ) {
195205 locC = mDict ->getClusterCoordinates (cluster, patt, false );
@@ -200,6 +210,15 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx)
200210 nClustersForBunchCrossing++;
201211 }
202212
213+ if (lay < NLayerIB) {
214+ nHitsFromClusters[ChipID] += npix;
215+ }
216+
217+ if (lay < NLayerIB && colspan > 127 && rowspan < 30 ) {
218+ // definition of long cluster. 127 is driven by o2::itsmft::ClusterPattern::MaxColSpan = 128
219+ nLongClusters[ChipID]++;
220+ }
221+
203222 if (lay < NLayerIB) {
204223 hAverageClusterOccupancySummaryIB[lay]->getNum ()->Fill (chip, sta);
205224 hAverageClusterSizeSummaryIB[lay]->getNum ()->Fill (chip, sta, (double )npix);
@@ -249,6 +268,23 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx)
249268 }
250269 }
251270 hClusterVsBunchCrossing->Fill (bcdata.bc , nClustersForBunchCrossing); // we count only the number of clusters, not their sizes
271+
272+ // filling these anomaly plots once per ROF, ignoring chips w/o long clusters
273+ for (int ichip = 0 ; ichip < ChipBoundary[NLayerIB]; ichip++) {
274+
275+ int nLong = nLongClusters[ichip] <= 20 ? nLongClusters[ichip] : 21 ;
276+
277+ if (nLong < 1 ) {
278+ continue ;
279+ }
280+
281+ int ilayer = -1 ;
282+ while (ichip >= ChipBoundary[ilayer + 1 ]) {
283+ ilayer++;
284+ }
285+ hLongClustersPerChip[ilayer]->Fill (ichip, nLong);
286+ hMultPerChipWhenLongClusters[ilayer]->Fill (ichip, nHitsFromClusters[ichip]);
287+ }
252288 }
253289
254290 if ((int )clusRofArr.size () > 0 ) {
@@ -396,7 +432,7 @@ void ITSClusterTask::reset()
396432
397433void ITSClusterTask::createAllHistos ()
398434{
399- hClusterVsBunchCrossing = new TH2D (" BunchCrossingIDvsClusters" , " BunchCrossingIDvsClusters" , nBCbins, 0 , 4095 , 100 , 0 , 1000 );
435+ hClusterVsBunchCrossing = new TH2D (" BunchCrossingIDvsClusters" , " BunchCrossingIDvsClusters" , nBCbins, 0 , 4095 , 100 , 0 , 2000 );
400436 hClusterVsBunchCrossing->SetTitle (" #clusters vs BC id for clusters with npix > 2" );
401437 addObject (hClusterVsBunchCrossing);
402438 formatAxes (hClusterVsBunchCrossing, " Bunch Crossing ID" , " Number of clusters with npix > 2 in ROF" , 1 , 1.10 );
@@ -419,6 +455,17 @@ void ITSClusterTask::createAllHistos()
419455 if (!mEnableLayers [iLayer])
420456 continue ;
421457
458+ if (iLayer < NLayerIB) {
459+ hLongClustersPerChip[iLayer] = new TH2D (Form (" Anomalies/Layer%d/LongClusters" , iLayer), Form (" Layer%d/LongClusters" , iLayer), ChipBoundary[iLayer + 1 ] - ChipBoundary[iLayer], ChipBoundary[iLayer], ChipBoundary[iLayer + 1 ], 21 , 0 , 21 );
460+ hMultPerChipWhenLongClusters[iLayer] = new TH2D (Form (" Anomalies/Layer%d/HitsWhenLongClusters" , iLayer), Form (" Layer%d/HitsWhenLongClusters" , iLayer), ChipBoundary[iLayer + 1 ] - ChipBoundary[iLayer], ChipBoundary[iLayer], ChipBoundary[iLayer + 1 ], 150 , 0 , 15000 );
461+ addObject (hLongClustersPerChip[iLayer]);
462+ formatAxes (hLongClustersPerChip[iLayer], " Chip ID" , " events with long clusters" , 1 , 1.10 );
463+ hLongClustersPerChip[iLayer]->SetStats (0 );
464+ addObject (hMultPerChipWhenLongClusters[iLayer]);
465+ formatAxes (hMultPerChipWhenLongClusters[iLayer], " Chip ID" , " Sum of clusters size (events w/ long clus)" , 1 , 1.10 );
466+ hMultPerChipWhenLongClusters[iLayer]->SetStats (0 );
467+ }
468+
422469 hClusterSizeLayerSummary[iLayer] = new TH1D (Form (" Layer%d/AverageClusterSizeSummary" , iLayer), Form (" Layer%dAverageClusterSizeSummary" , iLayer), 100 , 0 , 100 );
423470 hClusterSizeLayerSummary[iLayer]->SetTitle (Form (" Cluster size summary for Layer %d" , iLayer));
424471 addObject (hClusterSizeLayerSummary[iLayer]);
0 commit comments