ToolDAQFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
DataOut Class Reference

#include <DataOut.h>

Inheritance diagram for DataOut:

Public Member Functions

 DataOut ()
 
bool Execute ()
 
bool Finalise ()
 
bool Initialise (std::string configfile, DataModel &data)
 

Private Types

enum  LogLevel {
  FATAL =-1, ERROR =0, WARN =1, INFO =2,
  DEBUG1 =3, DEBUG2 =4, DEBUG3 =5
}
 Log level enumerations. More...
 

Private Member Functions

void AddTruthInfo (WCSimRootEvent *wcsim_event, WCSimRootEvent *original_wcsim_event, const TimeDelta &time_shift)
 
void CreateSubEvents (WCSimRootEvent *wcsim_event)
 
void ExecuteSubDet (WCSimRootEvent *wcsim_event, std::vector< SubSample > &samples, WCSimRootEvent *original_wcsim_event=0)
 Runs other methods to take information from the DataModel and create/populate the WCSimRootEvent. More...
 
void FillHits (WCSimRootEvent *wcsim_event, std::vector< SubSample > &samples)
 
void FinaliseSubEvents (WCSimRootEvent *wcsim_event)
 
TimeDelta GetOffset (WCSimRootEvent *original_wcsim_event=0)
 
void StreamToLog (int level)
 

Private Attributes

TriggerInfom_all_triggers
 Combined list of triggers from all sources (ID+OD) More...
 
int m_event_num
 Current event number. More...
 
TTree * m_event_tree
 Tree contain WCSimRootEvent(s), and the original WCSim filename / event number. More...
 
WCSimRootEvent * m_id_wcsimevent_triggered
 Output ROOT event structure for ID. More...
 
WCSimRootEvent * m_od_wcsimevent_triggered
 Output ROOT event structure for OD. More...
 
TFile * m_output_file
 Output ROOT file. More...
 
std::string m_output_filename
 Output ROOT filename that this tool RECREATE's. More...
 
bool m_save_multiple_hits_per_trigger
 If false, only 1 hit is allowed to be saved per trigger, rather than all hits from that trigger. More...
 
bool m_save_only_failed_hits
 If true, saves hits that failed the trigger, rather those that passed. More...
 
std::stringstream m_ss
 For easy formatting of Log messages. More...
 
util::Stopwatchm_stopwatch
 The stopwatch, if we're using one. More...
 
std::string m_stopwatch_file
 Image filename to save the histogram to, if required. More...
 
TimeDelta m_trigger_offset
 A time used to offset all hit times. Set by config file. More...
 
int m_verbose
 Verbosity level, as defined in tool parameter file. More...
 

Detailed Description

Definition at line 19 of file DataOut.h.

Member Enumeration Documentation

enum DataOut::LogLevel
private

Log level enumerations.

Enumerator
FATAL 
ERROR 
WARN 
INFO 
DEBUG1 
DEBUG2 
DEBUG3 

Definition at line 94 of file DataOut.h.

Constructor & Destructor Documentation

DataOut::DataOut ( )

Definition at line 3 of file DataOut.cpp.

Member Function Documentation

void DataOut::AddTruthInfo ( WCSimRootEvent *  wcsim_event,
WCSimRootEvent *  original_wcsim_event,
const TimeDelta time_shift 
)
private

If this is an MC file, we also need to add

  • true tracks
  • true hits

Definition at line 272 of file DataOut.cpp.

void DataOut::CreateSubEvents ( WCSimRootEvent *  wcsim_event)
private

If there are multiple triggers in the event, create subevents (i.e. new WCSimRootTrigger's) in the WCSimRootEvent Also sets the time correctly

Definition at line 185 of file DataOut.cpp.

bool DataOut::Execute ( )

Definition at line 111 of file DataOut.cpp.

void DataOut::ExecuteSubDet ( WCSimRootEvent *  wcsim_event,
std::vector< SubSample > &  samples,
WCSimRootEvent *  original_wcsim_event = 0 
)
private

Runs other methods to take information from the DataModel and create/populate the WCSimRootEvent.

Definition at line 155 of file DataOut.cpp.

void DataOut::FillHits ( WCSimRootEvent *  wcsim_event,
std::vector< SubSample > &  samples 
)
private

For every hit, if it's in a trigger window, add it to the appropriate WCSimRootTrigger in the WCSimRootEvent

Definition at line 231 of file DataOut.cpp.

bool DataOut::Finalise ( )

Definition at line 409 of file DataOut.cpp.

void DataOut::FinaliseSubEvents ( WCSimRootEvent *  wcsim_event)
private

Definition at line 384 of file DataOut.cpp.

TimeDelta DataOut::GetOffset ( WCSimRootEvent *  original_wcsim_event = 0)
private

Definition at line 205 of file DataOut.cpp.

bool DataOut::Initialise ( std::string  configfile,
DataModel data 
)

Definition at line 6 of file DataOut.cpp.

void DataOut::StreamToLog ( int  level)
inlineprivate

Print the current value of the streamer at the set log level, then clear the streamer

Definition at line 88 of file DataOut.h.

Member Data Documentation

TriggerInfo* DataOut::m_all_triggers
private

Combined list of triggers from all sources (ID+OD)

Definition at line 63 of file DataOut.h.

int DataOut::m_event_num
private

Current event number.

Definition at line 68 of file DataOut.h.

TTree* DataOut::m_event_tree
private

Tree contain WCSimRootEvent(s), and the original WCSim filename / event number.

Definition at line 56 of file DataOut.h.

WCSimRootEvent* DataOut::m_id_wcsimevent_triggered
private

Output ROOT event structure for ID.

Definition at line 58 of file DataOut.h.

WCSimRootEvent* DataOut::m_od_wcsimevent_triggered
private

Output ROOT event structure for OD.

Definition at line 60 of file DataOut.h.

TFile* DataOut::m_output_file
private

Output ROOT file.

Definition at line 54 of file DataOut.h.

std::string DataOut::m_output_filename
private

Output ROOT filename that this tool RECREATE's.

Definition at line 52 of file DataOut.h.

bool DataOut::m_save_multiple_hits_per_trigger
private

If false, only 1 hit is allowed to be saved per trigger, rather than all hits from that trigger.

Definition at line 73 of file DataOut.h.

bool DataOut::m_save_only_failed_hits
private

If true, saves hits that failed the trigger, rather those that passed.

Definition at line 71 of file DataOut.h.

std::stringstream DataOut::m_ss
private

For easy formatting of Log messages.

Definition at line 84 of file DataOut.h.

util::Stopwatch* DataOut::m_stopwatch
private

The stopwatch, if we're using one.

Definition at line 76 of file DataOut.h.

std::string DataOut::m_stopwatch_file
private

Image filename to save the histogram to, if required.

Definition at line 78 of file DataOut.h.

TimeDelta DataOut::m_trigger_offset
private

A time used to offset all hit times. Set by config file.

Definition at line 65 of file DataOut.h.

int DataOut::m_verbose
private

Verbosity level, as defined in tool parameter file.

Definition at line 81 of file DataOut.h.


The documentation for this class was generated from the following files: