er  dev
ERNeuRadRawEvent.h
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 #ifndef ERNeuRadRawEvent_H
10 #define ERNeuRadRawEvent_H
11 
12 #include <iostream>
13 
14 #include "TError.h"
15 #include "TGraph.h"
16 #include "TArrayD.h"
17 #include "TNamed.h"
18 #include "TArrayF.h"
19 
20 using std::cout;
21 using std::endl;
22 
28 class ERNeuRadRawEvent: public TNamed {
29 
30 private:
31  TArrayD fAmp; //array for raw amplitudes
32  TArrayD fTime; //array for raw times
33 
34  TArrayF fPEAmps; //array for amps of single electron signals
35  TArrayF fPETimes; // array for times of single electron signals
36 
37  Double_t fStartTime;
38  Double_t fFinishTime;
39  Int_t fEvent;
40  const Int_t fNPoints;
41 
42 public:
44  ERNeuRadRawEvent(const Int_t npoints);
45  virtual ~ERNeuRadRawEvent();
46  ClassDef(ERNeuRadRawEvent,1);
47 
48  void Reset();
49  //Resets arrays to zeros
50 
51  const Double_t* GetAmp() const { return fAmp.GetArray(); }
52  const Double_t* GetTime() const { return fTime.GetArray(); }
53 
54  void SetAmp(Double_t a, Int_t i);
55  //Takes amplitude (raw data, voltage from binary file)
56  //and places it in the array fAmp
57 
58  void SetTime(Double_t t, Int_t i);
59  //Takes time (raw data, times from binary file)
60  //and places it in the array fTime
61 
62  void PrintAmp(Int_t i);
63  //Prints i amplitudes (to make sense i shold be NCELLS)
64 
65  void PrintTime(Int_t i);
66 
67  Double_t GetTime(Int_t i);
68 
69  Double_t GetAmp(Int_t i);
70 
71  Double_t& Amp(Int_t i){return fAmp[i];}
72 
73 // void InvertAmp(Double_t a, Int_t i);
74  //Inverts the amplitudes i.e. makes from negative singals
75  //posititve signals and vise versa.
76 
77 // void SetGraphs();
78 // TGraph* GetGraph() {
79 // return gAmp;
80 // }
81  TArrayF& GetPEAmps() {return fPEAmps;}
82  TArrayF& GetPETimes() {return fPETimes;}
83  void SetPETimes(TArrayF& fPETimesOLD) {fPETimesOLD.Copy(fPETimes);}
84  void SetPEAmps(TArrayF& fPEAmpsOLD) {fPEAmpsOLD.Copy(fPEAmps);}
85 
86  void SetStartTime(Double_t t);
87  Double_t GetStartTime() {return fStartTime;}
88  void SetFinishTime(Double_t t);
89  Double_t GetFinishTime() {return fFinishTime;}
90  void SetEvent(Int_t t);
91  Int_t GetEvent() {return fEvent;}
92 
93 private:
94  void Init();
95 
96 };
97 
98 #endif /* ERNeuRadRawEvent_H */
class for raw data obtained from measurements or simulations