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