GSI Object Oriented Online Offline (Go4)
GO4-6.2.0
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Go4ExampleUserSource
TYYYRawEvent.cxx
Go to the documentation of this file.
1
// $Id: TYYYRawEvent.cxx 2769 2020-04-16 14:54:23Z linev $
2
//-----------------------------------------------------------------------
3
// The GSI Online Offline Object Oriented (Go4) Project
4
// Experiment Data Processing at EE department, GSI
5
//-----------------------------------------------------------------------
6
// Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7
// Planckstr. 1, 64291 Darmstadt, Germany
8
// Contact: http://go4.gsi.de
9
//-----------------------------------------------------------------------
10
// This software can be used under the license agreements as stated
11
// in Go4License.txt file which is part of the distribution.
12
//-----------------------------------------------------------------------
13
14
#include "
TYYYRawEvent.h
"
15
16
#include <iostream>
17
18
#include "
TGo4Log.h
"
19
20
TYYYRawEvent::TYYYRawEvent
() :
21
TGo4EventElement
(),
22
fiColumns(0),
23
fdData(0),
24
fiAllocated(0)
25
{
26
// default ctor is for streamer only, avoid heap objects here!
27
}
28
29
TYYYRawEvent::TYYYRawEvent
(
const
char
* name) :
30
TGo4EventElement
(name),
31
fiColumns(0),
32
fdData(0),
33
fiAllocated(0)
34
{
35
}
36
37
TYYYRawEvent::~TYYYRawEvent
()
38
{
39
if
(
fdData
) {
40
delete
[]
fdData
;
41
fdData
= 0;
42
}
43
}
44
45
void
TYYYRawEvent::Clear
(Option_t *t)
46
{
47
for
(Int_t t=0; t<
fiColumns
;++t)
48
fdData
[t] = 0.;
49
}
50
51
void
TYYYRawEvent::ReAllocate
(Int_t newsize)
52
{
53
if
(newsize >
fiAllocated
) {
54
fiAllocated
= newsize < 16 ? 16 : (newsize + 8);
55
TGo4Log::Info
(
"YYYRawEvent reallocating from %d to %d"
,
fiColumns
,
fiAllocated
);
56
Double_t* narray=
new
Double_t[
fiAllocated
];
57
for
(Int_t i=0;i<
fiColumns
;++i)
58
narray[i] =
fdData
[i];
59
delete
[]
fdData
;
60
fdData
= narray;
61
fiColumns = newsize;
62
}
else
{
63
if
(newsize == 0) {
64
delete
[]
fdData
;
65
fdData
= 0;
66
fiAllocated
= 0;
67
}
68
fiColumns
= newsize;
69
}
70
}
71
72
void
TYYYRawEvent::PrintEvent
()
73
{
74
TGo4EventElement::PrintEvent
();
75
std::cout<<
" YYY Event printout: "
<<std::endl;
76
for
(Int_t t=0; t<
fiColumns
;++t)
77
std::cout <<
"\t dat("
<<t<<
")="
<<
fdData
[t]<<std::endl;
78
}
TYYYRawEvent.h
TYYYRawEvent::ReAllocate
void ReAllocate(Int_t newsize)
Definition:
TYYYRawEvent.cxx:51
TYYYRawEvent::Clear
virtual void Clear(Option_t *t="")
Definition:
TYYYRawEvent.cxx:45
TYYYRawEvent::PrintEvent
void PrintEvent()
Definition:
TYYYRawEvent.cxx:72
TYYYRawEvent::~TYYYRawEvent
virtual ~TYYYRawEvent()
Definition:
TYYYRawEvent.cxx:37
TYYYRawEvent::TYYYRawEvent
TYYYRawEvent()
Definition:
TYYYRawEvent.cxx:20
TGo4EventElement::PrintEvent
virtual void PrintEvent()
Definition:
TGo4EventElement.cxx:78
TGo4Log.h
TGo4EventElement
Definition:
TGo4EventElement.h:36
TYYYRawEvent::fdData
Double_t * fdData
Definition:
TYYYRawEvent.h:49
TYYYRawEvent::fiAllocated
Int_t fiAllocated
Definition:
TYYYRawEvent.h:51
TYYYRawEvent::fiColumns
Int_t fiColumns
Definition:
TYYYRawEvent.h:47
TGo4Log::Info
static void Info(const char *text,...)
Definition:
TGo4Log.cxx:297
Generated on Tue Apr 26 2022 16:39:54 for GSI Object Oriented Online Offline (Go4) by
1.8.8