AnalyzeData.cpp 1.29 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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
/*
 * AnalyzeData.cpp
 *
 *  Created on: Dec 28, 2016
 *      Author: daria
 */

#include "AnalyzeData.h"

AnalyzeData::AnalyzeData() {
	// TODO Auto-generated constructor stub

	TGraph gr;

}

AnalyzeData::~AnalyzeData() {
	// TODO Auto-generated destructor stub
}

Bool_t AnalyzeData::SetRawDataFile(const char* inprawfile, const char* treename) {

	TString iFileName = inprawfile;
	TFile *fraw = new TFile(iFileName.Data());
	if ( !fraw->IsOpen() ) {
		Error("SetRawDataFile", "File %s was not opened and won't be processed", iFileName.Data());
		return 0;
	}
	TTree *traw = (TTree*)fraw->Get(treename);
	if (!traw) {
		Error("SetRawDataFile", "Tree %s was not found in file %s", treename, iFileName.Data());
		return 0;
	}
	//traw->Draw
}
/*
void RawData::Reset() {

	for (Int_t i = 0; i < NCELLS; i++) {
		Amp[i] = 0;
		Time[i] = 0;
	}

}

void RawData::PrintTime(Int_t i) {
		cout << Time[i] << endl;
}

void RawData::PrintAmp(Int_t i) {
		cout << Amp[i] << endl;
}

void RawData::SetAmp(Double_t a, Int_t i) {
	if (i >=NCELLS) {
		cout << "Error: array with raw amplitudes is overloaded!" << endl;
		return;
	}
	Amp[i] = a;
	return;
}

void RawData::SetTime(Double_t t, Int_t i) {
	if (i >=NCELLS) {
		cout << "Error: array with raw times is overloaded!" << endl;
		return;
	}
	Time[i] = t;
	return;
}*/