Skip to content

Commit 01283ad

Browse files
[PWGJE] [EMCAL] fix zorro event selection in emc correction framework (#15047)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 7f6225c commit 01283ad

File tree

1 file changed

+33
-44
lines changed

1 file changed

+33
-44
lines changed

PWGJE/TableProducer/emcalCorrectionTask.cxx

Lines changed: 33 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -410,12 +410,6 @@ struct EmcalCorrectionTask {
410410

411411
initZorroCCDB(bc);
412412

413-
if (applySoftwareTriggerSelection) {
414-
if (!zorro.isSelected(bc.globalBC())) {
415-
continue;
416-
}
417-
}
418-
419413
// get run number
420414
runNumber = bc.runNumber();
421415

@@ -441,6 +435,14 @@ struct EmcalCorrectionTask {
441435
}
442436
// Counters for BCs with matched collisions
443437
countBC(collisionsInFoundBC.size(), true);
438+
439+
// do not do the next part if we do not fulfill the software trigger selection
440+
if (applySoftwareTriggerSelection) {
441+
if (!zorro.isSelected(bc.globalBC())) {
442+
continue;
443+
}
444+
}
445+
444446
std::vector<o2::emcal::Cell> cellsBC;
445447
std::vector<int64_t> cellIndicesBC;
446448
for (const auto& cell : cellsInBC) {
@@ -525,12 +527,8 @@ struct EmcalCorrectionTask {
525527
} // end of bc loop
526528

527529
// Loop through all collisions and fill emcalcollisionmatch with a boolean stating, whether the collision was ambiguous (not the only collision in its BC)
530+
// NOTE: we can not do zorro selection here since emcalcollisionmatch needs to alway be filled to be joinable with collision table
528531
for (const auto& collision : collisions) {
529-
if (applySoftwareTriggerSelection) {
530-
if (!zorro.isSelected(collision.foundBC_as<BcEvSels>().globalBC())) {
531-
continue;
532-
}
533-
}
534532
auto globalbcid = collision.foundBC_as<BcEvSels>().globalIndex();
535533
auto foundColls = numberCollsInBC.find(globalbcid);
536534
auto foundCells = numberCellsInBC.find(globalbcid);
@@ -559,12 +557,6 @@ struct EmcalCorrectionTask {
559557

560558
initZorroCCDB(bc);
561559

562-
if (applySoftwareTriggerSelection) {
563-
if (!zorro.isSelected(bc.globalBC())) {
564-
continue;
565-
}
566-
}
567-
568560
// get run number
569561
runNumber = bc.runNumber();
570562

@@ -590,6 +582,14 @@ struct EmcalCorrectionTask {
590582
}
591583
// Counters for BCs with matched collisions
592584
countBC(collisionsInFoundBC.size(), true);
585+
586+
// do not do the next part if we do not fulfill the software trigger selection
587+
if (applySoftwareTriggerSelection) {
588+
if (!zorro.isSelected(bc.globalBC())) {
589+
continue;
590+
}
591+
}
592+
593593
std::vector<o2::emcal::Cell> cellsBC;
594594
std::vector<int64_t> cellIndicesBC;
595595
for (const auto& cell : cellsInBC) {
@@ -678,12 +678,8 @@ struct EmcalCorrectionTask {
678678
} // end of bc loop
679679

680680
// Loop through all collisions and fill emcalcollisionmatch with a boolean stating, whether the collision was ambiguous (not the only collision in its BC)
681+
// NOTE: we can not do zorro selection here since emcalcollisionmatch needs to alway be filled to be joinable with collision table
681682
for (const auto& collision : collisions) {
682-
if (applySoftwareTriggerSelection) {
683-
if (!zorro.isSelected(collision.foundBC_as<BcEvSels>().globalBC())) {
684-
continue;
685-
}
686-
}
687683
auto globalbcid = collision.foundBC_as<BcEvSels>().globalIndex();
688684
auto foundColls = numberCollsInBC.find(globalbcid);
689685
auto foundCells = numberCellsInBC.find(globalbcid);
@@ -714,12 +710,6 @@ struct EmcalCorrectionTask {
714710

715711
initZorroCCDB(bc);
716712

717-
if (applySoftwareTriggerSelection) {
718-
if (!zorro.isSelected(bc.globalBC())) {
719-
continue;
720-
}
721-
}
722-
723713
// get run number
724714
runNumber = bc.runNumber();
725715

@@ -737,6 +727,14 @@ struct EmcalCorrectionTask {
737727
}
738728
// Counters for BCs with matched collisions
739729
countBC(collisionsInFoundBC.size(), true);
730+
731+
// do not do the next part if we do not fulfill the software trigger selection
732+
if (applySoftwareTriggerSelection) {
733+
if (!zorro.isSelected(bc.globalBC())) {
734+
continue;
735+
}
736+
}
737+
740738
std::vector<o2::emcal::Cell> cellsBC;
741739
std::vector<int64_t> cellIndicesBC;
742740
std::vector<o2::emcal::CellLabel> cellLabels;
@@ -860,11 +858,6 @@ struct EmcalCorrectionTask {
860858

861859
// Loop through all collisions and fill emcalcollisionmatch with a boolean stating, whether the collision was ambiguous (not the only collision in its BC)
862860
for (const auto& collision : collisions) {
863-
if (applySoftwareTriggerSelection) {
864-
if (!zorro.isSelected(collision.foundBC_as<BcEvSels>().globalBC())) {
865-
continue;
866-
}
867-
}
868861
auto globalbcid = collision.foundBC_as<BcEvSels>().globalIndex();
869862
auto foundColls = numberCollsInBC.find(globalbcid);
870863
auto foundCells = numberCellsInBC.find(globalbcid);
@@ -895,12 +888,6 @@ struct EmcalCorrectionTask {
895888

896889
initZorroCCDB(bc);
897890

898-
if (applySoftwareTriggerSelection) {
899-
if (!zorro.isSelected(bc.globalBC())) {
900-
continue;
901-
}
902-
}
903-
904891
// get run number
905892
runNumber = bc.runNumber();
906893

@@ -918,6 +905,13 @@ struct EmcalCorrectionTask {
918905
}
919906
// Counters for BCs with matched collisions
920907
countBC(collisionsInFoundBC.size(), true);
908+
909+
if (applySoftwareTriggerSelection) {
910+
if (!zorro.isSelected(bc.globalBC())) {
911+
continue;
912+
}
913+
}
914+
921915
std::vector<o2::emcal::Cell> cellsBC;
922916
std::vector<int64_t> cellIndicesBC;
923917
std::vector<o2::emcal::CellLabel> cellLabels;
@@ -1045,11 +1039,6 @@ struct EmcalCorrectionTask {
10451039

10461040
// Loop through all collisions and fill emcalcollisionmatch with a boolean stating, whether the collision was ambiguous (not the only collision in its BC)
10471041
for (const auto& collision : collisions) {
1048-
if (applySoftwareTriggerSelection) {
1049-
if (!zorro.isSelected(collision.foundBC_as<BcEvSels>().globalBC())) {
1050-
continue;
1051-
}
1052-
}
10531042
auto globalbcid = collision.foundBC_as<BcEvSels>().globalIndex();
10541043
auto foundColls = numberCollsInBC.find(globalbcid);
10551044
auto foundCells = numberCellsInBC.find(globalbcid);

0 commit comments

Comments
 (0)