CGEM BOSS 6.6.5.i
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_tCgemMcHitCol = new TObjArray();
13 m_tEmcMcDigiCol= new TObjArray();
14 Clear();
15}
16
17//*****************************************************************
19 m_tTofMcHitCol->Delete();
20 delete m_tTofMcHitCol;
21 m_tTofMcHitCol = 0;
22
23 m_tMdcMcHitCol->Delete();
24 delete m_tMdcMcHitCol;
25 m_tMdcMcHitCol = 0;
26
27 m_tCgemMcHitCol->Delete();
28 delete m_tCgemMcHitCol;
29 m_tCgemMcHitCol = 0;
30
31 m_tEmcMcDigiCol->Delete();
32 delete m_tEmcMcDigiCol;
33 m_tEmcMcDigiCol = 0;
34}
35
36
37//*****************************************************************
38void TMcHitEvent::Clear(Option_t *option) {
39 int i = 0;
40
41 for(i = 0; i < m_tTofMcHitCol->GetEntries(); i++)delete m_tTofMcHitCol->At(i);
42 m_tTofMcHitCol->Clear();
43
44 for(i = 0; i < m_tMdcMcHitCol->GetEntries(); i++)delete m_tMdcMcHitCol->At(i);
45 m_tMdcMcHitCol->Clear();
46
47 for(i = 0; i < m_tCgemMcHitCol->GetEntries(); i++)delete m_tCgemMcHitCol->At(i);
48 m_tCgemMcHitCol->Clear();
49
50 for(i = 0; i < m_tEmcMcDigiCol->GetEntries(); i++)delete m_tEmcMcDigiCol->At(i);
51 m_tEmcMcDigiCol->Clear();
52}
53
54//*****************************************************************************
55void TMcHitEvent::Print(Option_t *option) const {
56 TObject::Print(option);
57}
58
59///Emc
61 m_tEmcMcDigiCol->Add(mcDigi);
62}
63
64
66 if(Int_t(i) >=m_tEmcMcDigiCol->GetEntries()) return 0;
67 else return (TMcDigiEmc*) m_tEmcMcDigiCol->At(i);
68}
69
70///Tof
72 m_tTofMcHitCol->Add(mcHit);
73}
74
75
76const TMcHitTof* TMcHitEvent::getMcHitTof(Int_t i) const {
77 if(Int_t(i) >=m_tTofMcHitCol->GetEntries()) return 0;
78 else return (TMcHitTof*) m_tTofMcHitCol->At(i);
79}
80
81///Mdc
83 m_tMdcMcHitCol->Add(mcHit);
84}
85
86
87const TMcHitMdc* TMcHitEvent::getMcHitMdc(Int_t i) const {
88 if(Int_t(i) >=m_tMdcMcHitCol->GetEntries()) return 0;
89 else return (TMcHitMdc*) m_tMdcMcHitCol->At(i);
90}
91
92///Cgem
94 m_tCgemMcHitCol->Add(mcHit);
95}
96
97
99 if(Int_t(i) >=m_tCgemMcHitCol->GetEntries()) return 0;
100 else return (TMcHitCgem*) m_tCgemMcHitCol->At(i);
101}
102
ClassImp(TMcHitEvent) TMcHitEvent
virtual ~TMcHitEvent()
const TMcHitTof * getMcHitTof(Int_t i) const
retrieve a McHitTof From the collection, using the index into the array
const TMcHitCgem * getMcHitCgem(Int_t i) const
retrieve a McHitCgem From the collection, using the index into the array
void addMcHitCgem(TMcHitCgem *hit)
Add a McHitCgem into the Cgem Data collection.
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="")