testdockerwcsim / XTriggerApplication

Other
2 stars 3 forks source link

Allocate a sensible default size for m_time_int #58

Open tdealtry opened 4 years ago

tdealtry commented 4 years ago

Thinking ahead to memory fragmentation and tools running for days at a time... m_time_int is a vector used in NHits & TestVertices to take a SubSample's (nominally double) times and convert them to an int. In order to prevent memory fragmentation (and for speed), it's a good idea to allocate as much memory as required in the Initalise() method, so that the vector isn't moved around in memory multiple times as it sees larger and larger SubSamples

Studies should be done on an appropriate value - but having the SubSample width used by PrepareSubSamples available in the data model would be useful (so you can potentially do something like 1.5 * average_dark_noise_rate_in_subsample_width)