RawEvent.h 1.45 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
/*
 * RawEvent.h
 *
 *  Created on: Dec 27, 2016
 *      Author: vratik
 */

#ifndef DATACLASSES_RAWEVENT_H_
#define DATACLASSES_RAWEVENT_H_

#include <iostream>

//#include "Rtypes.h"
#include "TError.h"
#include "TGraph.h"
#include "TArrayD.h"

//#define NCELLS 1024

using std::cout;
using std::endl;

class RawEvent {

private:
//	Double_t fAmp[NCELLS]; //array for raw amplitudes
//	Double_t fTime[NCELLS]; //array for raw times

	TArrayD fAmp;	//array for raw amplitudes
	TArrayD fTime;	//array for raw times

	const Int_t fNPoints;	//!

//	TGraph *gAmp;

//public:
//	TArrayD fAmpA;

public:
	RawEvent();
	RawEvent(const Int_t npoints);
	virtual ~RawEvent();
	ClassDef(RawEvent,1);

	void Reset();
	//Resets arrays to zeros

	const Double_t* GetAmp() const { return fAmp.GetArray(); }
	
	const Double_t* GetTime() const { return fTime.GetArray(); }

	void SetAmp(Double_t a, Int_t i);
	//Takes amplitude (raw data, voltage from binary file) 
54
	//and places it in the array fAmp
55 56 57

	void SetTime(Double_t t, Int_t i);
	//Takes time (raw data, times from binary file) 
58
	//and places it in the array fTime
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79

	void PrintAmp(Int_t i);
	//Prints i amplitudes (to make sense i shold be NCELLS)

	void PrintTime(Int_t i);

//	void InvertAmp(Double_t a, Int_t i);
	//Inverts the amplitudes i.e. makes from negative singals 
	//posititve signals and vise versa.

//	void SetGraphs();
//	TGraph* GetGraph() {
//		return gAmp;
//	}

private:
	void Init();

};

#endif /* DATACLASSES_RAWEVENT_H_ */