Commit 86d31558 authored by Vratislav Chudoba's avatar Vratislav Chudoba

Class for raw data added.

parent 51b8b7d2
################################################################################
# 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
/*
* 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;
}
}
/*
* RawData.h
*
* Created on: Dec 27, 2016
* Author: vratik
*/
#ifndef DATACLASSES_RAWDATA_H_
#define DATACLASSES_RAWDATA_H_
#include <iostream>
#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_ */
#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
//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();
}
################################################################################
# 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 ' '
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