@@ -1239,12 +1239,6 @@ class EventSelectionModule
12391239 // ### for occupancy in time windows
12401240 std::vector<int > vAssocToThisCol;
12411241 std::vector<float > vCollsTimeDeltaWrtGivenColl;
1242- // protection against the TF borders
1243- if (!vIsFullInfoForOccupancy[colIndex]) {
1244- vCollsInTimeWin.push_back (vAssocToThisCol);
1245- vTimeDeltaForColls.push_back (vCollsTimeDeltaWrtGivenColl);
1246- continue ;
1247- }
12481242 // find all collisions in time window before the current one
12491243 minColIndex = colIndex - 1 ;
12501244 while (minColIndex >= 0 ) {
@@ -1325,12 +1319,6 @@ class EventSelectionModule
13251319 vNoHighMultCollInPrevRof[colIndex] = (totalFT0amplInPrevROF < evselOpts.confFT0CamplCutVetoOnCollInROF );
13261320
13271321 // ### occupancy in time windows
1328- // protection against TF borders
1329- if (!vIsFullInfoForOccupancy[colIndex]) { // occupancy in undefined (too close to TF borders)
1330- vNumTracksITS567inFullTimeWin[colIndex] = -1 ;
1331- vSumAmpFT0CinFullTimeWin[colIndex] = -1 ;
1332- continue ;
1333- }
13341322 std::vector<int > vAssocToThisCol = vCollsInTimeWin[colIndex];
13351323 std::vector<float > vCollsTimeDeltaWrtGivenColl = vTimeDeltaForColls[colIndex];
13361324 int nITS567tracksInFullTimeWindow = 0 ;
@@ -1341,41 +1329,43 @@ class EventSelectionModule
13411329 int colIndexFirstRejectedByTFborderCut = -1 ;
13421330 for (uint32_t iCol = 0 ; iCol < vAssocToThisCol.size (); iCol++) {
13431331 int thisColIndex = vAssocToThisCol[iCol];
1344- // check if we are close to TF borders => N ITS tracks is not reliable, and FT0C ampl will be used for occupancy estimation (a loop below)
1345- if (vIsCollRejectedByTFborderCut[thisColIndex]) {
1346- if (colIndexFirstRejectedByTFborderCut == -1 )
1347- colIndexFirstRejectedByTFborderCut = thisColIndex;
1348- continue ;
1349- }
13501332 float dt = vCollsTimeDeltaWrtGivenColl[iCol] / 1e3 ; // ns -> us
1351- float wOccup = 1 .;
1352- if (evselOpts.confUseWeightsForOccupancyVariable ) {
1353- // weighted occupancy
1354- wOccup = calcWeightForOccupancy (dt);
1355- }
13561333
13571334 // check if we are close to ITS ROF borders => N ITS tracks is not reliable, and FT0C ampl can be used for occupancy estimation
13581335 // denominator for vAmpFT0CperColl is the approximate conversion factor b/n FT0C ampl and number of PV tracks after cuts
13591336 int nItsTracksAssocColl = !vIsCollAtROFborder[thisColIndex] ? vTracksITS567perColl[thisColIndex] : vAmpFT0CperColl[thisColIndex] / 10 .;
1360-
1361- nITS567tracksInFullTimeWindow += wOccup * nItsTracksAssocColl;
1362- sumAmpFT0CInFullTimeWindow += wOccup * vAmpFT0CperColl[thisColIndex];
1363-
13641337 // counting tracks from other collisions in fixed time windows
13651338 if (std::fabs (dt) < evselOpts.confTimeRangeVetoOnCollNarrow )
13661339 nITS567tracksForVetoNarrow += nItsTracksAssocColl;
13671340 if (std::fabs (dt) < evselOpts.confTimeRangeVetoOnCollStrict )
13681341 nITS567tracksForVetoStrict += nItsTracksAssocColl;
13691342
1370- // standard cut on other collisions vs delta-times:
1371- // veto on high-mult collisions nearby, where artificial structures in the dt-occupancy plots are observed
1343+ // veto on high-mult collisions nearby, where artificial structures in the dt-occupancy plots are observed
13721344 if (dt > -4.0 && dt < 2.0 && vAmpFT0CperColl[thisColIndex] > evselOpts.confFT0CamplCutVetoOnCollInTimeRange ) { // dt in us // o2-linter: disable=magic-number
13731345 nCollsWithFT0CAboveVetoStandard++;
13741346 }
1347+
1348+ // check if we are close to TF borders => N ITS tracks is not reliable, and FT0C ampl will be used for occupancy estimation (a loop below)
1349+ if (vIsCollRejectedByTFborderCut[thisColIndex]) {
1350+ if (colIndexFirstRejectedByTFborderCut == -1 )
1351+ colIndexFirstRejectedByTFborderCut = thisColIndex;
1352+ continue ;
1353+ }
1354+
1355+ // weighted occupancy calc:
1356+ if (vIsFullInfoForOccupancy[colIndex]) {
1357+ float wOccup = 1 .;
1358+ if (evselOpts.confUseWeightsForOccupancyVariable ) {
1359+ // weighted occupancy
1360+ wOccup = calcWeightForOccupancy (dt);
1361+ }
1362+ nITS567tracksInFullTimeWindow += wOccup * nItsTracksAssocColl;
1363+ sumAmpFT0CInFullTimeWindow += wOccup * vAmpFT0CperColl[thisColIndex];
1364+ }
13751365 }
13761366
1377- // if some associated collisions are close to TF border - take FT0C amplitude instead of nTracks
1378- if (vCanHaveAssocCollsWithinLastDriftTime[colIndex] && colIndexFirstRejectedByTFborderCut >= 0 ) {
1367+ // if some associated collisions are close to TF border - take FT0C amplitude instead of nTracks, using BC table
1368+ if (vIsFullInfoForOccupancy[colIndex] && vCanHaveAssocCollsWithinLastDriftTime[colIndex] && colIndexFirstRejectedByTFborderCut >= 0 ) {
13791369 int64_t foundGlobalBC = vFoundGlobalBC[colIndex];
13801370 int64_t tfId = (foundGlobalBC - bcSOR) / nBCsPerTF;
13811371 std::map<int64_t , int32_t >::iterator it = mapGlobalBcWithTVX.find (vFoundGlobalBC[colIndexFirstRejectedByTFborderCut]);
@@ -1408,6 +1398,12 @@ class EventSelectionModule
14081398 }
14091399 }
14101400
1401+ // protection against TF borders
1402+ if (!vIsFullInfoForOccupancy[colIndex]) { // occupancy in undefined (too close to TF borders)
1403+ nITS567tracksInFullTimeWindow = -1 ;
1404+ sumAmpFT0CInFullTimeWindow = -1 ;
1405+ }
1406+
14111407 vNumTracksITS567inFullTimeWin[colIndex] = nITS567tracksInFullTimeWindow; // occupancy by a sum of number of ITS tracks (without a current collision)
14121408 vSumAmpFT0CinFullTimeWin[colIndex] = sumAmpFT0CInFullTimeWindow; // occupancy by a sum of FT0C amplitudes (without a current collision)
14131409 // occupancy flags based on nearby collisions
0 commit comments