REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Public Member Functions | Protected Member Functions | Protected Attributes
TRestEvent Class Referenceabstract

Detailed Description

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>

Inheritance diagram for TRestEvent:
TRestAxionEvent TRestDetectorHitsEvent TRestDetectorSignalEvent TRestGeant4Event TRestRawSignalEvent TRestTrackEvent

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. More...
 
TTimeStamp fEventTime
 Absolute event time. More...
 
Bool_t fOk
 Flag to be used by processes to define an event status. fOk=true is the default. More...
 
TPad * fPad
 
TRestRunfRun = nullptr
 
Int_t fRunOrigin
 Run ID number of the event. More...
 
Int_t fSubEventID
 Sub-Event identification number. More...
 
TString fSubEventTag
 A short length label to identify the sub-Event. More...
 
Int_t fSubRunOrigin
 Sub-run ID number of the event. More...
 

Constructor & Destructor Documentation

◆ TRestEvent()

TRestEvent::TRestEvent ( )

TRestEvent default constructor

Definition at line 61 of file TRestEvent.cxx.

◆ ~TRestEvent()

TRestEvent::~TRestEvent ( )
virtual

TRestEvent default destructor

Definition at line 66 of file TRestEvent.cxx.

Member Function Documentation

◆ CloneTo()

void TRestEvent::CloneTo ( TRestEvent target)
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.

◆ DrawEvent()

virtual TPad * TRestEvent::DrawEvent ( const TString &  option = "")
inlinevirtual

Draw the event.

To be implemented in the derived class

Reimplemented in TRestDetectorHitsEvent, TRestDetectorSignalEvent, TRestRawSignalEvent, TRestTrackEvent, and TRestGeant4Event.

Definition at line 103 of file TRestEvent.h.

◆ GetID()

Int_t TRestEvent::GetID ( ) const
inline

Definition at line 73 of file TRestEvent.h.

◆ GetRunOrigin()

Int_t TRestEvent::GetRunOrigin ( ) const
inline

Definition at line 77 of file TRestEvent.h.

◆ GetSubEventTag()

TString TRestEvent::GetSubEventTag ( ) const
inline

Definition at line 75 of file TRestEvent.h.

◆ GetSubID()

Int_t TRestEvent::GetSubID ( ) const
inline

Definition at line 74 of file TRestEvent.h.

◆ GetSubRunOrigin()

Int_t TRestEvent::GetSubRunOrigin ( ) const
inline

Definition at line 78 of file TRestEvent.h.

◆ GetTime()

Double_t TRestEvent::GetTime ( ) const
inline

Definition at line 80 of file TRestEvent.h.

◆ GetTimeStamp()

TTimeStamp TRestEvent::GetTimeStamp ( ) const
inline

Definition at line 81 of file TRestEvent.h.

◆ Initialize()

void TRestEvent::Initialize ( )
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 TRestAxionEvent, TRestDetectorHitsEvent, TRestDetectorSignalEvent, TRestRawSignalEvent, TRestTrackEvent, and TRestGeant4Event.

Definition at line 73 of file TRestEvent.cxx.

◆ InitializeReferences()

void TRestEvent::InitializeReferences ( TRestRun run)
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.

◆ InitializeWithMetadata()

void TRestEvent::InitializeWithMetadata ( TRestRun run)
virtual

Definition at line 173 of file TRestEvent.cxx.

◆ isOk()

Bool_t TRestEvent::isOk ( ) const
inline

Definition at line 83 of file TRestEvent.h.

◆ PrintEvent()

void TRestEvent::PrintEvent ( ) const
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.

◆ RestartPad()

void TRestEvent::RestartPad ( Int_t  nElements)
protected

Definition at line 147 of file TRestEvent.cxx.

◆ SetEventInfo()

void TRestEvent::SetEventInfo ( TRestEvent eve)

Copy the six universal information in TRestEvent from another TRestEvent

Definition at line 137 of file TRestEvent.cxx.

◆ SetID()

void TRestEvent::SetID ( Int_t  id)
inline

Definition at line 59 of file TRestEvent.h.

◆ SetOK()

void TRestEvent::SetOK ( Bool_t  state)
inline

Definition at line 68 of file TRestEvent.h.

◆ SetRunOrigin()

void TRestEvent::SetRunOrigin ( Int_t  run_origin)
inline

Definition at line 56 of file TRestEvent.h.

◆ SetState()

void TRestEvent::SetState ( Bool_t  state)
inline

Definition at line 67 of file TRestEvent.h.

◆ SetSubEventTag()

void TRestEvent::SetSubEventTag ( const TString &  tag)
inline

Definition at line 61 of file TRestEvent.h.

◆ SetSubID()

void TRestEvent::SetSubID ( Int_t  id)
inline

Definition at line 60 of file TRestEvent.h.

◆ SetSubRunOrigin()

void TRestEvent::SetSubRunOrigin ( Int_t  sub_run_origin)
inline

Definition at line 57 of file TRestEvent.h.

◆ SetTime() [1/2]

void TRestEvent::SetTime ( Double_t  seconds,
Double_t  nanoseconds 
)

Set the time of the event

Definition at line 129 of file TRestEvent.cxx.

◆ SetTime() [2/2]

void TRestEvent::SetTime ( Double_t  time)

Set the time of the event

Definition at line 85 of file TRestEvent.cxx.

◆ SetTimeStamp()

void TRestEvent::SetTimeStamp ( const TTimeStamp &  time)
inline

Definition at line 65 of file TRestEvent.h.

Field Documentation

◆ fEventID

Int_t TRestEvent::fEventID
protected

Event identification number.

Definition at line 42 of file TRestEvent.h.

◆ fEventTime

TTimeStamp TRestEvent::fEventTime
protected

Absolute event time.

Definition at line 45 of file TRestEvent.h.

◆ fOk

Bool_t TRestEvent::fOk
protected

Flag to be used by processes to define an event status. fOk=true is the default.

Definition at line 46 of file TRestEvent.h.

◆ fPad

TPad* TRestEvent::fPad
protected

Definition at line 50 of file TRestEvent.h.

◆ fRun

TRestRun* TRestEvent::fRun = nullptr
protected

Definition at line 48 of file TRestEvent.h.

◆ fRunOrigin

Int_t TRestEvent::fRunOrigin
protected

Run ID number of the event.

Definition at line 40 of file TRestEvent.h.

◆ fSubEventID

Int_t TRestEvent::fSubEventID
protected

Sub-Event identification number.

Definition at line 43 of file TRestEvent.h.

◆ fSubEventTag

TString TRestEvent::fSubEventTag
protected

A short length label to identify the sub-Event.

Definition at line 44 of file TRestEvent.h.

◆ fSubRunOrigin

Int_t TRestEvent::fSubRunOrigin
protected

Sub-run ID number of the event.

Definition at line 41 of file TRestEvent.h.


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