diff --git a/convertDRS4/read_binary.cpp b/convertDRS4/read_binary.cpp index eb4a5f65e00ea7507ec07b28ab0035ee5e09ca11..40dde8189581c1904cd06fe75591b7005ee48e54 100644 --- a/convertDRS4/read_binary.cpp +++ b/convertDRS4/read_binary.cpp @@ -32,7 +32,7 @@ #include "TH1F.h" //our code -#include "../dataClasses/RawData.h" +#include "../dataClasses/RawEvent.h" typedef struct { char tag[3]; @@ -123,8 +123,8 @@ int main(int argc, const char * argv[]) rtree->Branch("amp_ch1", amp_ch1, "amp_ch1[ncell]/D"); rtree->Branch("time_ch1", time_ch1, "time_ch1[ncell]/D"); - RawData *event = new RawData(); - rtree->Bronch("rawEvent", "RawData", &event); + RawEvent *event = new RawEvent(); + rtree->Bronch("rawEvent", "RawEvent", &event); //------for other channels // rtree->Branch("amp_ch2", amp_ch2, "amp_ch2[ncell]/D"); diff --git a/dataClasses/AnalyzeData.cpp b/dataClasses/AnalyzeData.cpp deleted file mode 100644 index 40fd1f9e041502e8589d9a2154dd91a1291ec1b0..0000000000000000000000000000000000000000 --- a/dataClasses/AnalyzeData.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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; -}*/ - diff --git a/dataClasses/AnalyzeData.h b/dataClasses/AnalyzeData.h deleted file mode 100644 index fd0df9941c33ffcb0ba94bef18002430be41c25c..0000000000000000000000000000000000000000 --- a/dataClasses/AnalyzeData.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * AnalyzeData.h - * - * Created on: Dec 28, 2016 - * Author: daria - */ - -#ifndef DATACLASSES_ANALYZEDATA_H_ -#define DATACLASSES_ANALYZEDATA_H_ - -#include -#include -#include -#include - -#include "TString.h" -#include "TTree.h" -#include "TFile.h" -#include "TMath.h" - -#include "RawData.h" - -#define NCELLS 1024 - -using std::cout; -using std::endl; - -class AnalyzeData { - -private: - - Double_t fAmpPos[NCELLS]; //array for raw amplitudes - Double_t fTime[NCELLS]; //array for raw times*/ - Double_t fAmpMax; - Double_t fTimeAmpMax; - -public: - AnalyzeData(); - virtual ~AnalyzeData(); - ClassDef(AnalyzeData,1); - - void SetRawDataFile(const char* inprawfile, const char* treename); - void ProcessEvent(RawData* event); -// void Integral() -/* void Reset(); - //Resets arrays to zeros - - const Double_t* GetAmp() const { - return Amp; - } - - const Double_t* GetTime() const { - return Time; - } - - void SetAmp(Double_t a, Int_t i); - //Takes amplitude (raw data, voltage from binary file) - //and places it in the array Amp[NCELLS] - - void SetTime(Double_t t, Int_t i); - //Takes time (raw data, times from binary file) - //and places it in the array Time[NCELLS] - - void PrintAmp(Int_t i); - void PrintTime(Int_t i);*/ -}; - -#endif /* DATACLASSES_ANALYZEDATA_H_ */ diff --git a/dataClasses/Data.mk b/dataClasses/Data.mk index 38b7876a309bd852a1bc09733958b0a4121852c5..fbdf83b829f3cf253d0755daa2613ed310e5b370 100755 --- a/dataClasses/Data.mk +++ b/dataClasses/Data.mk @@ -6,22 +6,22 @@ DATALIBS := -lHist #-lCore #-lCint -lRIO -lTree -lNet -lThread -lMatrix -lMathCo # Add inputs and outputs from these tool invocations to the build variables DATA_HEADERS += \ -$(DATA)/RawData.h \ -$(DATA)/AnalyzeData.h \ +$(DATA)/RawEvent.h \ +$(DATA)/AEvent.h \ $(DATA)/linkdef.h DATACPP_SRCS += \ -$(DATA)/RawData.cpp \ -$(DATA)/AnalyzeData.cpp \ +$(DATA)/RawEvent.cpp \ +$(DATA)/AEvent.cpp \ $(DATA)/DataCint.cpp DATAOBJS += \ -$(DATA)/RawData.o \ -$(DATA)/AnalyzeData.o \ +$(DATA)/RawEvent.o \ +$(DATA)/AEvent.o \ $(DATA)/DataCint.o DATACPP_DEPS += \ -$(DATA)/RawData.d \ -$(DATA)/AnalyzeData.d \ +$(DATA)/RawEvent.d \ +$(DATA)/AEvent.d \ $(DATA)/DataCint.d diff --git a/dataClasses/RawData.cpp b/dataClasses/RawData.cpp deleted file mode 100644 index fcaf4f010c924352d749724f947ce47415e5186a..0000000000000000000000000000000000000000 --- a/dataClasses/RawData.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * RawData.cpp - * - * Created on: Dec 27, 2016 - * Author: vratik - */ - -#include "RawData.h" - -RawData::RawData() { - // TODO Auto-generated constructor stub - - TGraph gr; - -} - -RawData::~RawData() { - // TODO Auto-generated destructor stub -} - -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; -} - -/*void RawData::InvertAmp(Double_t a,Int_t i) { - if (i >=NCELLS) { - cout << "Error: array with raw amplitudes for turn over is overloaded!" << endl; - return; - } - Amplitude[i] = a*(-1.); - return; -}*/ - diff --git a/dataClasses/RawData.h b/dataClasses/RawData.h deleted file mode 100644 index 09801c279160a83ae5a90a430cd460a02a607878..0000000000000000000000000000000000000000 --- a/dataClasses/RawData.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * RawData.h - * - * Created on: Dec 27, 2016 - * Author: vratik - */ - -#ifndef DATACLASSES_RAWDATA_H_ -#define DATACLASSES_RAWDATA_H_ -#include -#include "TGraph.h" -#define NCELLS 1024 - -using std::cout; -using std::endl; - -class RawData { - -private: - Double_t Amp[NCELLS]; //array for raw amplitudes - Double_t Time[NCELLS]; //array for raw times -// Double_t Amplitude[NCELLS]; //array for inverted amplitudes -public: - RawData(); - virtual ~RawData(); - ClassDef(RawData,1); - - void Reset(); - //Resets arrays to zeros - - const Double_t* GetAmp() const { - return Amp; - } - - const Double_t* GetTime() const { - return Time; - } - - void SetAmp(Double_t a, Int_t i); - //Takes amplitude (raw data, voltage from binary file) - //and places it in the array Amp[NCELLS] - - void SetTime(Double_t t, Int_t i); - //Takes time (raw data, times from binary file) - //and places it in the array Time[NCELLS] - - void PrintAmp(Int_t i); - //Prints i amplitudes (to make sense i shold be NCELLS) - - void PrintTime(Int_t i); - -// void InvertAmp(Double_t a, Int_t i); - //Inverts the amplitudes i.e. makes from negative singals - //posititve signals and vise versa. - -}; - -#endif /* DATACLASSES_RAWDATA_H_ */ diff --git a/dataClasses/linkdef.h b/dataClasses/linkdef.h index 0f01ae6c9bbdbe33b37a58bf655dd51a6e4d9812..3e8476a6b4be127db32157569689d2acce705bc1 100755 --- a/dataClasses/linkdef.h +++ b/dataClasses/linkdef.h @@ -3,8 +3,8 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class RawData; -#pragma link C++ class AnalyzeData; +#pragma link C++ class RawEvent; +#pragma link C++ class AEvent; //#pragma link C++ class ConfigDictionary; diff --git a/makefile b/makefile index ff16c52f84eece69110f928a59a4afd6889bbc9f..a30f0f007bfabcfb84bcb13e861757ad1ed2dc65 100755 --- a/makefile +++ b/makefile @@ -59,7 +59,7 @@ libData.so: $(DATAOBJS) @echo 'Finished building target: $@' @echo ' ' -read_binary_DRS4: libData.so $(CONVERTDRS4)/read_binary.cpp +read_binary_DRS4: $(CONVERTDRS4)/read_binary.cpp libData.so @echo 'Building target: $@' @echo 'Invoking: GCC C++ Linker' # $(CC) -L $(ROOTLIBS) -shared -o"libData.so" $(DATAOBJS) $(DATALIBS)