diff --git a/dataClasses/Data.mk b/dataClasses/Data.mk new file mode 100755 index 0000000000000000000000000000000000000000..a5ad69c03c0dcc4677dca9f1ccf6785a66ae33c5 --- /dev/null +++ b/dataClasses/Data.mk @@ -0,0 +1,22 @@ +################################################################################ +# AculData input with some variables +################################################################################ + +DATALIBS := -lHist #-lCore #-lCint -lRIO -lTree -lNet -lThread -lMatrix -lMathCore -lGpad -lGraf -lSpectrum #-lTELoss + +# Add inputs and outputs from these tool invocations to the build variables +DATA_HEADERS += \ +$(DATA)/RawData.h \ +$(DATA)/linkdef.h + +DATACPP_SRCS += \ +$(DATA)/RawData.cpp \ +$(DATA)/DataCint.cpp + +DATAOBJS += \ +$(DATA)/RawData.o \ +$(DATA)/DataCint.o + +DATACPP_DEPS += \ +$(DATA)/RawData.d \ +$(DATA)/DataCint.d \ No newline at end of file diff --git a/dataClasses/RawData.cpp b/dataClasses/RawData.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0d9a50fc3e0f6702c60b0389beaee9876f46e15b --- /dev/null +++ b/dataClasses/RawData.cpp @@ -0,0 +1,36 @@ +/* + * 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 < 1024; i++) { + Amp[i] = 0; + Time[i] = 0; + } + + +} + +void RawData::Print() { + for (Int_t i = 0; i < 1024; i++) { + cout << Amp[i] << endl; +// Time[i] = 0; + } +} diff --git a/dataClasses/RawData.h b/dataClasses/RawData.h new file mode 100644 index 0000000000000000000000000000000000000000..52200a277abc5fa248199f82ec75cbe096e0a64b --- /dev/null +++ b/dataClasses/RawData.h @@ -0,0 +1,42 @@ +/* + * RawData.h + * + * Created on: Dec 27, 2016 + * Author: vratik + */ + +#ifndef DATACLASSES_RAWDATA_H_ +#define DATACLASSES_RAWDATA_H_ + +#include + +#include "TGraph.h" + +using std::cout; +using std::endl; + +class RawData { + +private: + Double_t Amp[1024]; + Double_t Time[1024]; + +public: + RawData(); + virtual ~RawData(); + ClassDef(RawData,1); + + void Reset(); + + const Double_t* GetAmp() const { + return Amp; + } + + const Double_t* GetTime() const { + return Time; + } + + void Print(); +}; + +#endif /* DATACLASSES_RAWDATA_H_ */ diff --git a/dataClasses/linkdef.h b/dataClasses/linkdef.h new file mode 100755 index 0000000000000000000000000000000000000000..f83a2b1bdc935f4531c3f1979dbf478c49196cb0 --- /dev/null +++ b/dataClasses/linkdef.h @@ -0,0 +1,11 @@ +#ifdef __CINT__ +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; + +#pragma link C++ class RawData; +//#pragma link C++ class ConfigDictionary; + + +#endif + diff --git a/dataClasses/rawData.cpp b/dataClasses/rawData.cpp deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/dataClasses/rawData.h b/dataClasses/rawData.h deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/macros/test.cxx b/macros/test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b236ea4ae8ca499a71b307639866fd0809945f57 --- /dev/null +++ b/macros/test.cxx @@ -0,0 +1,15 @@ +//void test() +{ + + gSystem->Load("../libData.so"); + + RawData o; + + Double_t *m = o.GetAmp(); + + for(Int_t i = 0; i < 1024; i++) { + m[i] = 1; + } + + o.Print(); +} diff --git a/makefile b/makefile new file mode 100755 index 0000000000000000000000000000000000000000..a05ed764f7ebfacfd545ae6471aeedc58f990b8a --- /dev/null +++ b/makefile @@ -0,0 +1,68 @@ +################################################################################ +# Makefile building all dynamic libraries: +# +# +# OBJS - files type *.o (subdir.mk) +# LIBS - list of the loaded libraries (objects.mk) +# RM - command "rm -rf" +# CPP_DEPS - files type *.d (subdir.mk) +# .PHONY - +# .SECONDARY - +# +# Vratislav Chudoba +################################################################################ + +RM := rm -rf + +CC := g++ + +#global paths +ROOTINCS = $(shell root-config --incdir) +ROOTLIBS = $(shell root-config --libdir) +ROOTCFLAGS = $(shell root-config --cflags) +PWD = $(shell pwd) + +DATA = $(PWD)/dataClasses + +-include $(DATA)/Data.mk + +all: libData.so \ + + +#ROOT html documentation, it will be done as a program which will be alsa compiled by this makefile, program will be as a last condition after all of the libraries +#htmldoc: libAculData.so +# -$(RM) htmldoc +# root -l -q html.cxx + +clean: + -$(RM) $(DATAOBJS) $(DATACPP_DEPS) + -$(RM) $(DATA)/DataCint.* libData.so + -@echo ' ' + -$(RM) htmldoc + -@echo ' ' + +# Those *Cint* files below need special treating: +$(DATA)/DataCint.cpp: + -@echo 'Pre-building DataCint.cpp and DataCint.h files' + -rootcint -f $(DATA)/DataCint.cpp -c -p $(DATA_HEADERS) + -@echo ' ' + +#*.so files +libData.so: $(DATAOBJS) + @echo 'Building target: $@' + @echo 'Invoking: GCC C++ Linker' + $(CC) -L $(ROOTLIBS) -shared -o"libData.so" $(DATAOBJS) $(DATALIBS) + @echo 'Finished building target: $@' + @echo ' ' + + +.PHONY: all clean + +# Each subdirectory must supply rules for building sources it contributes +%.o: %.cpp + @echo 'Building file: $@' + @echo 'Invoking: $(CC) Compiler' + $(CC) -I$(ROOTINCS) -O0 -g3 -Wall -c -fmessage-length=0 -fPIC $(ROOTCFLAGS) -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<" +# $(CC) -I$(ROOTINCS) -O2 -Wall -mmmx -msse -msse2 -msse3 -mfpmath=sse,387 -march=nocona -mtune=nocona -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<" + @echo 'Finished building: $@' + @echo ' '