The gas gain was calculated by single thread and multiple threads.
The mean gain by 1000 events from single thread is 315,
but, the mean gain is 23 from multiple threads.
the key codes are:
#pragma omp parallel for
for(int event=0;event<EventNumber;event++)
{
AvalancheMicroscopic aval(&sensor);
aval.AvalancheElectron(x0, y0, z0, t0, e0);
ElectronNumber[event]=aval.GetNumberOfElectronEndpoints();
}
for(int i=0;i<EventNumber;i++)
{
TotalElectronNumber+=ElectronNumber[i];
}
what is the wrong thing with the codes?