REST-for-Physics
v2.3
Rare Event Searches ToolKit for Physics
|
A base class for any REST event.
TRestEvent is one of the core classes of REST. Absract class from which all REST "event classes" must derive. REST event classes represent the different holders to store specific event data. TRestEvent contains common data members to all type of events, as it is the timestamp. or the references to the event belongs to, as run and subrun numbers. It contains virtual functions that must be implemented in derived classes like Initialize(), PrintEvent() or DrawEvent().
RESTsoft - Software for Rare Event Searches with TPCs
History of developments:
2014-june: First concept. As part of conceptualization of previous REST code (REST v2) Igor G. Irastorza
Definition at line 38 of file TRestEvent.h.
#include <TRestEvent.h>
Public Member Functions | |
virtual void | CloneTo (TRestEvent *target) |
Clone the content of this TRestEvent object to another. More... | |
virtual TPad * | DrawEvent (const TString &option="") |
Draw the event. More... | |
Int_t | GetID () const |
Int_t | GetRunOrigin () const |
TString | GetSubEventTag () const |
Int_t | GetSubID () const |
Int_t | GetSubRunOrigin () const |
Double_t | GetTime () const |
TTimeStamp | GetTimeStamp () const |
virtual void | Initialize ()=0 |
virtual void | InitializeReferences (TRestRun *run) |
Initialize dynamical references when loading the event from a root file. More... | |
virtual void | InitializeWithMetadata (TRestRun *run) |
Bool_t | isOk () const |
virtual void | PrintEvent () const |
void | SetEventInfo (TRestEvent *eve) |
void | SetID (Int_t id) |
void | SetOK (Bool_t state) |
void | SetRunOrigin (Int_t run_origin) |
void | SetState (Bool_t state) |
void | SetSubEventTag (const TString &tag) |
void | SetSubID (Int_t id) |
void | SetSubRunOrigin (Int_t sub_run_origin) |
void | SetTime (Double_t seconds, Double_t nanoseconds) |
void | SetTime (Double_t time) |
void | SetTimeStamp (const TTimeStamp &time) |
TRestEvent () | |
virtual | ~TRestEvent () |
Protected Member Functions | |
void | RestartPad (Int_t nElements) |
Protected Attributes | |
Int_t | fEventID |
Event identification number. | |
TTimeStamp | fEventTime |
Absolute event time. | |
Bool_t | fOk |
Flag to be used by processes to define an event status. fOk=true is the default. | |
TPad * | fPad |
TRestRun * | fRun = nullptr |
Int_t | fRunOrigin |
Run ID number of the event. | |
Int_t | fSubEventID |
Sub-Event identification number. | |
TString | fSubEventTag |
A short length label to identify the sub-Event. | |
Int_t | fSubRunOrigin |
Sub-run ID number of the event. | |
TRestEvent::TRestEvent | ( | ) |
TRestEvent default constructor
Definition at line 61 of file TRestEvent.cxx.
|
virtual |
TRestEvent default destructor
Definition at line 66 of file TRestEvent.cxx.
|
virtual |
Clone the content of this TRestEvent object to another.
This method uses default root streamer to do the copying. The efficiency is low. Override recommended.
Definition at line 98 of file TRestEvent.cxx.
|
inlinevirtual |
Draw the event.
To be implemented in the derived class
Reimplemented in TRestGeant4Event, TRestTrackEvent, TRestRawSignalEvent, TRestDetectorSignalEvent, and TRestDetectorHitsEvent.
Definition at line 103 of file TRestEvent.h.
|
pure virtual |
Run to initialize event data. To be re-implemented in derived class, you may want to call the base class at the end of the re-implemented, by calling TRestEvent::Initialize();
Implemented in TRestGeant4Event, TRestTrackEvent, TRestRawSignalEvent, TRestDetectorSignalEvent, TRestDetectorHitsEvent, and TRestAxionEvent.
Definition at line 73 of file TRestEvent.cxx.
|
virtual |
Initialize dynamical references when loading the event from a root file.
This method should only be called from TRestRun::GetEntry
and it will give the corresponding TRestEvent
access to the instance of TRestRun
. In a derived class such as TRestGeant4Event
, it can be overwritten to give each track access to the event
Reimplemented in TRestGeant4Event.
Definition at line 175 of file TRestEvent.cxx.
|
virtual |
Run to print event data info on console To be re-implemented in derived class. You may want to call the base class inside the re-implemented one, by calling TRestEvent::PrintEvent();
Reimplemented in TRestDetectorHitsEvent.
Definition at line 187 of file TRestEvent.cxx.
void TRestEvent::SetEventInfo | ( | TRestEvent * | eve | ) |
Copy the six universal information in TRestEvent from another TRestEvent
Definition at line 137 of file TRestEvent.cxx.
void TRestEvent::SetTime | ( | Double_t | seconds, |
Double_t | nanoseconds | ||
) |
Set the time of the event
Definition at line 129 of file TRestEvent.cxx.
void TRestEvent::SetTime | ( | Double_t | time | ) |
Set the time of the event
Definition at line 85 of file TRestEvent.cxx.