-
Notifications
You must be signed in to change notification settings - Fork 496
Expand file tree
/
Copy pathtrigger_mpi.C
More file actions
28 lines (25 loc) · 840 Bytes
/
trigger_mpi.C
File metadata and controls
28 lines (25 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// MPI trigger
//
// usage: o2sim --trigger external --configKeyValues 'TriggerExternal.fileName=trigger_mpi.C;TriggerExternal.funcName="trigger_mpi()"'
//
/// \author R+Preghenella - February 2020
#include "Generators/Trigger.h"
#include "Pythia8/Pythia.h"
#include "TPythia6.h"
#include "FairLogger.h"
o2::eventgen::DeepTrigger
trigger_mpi(int mpiMin = 15)
{
return [mpiMin](void* interface, std::string name) -> bool {
int nMPI = 0;
if (!name.compare("pythia8")) {
auto py8 = reinterpret_cast<Pythia8::Pythia*>(interface);
nMPI = py8->info.nMPI();
} else if (!name.compare("pythia6")) {
auto py6 = reinterpret_cast<TPythia6*>(interface);
nMPI = py6->GetMSTI(31);
} else
LOG(FATAL) << "Cannot define MPI for generator interface \'" << name << "\'";
return nMPI >= mpiMin;
};
}