|
24 | 24 | #include <TVector2.h> |
25 | 25 | #include <TVector3.h> |
26 | 26 | #include "TGrid.h" |
| 27 | +#include <random> |
27 | 28 |
|
28 | 29 | #include "CCDB/BasicCCDBManager.h" |
29 | 30 | #include "CCDB/CcdbApi.h" |
@@ -93,6 +94,8 @@ struct AntinucleiInJets { |
93 | 94 | // track parameters |
94 | 95 | Configurable<bool> requirePvContributor{"requirePvContributor", false, "require that the track is a PV contributor"}; |
95 | 96 | Configurable<bool> applyItsPid{"applyItsPid", true, "apply ITS PID"}; |
| 97 | + Configurable<bool> rejectEvents{"rejectEvents", false, "reject some events"}; |
| 98 | + Configurable<int> rejectionPercentage{"rejectionPercentage", 3, "percentage of events to reject"}; |
96 | 99 | Configurable<int> minItsNclusters{"minItsNclusters", 5, "minimum number of ITS clusters"}; |
97 | 100 | Configurable<int> minTpcNcrossedRows{"minTpcNcrossedRows", 80, "minimum number of TPC crossed pad rows"}; |
98 | 101 | Configurable<double> minTpcNcrossedRowsOverFindable{"minTpcNcrossedRowsOverFindable", 0.8, "crossed rows/findable"}; |
@@ -440,9 +443,24 @@ struct AntinucleiInJets { |
440 | 443 | LOGP(info, "Opened histogram {}", Form("%s_antiproton", histname_antip_ue.Data())); |
441 | 444 | } |
442 | 445 |
|
| 446 | + bool shouldRejectEvent() |
| 447 | + { |
| 448 | + static std::random_device rd; |
| 449 | + static std::mt19937 gen(rd()); |
| 450 | + static std::uniform_int_distribution<> dis(0, 99); |
| 451 | + int randomNumber = dis(gen); |
| 452 | + if (randomNumber <= rejectionPercentage) { |
| 453 | + return false; |
| 454 | + } |
| 455 | + return true; |
| 456 | + } |
| 457 | + |
443 | 458 | // Process Data |
444 | 459 | void processData(SelectedCollisions::iterator const& collision, FullNucleiTracks const& tracks) |
445 | 460 | { |
| 461 | + if (rejectEvents && shouldRejectEvent()) |
| 462 | + return; |
| 463 | + |
446 | 464 | // event counter: before event selection |
447 | 465 | registryData.fill(HIST("number_of_events_data"), 0.5); |
448 | 466 |
|
@@ -1198,6 +1216,9 @@ struct AntinucleiInJets { |
1198 | 1216 | // Process Systematics |
1199 | 1217 | void processSystematicsData(SelectedCollisions::iterator const& collision, FullNucleiTracks const& tracks) |
1200 | 1218 | { |
| 1219 | + if (rejectEvents && shouldRejectEvent()) |
| 1220 | + return; |
| 1221 | + |
1201 | 1222 | const int nSystematics = 10; |
1202 | 1223 | int itsNclustersSyst[nSystematics] = {5, 6, 5, 4, 5, 3, 5, 6, 3, 4}; |
1203 | 1224 | float tpcNcrossedRowsSyst[nSystematics] = {100, 85, 80, 110, 95, 90, 105, 95, 100, 105}; |
|
0 commit comments