AEvent.h 1.46 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
/*
 * AEvent.h
 *
 *  Created on: Dec 28, 2016
 *      Author: daria
 */

#ifndef DATACLASSES_AEVENT_H_
#define DATACLASSES_AEVENT_H_

#include <iostream>
#include <fstream>
#include <iomanip>
#include <sstream>

#include "TError.h"
#include "TString.h"
#include "TTree.h"
#include "TFile.h"
//#include "TMath.h"


#include "RawEvent.h"

25
//#define NCELLS 1024
26 27 28 29 30 31 32 33 34

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

class AEvent {

private:

	const Int_t fNPoints;	//!
35 36 37
	TArrayD fAmpPos;	//array for raw amplitudes
	TArrayD fTime;		//array for raw times

38 39
	Double_t fAmpMax;
	Double_t fTimeAmpMax;
40 41

	TArrayD fAmpCFD;	//array for CFD amplitudes (attenuated, inversed and delayed)
42
	Double_t fCFD;			//zero-crossing time
43

44 45
	TGraph *fGraphSignal;
	TGraph *fGraphCFD;
46 47 48

	RawEvent *fInputEvent;		//!

49 50 51
	Double_t fCFratio;			//!
	Double_t fCFtimeDelay;		//!

52 53
public:
	AEvent();
54
	AEvent(const Int_t npoints);
55 56
	virtual ~AEvent();
	ClassDef(AEvent,1);
Muzalevsky I.A's avatar
Muzalevsky I.A committed
57 58 59
	Double_t GetfCFD();
	Double_t GetOnefTime(Int_t i);
	Double_t GetOnefAmpPos(Int_t i);
60 61 62 63
	void SetRawDataFile(const char* inprawfile, const char* treename);
	void ProcessEvent();
//	void Integral()
	void SetInputEvent(RawEvent** event);
64 65 66 67

	void SetCFratio(Double_t ratio) { fCFratio = ratio; };
	void SetCFtimeDelay(Double_t timeDelay) { fCFtimeDelay = timeDelay; };

68 69 70 71
	void Reset();
	 //Resets arrays to zeros

	TGraph* GetGraph() {
72 73
		//todo
		return fGraphCFD;
74
	//	return gSignal;
75 76 77 78
	}

private:
	void Init();
79
	void SetGraphs();
80
	void SetCFD();
81 82 83
};

#endif /* DATACLASSES_AEVENT_H_ */