AEvent.h 1.83 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/*
 * 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"
20
#include "TF1.h"
21 22 23 24 25
//#include "TMath.h"


#include "RawEvent.h"

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

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

class AEvent {

private:

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

39 40
	Double_t fAmpMax;
	Double_t fTimeAmpMax;
41 42

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

45 46
	TGraph *fGraphSignal;
	TGraph *fGraphCFD;
47
	TGraph *fGraphZero;
48 49 50

	RawEvent *fInputEvent;		//!

51
	Double_t fCFratio;		//!
52 53
	Double_t fCFtimeDelay;		//!

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

66 67 68 69 70
	void SetCFratio(Double_t ratio) { fCFratio = ratio; };	
	//CFD set attenuation coefficient

	void SetCFtimeDelay(Double_t timeDelay) { fCFtimeDelay = timeDelay; };	
	//CFD set time delay (in points)
71

72 73 74
	void Reset();
	 //Resets arrays to zeros

75 76
	TGraph* GetGraphCFD() {

77
		return fGraphCFD;
78
	}
79 80 81 82 83 84 85 86 87
	//draws CFD graphs

	TGraph* GetGraphSignal() {

		return fGraphSignal;
	}
	//draws signal shape graphs

	Double_t FindZeroLevel(Int_t pmin = 10, Int_t pmax = 100);
88
	//for zero level correction. one parameter fit between pmin and pmax
89
	//returns fit parameter i.e. number on which amplitude should be corrected
90 91 92

private:
	void Init();
93
	void SetGraphs();
94
	void SetCFD();
95 96 97
};

#endif /* DATACLASSES_AEVENT_H_ */