/* * AEvent.h * * Created on: Dec 28, 2016 * Author: daria */ #ifndef DATACLASSES_AEVENT_H_ #define DATACLASSES_AEVENT_H_ #include #include #include #include #include "TError.h" #include "TString.h" #include "TTree.h" #include "TFile.h" #include "TF1.h" //#include "TMath.h" #include "RawEvent.h" //#define NCELLS 1024 using std::cout; using std::endl; class AEvent { private: const Int_t fNPoints; //! TArrayD fAmpPos; //array for raw amplitudes TArrayD fTime; //array for raw times Double_t fAmpMax; Double_t fTimeAmpMax; Double_t fZeroLevel; TArrayD fAmpCFD; //array for CFD amplitudes (attenuated, inversed and delayed) Double_t fTimeCFD; //zero-crossing time Double_t fChargeCFD; //charge of the signal in Coulomb TGraph *fGraphSignal; TGraph *fGraphCFD; RawEvent *fInputEvent; //! Double_t fCFratio; //! Double_t fCFtimeDelay; //! public: AEvent(); AEvent(const Int_t npoints); virtual ~AEvent(); ClassDef(AEvent,1); Double_t GetfCFD(); Double_t GetOnefTime(Int_t i); Double_t GetOnefAmpPos(Int_t i); void SetRawDataFile(const char* inprawfile, const char* treename); void ProcessEvent(); void SetInputEvent(RawEvent** event); void SetCFratio(Double_t ratio) { fCFratio = ratio; }; //CFD set attenuation coefficient void SetCFtimeDelay(Double_t timeDelay) { fCFtimeDelay = timeDelay; }; //CFD set time delay (in points) void Reset(); //Resets arrays to zeros TGraph* GetGraphCFD() { return fGraphCFD; } //draws CFD graphs TGraph* GetGraphSignal() { return fGraphSignal; } //draws signal shape graphs Double_t FindZeroLevel(Int_t pmin = 10, Int_t pmax = 100); //for zero level correction. one parameter fit between pmin and pmax //returns fit parameter i.e. number on which amplitude should be corrected void SetChargeCFD(Int_t tmin = -3, Int_t tmax = 17); //calculates charge of the signal (i.e. its integral //in range of (tmin,tmax) in ns) //CFD time is taken as a start point private: void Init(); void SetGraphs(); void SetCFD(); }; #endif /* DATACLASSES_AEVENT_H_ */