SoLAr-Neutrinos / CLSim

Parametrized charge and light simulation
0 stars 0 forks source link

Multithread the Charge Simulation #1

Open TillDiem opened 2 years ago

TillDiem commented 2 years ago

Currently the charge simulation is a double nested for loop. This was necessary as we dont want to have a prior assumption on the placement of the detectors. To speed things up, the main part of the charge simulation can and should be multithreaded.

Explicitly its the loops starting at line 278 in the main analyze_light.cpp file.

Alternatively a rewrite of this section of the code is required.

In this go, the separate calling of gRandom in line 259 could be combined to one general call using RndmArray.

TillDiem commented 2 years ago

The mutlithread of the charge is done. Similar changed to be applied to the light simulation - see commit/merge message.

TillDiem commented 2 years ago

Reverted MT for charge. Seems overkill, as most time is wasted waiting to be allowed to write to the final vector. More clever version needed. Problem for the light sim is the not thread safe objects in the light-sim algorithm.