/* * 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 } void 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 AnalyzeData::ProcessEvent(RawData *event) { const Double_t *amp = event->GetAmp(); const Double_t *time = event->GetTime(); for(Int_t j = 0; j < NCELLS; j++) { fAmpPos[j] = amp[j]*(-1.); fTime[j] = time[j]; } Double_t maxAmp = 0.; Double_t maxAmpT = 0.; maxAmp = fAmpPos[0]; for(Int_t j=0; j maxAmp) { maxAmp = fAmpPos[j]; maxAmpT = fTime[j]; } } fAmpMax = maxAmp; fTimeAmpMax = maxAmpT; } /* 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; }*/