21 bool CompareTimes(
const std::pair<int, unsigned long long> &EventAndTime1,
22 const std::pair<int, unsigned long long> &EventAndTime2)
24 return EventAndTime1.second < EventAndTime2.second;
49 Panic(
"Invalid filename for temporary data. Filename must end in .root or .txt");
69 std::pair<int, unsigned long long> EventAndTime;
71 const QRawEvent& raw = ev->GetRawEvent();
72 QTime t = raw.GetTime();
73 int chan = raw.GetPulse().GetChannelId();
104 std::pair<int, unsigned long long> EventAndTime;
115 EventList[i] = (double)EventAndTime.first;
116 TimeList[i] = (
double)EventAndTime.second/1.0e6;
bool CompareTimes(const std::pair< int, unsigned long long > &EventAndTime1, const std::pair< int, unsigned long long > &EventAndTime2)
#define REGISTER_MODULE(clazz)
Module for sorting events by time.
int fNumberOfEvents
Number of sorted events.
std::map< int, unsigned int > fStartTime
Start time of run.
virtual Action Do(Diana::QEventAssembler &ev)
int fIteration
What iteration are we on?
std::map< int, std::vector< int > > fChannelVector
Vector of channel numbers.
std::string fOutputFilename
this is the name of the file where the sorted list is kept
std::map< int, std::vector< std::pair< int, unsigned long long > > > fEventVector
this is the name of the file where the sorted list is kept
virtual Action Done()
Done method is called after event loop.
int fIndex
An index to keep track of event.
const std::string & GetString(const std::string &parname, const std::string &defVal, bool warnCfg=true) const
Get a string parameter from config file ( see GetDouble() )
unsigned int GetIteration() const
Get Current sequence iteration.
void Error(const char *descr,...) const
Send an error message (an error that the framework cannot recover) with printf syntax.
void Panic(const char *descr,...) const
Send a panic message (stops the framework) with printf syntax.
bool GetBool(const std::string &parname, bool defVal, bool warnCfg=true) const
Get a bool parameter from config file ( see GetDouble() )
void SetRunAgain(bool b)
Set that the sequence will be reiterated.
error class with error type and description
unsigned int GetReadNumber() const
return the event number as read by the current reader.
Base class for diana modules.
Diana Reconstruction program.
unsigned long long GetFromStartRunNs() const
retrieve time from start of run in ns
time_t GetStartRunUnix() const
retrieve time of start of run in seconds from 1/1/1970