|
REST-for-Physics
v2.3
Rare Event Searches ToolKit for Physics
|
RESTSoft : Software for Rare Event Searches with TPCs
TRestDetectorSignalEvent.h
Event class to store DAQ events either from simulation and
acquisition
sept 2015: First concept
Created as part of the conceptualization of existing REST
software.
JuanAn Garcia
TRestDetectorSignalEvent stores the detector-channel signals associated with one REST event.
A TRestDetectorSignalEvent is a collection of TRestDetectorSignal objects. Each TRestDetectorSignal corresponds to one readout channel, identified by its signal ID, and stores the signal as time-charge points in physical coordinates. The event object groups those channel signals and provides event-level operations such as signal lookup, drawing, sorting, integrals, and global time or amplitude limits.
This event type is usually found after the raw ADC representation has been converted into detector-level signals, or after simulated detector hits have been projected onto a readout. It sits between TRestRawSignalEvent, which keeps ADC samples, and TRestDetectorHitsEvent, which stores reconstructed or simulated spatial hits. Processes such as TRestDetectorHitsToSignalProcess, TRestRawToDetectorSignalProcess, and TRestDetectorSignalToHitsProcess use this class as the detector-signal representation.
A minimal inspection from a restRoot session or ROOT macro looks like:
Signals can be accessed by collection index with GetSignal(), or by channel identifier with GetSignalById(). Analysis code should normally use GetSignalById() when referring to a physical readout channel, because the internal ordering of the signal collection is not the channel mapping.
AddChargeToSignal() is a convenient way to fill an event when several charge contributions may arrive at the same channel and time. It creates the corresponding TRestDetectorSignal if the signal ID is not yet present, and otherwise accumulates the charge in the existing signal.
DrawEvent() displays all contained TRestDetectorSignal objects in a TMultiGraph, with time on the horizontal axis and amplitude on the vertical axis.
The following figure shows a detector signal event drawn with DrawEvent(). Each trace corresponds to one TRestDetectorSignal in the event, with the horizontal axis expressed in physical time.
RESTsoft - Software for Rare Event Searches with TPCs
History of developments:
2015-September: First concept. JuanAn Garcia/Javier Galan
2016-February: Added titles to axis in DrawGraph using TMultiGraph. Javier Gracia
Definition at line 32 of file TRestDetectorSignalEvent.h.
#include <TRestDetectorSignalEvent.h>
Public Member Functions | |
| void | AddChargeToSignal (Int_t signalID, Double_t time, Double_t charge) |
| void | AddSignal (const TRestDetectorSignal &signal) |
| TPad * | DrawEvent (const TString &option="") |
| Draw the event. More... | |
| Double_t | GetIntegral (Int_t startBin=0, Int_t endBin=0) |
| Double_t | GetIntegralWithTime (Double_t startTime, Double_t endTime) |
| Double_t | GetMaxTime () |
| Double_t | GetMaxValue () |
| Double_t | GetMinTime () |
| Double_t | GetMinValue () |
| Int_t | GetNumberOfSignals () const |
| TRestDetectorSignal * | GetSignal (Int_t n) |
| TRestDetectorSignal * | GetSignalById (Int_t sid) |
| Int_t | GetSignalIndex (Int_t signalID) |
| void | Initialize () |
| void | PrintEvent () |
| void | RemoveSignalWithId (Int_t sId) |
| Bool_t | signalIDExists (Int_t sID) |
| void | SortSignals () |
Public Member Functions inherited from TRestEvent | |
| 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 Attributes | |
| Double_t | fMaxTime |
| Double_t | fMaxValue |
| Double_t | fMinTime |
| Double_t | fMinValue |
| std::vector< TRestDetectorSignal > | fSignal |
Protected Attributes inherited from TRestEvent | |
| 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 |
| TRestRun * | fRun = 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... | |
Private Member Functions | |
| void | SetMaxAndMin () |
Additional Inherited Members | |
Protected Member Functions inherited from TRestEvent | |
| void | RestartPad (Int_t nElements) |
| TRestDetectorSignalEvent::TRestDetectorSignalEvent | ( | ) |
Definition at line 88 of file TRestDetectorSignalEvent.cxx.
|
virtual |
Definition at line 93 of file TRestDetectorSignalEvent.cxx.
| void TRestDetectorSignalEvent::AddChargeToSignal | ( | Int_t | signalID, |
| Double_t | time, | ||
| Double_t | charge | ||
| ) |
Definition at line 150 of file TRestDetectorSignalEvent.cxx.
| void TRestDetectorSignalEvent::AddSignal | ( | const TRestDetectorSignal & | signal | ) |
Definition at line 107 of file TRestDetectorSignalEvent.cxx.
|
virtual |
Draw the event.
To be implemented in the derived class
Reimplemented from TRestEvent.
Definition at line 218 of file TRestDetectorSignalEvent.cxx.
| Double_t TRestDetectorSignalEvent::GetIntegral | ( | Int_t | startBin = 0, |
| Int_t | endBin = 0 |
||
| ) |
Definition at line 135 of file TRestDetectorSignalEvent.cxx.
| Double_t TRestDetectorSignalEvent::GetIntegralWithTime | ( | Double_t | startTime, |
| Double_t | endTime | ||
| ) |
Definition at line 143 of file TRestDetectorSignalEvent.cxx.
| Double_t TRestDetectorSignalEvent::GetMaxTime | ( | ) |
Definition at line 207 of file TRestDetectorSignalEvent.cxx.
| Double_t TRestDetectorSignalEvent::GetMaxValue | ( | ) |
Definition at line 187 of file TRestDetectorSignalEvent.cxx.
| Double_t TRestDetectorSignalEvent::GetMinTime | ( | ) |
Definition at line 197 of file TRestDetectorSignalEvent.cxx.
| Double_t TRestDetectorSignalEvent::GetMinValue | ( | ) |
Definition at line 192 of file TRestDetectorSignalEvent.cxx.
|
inline |
Definition at line 65 of file TRestDetectorSignalEvent.h.
|
inline |
Definition at line 66 of file TRestDetectorSignalEvent.h.
|
inline |
Definition at line 68 of file TRestDetectorSignalEvent.h.
| Int_t TRestDetectorSignalEvent::GetSignalIndex | ( | Int_t | signalID | ) |
Definition at line 129 of file TRestDetectorSignalEvent.cxx.
|
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();
Implements TRestEvent.
Definition at line 97 of file TRestDetectorSignalEvent.cxx.
| void TRestDetectorSignalEvent::PrintEvent | ( | ) |
Definition at line 162 of file TRestDetectorSignalEvent.cxx.
| void TRestDetectorSignalEvent::RemoveSignalWithId | ( | Int_t | sId | ) |
Definition at line 117 of file TRestDetectorSignalEvent.cxx.
|
private |
Definition at line 172 of file TRestDetectorSignalEvent.cxx.
|
inline |
Definition at line 45 of file TRestDetectorSignalEvent.h.
|
inline |
Definition at line 52 of file TRestDetectorSignalEvent.h.
|
protected |
Definition at line 35 of file TRestDetectorSignalEvent.h.
|
protected |
Definition at line 37 of file TRestDetectorSignalEvent.h.
|
protected |
Definition at line 34 of file TRestDetectorSignalEvent.h.
|
protected |
Definition at line 36 of file TRestDetectorSignalEvent.h.
|
protected |
Definition at line 39 of file TRestDetectorSignalEvent.h.