|
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"}; |
@@ -367,7 +370,7 @@ struct AntinucleiInJets { |
367 | 370 | return false; |
368 | 371 | if (std::fabs(track.dcaZ()) > 2.0) |
369 | 372 | return false; |
370 | | - return true; |
| 373 | + return false; |
371 | 374 | } |
372 | 375 |
|
373 | 376 | // single-track selection |
@@ -440,9 +443,23 @@ 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()) return; |
| 462 | + |
446 | 463 | // event counter: before event selection |
447 | 464 | registryData.fill(HIST("number_of_events_data"), 0.5); |
448 | 465 |
|
@@ -1198,6 +1215,8 @@ struct AntinucleiInJets { |
1198 | 1215 | // Process Systematics |
1199 | 1216 | void processSystematicsData(SelectedCollisions::iterator const& collision, FullNucleiTracks const& tracks) |
1200 | 1217 | { |
| 1218 | + if(rejectEvents && shouldRejectEvent()) return; |
| 1219 | + |
1201 | 1220 | const int nSystematics = 10; |
1202 | 1221 | int itsNclustersSyst[nSystematics] = {5, 6, 5, 4, 5, 3, 5, 6, 3, 4}; |
1203 | 1222 | float tpcNcrossedRowsSyst[nSystematics] = {100, 85, 80, 110, 95, 90, 105, 95, 100, 105}; |
|
0 commit comments