CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
TEvtRecObject.cxx
Go to the documentation of this file.
2#include "TCollection.h" // Declares TIter
3
5
6// Allocate the TObjArray just once
7
8TEvtRecEvent* TEvtRecObject::s_staticEvtRecEvent = 0;
9TObjArray* TEvtRecObject::s_staticEvtRecTrackCol = 0;
10TEvtRecPrimaryVertex *TEvtRecObject::s_staticEvtRecPrimaryVertex = 0;
11TObjArray *TEvtRecObject::s_staticEvtRecVeeVertexCol = 0;
12TObjArray *TEvtRecObject::s_staticEvtRecPi0Col = 0;
13TObjArray *TEvtRecObject::s_staticEvtRecEtaToGGCol = 0;
14TObjArray *TEvtRecObject::s_staticEvtRecDTagCol = 0;
15
17{
18 if ( ! s_staticEvtRecEvent ) {
19 s_staticEvtRecEvent = new TEvtRecEvent;
20 }
21 m_evtRecEvent = s_staticEvtRecEvent;
22
23 if ( !s_staticEvtRecTrackCol) {
24 s_staticEvtRecTrackCol = new TObjArray();
25 }
26 m_evtRecTrackCol = s_staticEvtRecTrackCol;
27
28 if ( ! s_staticEvtRecPrimaryVertex ) {
29 s_staticEvtRecPrimaryVertex = new TEvtRecPrimaryVertex();
30 }
31 m_evtRecPrimaryVertex = s_staticEvtRecPrimaryVertex;
32
33 if ( ! s_staticEvtRecVeeVertexCol ) {
34 s_staticEvtRecVeeVertexCol = new TObjArray();
35 }
36 m_evtRecVeeVertexCol = s_staticEvtRecVeeVertexCol;
37
38 if ( ! s_staticEvtRecPi0Col ) {
39 s_staticEvtRecPi0Col = new TObjArray();
40 }
41 m_evtRecPi0Col = s_staticEvtRecPi0Col;
42
43 if ( ! s_staticEvtRecEtaToGGCol ) {
44 s_staticEvtRecEtaToGGCol = new TObjArray();
45 }
46 m_evtRecEtaToGGCol = s_staticEvtRecEtaToGGCol;
47
48 if ( ! s_staticEvtRecDTagCol ) {
49 s_staticEvtRecDTagCol = new TObjArray();
50 }
51 m_evtRecDTagCol = s_staticEvtRecDTagCol;
52
53
54
55 Clear();
56}
57
59
60 if ( m_evtRecEvent == s_staticEvtRecEvent ) s_staticEvtRecEvent = 0;
61 delete m_evtRecEvent;
62 m_evtRecEvent = 0;
63
64 if ( m_evtRecTrackCol == s_staticEvtRecTrackCol ) s_staticEvtRecTrackCol = 0;
65 m_evtRecTrackCol->Delete();
66 delete m_evtRecTrackCol;
67 m_evtRecTrackCol = 0;
68
69 if ( m_evtRecPrimaryVertex == s_staticEvtRecPrimaryVertex ) s_staticEvtRecPrimaryVertex = 0;
70 delete m_evtRecPrimaryVertex;
71 m_evtRecPrimaryVertex = 0;
72
73 if ( m_evtRecVeeVertexCol == s_staticEvtRecVeeVertexCol ) s_staticEvtRecVeeVertexCol = 0;
74 m_evtRecVeeVertexCol->Delete();
75 delete m_evtRecVeeVertexCol;
76 m_evtRecVeeVertexCol = 0;
77
78 if ( m_evtRecPi0Col == s_staticEvtRecPi0Col ) s_staticEvtRecPi0Col = 0;
79 m_evtRecPi0Col->Delete();
80 delete m_evtRecPi0Col;
81 m_evtRecPi0Col = 0;
82
83 if ( m_evtRecEtaToGGCol == s_staticEvtRecEtaToGGCol ) s_staticEvtRecEtaToGGCol = 0;
84 m_evtRecEtaToGGCol->Delete();
85 delete m_evtRecEtaToGGCol;
86 m_evtRecEtaToGGCol = 0;
87
88 if ( m_evtRecDTagCol == s_staticEvtRecDTagCol ) s_staticEvtRecDTagCol = 0;
89 m_evtRecDTagCol->Delete();
90 delete m_evtRecDTagCol;
91 m_evtRecDTagCol = 0;
92
93}
94
96}
97
98void TEvtRecObject::Clear(Option_t* option) {
99}
100
101void TEvtRecObject::Print(Option_t* option) const {
102 TObject::Print(option);
103}
104
106 m_evtRecEvent->setTotalTracks ( evtRecEvent->totalTracks() );
107 m_evtRecEvent->setTotalCharged( evtRecEvent->totalCharged() );
108 m_evtRecEvent->setTotalNeutral( evtRecEvent->totalNeutral() );
109 m_evtRecEvent->setNumberOfVee ( evtRecEvent->numberOfVee() );
110 m_evtRecEvent->setNumberOfPi0 ( evtRecEvent->numberOfPi0() );
111 m_evtRecEvent->setNumberOfEtaToGG ( evtRecEvent->numberOfEtaToGG() );
112 m_evtRecEvent->setNumberOfDTag( evtRecEvent->numberOfDTag() );
113}
114
116 m_evtRecTrackCol->Add(track);
117}
118
120 if ( i >= m_evtRecTrackCol->GetEntries() || i < 0 )
121 return 0;
122 return (TEvtRecTrack*) m_evtRecTrackCol->At(i);
123}
124
126 m_evtRecPrimaryVertex->setIsValid (evtRecPrimaryVertex->isValid() );
127 m_evtRecPrimaryVertex->setNTracks (evtRecPrimaryVertex->nTracks() );
128 m_evtRecPrimaryVertex->setTrackIdList (evtRecPrimaryVertex->trackIdList() );
129 m_evtRecPrimaryVertex->setChi2 (evtRecPrimaryVertex->chi2() );
130 m_evtRecPrimaryVertex->setNdof (evtRecPrimaryVertex->ndof() );
131 m_evtRecPrimaryVertex->setFitMethod (evtRecPrimaryVertex->fitMethod() );
132 Double_t vtx[3];
133 for (Int_t i = 0; i < 3; i++) {
134 vtx[i] = evtRecPrimaryVertex->vertex(i);
135 }
136 Double_t Evtx[6];
137 for (Int_t i = 0; i < 6; i++) {
138 Evtx[i] = evtRecPrimaryVertex->errorVertex(i);
139 }
140 m_evtRecPrimaryVertex->setVertex (vtx);
141 m_evtRecPrimaryVertex->setErrorVertex (Evtx);
142}
143
145 m_evtRecVeeVertexCol->Add(veeVertex);
146}
147
148
149
151 m_evtRecPi0Col->Add(pi0);
152}
153
154
156 m_evtRecEtaToGGCol->Add(eta);
157}
158
160 m_evtRecDTagCol->Add(dtag);
161}
162
164 if ( i >= m_evtRecVeeVertexCol->GetEntries() || i < 0 )
165 return 0;
166 return (TEvtRecVeeVertex*) m_evtRecVeeVertexCol->At(i);
167}
168
169
171 if ( i >= m_evtRecPi0Col->GetEntries() || i < 0 )
172 return 0;
173 return (TEvtRecPi0*) m_evtRecPi0Col->At(i);
174}
175
176
178 if ( i >= m_evtRecEtaToGGCol->GetEntries() || i < 0 )
179 return 0;
180 return (TEvtRecEtaToGG*) m_evtRecEtaToGGCol->At(i);
181}
182
183
185 if ( i >= m_evtRecDTagCol->GetEntries() || i < 0 )
186 return 0;
187 return (TEvtRecDTag*) m_evtRecDTagCol->At(i);
188}
ClassImp(TBossFullEvent) TBossFullEvent
Int_t numberOfPi0() const
Definition: TEvtRecEvent.h:24
Int_t totalNeutral() const
Definition: TEvtRecEvent.h:22
void setNumberOfVee(const int nvee)
Definition: TEvtRecEvent.h:31
void setTotalCharged(const int nchrg)
Definition: TEvtRecEvent.h:29
Int_t totalCharged() const
Definition: TEvtRecEvent.h:21
void setNumberOfPi0(const int npi0)
Definition: TEvtRecEvent.h:32
void setNumberOfEtaToGG(const int neta)
Definition: TEvtRecEvent.h:33
Int_t totalTracks() const
Definition: TEvtRecEvent.h:20
Int_t numberOfEtaToGG() const
Definition: TEvtRecEvent.h:25
void setTotalNeutral(const int nneu)
Definition: TEvtRecEvent.h:30
void setTotalTracks(const int tottks)
Definition: TEvtRecEvent.h:28
void setNumberOfDTag(const int ndtag)
Definition: TEvtRecEvent.h:34
Int_t numberOfDTag() const
Definition: TEvtRecEvent.h:26
Int_t numberOfVee() const
Definition: TEvtRecEvent.h:23
const TEvtRecVeeVertex * getEvtRecVeeVertex(Int_t i) const
const TEvtRecTrack * getEvtRecTrack(Int_t i) const
const TEvtRecPi0 * getEvtRecPi0(Int_t i) const
const TEvtRecEtaToGG * getEvtRecEtaToGG(Int_t i) const
void addEvtRecEtaToGG(TEvtRecEtaToGG *eta)
void Clear(Option_t *option="")
void addEvtRecPi0(TEvtRecPi0 *pi0)
void Print(Option_t *option="") const
void setEvtRecPrimaryVertex(TEvtRecPrimaryVertex *evtRecPrimaryVertex)
void addEvtRecTrack(TEvtRecTrack *track)
void setEvtRecEvent(TEvtRecEvent *evtRecEvent)
virtual ~TEvtRecObject()
const TEvtRecDTag * getEvtRecDTag(Int_t i) const
void addEvtRecVeeVertex(TEvtRecVeeVertex *veeVertex)
void addEvtRecDTag(TEvtRecDTag *dtag)
Double_t errorVertex(Int_t i) const
void setChi2(Double_t chi2)
void setTrackIdList(const std::vector< Int_t > &trackIdList)
Double_t vertex(Int_t i) const
void setNdof(Int_t ndof)
const std::vector< Int_t > & trackIdList() const
void setErrorVertex(Double_t Evtx[6])
void setIsValid(Bool_t isValid)
void setFitMethod(Int_t fitMethod)
void setVertex(Double_t vtx[3])
void setNTracks(Int_t nTracks)