Commit d3787933 authored by Vratislav Chudoba's avatar Vratislav Chudoba

Class AEvent modified. Second constructor added.

parent 580c6137
......@@ -8,17 +8,23 @@
#include "AEvent.h"
AEvent::AEvent() : fNPoints(1024) { //fNPoints is number of points in one event, 1024 or 1000
// TODO Auto-generated constructor stub
Init();
Reset();
}
AEvent::AEvent(const Int_t npoints) : fNPoints(npoints) {
Init();
Reset();
}
AEvent::~AEvent() {
// TODO Auto-generated destructor stub
delete gSignal;
delete gCFD;
delete fInputEvent;
}
void AEvent::SetRawDataFile(const char* inprawfile, const char* treename) {
......@@ -44,7 +50,7 @@ void AEvent::ProcessEvent() {
const Double_t *amp = fInputEvent->GetAmp();
const Double_t *time = fInputEvent->GetTime();
for(Int_t j = 0; j < NCELLS; j++) {
for(Int_t j = 0; j < fNPoints; j++) {
fAmpPos[j] = amp[j]*(-1.);
fTime[j] = time[j];
}
......@@ -53,7 +59,7 @@ void AEvent::ProcessEvent() {
Double_t maxAmpT = 0.;
maxAmp = fAmpPos[0];
for(Int_t j=0; j < NCELLS; j++) {
for(Int_t j=0; j < fNPoints; j++) {
if(fAmpPos[j] > maxAmp) {
maxAmp = fAmpPos[j];
maxAmpT = fTime[j];
......@@ -72,7 +78,7 @@ void AEvent::ProcessEvent() {
void AEvent::Reset() {
for (Int_t i = 0; i < NCELLS; i++) {
for (Int_t i = 0; i < fNPoints; i++) {
fAmpPos[i] = 0;
fTime[i] = 0;
fAmpCFD[i] = 0;
......@@ -93,6 +99,10 @@ void AEvent::SetInputEvent(RawEvent** event) {
void AEvent::Init() {
fAmpPos.Set(fNPoints);
fTime.Set(fNPoints);
fAmpCFD.Set(fNPoints);
gSignal = new TGraph();
gCFD = new TGraph();
fInputEvent = 0;
......
......@@ -22,7 +22,7 @@
#include "RawEvent.h"
#define NCELLS 1024
//#define NCELLS 1024
using std::cout;
using std::endl;
......@@ -32,11 +32,13 @@ class AEvent {
private:
const Int_t fNPoints; //!
Double_t fAmpPos[NCELLS]; //array for raw amplitudes
Double_t fTime[NCELLS]; //array for raw times
TArrayD fAmpPos; //array for raw amplitudes
TArrayD fTime; //array for raw times
Double_t fAmpMax;
Double_t fTimeAmpMax;
Double_t fAmpCFD[NCELLS]; //array for CFD amplitudes (attenuated, inversed and delayed)
TArrayD fAmpCFD; //array for CFD amplitudes (attenuated, inversed and delayed)
Double_t fCFD; //zero-crossing time
TGraph *gSignal;
......@@ -46,6 +48,7 @@ private:
public:
AEvent();
AEvent(const Int_t npoints);
virtual ~AEvent();
ClassDef(AEvent,1);
......
......@@ -65,11 +65,11 @@ void RawEvent::SetTime(Double_t t, Int_t i) {
return;
}
double RawEvent::GetTime(Int_t i) {
Double_t RawEvent::GetTime(Int_t i) {
return fTime[i];
}
double RawEvent::GetAmp(Int_t i) {
Double_t RawEvent::GetAmp(Int_t i) {
return fAmp[i];
}
//void RawEvent::SetGraphs() {
......
......@@ -62,9 +62,9 @@ public:
void PrintTime(Int_t i);
double GetTime(Int_t i);
Double_t GetTime(Int_t i);
double GetAmp(Int_t i);
Double_t GetAmp(Int_t i);
// void InvertAmp(Double_t a, Int_t i);
//Inverts the amplitudes i.e. makes from negative singals
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment