ROOT
git-r3/HEAD
Reference Guide
Loading...
Searching...
No Matches
TEveVSD.cxx
Go to the documentation of this file.
1
// @(#)root/eve:$Id$
2
// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4
/*************************************************************************
5
* Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6
* All rights reserved. *
7
* *
8
* For the licensing terms see $ROOTSYS/LICENSE. *
9
* For the list of contributors see $ROOTSYS/README/CREDITS. *
10
*************************************************************************/
11
12
#include "
TEveVSD.h
"
13
14
/** \class TEveVSD
15
\ingroup TEve
16
Visualization Summary Data - a collection of trees holding standard
17
event data in experiment independent format.
18
*/
19
20
21
////////////////////////////////////////////////////////////////////////////////
22
/// Constructor.
23
24
TEveVSD::TEveVSD
(
const
char
* ,
const
char
*) :
25
TObject
(),
26
27
fFile
(nullptr),
28
fDirectory
(nullptr),
29
fBuffSize
(32000),
30
fVerbose
(0),
31
32
fTreeK
(nullptr),
33
fTreeH
(nullptr),
34
fTreeC
(nullptr),
35
fTreeR
(nullptr),
36
fTreeKK
(nullptr),
37
fTreeV0
(nullptr),
38
fTreeCC
(nullptr),
39
fTreeGI
(nullptr),
40
41
fK
(),
fpK
(&
fK
),
42
fH
(),
fpH
(&
fH
),
43
fC
(),
fpC
(&
fC
),
44
fR
(),
fpR
(&
fR
),
45
fKK
(),
fpKK
(&
fKK
),
46
fV0
(),
fpV0
(&
fV0
),
47
fCC
(),
fpCC
(&
fCC
),
48
fGI
(),
fpGI
(&
fGI
)
49
{
50
}
51
52
////////////////////////////////////////////////////////////////////////////////
53
/// Destructor.
54
55
TEveVSD::~TEveVSD
()
56
{
57
}
58
59
////////////////////////////////////////////////////////////////////////////////
60
/// Set directory in which the trees are (or will be) created.
61
62
void
TEveVSD::SetDirectory
(
TDirectory
* dir)
63
{
64
fDirectory
= dir;
65
}
66
67
////////////////////////////////////////////////////////////////////////////////
68
/// Create internal trees.
69
70
void
TEveVSD::CreateTrees
()
71
{
72
TDirectory::TContext
ctx{
fDirectory
};
73
fTreeK
=
new
TTree
(
"Kinematics"
,
"Simulated tracks."
);
74
fTreeH
=
new
TTree
(
"Hits"
,
"Combined detector hits."
);
75
fTreeC
=
new
TTree
(
"Clusters"
,
"Reconstructed clusters."
);
76
fTreeR
=
new
TTree
(
"RecTracks"
,
"Reconstructed tracks."
);
77
fTreeKK
=
new
TTree
(
"RecKinks"
,
"Reconstructed kinks."
);
78
fTreeV0
=
new
TTree
(
"RecV0s"
,
"Reconstructed V0s."
);
79
fTreeCC
=
new
TTree
(
"RecCascades"
,
"Reconstructed cascades."
);
80
fTreeGI
=
new
TTree
(
"TEveMCRecCrossRef"
,
"Objects prepared for cross query."
);
81
}
82
83
////////////////////////////////////////////////////////////////////////////////
84
/// Delete internal trees.
85
86
void
TEveVSD::DeleteTrees
()
87
{
88
delete
fTreeK
;
fTreeK
=
nullptr
;
89
delete
fTreeH
;
fTreeH
=
nullptr
;
90
delete
fTreeC
;
fTreeC
=
nullptr
;
91
delete
fTreeR
;
fTreeR
=
nullptr
;
92
delete
fTreeV0
;
fTreeV0
=
nullptr
;
93
delete
fTreeKK
;
fTreeKK
=
nullptr
;
94
delete
fTreeGI
;
fTreeGI
=
nullptr
;
95
}
96
97
////////////////////////////////////////////////////////////////////////////////
98
/// Create internal VSD branches.
99
100
void
TEveVSD::CreateBranches
()
101
{
102
if
(
fTreeK
)
fTreeK
->Branch(
"K"
,
"TEveMCTrack"
, &
fpK
);
103
if
(
fTreeH
)
fTreeH
->Branch(
"H"
,
"TEveHit"
, &
fpH
);
104
if
(
fTreeC
)
fTreeC
->Branch(
"C"
,
"TEveCluster"
, &
fpC
);
105
if
(
fTreeR
)
fTreeR
->Branch(
"R"
,
"TEveRecTrack"
, &
fpR
);
106
if
(
fTreeKK
)
fTreeKK
->Branch(
"KK"
,
"TEveRecKink"
, &
fpKK
);
107
if
(
fTreeV0
)
fTreeV0
->Branch(
"V0"
,
"TEveRecV0"
, &
fpV0
);
108
109
if
(
fTreeGI
)
110
{
111
fTreeGI
->Branch(
"GI"
,
"TEveMCRecCrossRef"
, &
fpGI
);
112
fTreeGI
->Branch(
"K."
,
"TEveMCTrack"
, &
fpK
);
113
fTreeGI
->Branch(
"R."
,
"TEveRecTrack"
, &
fpR
);
114
}
115
}
116
117
////////////////////////////////////////////////////////////////////////////////
118
/// Set branche addresses of internal trees.
119
120
void
TEveVSD::SetBranchAddresses
()
121
{
122
if
(
fTreeK
)
fTreeK
->SetBranchAddress(
"K"
, &
fpK
);
123
if
(
fTreeH
)
fTreeH
->SetBranchAddress(
"H"
, &
fpH
);
124
if
(
fTreeC
)
fTreeC
->SetBranchAddress(
"C"
, &
fpC
);
125
if
(
fTreeR
)
fTreeR
->SetBranchAddress(
"R"
, &
fpR
);
126
if
(
fTreeKK
)
fTreeKK
->SetBranchAddress(
"KK"
, &
fpKK
);
127
if
(
fTreeV0
)
fTreeV0
->SetBranchAddress(
"V0"
, &
fpV0
);
128
129
if
(
fTreeGI
)
130
{
131
fTreeGI
->SetBranchAddress(
"GI"
, &
fpGI
);
132
fTreeGI
->SetBranchAddress(
"K."
, &
fpK
);
133
fTreeGI
->SetBranchAddress(
"R."
, &
fpR
);
134
}
135
}
136
137
////////////////////////////////////////////////////////////////////////////////
138
/// Does nothing here ... reimplemented in sub-classes.
139
140
void
TEveVSD::WriteTrees
()
141
{
142
}
143
144
////////////////////////////////////////////////////////////////////////////////
145
/// Load internal trees from directory.
146
147
void
TEveVSD::LoadTrees
()
148
{
149
static
const
TEveException
eH(
"TEveVSD::LoadTrees "
);
150
151
if
(
fDirectory
==
nullptr
)
152
throw
eH +
"directory not set."
;
153
154
fTreeK
= (
TTree
*)
fDirectory
->Get(
"Kinematics"
);
155
if
(
fTreeK
==
nullptr
&&
fVerbose
) {
156
printf(
"%s Kinematics not available in fDirectory %s.\n"
,
157
eH.
Data
(),
fDirectory
->GetName());
158
}
159
160
fTreeH
= (
TTree
*)
fDirectory
->Get(
"Hits"
);
161
if
(
fTreeH
==
nullptr
&&
fVerbose
) {
162
printf(
"%s Hits not available in fDirectory %s.\n"
,
163
eH.
Data
(),
fDirectory
->GetName());
164
}
165
166
fTreeC
= (
TTree
*)
fDirectory
->Get(
"Clusters"
);
167
if
(
fTreeC
==
nullptr
&&
fVerbose
) {
168
printf(
"%s Clusters not available in fDirectory %s.\n"
,
169
eH.
Data
(),
fDirectory
->GetName());
170
}
171
172
fTreeR
= (
TTree
*)
fDirectory
->Get(
"RecTracks"
);
173
if
(
fTreeR
==
nullptr
&&
fVerbose
) {
174
printf(
"%s RecTracks not available in fDirectory %s.\n"
,
175
eH.
Data
(),
fDirectory
->GetName());
176
}
177
178
fTreeKK
= (
TTree
*)
fDirectory
->Get(
"RecKinks"
);
179
if
(
fTreeKK
==
nullptr
&&
fVerbose
) {
180
printf(
"%s Kinks not available in fDirectory %s.\n"
,
181
eH.
Data
(),
fDirectory
->GetName());
182
}
183
184
fTreeV0
= (
TTree
*)
fDirectory
->Get(
"RecV0s"
);
185
if
(
fTreeV0
==
nullptr
&&
fVerbose
) {
186
printf(
"%s V0 not available in fDirectory %s.\n"
,
187
eH.
Data
(),
fDirectory
->GetName());
188
}
189
190
fTreeGI
= (
TTree
*)
fDirectory
->Get(
"TEveMCRecCrossRef"
);
191
if
(
fTreeGI
==
nullptr
&&
fVerbose
) {
192
printf(
"%s TEveMCRecCrossRef not available in fDirectory %s.\n"
,
193
eH.
Data
(),
fDirectory
->GetName());
194
}
195
196
}
197
198
////////////////////////////////////////////////////////////////////////////////
199
/// Disable TObject streamers for those VSD structs that inherit from
200
/// TObject directly.
201
202
void
TEveVSD::DisableTObjectStreamersForVSDStruct
()
203
{
204
// TEveVector is not TObject
205
206
// TEveMCTrack derives from TParticle
207
TParticle::Class
()->
IgnoreTObjectStreamer
(
true
);
208
209
TEveHit::Class
()->
IgnoreTObjectStreamer
(
true
);
210
TEveCluster::Class
()->
IgnoreTObjectStreamer
(
true
);
211
212
TEveRecTrack::Class
()->
IgnoreTObjectStreamer
(
true
);
213
// TEveRecKink derives from TEveRecTrack
214
215
TEveRecV0::Class
()->
IgnoreTObjectStreamer
(
true
);
216
217
TEveMCRecCrossRef::Class
()->
IgnoreTObjectStreamer
(
true
);
218
}
TEveVSD.h
TClass::IgnoreTObjectStreamer
void IgnoreTObjectStreamer(Bool_t ignore=kTRUE)
When the class kIgnoreTObjectStreamer bit is set, the automatically generated Streamer will not call ...
Definition
TClass.cxx:4899
TDirectory::TContext
TDirectory::TContext keeps track and restore the current directory.
Definition
TDirectory.h:89
TDirectory
Describe directory structure in memory.
Definition
TDirectory.h:45
TEveCluster::Class
static TClass * Class()
TEveException
Exception class thrown by TEve classes and macros.
Definition
TEveUtil.h:102
TEveHit::Class
static TClass * Class()
TEveMCRecCrossRef::Class
static TClass * Class()
TEveRecTrackT< Float_t >::Class
static TClass * Class()
TEveRecV0::Class
static TClass * Class()
TEveVSD::fC
TEveCluster fC
Definition
TEveVSD.h:43
TEveVSD::fpCC
TEveRecCascade * fpCC
!
Definition
TEveVSD.h:47
TEveVSD::fBuffSize
Int_t fBuffSize
!
Definition
TEveVSD.h:28
TEveVSD::fTreeGI
TTree * fTreeGI
! Sim-Rec cross references.
Definition
TEveVSD.h:39
TEveVSD::DisableTObjectStreamersForVSDStruct
static void DisableTObjectStreamersForVSDStruct()
Disable TObject streamers for those VSD structs that inherit from TObject directly.
Definition
TEveVSD.cxx:202
TEveVSD::fR
TEveRecTrack fR
Definition
TEveVSD.h:44
TEveVSD::fCC
TEveRecCascade fCC
Definition
TEveVSD.h:47
TEveVSD::fV0
TEveRecV0 fV0
Definition
TEveVSD.h:46
TEveVSD::SetBranchAddresses
virtual void SetBranchAddresses()
Set branche addresses of internal trees.
Definition
TEveVSD.cxx:120
TEveVSD::~TEveVSD
~TEveVSD() override
Destructor.
Definition
TEveVSD.cxx:55
TEveVSD::DeleteTrees
virtual void DeleteTrees()
Delete internal trees.
Definition
TEveVSD.cxx:86
TEveVSD::fDirectory
TDirectory * fDirectory
!
Definition
TEveVSD.h:26
TEveVSD::fTreeCC
TTree * fTreeCC
! Cascades.
Definition
TEveVSD.h:38
TEveVSD::SetDirectory
virtual void SetDirectory(TDirectory *dir)
Set directory in which the trees are (or will be) created.
Definition
TEveVSD.cxx:62
TEveVSD::fTreeKK
TTree * fTreeKK
! Kinks.
Definition
TEveVSD.h:36
TEveVSD::fH
TEveHit fH
Definition
TEveVSD.h:42
TEveVSD::fpK
TEveMCTrack * fpK
!
Definition
TEveVSD.h:41
TEveVSD::fpGI
TEveMCRecCrossRef * fpGI
!
Definition
TEveVSD.h:48
TEveVSD::fTreeH
TTree * fTreeH
! Hits.
Definition
TEveVSD.h:33
TEveVSD::fGI
TEveMCRecCrossRef fGI
Definition
TEveVSD.h:48
TEveVSD::fTreeK
TTree * fTreeK
! Kinematics.
Definition
TEveVSD.h:32
TEveVSD::fKK
TEveRecKink fKK
Definition
TEveVSD.h:45
TEveVSD::fpKK
TEveRecKink * fpKK
!
Definition
TEveVSD.h:45
TEveVSD::fK
TEveMCTrack fK
Definition
TEveVSD.h:41
TEveVSD::fpH
TEveHit * fpH
!
Definition
TEveVSD.h:42
TEveVSD::fpC
TEveCluster * fpC
!
Definition
TEveVSD.h:43
TEveVSD::fFile
TFile * fFile
!
Definition
TEveVSD.h:25
TEveVSD::fTreeV0
TTree * fTreeV0
! VO's.
Definition
TEveVSD.h:37
TEveVSD::fTreeC
TTree * fTreeC
! Clusters.
Definition
TEveVSD.h:34
TEveVSD::CreateTrees
virtual void CreateTrees()
Create internal trees.
Definition
TEveVSD.cxx:70
TEveVSD::fpV0
TEveRecV0 * fpV0
!
Definition
TEveVSD.h:46
TEveVSD::fVerbose
Int_t fVerbose
!
Definition
TEveVSD.h:29
TEveVSD::fpR
TEveRecTrack * fpR
!
Definition
TEveVSD.h:44
TEveVSD::LoadTrees
virtual void LoadTrees()
Load internal trees from directory.
Definition
TEveVSD.cxx:147
TEveVSD::CreateBranches
virtual void CreateBranches()
Create internal VSD branches.
Definition
TEveVSD.cxx:100
TEveVSD::WriteTrees
virtual void WriteTrees()
Does nothing here ... reimplemented in sub-classes.
Definition
TEveVSD.cxx:140
TEveVSD::fTreeR
TTree * fTreeR
! Reconstructed tracks.
Definition
TEveVSD.h:35
TEveVSD::TEveVSD
TEveVSD(const TEveVSD &)
TObject::TObject
TObject()
TObject constructor.
Definition
TObject.h:259
TParticle::Class
static TClass * Class()
TString::Data
const char * Data() const
Definition
TString.h:384
TTree
A TTree represents a columnar dataset.
Definition
TTree.h:89
graf3d
eve
src
TEveVSD.cxx
ROOTgit-r3/HEAD - Reference Guide Generated on
(GVA Time) using Doxygen 1.16.1