GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TYYYRawEvent.cxx
Go to the documentation of this file.
1// $Id$
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
22{
23 // default ctor is for streamer only, avoid heap objects here!
24}
25
26TYYYRawEvent::TYYYRawEvent(const char *name) :
28{
29}
30
32{
33 if (fdData) {
34 delete [] fdData;
35 fdData = nullptr;
36 }
37}
38
39void TYYYRawEvent::Clear(Option_t *)
40{
41 for (Int_t t = 0; t < fiColumns; ++t)
42 fdData[t] = 0.;
43}
44
45void TYYYRawEvent::ReAllocate(Int_t newsize)
46{
47 if (newsize > fiAllocated) {
48 fiAllocated = newsize < 16 ? 16 : (newsize + 8);
49 TGo4Log::Info("YYYRawEvent reallocating from %d to %d", fiColumns, fiAllocated);
50 auto narray = new Double_t[fiAllocated];
51 for (Int_t i = 0; i < fiColumns; ++i)
52 narray[i] = fdData[i];
53 delete [] fdData;
54 fdData = narray;
55 fiColumns = newsize;
56 } else {
57 if (newsize == 0) {
58 delete [] fdData;
59 fdData = nullptr;
60 fiAllocated = 0;
61 }
62 fiColumns = newsize;
63 }
64}
65
67{
69 std::cout << " YYY Event printout: " << std::endl;
70 for (Int_t t = 0; t < fiColumns; ++t)
71 std::cout << "\t dat(" << t << ")=" << fdData[t] << std::endl;
72}
virtual void PrintEvent()
Method prints content of the event.
static void Info(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 1.
Definition TGo4Log.cxx:294
void PrintEvent() override
Method prints content of the event.
Double_t * fdData
void Clear(Option_t *opt="") override
Method called by the event owner (analysis step) to clear the event element.
virtual ~TYYYRawEvent()
Int_t fiAllocated
void ReAllocate(Int_t newsize)
Expand data field if necessary.