CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
TMcEvent.cxx
Go to the documentation of this file.
2#include "TCollection.h" // Declares TIter
3
5
6// Allocate the TObjArray just once
7TObjArray *TMcEvent::s_staticMdcMcHitCol = 0;
8TObjArray *TMcEvent::s_staticCgemMcHitCol = 0;
9TObjArray *TMcEvent::s_staticEmcMcHitCol = 0;
10TObjArray *TMcEvent::s_staticTofMcHitCol = 0;
11TObjArray *TMcEvent::s_staticMucMcHitCol = 0;
12TObjArray *TMcEvent::s_staticMcParticleCol = 0;
13//TObject *TMcEvent::s_staticDecayMode = 0;
14
15
16//***************************************************************
18{
19
20 if (!s_staticMdcMcHitCol) {
21 s_staticMdcMcHitCol = new TObjArray();
22 }
23 m_mdcMcHitCol = s_staticMdcMcHitCol;
24
25 if (!s_staticCgemMcHitCol) {
26 s_staticCgemMcHitCol = new TObjArray();
27 }
28 m_cgemMcHitCol = s_staticCgemMcHitCol;
29
30 if (!s_staticEmcMcHitCol ){
31 s_staticEmcMcHitCol = new TObjArray();
32 }
33 m_emcMcHitCol = s_staticEmcMcHitCol;
34
35 if (! s_staticTofMcHitCol ){
36 s_staticTofMcHitCol = new TObjArray();
37 }
38 m_tofMcHitCol = s_staticTofMcHitCol;
39
40 if (! s_staticMucMcHitCol ){
41 s_staticMucMcHitCol = new TObjArray();
42 }
43 m_mucMcHitCol = s_staticMucMcHitCol;
44
45 if (! s_staticMcParticleCol ){
46 s_staticMcParticleCol = new TObjArray();
47 }
48 m_mcParticleCol = s_staticMcParticleCol;
49 /*
50 if (! s_staticDecayMode ){
51 s_staticDecayMode = new TObject();
52 }
53 m_decayMode = s_staticDecayMode;
54*/
55 Clear();
56
57}
58
59//*****************************************************************
61 if(m_mdcMcHitCol == s_staticMdcMcHitCol) s_staticMdcMcHitCol = 0;
62 m_mdcMcHitCol->Delete();
63 delete m_mdcMcHitCol;
64 m_mdcMcHitCol = 0;
65
66 if(m_cgemMcHitCol == s_staticCgemMcHitCol) s_staticCgemMcHitCol = 0;
67 m_cgemMcHitCol->Delete();
68 delete m_cgemMcHitCol;
69 m_cgemMcHitCol = 0;
70
71 if(m_emcMcHitCol == s_staticEmcMcHitCol) s_staticEmcMcHitCol = 0;
72 m_emcMcHitCol->Delete();
73 delete m_emcMcHitCol;
74 m_emcMcHitCol = 0;
75
76 if(m_tofMcHitCol == s_staticTofMcHitCol ) s_staticTofMcHitCol = 0;
77 m_tofMcHitCol->Delete();
78 delete m_tofMcHitCol;
79 m_tofMcHitCol = 0;
80
81 if(m_mucMcHitCol == s_staticMucMcHitCol ) s_staticMucMcHitCol = 0;
82 m_mucMcHitCol->Delete();
83 delete m_mucMcHitCol;
84 m_mucMcHitCol = 0;
85
86 if(m_mcParticleCol == s_staticMcParticleCol ) s_staticMcParticleCol = 0;
87 m_mcParticleCol->Delete();
88 delete m_mcParticleCol;
89 m_mcParticleCol = 0;
90/*
91 if(m_decayMode == s_staticDecayMode ) s_staticDecayMode = 0;
92 m_decayMode->Delete();
93 delete m_decayMode;
94 m_decayMode = 0;
95*/
96}
97
98//*****************************************************************
100
101}
102
103//*****************************************************************
104void TMcEvent::Clear(Option_t *option) {
105
106}
107
108//*****************************************************************************
109void TMcEvent::Print(Option_t *option) const {
110 TObject::Print(option);
111}
112
113/// Mdc
115 m_mdcMcHitCol->Add(mcHit);
116}
117
118const TMdcMc* TMcEvent::getMdcMc(Int_t i) const {
119 if (Int_t(i) >= m_mdcMcHitCol->GetEntries())
120 return 0;
121 return (TMdcMc*)m_mdcMcHitCol->At(i);
122}
123/// Cgem
125 m_cgemMcHitCol->Add(mcHit);
126}
127
128const TCgemMc* TMcEvent::getCgemMc(Int_t i) const {
129 if (Int_t(i) >= m_cgemMcHitCol->GetEntries())
130 return 0;
131 return (TCgemMc*)m_cgemMcHitCol->At(i);
132}
133///Emc
135 m_emcMcHitCol->Add(mcHit);
136}
137
138const TEmcMc* TMcEvent::getEmcMc( Int_t i) const {
139 if(Int_t(i) >= m_emcMcHitCol->GetEntries())
140 return 0;
141 return (TEmcMc*)m_emcMcHitCol->At(i);
142}
143
144///Tof
146 m_tofMcHitCol->Add(mcHit);
147}
148
149
150const TTofMc* TMcEvent::getTofMc(Int_t i) const {
151 if(Int_t(i) >=m_tofMcHitCol->GetEntries())
152 return 0;
153 return (TTofMc*) m_tofMcHitCol->At(i);
154}
155
156///Muc
158 m_mucMcHitCol->Add(mcHit);
159}
160
161
162const TMucMc* TMcEvent::getMucMc(Int_t i) const {
163 if(Int_t(i) >=m_mucMcHitCol->GetEntries())
164 return 0;
165 return (TMucMc*) m_mucMcHitCol->At(i);
166}
167
168///McParticle
170 m_mcParticleCol->Add(mcHit);
171}
172
173
175 if(Int_t(i) >=m_mcParticleCol->GetEntries())
176 return 0;
177 return (TMcParticle*) m_mcParticleCol->At(i);
178}
179/*
180///DecayMode
181void TMcEvent::addDecayMode(TDecayMode * decayMode){
182 m_decayMode = decayMode;
183}
184
185
186const TDecayMode* TMcEvent::getDecayMode() const {
187 return (TDecayMode*)m_decayMode ;
188}
189*/
ClassImp(TBossFullEvent) TBossFullEvent
void addMdcMc(TMdcMc *mcHit)
Mdc.
Definition TMcEvent.cxx:114
const TCgemMc * getCgemMc(Int_t i) const
Definition TMcEvent.cxx:128
void addMcParticle(TMcParticle *mcHit)
McParticle.
Definition TMcEvent.cxx:169
void Clear(Option_t *option="")
Definition TMcEvent.cxx:104
void Print(Option_t *option="") const
Definition TMcEvent.cxx:109
const TMdcMc * getMdcMc(Int_t i) const
Definition TMcEvent.cxx:118
void addCgemMc(TCgemMc *mcHit)
Cgem.
Definition TMcEvent.cxx:124
void addTofMc(TTofMc *mcHit)
Tof.
Definition TMcEvent.cxx:145
void addEmcMc(TEmcMc *mcHit)
Emc.
Definition TMcEvent.cxx:134
virtual ~TMcEvent()
Definition TMcEvent.cxx:60
const TMcParticle * getMcParticle(Int_t i) const
Definition TMcEvent.cxx:174
void addMucMc(TMucMc *mcHit)
Muc.
Definition TMcEvent.cxx:157
const TEmcMc * getEmcMc(Int_t i) const
Definition TMcEvent.cxx:138
const TMucMc * getMucMc(Int_t i) const
Definition TMcEvent.cxx:162
const TTofMc * getTofMc(Int_t i) const
Definition TMcEvent.cxx:150
void initialize()
Definition TMcEvent.cxx:99
Definition TMdcMc.h:9
Definition TMucMc.h:8
Definition TTofMc.h:8