|
17 | 17 | #include <algorithm> |
18 | 18 | #include "Framework/runDataProcessing.h" |
19 | 19 | #include "Framework/AnalysisTask.h" |
| 20 | +#include "ReconstructionDataFormats/Vertex.h" |
20 | 21 | #include "PWGUD/DataModel/UDTables.h" |
21 | 22 | #include "PWGUD/Core/UDHelpers.h" |
22 | 23 | #include "PWGUD/Core/UPCHelpers.h" |
@@ -279,11 +280,11 @@ struct DGBCCandProducer { |
279 | 280 |
|
280 | 281 | // update UDTables |
281 | 282 | template <typename TTracks> |
282 | | - void updateUDTables(bool onlyPV, int64_t colID, uint64_t bcnum, int rnum, float vx, float vy, float vz, |
| 283 | + void updateUDTables(bool onlyPV, int64_t colID, uint64_t bcnum, int rnum, float vx, float vy, float vz, int flag, |
283 | 284 | uint16_t const& ntrks, int8_t const& ncharge, float const& rtrwTOF, |
284 | 285 | TTracks const& tracks, upchelpers::FITInfo const& fitInfo) |
285 | 286 | { |
286 | | - outputCollisions(bcnum, rnum, vx, vy, vz, ntrks, ncharge, rtrwTOF); |
| 287 | + outputCollisions(bcnum, rnum, vx, vy, vz, flag, ntrks, ncharge, rtrwTOF); |
287 | 288 | outputCollisionsSels(fitInfo.ampFT0A, fitInfo.ampFT0C, fitInfo.timeFT0A, fitInfo.timeFT0C, |
288 | 289 | fitInfo.triggerMaskFT0, |
289 | 290 | fitInfo.ampFDDA, fitInfo.ampFDDC, fitInfo.timeFDDA, fitInfo.timeFDDC, |
@@ -383,7 +384,7 @@ struct DGBCCandProducer { |
383 | 384 |
|
384 | 385 | // check if DG event |
385 | 386 | // distinguish between cases with and without associated BC |
386 | | - // 1. candidate has associated BC and associated collision -> vertex position: col.[posX(), posY(), posZ()] |
| 387 | + // 1. candidate has associated BC and associated collision -> position: col.[posX(), posY(), posZ()] |
387 | 388 | // 2. candidate has associated BC but no associated collision -> [-2., 2., -2.] |
388 | 389 | // 3. candidate has no associated BC -> [-3., 3., -3.] |
389 | 390 | int isDG = -1; |
@@ -415,8 +416,11 @@ struct DGBCCandProducer { |
415 | 416 | registry.get<TH1>(HIST("table/candCase"))->Fill(1, 1.); |
416 | 417 | rtrwTOF = udhelpers::rPVtrwTOF<true>(colTracks, col.numContrib()); |
417 | 418 | nCharge = udhelpers::netCharge<true>(colTracks); |
418 | | - |
419 | | - updateUDTables(false, col.globalIndex(), bc.globalBC(), bc.runNumber(), col.posX(), col.posY(), col.posZ(), |
| 419 | + int upc_flag = 0; |
| 420 | + ushort flags = col.flags(); |
| 421 | + if (flags & dataformats::Vertex<o2::dataformats::TimeStamp<int>>::Flags::UPCMode) |
| 422 | + upc_flag = 1; |
| 423 | + updateUDTables(false, col.globalIndex(), bc.globalBC(), bc.runNumber(), col.posX(), col.posY(), col.posZ(), upc_flag, |
420 | 424 | col.numContrib(), nCharge, rtrwTOF, colTracks, fitInfo); |
421 | 425 | } |
422 | 426 | } else { |
@@ -448,7 +452,7 @@ struct DGBCCandProducer { |
448 | 452 | rtrwTOF = udhelpers::rPVtrwTOF<false>(tracksArray, tracksArray.size()); |
449 | 453 | nCharge = udhelpers::netCharge<false>(tracksArray); |
450 | 454 |
|
451 | | - updateUDTables(false, -1, bc.globalBC(), bc.runNumber(), -2., 2., -2, |
| 455 | + updateUDTables(false, -1, bc.globalBC(), bc.runNumber(), -2., 2., -2, 0, |
452 | 456 | tracksArray.size(), nCharge, rtrwTOF, tracksArray, fitInfo); |
453 | 457 | } |
454 | 458 | } |
@@ -494,7 +498,7 @@ struct DGBCCandProducer { |
494 | 498 | rtrwTOF = udhelpers::rPVtrwTOF<false>(tracksArray, tracksArray.size()); |
495 | 499 | nCharge = udhelpers::netCharge<false>(tracksArray); |
496 | 500 |
|
497 | | - updateUDTables(false, -1, bcnum, tibc.runNumber(), -3., 3., -3, |
| 501 | + updateUDTables(false, -1, bcnum, tibc.runNumber(), -3., 3., -3, 0, |
498 | 502 | tracksArray.size(), nCharge, rtrwTOF, tracksArray, fitInfo); |
499 | 503 | } |
500 | 504 | } |
@@ -612,7 +616,11 @@ struct DGBCCandProducer { |
612 | 616 | auto rtrwTOF = udhelpers::rPVtrwTOF<true>(colTracks, col.numContrib()); |
613 | 617 | auto nCharge = udhelpers::netCharge<true>(colTracks); |
614 | 618 | udhelpers::getFITinfo(fitInfo, bc, bcs, ft0s, fv0as, fdds); |
615 | | - updateUDTables(false, col.globalIndex(), bcnum, bc.runNumber(), col.posX(), col.posY(), col.posZ(), |
| 619 | + int upc_flag = 0; |
| 620 | + ushort flags = col.flags(); |
| 621 | + if (flags & dataformats::Vertex<o2::dataformats::TimeStamp<int>>::Flags::UPCMode) |
| 622 | + upc_flag = 1; |
| 623 | + updateUDTables(false, col.globalIndex(), bcnum, bc.runNumber(), col.posX(), col.posY(), col.posZ(), upc_flag, |
616 | 624 | col.numContrib(), nCharge, rtrwTOF, colTracks, fitInfo); |
617 | 625 | // fill UDZdcs |
618 | 626 | if (bc.has_zdc()) { |
@@ -681,7 +689,11 @@ struct DGBCCandProducer { |
681 | 689 | } |
682 | 690 |
|
683 | 691 | int64_t colID = withCollision ? col.globalIndex() : -1; |
684 | | - updateUDTables(false, colID, bcnum, tibc.runNumber(), vpos[0], vpos[1], vpos[2], |
| 692 | + int upc_flag = 0; |
| 693 | + ushort flags = col.flags(); |
| 694 | + if (flags & dataformats::Vertex<o2::dataformats::TimeStamp<int>>::Flags::UPCMode) |
| 695 | + upc_flag = 1; |
| 696 | + updateUDTables(false, colID, bcnum, tibc.runNumber(), vpos[0], vpos[1], vpos[2], upc_flag, |
685 | 697 | tracksArray.size(), nCharge, rtrwTOF, tracksArray, fitInfo); |
686 | 698 | // fill UDZdcs |
687 | 699 | if (bc.globalBC() == bcnum) { |
|
0 commit comments