/home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/gen/include/RAT/GLG4GenList.hh Source File

Ratpac-two: /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/gen/include/RAT/GLG4GenList.hh Source File
Ratpac-two
GLG4GenList.hh
1 #ifndef __GLG4GenList_h__
2 #define __GLG4GenList_h__
3 
4 #include <queue>
5 
6 #include "GLG4Gen.hh"
7 
9  public:
10  bool operator()(const GLG4Gen *a, const GLG4Gen *b) const {
11  // use greater than because priority queue top() returns the
12  // element x for which Compare(x, y) == false for all y
13  return a->NextTime() > b->NextTime();
14  };
15 };
16 
17 class GLG4GenList : public std::priority_queue<GLG4Gen *, std::vector<GLG4Gen *>, TimeOrder_GLG4Gen> {
18  public:
19  inline void SubtractTime(double time) {
20  for (std::vector<GLG4Gen *>::iterator i = c.begin(); i != c.end(); i++) (*i)->SubtractTime(time);
21  };
22  inline void clear(void) { c.clear(); };
23 };
24 
25 #endif
Definition: GLG4GenList.hh:17
Definition: GLG4Gen.hh:14
Definition: GLG4GenList.hh:8