er  dev
ERNeuRadRawEvent.cxx
1 /********************************************************************************
2  * Copyright (C) Joint Institute for Nuclear Research *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence version 3 (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
9 #include "ERNeuRadRawEvent.h"
10 
11 ERNeuRadRawEvent::ERNeuRadRawEvent() :
12 //--------------------------------------------------------------------------------------------------
13 TNamed("ERNeuRadRawEvent", "ERNeuRadRawEvent"),
14 fNPoints(1024)
15 {
16  // TODO Auto-generated constructor stub
17  Init();
18  Reset();
19 }
20 //--------------------------------------------------------------------------------------------------
21 ERNeuRadRawEvent::ERNeuRadRawEvent(const Int_t npoints) : fNPoints(npoints) {
22  // TODO Auto-generated constructor stub
23  Init();
24  Reset();
25 }
26 //--------------------------------------------------------------------------------------------------
27 ERNeuRadRawEvent::~ERNeuRadRawEvent() {
28  // TODO Auto-generated destructor stub
29 }
30 //--------------------------------------------------------------------------------------------------
31 void ERNeuRadRawEvent::Init() {
32  fAmp.Set(fNPoints);
33  fTime.Set(fNPoints);
34 }
35 //--------------------------------------------------------------------------------------------------
36 void ERNeuRadRawEvent::Reset() {
37 
38  for (Int_t i = 0; i < fNPoints; i++) {
39  fAmp[i] = 0;
40  fTime[i] = 0;
41  }
42  fPEAmps.Reset();
43  fPETimes.Reset();
44  fStartTime = 0;
45  fFinishTime = 0;
46 }
47 //--------------------------------------------------------------------------------------------------
48 void ERNeuRadRawEvent::PrintTime(Int_t i) {
49  cout << fTime[i] << endl;
50 }
51 //--------------------------------------------------------------------------------------------------
52 void ERNeuRadRawEvent::PrintAmp(Int_t i) {
53  cout << fAmp[i] << endl;
54 }
55 //--------------------------------------------------------------------------------------------------
56 void ERNeuRadRawEvent::SetAmp(Double_t a, Int_t i) {
57 // cout << fNPoints << endl;
58  if (i >= fNPoints) {
59  Error("ERNeuRadRawEvent::SetAmp", "Array with raw amplitudes is overloaded!");
60  return;
61  }
62  fAmp[i] = a;
63  return;
64 }
65 //--------------------------------------------------------------------------------------------------
66 void ERNeuRadRawEvent::SetTime(Double_t t, Int_t i) {
67  if (i >=fNPoints) {
68  Error("ERNeuRadRawEvent::SetTime", "Array with raw times is overloaded!");
69  return;
70  }
71  fTime[i] = t;
72  return;
73 }
74 //--------------------------------------------------------------------------------------------------
75 Double_t ERNeuRadRawEvent::GetTime(Int_t i) {
76  return fTime[i];
77 }
78 //--------------------------------------------------------------------------------------------------
79 Double_t ERNeuRadRawEvent::GetAmp(Int_t i) {
80  return fAmp[i];
81 }
82 //--------------------------------------------------------------------------------------------------
83 void ERNeuRadRawEvent::SetStartTime(Double_t t) {
84  fStartTime = t;
85  return;
86 }
87 //--------------------------------------------------------------------------------------------------
88 void ERNeuRadRawEvent::SetFinishTime(Double_t t) {
89  fFinishTime = t;
90  return;
91 }
92 //--------------------------------------------------------------------------------------------------
93 void ERNeuRadRawEvent::SetEvent(Int_t t) {
94  fEvent = t;
95  return;
96 }
97 //--------------------------------------------------------------------------------------------------