ROOT
git-r3/HEAD
Reference Guide
Loading...
Searching...
No Matches
REveVSD.cxx
Go to the documentation of this file.
1
// @(#)root/eve7:$Id$
2
// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007, 2018
3
4
/*************************************************************************
5
* Copyright (C) 1995-2019, 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 <
ROOT/REveVSD.hxx
>
13
14
#include "
TTree.h
"
15
16
using namespace
ROOT::Experimental
;
17
18
/** \class REveVSD
19
\ingroup REve
20
Visualization Summary Data - a collection of trees holding standard
21
event data in experiment independent format.
22
*/
23
24
////////////////////////////////////////////////////////////////////////////////
25
/// Constructor.
26
27
REveVSD::REveVSD
(
const
char
* ,
const
char
*) :
28
TObject
(),
29
30
fFile
(nullptr),
31
fDirectory
(nullptr),
32
fBuffSize
(32000),
33
fVerbose
(0),
34
35
fTreeK
(nullptr),
36
fTreeH
(nullptr),
37
fTreeC
(nullptr),
38
fTreeR
(nullptr),
39
fTreeKK
(nullptr),
40
fTreeV0
(nullptr),
41
fTreeCC
(nullptr),
42
fTreeGI
(nullptr),
43
44
fK
(),
fpK
(&
fK
),
45
fH
(),
fpH
(&
fH
),
46
fC
(),
fpC
(&
fC
),
47
fR
(),
fpR
(&
fR
),
48
fKK
(),
fpKK
(&
fKK
),
49
fV0
(),
fpV0
(&
fV0
),
50
fCC
(),
fpCC
(&
fCC
),
51
fGI
(),
fpGI
(&
fGI
)
52
{
53
}
54
55
////////////////////////////////////////////////////////////////////////////////
56
/// Destructor.
57
58
REveVSD::~REveVSD
()
59
{
60
}
61
62
////////////////////////////////////////////////////////////////////////////////
63
/// Set directory in which the trees are (or will be) created.
64
65
void
REveVSD::SetDirectory
(
TDirectory
* dir)
66
{
67
fDirectory
= dir;
68
}
69
70
////////////////////////////////////////////////////////////////////////////////
71
/// Create internal trees.
72
73
void
REveVSD::CreateTrees
()
74
{
75
TDirectory::TContext
ctx{
fDirectory
};
76
fTreeK
=
new
TTree
(
"Kinematics"
,
"Simulated tracks."
);
77
fTreeH
=
new
TTree
(
"Hits"
,
"Combined detector hits."
);
78
fTreeC
=
new
TTree
(
"Clusters"
,
"Reconstructed clusters."
);
79
fTreeR
=
new
TTree
(
"RecTracks"
,
"Reconstructed tracks."
);
80
fTreeKK
=
new
TTree
(
"RecKinks"
,
"Reconstructed kinks."
);
81
fTreeV0
=
new
TTree
(
"RecV0s"
,
"Reconstructed V0s."
);
82
fTreeCC
=
new
TTree
(
"RecCascades"
,
"Reconstructed cascades."
);
83
fTreeGI
=
new
TTree
(
"REveMCRecCrossRef"
,
"Objects prepared for cross query."
);
84
}
85
86
////////////////////////////////////////////////////////////////////////////////
87
/// Delete internal trees.
88
89
void
REveVSD::DeleteTrees
()
90
{
91
delete
fTreeK
;
fTreeK
=
nullptr
;
92
delete
fTreeH
;
fTreeH
=
nullptr
;
93
delete
fTreeC
;
fTreeC
=
nullptr
;
94
delete
fTreeR
;
fTreeR
=
nullptr
;
95
delete
fTreeV0
;
fTreeV0
=
nullptr
;
96
delete
fTreeKK
;
fTreeKK
=
nullptr
;
97
delete
fTreeGI
;
fTreeGI
=
nullptr
;
98
}
99
100
////////////////////////////////////////////////////////////////////////////////
101
/// Create internal VSD branches.
102
103
void
REveVSD::CreateBranches
()
104
{
105
if
(
fTreeK
)
fTreeK
->Branch(
"K"
,
"REveMCTrack"
, &
fpK
);
106
if
(
fTreeH
)
fTreeH
->Branch(
"H"
,
"REveHit"
, &
fpH
);
107
if
(
fTreeC
)
fTreeC
->Branch(
"C"
,
"REveCluster"
, &
fpC
);
108
if
(
fTreeR
)
fTreeR
->Branch(
"R"
,
"REveRecTrack"
, &
fpR
);
109
if
(
fTreeKK
)
fTreeKK
->Branch(
"KK"
,
"REveRecKink"
, &
fpKK
);
110
if
(
fTreeV0
)
fTreeV0
->Branch(
"V0"
,
"REveRecV0"
, &
fpV0
);
111
112
if
(
fTreeGI
)
113
{
114
fTreeGI
->Branch(
"GI"
,
"REveMCRecCrossRef"
, &
fpGI
);
115
fTreeGI
->Branch(
"K."
,
"REveMCTrack"
, &
fpK
);
116
fTreeGI
->Branch(
"R."
,
"REveRecTrack"
, &
fpR
);
117
}
118
}
119
120
////////////////////////////////////////////////////////////////////////////////
121
/// Set branche addresses of internal trees.
122
123
void
REveVSD::SetBranchAddresses
()
124
{
125
if
(
fTreeK
)
fTreeK
->SetBranchAddress(
"K"
, &
fpK
);
126
if
(
fTreeH
)
fTreeH
->SetBranchAddress(
"H"
, &
fpH
);
127
if
(
fTreeC
)
fTreeC
->SetBranchAddress(
"C"
, &
fpC
);
128
if
(
fTreeR
)
fTreeR
->SetBranchAddress(
"R"
, &
fpR
);
129
if
(
fTreeKK
)
fTreeKK
->SetBranchAddress(
"KK"
, &
fpKK
);
130
if
(
fTreeV0
)
fTreeV0
->SetBranchAddress(
"V0"
, &
fpV0
);
131
132
if
(
fTreeGI
)
133
{
134
fTreeGI
->SetBranchAddress(
"GI"
, &
fpGI
);
135
fTreeGI
->SetBranchAddress(
"K."
, &
fpK
);
136
fTreeGI
->SetBranchAddress(
"R."
, &
fpR
);
137
}
138
}
139
140
////////////////////////////////////////////////////////////////////////////////
141
/// Does nothing here ... reimplemented in sub-classes.
142
143
void
REveVSD::WriteTrees
()
144
{
145
}
146
147
////////////////////////////////////////////////////////////////////////////////
148
/// Load internal trees from directory.
149
150
void
REveVSD::LoadTrees
()
151
{
152
static
const
REveException
eH(
"REveVSD::LoadTrees"
);
153
154
if
(!
fDirectory
)
155
throw
eH +
" directory not set."
;
156
157
fTreeK
= (
TTree
*)
fDirectory
->Get(
"Kinematics"
);
158
if
(!
fTreeK
&&
fVerbose
)
159
Error
(
"REveVSD::LoadTrees"
,
"Kinematics not available in fDirectory %s."
,
fDirectory
->GetName());
160
161
fTreeH
= (
TTree
*)
fDirectory
->Get(
"Hits"
);
162
if
(!
fTreeH
&&
fVerbose
)
163
Error
(
"REveVSD::LoadTrees"
,
"Hits not available in fDirectory %s."
,
fDirectory
->GetName());
164
165
fTreeC
= (
TTree
*)
fDirectory
->Get(
"Clusters"
);
166
if
(!
fTreeC
&&
fVerbose
)
167
Error
(
"REveVSD::LoadTrees"
,
"Clusters not available in fDirectory %s."
,
fDirectory
->GetName());
168
169
fTreeR
= (
TTree
*)
fDirectory
->Get(
"RecTracks"
);
170
if
(!
fTreeR
&&
fVerbose
)
171
Error
(
"REveVSD::LoadTrees"
,
"RecTracks not available in fDirectory %s."
,
fDirectory
->GetName());
172
173
fTreeKK
= (
TTree
*)
fDirectory
->Get(
"RecKinks"
);
174
if
(!
fTreeKK
&&
fVerbose
)
175
Error
(
"REveVSD::LoadTrees"
,
"RecKinks not available in fDirectory %s."
,
fDirectory
->GetName());
176
177
fTreeV0
= (
TTree
*)
fDirectory
->Get(
"RecV0s"
);
178
if
(!
fTreeV0
&&
fVerbose
)
179
Error
(
"REveVSD::LoadTrees"
,
"RecV0 not available in fDirectory %s."
,
fDirectory
->GetName());
180
181
fTreeGI
= (
TTree
*)
fDirectory
->Get(
"REveMCRecCrossRef"
);
182
if
(!
fTreeGI
&&
fVerbose
)
183
Error
(
"REveVSD::LoadTrees"
,
"REveMCRecCrossRef not available in fDirectory %s."
,
fDirectory
->GetName());
184
}
185
186
////////////////////////////////////////////////////////////////////////////////
187
/// Disable TObject streamers for those VSD structs that inherit from
188
/// TObject directly.
189
190
void
REveVSD::DisableTObjectStreamersForVSDStruct
()
191
{
192
// REveVector is not TObject
193
194
// REveMCTrack derives from TParticle
195
TParticle::Class
()->
IgnoreTObjectStreamer
(
true
);
196
197
// REveHit::Class()->IgnoreTObjectStreamer(true);
198
// REveCluster::Class()->IgnoreTObjectStreamer(true);
199
200
// REveRecTrack::Class()->IgnoreTObjectStreamer(true);
201
// REveRecKink derives from REveRecTrack
202
203
// REveRecV0::Class()->IgnoreTObjectStreamer(true);
204
205
// REveMCRecCrossRef::Class()->IgnoreTObjectStreamer(true);
206
}
REveVSD.hxx
TTree.h
ROOT::Experimental::REveException
REveException Exception-type thrown by Eve classes.
Definition
REveTypes.hxx:42
ROOT::Experimental::REveVSD::fVerbose
Int_t fVerbose
!
Definition
REveVSD.hxx:34
ROOT::Experimental::REveVSD::fV0
REveRecV0 fV0
Definition
REveVSD.hxx:51
ROOT::Experimental::REveVSD::CreateBranches
virtual void CreateBranches()
Create internal VSD branches.
Definition
REveVSD.cxx:103
ROOT::Experimental::REveVSD::fCC
REveRecCascade fCC
Definition
REveVSD.hxx:52
ROOT::Experimental::REveVSD::fTreeR
TTree * fTreeR
! Reconstructed tracks.
Definition
REveVSD.hxx:40
ROOT::Experimental::REveVSD::fpKK
REveRecKink * fpKK
!
Definition
REveVSD.hxx:50
ROOT::Experimental::REveVSD::fTreeK
TTree * fTreeK
! Kinematics.
Definition
REveVSD.hxx:37
ROOT::Experimental::REveVSD::fTreeH
TTree * fTreeH
! Hits.
Definition
REveVSD.hxx:38
ROOT::Experimental::REveVSD::DisableTObjectStreamersForVSDStruct
static void DisableTObjectStreamersForVSDStruct()
Disable TObject streamers for those VSD structs that inherit from TObject directly.
Definition
REveVSD.cxx:190
ROOT::Experimental::REveVSD::fpR
REveRecTrack * fpR
!
Definition
REveVSD.hxx:49
ROOT::Experimental::REveVSD::DeleteTrees
virtual void DeleteTrees()
Delete internal trees.
Definition
REveVSD.cxx:89
ROOT::Experimental::REveVSD::REveVSD
REveVSD(const REveVSD &)=delete
ROOT::Experimental::REveVSD::fpH
REveHit * fpH
!
Definition
REveVSD.hxx:47
ROOT::Experimental::REveVSD::fTreeKK
TTree * fTreeKK
! Kinks.
Definition
REveVSD.hxx:41
ROOT::Experimental::REveVSD::CreateTrees
virtual void CreateTrees()
Create internal trees.
Definition
REveVSD.cxx:73
ROOT::Experimental::REveVSD::fTreeV0
TTree * fTreeV0
! VO's.
Definition
REveVSD.hxx:42
ROOT::Experimental::REveVSD::fpC
REveCluster * fpC
!
Definition
REveVSD.hxx:48
ROOT::Experimental::REveVSD::fFile
TFile * fFile
!
Definition
REveVSD.hxx:30
ROOT::Experimental::REveVSD::fpGI
REveMCRecCrossRef * fpGI
!
Definition
REveVSD.hxx:53
ROOT::Experimental::REveVSD::WriteTrees
virtual void WriteTrees()
Does nothing here ... reimplemented in sub-classes.
Definition
REveVSD.cxx:143
ROOT::Experimental::REveVSD::fTreeCC
TTree * fTreeCC
! Cascades.
Definition
REveVSD.hxx:43
ROOT::Experimental::REveVSD::fBuffSize
Int_t fBuffSize
!
Definition
REveVSD.hxx:33
ROOT::Experimental::REveVSD::fC
REveCluster fC
Definition
REveVSD.hxx:48
ROOT::Experimental::REveVSD::fH
REveHit fH
Definition
REveVSD.hxx:47
ROOT::Experimental::REveVSD::fK
REveMCTrack fK
Definition
REveVSD.hxx:46
ROOT::Experimental::REveVSD::fTreeGI
TTree * fTreeGI
! Sim-Rec cross references.
Definition
REveVSD.hxx:44
ROOT::Experimental::REveVSD::fpV0
REveRecV0 * fpV0
!
Definition
REveVSD.hxx:51
ROOT::Experimental::REveVSD::fGI
REveMCRecCrossRef fGI
Definition
REveVSD.hxx:53
ROOT::Experimental::REveVSD::fDirectory
TDirectory * fDirectory
!
Definition
REveVSD.hxx:31
ROOT::Experimental::REveVSD::SetDirectory
virtual void SetDirectory(TDirectory *dir)
Set directory in which the trees are (or will be) created.
Definition
REveVSD.cxx:65
ROOT::Experimental::REveVSD::fpCC
REveRecCascade * fpCC
!
Definition
REveVSD.hxx:52
ROOT::Experimental::REveVSD::LoadTrees
virtual void LoadTrees()
Load internal trees from directory.
Definition
REveVSD.cxx:150
ROOT::Experimental::REveVSD::~REveVSD
~REveVSD() override
Destructor.
Definition
REveVSD.cxx:58
ROOT::Experimental::REveVSD::SetBranchAddresses
virtual void SetBranchAddresses()
Set branche addresses of internal trees.
Definition
REveVSD.cxx:123
ROOT::Experimental::REveVSD::fKK
REveRecKink fKK
Definition
REveVSD.hxx:50
ROOT::Experimental::REveVSD::fR
REveRecTrack fR
Definition
REveVSD.hxx:49
ROOT::Experimental::REveVSD::fTreeC
TTree * fTreeC
! Clusters.
Definition
REveVSD.hxx:39
ROOT::Experimental::REveVSD::fpK
REveMCTrack * fpK
!
Definition
REveVSD.hxx:46
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
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition
TObject.cxx:1098
TObject::TObject
TObject()
TObject constructor.
Definition
TObject.h:259
TParticle::Class
static TClass * Class()
TTree
A TTree represents a columnar dataset.
Definition
TTree.h:89
ROOT::Experimental
Namespace for ROOT features in testing.
Definition
TROOT.h:100
graf3d
eve7
src
REveVSD.cxx
ROOTgit-r3/HEAD - Reference Guide Generated on
(GVA Time) using Doxygen 1.16.1