DDASToys for NSCLDAQ  6.2-000
Public Member Functions | Public Attributes | List of all members
ddastoys::DDASRootFitEvent Class Reference

Defines the object that's put in a ROOT TTree for each event. More...

#include <DDASRootFitEvent.h>

Inheritance diagram for ddastoys::DDASRootFitEvent:
Inheritance graph
[legend]
Collaboration diagram for ddastoys::DDASRootFitEvent:
Collaboration graph
[legend]

Public Member Functions

 DDASRootFitEvent ()
 Constructor. More...
 
 DDASRootFitEvent (const DDASRootFitEvent &rhs)
 Copy constructor. More...
 
 ~DDASRootFitEvent ()
 Destructor. More...
 
DDASRootFitEventoperator= (const DDASRootFitEvent &rhs)
 Assignment operator. More...
 
std::vector< DDASRootFitHit * > GetData ()
 Return the event vector. More...
 
Double_t GetFirstTime () const
 Get the time from the first hit in the event. More...
 
Double_t GetLastTime () const
 Get the time from the last hit in the event. More...
 
Double_t GetTimeWidth () const
 Get the time from the last hit in the event. More...
 
void AddHit (const DDASRootFitHit &hit)
 Add a hit to the event. More...
 
void Reset ()
 Delete the hits and empty the array of hits.
 

Public Attributes

std::vector< DDASRootFitHit * > m_hits
 An event is a vector of hits.
 

Detailed Description

Defines the object that's put in a ROOT TTree for each event.

An event is just a sequence (vector) of hits. Hits are stored here as pointers to DDASRootFitHit objects which are hits that are also derived from TObject.

Note
The code assumes that the pointers in m_hits point to dynamically allocated data. Thus the destructor will destroy the hits as well.
Copy construction and assignment are implemented as deep operations as demanded by ROOT.

Constructor & Destructor Documentation

◆ DDASRootFitEvent() [1/2]

ddastoys::DDASRootFitEvent::DDASRootFitEvent ( )

Constructor.

Pretty much null but ROOT requires an implementation.

◆ DDASRootFitEvent() [2/2]

ddastoys::DDASRootFitEvent::DDASRootFitEvent ( const DDASRootFitEvent rhs)

Copy constructor.

Parameters
rhsThe object we're being copied from.

◆ ~DDASRootFitEvent()

ddastoys::DDASRootFitEvent::~DDASRootFitEvent ( )

Destructor.

Destroy the hits. Note that the event vector destroys itself.

Member Function Documentation

◆ AddHit()

void ddastoys::DDASRootFitEvent::AddHit ( const DDASRootFitHit hit)

Add a hit to the event.

Parameters
hitReferences the hit to add.
Note
The hit is copied into a dynamically allocated hit to ensure all hit objects in the vector are dynamic.

◆ GetData()

std::vector< ddastoys::DDASRootFitHit * > ddastoys::DDASRootFitEvent::GetData ( )

Return the event vector.

Returns
Vector of references to hit objects.

◆ GetFirstTime()

Double_t ddastoys::DDASRootFitEvent::GetFirstTime ( ) const

Get the time from the first hit in the event.

Returns
Double_t The time from the first hit of data.
Return values
0.0Returned if there are no hits.

◆ GetLastTime()

Double_t ddastoys::DDASRootFitEvent::GetLastTime ( ) const

Get the time from the last hit in the event.

Returns
Double_t The time from the last hit of data.
Return values
0.0Returned if there are no hits.

◆ GetTimeWidth()

Double_t ddastoys::DDASRootFitEvent::GetTimeWidth ( ) const

Get the time from the last hit in the event.

Returns
Double_t The time from the last hit of data.
Return values
0.0Returned if there are no hits.

◆ operator=()

ddastoys::DDASRootFitEvent & ddastoys::DDASRootFitEvent::operator= ( const DDASRootFitEvent rhs)

Assignment operator.

Parameters
rhsThe object we're assigning to *this.
Returns
Referencing *this.

Assignment will:

  • Kill off our vector of hits.
  • For each hit on the right hand side, dynamically copy construct a new one and insert it into our vector.

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