///////////////////////////////////////////////////////////////////////////
//
// The Event class is the top level class for the ASCII to ROOT
// conversion. It contains all the information about a single event.
// It contains TObjArrays (typically one per detector component) of
// information about hit detector elements, as well as functions to
// access these arrays.
//
///////////////////////////////////////////////////////////////////////////

#include "Event.h"
#include "TMath.h"

#include "ACDTile.h"    // So that we can manually delete ACDTiles
                        // [ See Event::Clean() for details ]

ClassImp(Event)
//__________________________________________________________________________
 Event::Event() {
    // Default constructor.
    // Assign default values to members
    m_ACD = 0;
    m_CAL = 0;
    m_TKR = 0;
    m_MCPart = 0;
    m_L1Trigger = 0;
}
//_________________________________________________________________________
 Event::~Event() {
  // Destructor
  Clean();
}
//__________________________________________________________________________
 void Event::Create() {
    m_ACD = new TObjArray();
    m_CAL = new TObjArray();
    m_TKR = new TObjArray();
    m_MCPart = new TObjArray();
    m_L1Trigger = 0;
}
//_________________________________________________________________________
 void Event::Clean() {
    // Clears and destroys all TObjArrays contained in the Event object.
    // Necessary both for destruction and between subsequent fills and
    // writes/reads to/from file.

    if (m_CAL) {
        int nEntries = m_CAL->GetEntries();
        for (int i=0; i<nEntries; i++)
            delete m_CAL->At(i);
        m_CAL->Clear();
        delete m_CAL;
        m_CAL = 0;
    }

    if (m_ACD) {
        int nEntries = m_ACD->GetEntries();
        for (int i=0; i<nEntries; i++)
            delete m_ACD->At(i);
        m_ACD->Clear();
        delete m_ACD;
        m_ACD = 0;
    }

    if (m_TKR) {
        int nEntries = m_TKR->GetEntries();
        for (int i=0; i<nEntries; i++)
            delete m_TKR->At(i);
        m_TKR->Clear();
        delete m_TKR;
        m_TKR = 0;
    }

    if (m_MCPart) {
        int nEntries = m_MCPart->GetEntries();
        for (int i=0; i<nEntries; i++)
            delete m_MCPart->At(i);
        m_MCPart->Clear();
        delete m_MCPart;
        m_MCPart = 0;
    }

    if (m_L1Trigger) {
        delete m_L1Trigger;
        m_L1Trigger = 0;
    }

    return;
}

//________________________________________________________________________
 TObjArray* Event::getACD() {
    // Provides access to list of ACD tiles
    return m_ACD;
}
//________________________________________________________________________
 TObjArray* Event::getCAL(){
    // Provides access to list of Calorimeter CsI logs
    return m_CAL;
}
//________________________________________________________________________
 TObjArray* Event::getMCPart(){
    // Provides access to list of MC particles from
    // reconstruction of this event
    return m_MCPart;
}
//________________________________________________________________________
 TObjArray* Event::getTKR(){
    // Provides access to list of tracker layers
    return m_TKR;
}


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.