10 #include "TClonesArray.h"
13 #include <fairlogger/Logger.h>
20 int evtPresent = std::count(fEventsFilledInBuffer.begin(), fEventsFilledInBuffer.end(), evtIndex);
21 LOG(debug) <<
"Fill TClonesArray: CurrentTime " << t0Current <<
" Event " << evtIndex <<
" time: " << t0Event
22 <<
" is already present " << evtPresent;
23 if (evtPresent == 0) {
24 fEventsFilledInBuffer.push_back(evtIndex);
25 for (
int i = 0; i < geoArray->GetEntriesFast(); i++) {
26 TGeoTrack* track = (TGeoTrack*)geoArray->At(i)->Clone();
27 fTrackVector.push_back(std::make_pair(track, t0Event));
34 std::for_each(fTrackVector.begin(), fTrackVector.end(), [](std::pair<TGeoTrack*, double>
const& track) {
38 fEventsFilledInBuffer.clear();
43 if (fTrackVector.size() > 0) {
44 fTrackVector.erase(std::remove_if(fTrackVector.begin(),
46 [&](std::pair<TGeoTrack*, double>
const& track) {
48 track.first->GetLastPoint(x, y, z, t);
49 if (((t * 1e9) + track.second) < (newT0Time - fHoldTime)) {
void FillTClonesArray(TClonesArray *geoArray, int evtIndex, double t0Event, double t0Current)
void RemoveOldTracks(double newT0Time)