50#include "TRestEvent.h"
84 auto seconds = (Int_t)time;
85 auto nanoseconds = (Int_t)((time - seconds) * 1E9);
97 if (this->ClassName() != target->ClassName()) {
98 cout <<
"In TRestEvent::CloneTo() : Event type doesn't match! (This :" << this->ClassName()
99 <<
", Target : " << target->ClassName() <<
")" << endl;
103 TBufferFile buffer(TBuffer::kWrite);
104 buffer.MapObject(
this);
106 Bool_t isRef = this->TestBit(kIsReferenced);
107 ((TObject*)
this)->ResetBit(kIsReferenced);
109 ((TObject*)
this)->Streamer(buffer);
111 if (isRef) ((TObject*)
this)->SetBit(kIsReferenced);
115 buffer.SetReadMode();
117 buffer.SetBufferOffset(0);
118 buffer.MapObject(target);
119 target->Streamer(buffer);
120 target->ResetBit(kIsReferenced);
121 target->ResetBit(kCanDelete);
136 if (eve !=
nullptr) {
138 SetSubID(eve->GetSubID());
139 SetTimeStamp(eve->GetTimeStamp());
140 SetSubEventTag(eve->GetSubEventTag());
145void TRestEvent::RestartPad(Int_t nElements) {
146 if (fPad !=
nullptr) {
151 fPad =
new TPad(this->GetName(),
"", 0., 0., 1., 1.);
153 if (nElements == 1) fPad->Divide(1, 1);
154 if (nElements == 2) fPad->Divide(2, 1);
155 if (nElements == 3 || nElements == 4) fPad->Divide(2, 2);
156 if (nElements == 5) fPad->Divide(3, 2);
157 if (nElements == 6) fPad->Divide(3, 2);
158 if (nElements > 6) fPad->Divide(3, 3);
161 cout <<
"REST_WARNING. TRestEvent::RestartPad. Maximum number of pad "
164 cout <<
"Setting the pad elements to 9" << endl;
183 cout << TString::Format(
"EventID: %d - SubEventID: %d",
fEventID,
fSubEventID).Data() << endl;
184 cout << TString::Format(
"- Timestamp: %s",
fEventTime.AsString()) << endl;
189 cout <<
"- Status not OK" << endl;
A base class for any REST event.
void SetTime(Double_t time)
virtual void InitializeReferences(TRestRun *run)
Initialize dynamical references when loading the event from a root file.
virtual void CloneTo(TRestEvent *target)
Clone the content of this TRestEvent object to another.
void SetEventInfo(TRestEvent *eve)
virtual void PrintEvent() const
TString fSubEventTag
A short length label to identify the sub-Event.
TTimeStamp fEventTime
Absolute event time.
Bool_t fOk
Flag to be used by processes to define an event status. fOk=true is the default.
virtual void Initialize()=0
Int_t fEventID
Event identification number.
Int_t fSubEventID
Sub-Event identification number.
Data provider and manager in REST.