BOSS 6.6.4.p01
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_staticEmcMcHitCol = 0;
9TObjArray *TMcEvent::s_staticTofMcHitCol = 0;
10TObjArray *TMcEvent::s_staticMucMcHitCol = 0;
11TObjArray *TMcEvent::s_staticMcParticleCol = 0;
12//TObject *TMcEvent::s_staticDecayMode = 0;
13
14
15//***************************************************************
17{
18
19 if (!s_staticMdcMcHitCol) {
20 s_staticMdcMcHitCol = new TObjArray();
21 }
22 m_mdcMcHitCol = s_staticMdcMcHitCol;
23
24 if (!s_staticEmcMcHitCol ){
25 s_staticEmcMcHitCol = new TObjArray();
26 }
27 m_emcMcHitCol = s_staticEmcMcHitCol;
28
29 if (! s_staticTofMcHitCol ){
30 s_staticTofMcHitCol = new TObjArray();
31 }
32 m_tofMcHitCol = s_staticTofMcHitCol;
33
34 if (! s_staticMucMcHitCol ){
35 s_staticMucMcHitCol = new TObjArray();
36 }
37 m_mucMcHitCol = s_staticMucMcHitCol;
38
39 if (! s_staticMcParticleCol ){
40 s_staticMcParticleCol = new TObjArray();
41 }
42 m_mcParticleCol = s_staticMcParticleCol;
43 /*
44 if (! s_staticDecayMode ){
45 s_staticDecayMode = new TObject();
46 }
47 m_decayMode = s_staticDecayMode;
48*/
49 Clear();
50
51}
52
53//*****************************************************************
55 if(m_mdcMcHitCol == s_staticMdcMcHitCol) s_staticMdcMcHitCol = 0;
56 m_mdcMcHitCol->Delete();
57 delete m_mdcMcHitCol;
58 m_mdcMcHitCol = 0;
59
60 if(m_emcMcHitCol == s_staticEmcMcHitCol) s_staticEmcMcHitCol = 0;
61 m_emcMcHitCol->Delete();
62 delete m_emcMcHitCol;
63 m_emcMcHitCol = 0;
64
65 if(m_tofMcHitCol == s_staticTofMcHitCol ) s_staticTofMcHitCol = 0;
66 m_tofMcHitCol->Delete();
67 delete m_tofMcHitCol;
68 m_tofMcHitCol = 0;
69
70 if(m_mucMcHitCol == s_staticMucMcHitCol ) s_staticMucMcHitCol = 0;
71 m_mucMcHitCol->Delete();
72 delete m_mucMcHitCol;
73 m_mucMcHitCol = 0;
74
75 if(m_mcParticleCol == s_staticMcParticleCol ) s_staticMcParticleCol = 0;
76 m_mcParticleCol->Delete();
77 delete m_mcParticleCol;
78 m_mcParticleCol = 0;
79/*
80 if(m_decayMode == s_staticDecayMode ) s_staticDecayMode = 0;
81 m_decayMode->Delete();
82 delete m_decayMode;
83 m_decayMode = 0;
84*/
85}
86
87//*****************************************************************
89
90}
91
92//*****************************************************************
93void TMcEvent::Clear(Option_t *option) {
94
95}
96
97//*****************************************************************************
98void TMcEvent::Print(Option_t *option) const {
99 TObject::Print(option);
100}
101
102/// Mdc
104 m_mdcMcHitCol->Add(mcHit);
105}
106
107const TMdcMc* TMcEvent::getMdcMc(Int_t i) const {
108 if (Int_t(i) >= m_mdcMcHitCol->GetEntries())
109 return 0;
110 return (TMdcMc*)m_mdcMcHitCol->At(i);
111}
112///Emc
114 m_emcMcHitCol->Add(mcHit);
115}
116
117const TEmcMc* TMcEvent::getEmcMc( Int_t i) const {
118 if(Int_t(i) >= m_emcMcHitCol->GetEntries())
119 return 0;
120 return (TEmcMc*)m_emcMcHitCol->At(i);
121}
122
123///Tof
125 m_tofMcHitCol->Add(mcHit);
126}
127
128
129const TTofMc* TMcEvent::getTofMc(Int_t i) const {
130 if(Int_t(i) >=m_tofMcHitCol->GetEntries())
131 return 0;
132 return (TTofMc*) m_tofMcHitCol->At(i);
133}
134
135///Muc
137 m_mucMcHitCol->Add(mcHit);
138}
139
140
141const TMucMc* TMcEvent::getMucMc(Int_t i) const {
142 if(Int_t(i) >=m_mucMcHitCol->GetEntries())
143 return 0;
144 return (TMucMc*) m_mucMcHitCol->At(i);
145}
146
147///McParticle
149 m_mcParticleCol->Add(mcHit);
150}
151
152
154 if(Int_t(i) >=m_mcParticleCol->GetEntries())
155 return 0;
156 return (TMcParticle*) m_mcParticleCol->At(i);
157}
158/*
159///DecayMode
160void TMcEvent::addDecayMode(TDecayMode * decayMode){
161 m_decayMode = decayMode;
162}
163
164
165const TDecayMode* TMcEvent::getDecayMode() const {
166 return (TDecayMode*)m_decayMode ;
167}
168*/
ClassImp(TBossFullEvent) TBossFullEvent
Definition: TEmcMc.h:10
void addMdcMc(TMdcMc *mcHit)
Mdc.
Definition: TMcEvent.cxx:103
void addMcParticle(TMcParticle *mcHit)
McParticle.
Definition: TMcEvent.cxx:148
void Clear(Option_t *option="")
Definition: TMcEvent.cxx:93
void Print(Option_t *option="") const
Definition: TMcEvent.cxx:98
const TMdcMc * getMdcMc(Int_t i) const
Definition: TMcEvent.cxx:107
void addTofMc(TTofMc *mcHit)
Tof.
Definition: TMcEvent.cxx:124
void addEmcMc(TEmcMc *mcHit)
Emc.
Definition: TMcEvent.cxx:113
virtual ~TMcEvent()
Definition: TMcEvent.cxx:54
TMcEvent()
Definition: TMcEvent.cxx:16
const TMcParticle * getMcParticle(Int_t i) const
Definition: TMcEvent.cxx:153
void addMucMc(TMucMc *mcHit)
Muc.
Definition: TMcEvent.cxx:136
const TEmcMc * getEmcMc(Int_t i) const
Definition: TMcEvent.cxx:117
const TMucMc * getMucMc(Int_t i) const
Definition: TMcEvent.cxx:141
const TTofMc * getTofMc(Int_t i) const
Definition: TMcEvent.cxx:129
void initialize()
Definition: TMcEvent.cxx:88
Definition: TMdcMc.h:8
Definition: TMucMc.h:8
Definition: TTofMc.h:8