BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TMcHitEvent.cxx
Go to the documentation of this file.
1#include "RootEventData/TMcHitEvent.h"
2#include "TCollection.h" // Declares TIter
3
5
6//***************************************************************
8 m_beamTime = -1.;
9 m_tTofMcHitCol = new TObjArray();
10 m_tMdcMcHitCol = new TObjArray();
11 m_tEmcMcDigiCol = new TObjArray();
12 Clear();
13}
14
15//*****************************************************************
17 m_tTofMcHitCol->Delete();
18 delete m_tTofMcHitCol;
19 m_tTofMcHitCol = 0;
20
21 m_tMdcMcHitCol->Delete();
22 delete m_tMdcMcHitCol;
23 m_tMdcMcHitCol = 0;
24
25 m_tEmcMcDigiCol->Delete();
26 delete m_tEmcMcDigiCol;
27 m_tEmcMcDigiCol = 0;
28}
29
30//*****************************************************************
31void TMcHitEvent::Clear( Option_t* option ) {
32 int i = 0;
33
34 for ( i = 0; i < m_tTofMcHitCol->GetEntries(); i++ ) delete m_tTofMcHitCol->At( i );
35 m_tTofMcHitCol->Clear();
36
37 for ( i = 0; i < m_tMdcMcHitCol->GetEntries(); i++ ) delete m_tMdcMcHitCol->At( i );
38 m_tMdcMcHitCol->Clear();
39
40 for ( i = 0; i < m_tEmcMcDigiCol->GetEntries(); i++ ) delete m_tEmcMcDigiCol->At( i );
41 m_tEmcMcDigiCol->Clear();
42}
43
44//*****************************************************************************
45void TMcHitEvent::Print( Option_t* option ) const { TObject::Print( option ); }
46
47/// Emc
48void TMcHitEvent::addMcDigiEmc( TMcDigiEmc* mcDigi ) { m_tEmcMcDigiCol->Add( mcDigi ); }
49
50const TMcDigiEmc* TMcHitEvent::getMcDigiEmc( Int_t i ) const {
51 if ( Int_t( i ) >= m_tEmcMcDigiCol->GetEntries() ) return 0;
52 else return (TMcDigiEmc*)m_tEmcMcDigiCol->At( i );
53}
54
55/// Tof
56void TMcHitEvent::addMcHitTof( TMcHitTof* mcHit ) { m_tTofMcHitCol->Add( mcHit ); }
57
58const TMcHitTof* TMcHitEvent::getMcHitTof( Int_t i ) const {
59 if ( Int_t( i ) >= m_tTofMcHitCol->GetEntries() ) return 0;
60 else return (TMcHitTof*)m_tTofMcHitCol->At( i );
61}
62
63/// Mdc
64void TMcHitEvent::addMcHitMdc( TMcHitMdc* mcHit ) { m_tMdcMcHitCol->Add( mcHit ); }
65
66const TMcHitMdc* TMcHitEvent::getMcHitMdc( Int_t i ) const {
67 if ( Int_t( i ) >= m_tMdcMcHitCol->GetEntries() ) return 0;
68 else return (TMcHitMdc*)m_tMdcMcHitCol->At( i );
69}
ClassImp(TMcHitEvent)
virtual ~TMcHitEvent()
const TMcHitTof * getMcHitTof(Int_t i) const
retrieve a McHitTof From the collection, using the index into the array
void addMcHitTof(TMcHitTof *hit)
Add a McHitTof into the TOF Data collection.
void addMcDigiEmc(TMcDigiEmc *digi)
Add a McHitMdc into the Mdc Data collection.
const TMcHitMdc * getMcHitMdc(Int_t i) const
retrieve a McHitMdc From the collection, using the index into the array
void Print(Option_t *option="") const
const TMcDigiEmc * getMcDigiEmc(Int_t i) const
retrieve a McHitMdc From the collection, using the index into the array
void addMcHitMdc(TMcHitMdc *hit)
Add a McHitMdc into the Mdc Data collection.
void Clear(Option_t *option="")