From: Samir Amar-Youcef Date: Tue, 31 Mar 2015 12:41:07 +0000 (+0200) Subject: add normalmode analysis X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=fdfad94b945d72ae0eb7ea19d3e7cc66df9c2ac9;p=mvd_soft.git add normalmode analysis --- diff --git a/normalmode/analysis_gui/ANA/Makefile b/normalmode/analysis_gui/ANA/Makefile new file mode 100644 index 0000000..0b7bb4f --- /dev/null +++ b/normalmode/analysis_gui/ANA/Makefile @@ -0,0 +1,16 @@ +CC=g++ +CFLAGS=-c -g -Wall -std=c++11 `root-config --cflags` +LDFLAGS=`root-config --glibs` +CLDFLAGS = -std=c++11 `root-config --cflags --glibs` -lboost_system -lboost_filesystem +SOURCES= main.cpp Mi26Ana.cpp Mi26Ana.h help.h +OBJECTS=$(subst .cc,.o,$(SOURCES)) +EXECUTABLE=Mi26Ana + +all: $(SOURCES) $(EXECUTABLE) + +$(EXECUTABLE): $(OBJECTS) + $(CC) $(CLDFLAGS) $(OBJECTS) -o $@ + + +clean: + rm -f $(OBJS) diff --git a/normalmode/analysis_gui/ANA/Mi26Ana b/normalmode/analysis_gui/ANA/Mi26Ana new file mode 100755 index 0000000..a2b291c Binary files /dev/null and b/normalmode/analysis_gui/ANA/Mi26Ana differ diff --git a/normalmode/analysis_gui/ANA/Mi26Ana.cpp b/normalmode/analysis_gui/ANA/Mi26Ana.cpp new file mode 100644 index 0000000..894a06e --- /dev/null +++ b/normalmode/analysis_gui/ANA/Mi26Ana.cpp @@ -0,0 +1,722 @@ +#include "Mi26Ana.h" +#include "help.h" +#include +#include +#include + + +//#################################################################### + +Mi26Ana::Mi26Ana() { // ok + + + fInputRootFile = ""; + fInputPxFile = ""; + fNPx = 0; + fMap = 0; +} + +//#################################################################### + +Mi26Ana::Mi26Ana( TString inFile, TString pxFile, int NPx, int Map ) { // ok + + fInputRootFile = inFile; + fInputPxFile = pxFile; + fNPx = NPx; + fMap = Map; +} + +//#################################################################### + +Mi26Ana::~Mi26Ana() { + + delete[] fNPxFound_arr; +} + +//#################################################################### + +void Mi26Ana::Exec(int Mode) { +// Open Root-File + fFile = new TFile(fInputRootFile); + cout<<"--------------------------------"<Get(Form("sensor%i",sensorNr)); + + if( !fSensor[0] ) { cout<<"Cannot read file!"<GetEntries(); + + fSensor[sensorNr]->SetBranchAddress ("event" , &fEvent ); + fSensor[sensorNr]->SetBranchAddress ("framenr" , &fFramenr ); + fSensor[sensorNr]->SetBranchAddress ("sensorid" , &fSensorid ); + fSensor[sensorNr]->SetBranchAddress ("status" , &fStatus ); + fSensor[sensorNr]->SetBranchAddress ("datalengthcount" , &fDatalengthcount ); + fSensor[sensorNr]->SetBranchAddress ("datalength" , &fDatalength ); + fSensor[sensorNr]->SetBranchAddress ("timestamp" , &fTimestamp ); + fSensor[sensorNr]->SetBranchAddress ("debug" , &fDebug ); + fSensor[sensorNr]->SetBranchAddress ("states" , &fStates ); + fSensor[sensorNr]->SetBranchAddress ("row" , fRow ); + fSensor[sensorNr]->SetBranchAddress ("column" , fColumn ); + fSensor[sensorNr]->SetBranchAddress ("nextn" , fNextn ); + fSensor[sensorNr]->SetBranchAddress ("overflow" , fOverflow ); + fSensor[sensorNr]->SetBranchAddress ("clusters" , &fClusters ); + fSensor[sensorNr]->SetBranchAddress ("pixelsPerCluster" , fPixelsPerCluster ); + fSensor[sensorNr]->SetBranchAddress ("statesPerCluster" , fStatesPerCluster ); + fSensor[sensorNr]->SetBranchAddress ("row_cg" , fRow_cg ); + fSensor[sensorNr]->SetBranchAddress ("column_cg" , fColumn_cg ); + fSensor[sensorNr]->SetBranchAddress ("shapecode" , fShapeCode ); + fSensor[sensorNr]->SetBranchAddress ("dx" , fDx ); + fSensor[sensorNr]->SetBranchAddress ("dy" , fDy ); + + printf("Sensor No. %3i --> %10i Entries\n", sensorNr, fNentries[sensorNr] ); + fSensorspresent++; + } + else + { + break; + } + } + fSensorspresent=1; + cout<<"--------------------------------"< "<< fSensorspresent <<" sensors found!"<Divide(fSensorspresent,1); + + for(Int_t sensor=0;sensorGetEntry(i); + + for(UInt_t j=0; jFill(pixmulti[i]); + } + + cm1->cd(1+sensor); + plot[sensor]->Draw(); + plot[sensor]->SetLineColor(2); + plot[sensor]->GetXaxis()->SetTitle("Pixel Multiplicity"); + plot[sensor]->GetYaxis()->SetTitle("Number of Pixels"); + plot[sensor]->GetXaxis()->CenterTitle(); + plot[sensor]->GetYaxis()->CenterTitle(); + gPad->SetLogy(); + } +} + +//#################################################################### + +void Mi26Ana::pixelocc3() { + + TH2F* plot[fSensorspresent]; + TCanvas* cm1 = new TCanvas("pixmulit3","pixmulit3",50,100,700,400); + cm1->Divide(fSensorspresent,1); + + for(Int_t sensor=0;sensorGetEntry(i); + + for(UInt_t j=0; jFill(fColumn[j]+k, fRow[j]); + } + } + } + + cm1->cd(1+sensor); + plot[sensor]->Draw("colz"); + plot[sensor]->GetXaxis()->SetTitle("Column#"); + plot[sensor]->GetYaxis()->SetTitle("Row#"); + plot[sensor]->GetXaxis()->CenterTitle(); + plot[sensor]->GetYaxis()->CenterTitle(); + } + +} + +//#################################################################### + +void Mi26Ana::pixeloccHT() { + + TH1F* plot[fSensorspresent]; + TCanvas* cm1 = new TCanvas("hitmulitTime","hitmulitTime",50,100,700,400); + cm1->Divide(fSensorspresent,1); + + int bins = fNentries[0]/8681; + int sum; + + + for(Int_t sensor=0;sensorGetEntry(i); + sum+=fClusters; + if( i%8681==0 && i!=0 ) + { + cout<Fill(115.2/1000000*i-1., sum ); + sum=0; + } + } + + cm1->cd(1+sensor); + plot[sensor]->SetStats(false); + plot[sensor]->SetLineColor(kRed); + plot[sensor]->SetMarkerStyle(20); + plot[sensor]->SetMarkerSize (0.5); + plot[sensor]->Draw(); + plot[sensor]->GetXaxis()->SetTitle("Time [sec.]"); +// plot[sensor]->GetXaxis()->SetTitleColor(4); +// plot[sensor]->GetXaxis()->SetTitleOffset(0.5); + plot[sensor]->GetYaxis()->SetTitle("Hits per sec."); +// plot[sensor]->GetYaxis()->SetTitleColor(4); + plot[sensor]->GetYaxis()->SetTitleOffset(1.5); + plot[sensor]->GetXaxis()->CenterTitle(); + plot[sensor]->GetYaxis()->CenterTitle(); +// plot[sensor]->SetAxisRange(0., bins,"X"); + } +} + +//#################################################################### + +void Mi26Ana::pixeloccH3() { + + TH2F* plot[fSensorspresent]; + TCanvas* cm1 = new TCanvas("hitmulit3","hitmulit3",50,100,700,400); + cm1->Divide(fSensorspresent,1); + + for(Int_t sensor=0;sensorGetEntry(i); + + for(UInt_t j=0; jFill(fColumn_cg[j], fRow_cg[j]); + } + } + + cm1->cd(1+sensor); + plot[sensor]->Draw("colz"); + plot[sensor]->GetXaxis()->SetTitle("Column#"); + plot[sensor]->GetYaxis()->SetTitle("Row#"); + plot[sensor]->GetXaxis()->CenterTitle(); + plot[sensor]->GetYaxis()->CenterTitle(); + } +} + +//#################################################################### +//#################################################################### +//#################################################################### + +void Mi26Ana::Map() { + + cout<<"Note: Only one hard-coded Sensor processed!"<Branch("event" , &event , "event/i" , BUFSIZE); + Sensor[i]->Branch("framenr" , &framenr , "framenr/i" , BUFSIZE); + Sensor[i]->Branch("sensorid" , &sensorid , "sensorid/s" , BUFSIZE); + Sensor[i]->Branch("status" , &status , "status/i" , BUFSIZE); + Sensor[i]->Branch("datalength" , &datalength , "datalength/s" , BUFSIZE); + Sensor[i]->Branch("datalengthcount" , &datalengthcount , "datalengthcount/s" , BUFSIZE); + Sensor[i]->Branch("states" , &states , "states/i" , BUFSIZE); + Sensor[i]->Branch("clusters" , &clusters , "clusters/i" , BUFSIZE); + Sensor[i]->Branch("timestamp" , ×tamp , "timestamp/l" , BUFSIZE); + Sensor[i]->Branch("debug" , &debug , "debug/l" , BUFSIZE); + Sensor[i]->Branch("row" , row , "row [states]/i" , BUFSIZE); + Sensor[i]->Branch("column" , column , "column [states]/i" , BUFSIZE); + Sensor[i]->Branch("nextn" , nextn , "nextn [states]/i" , BUFSIZE); + Sensor[i]->Branch("overflow" , overflow , "overflow [states]/i" , BUFSIZE); + Sensor[i]->Branch("pixelsPerCluster" , pixelsPerCluster , "pixelsPerCluster [clusters]/i" , BUFSIZE); + Sensor[i]->Branch("statesPerCluster" , statesPerCluster , "statesPerCluster [clusters]/i" , BUFSIZE); + Sensor[i]->Branch("row_cg" , row_cg , "row_cg [clusters]/F" , BUFSIZE); + Sensor[i]->Branch("column_cg" , column_cg , "column_cg [clusters]/F" , BUFSIZE); + Sensor[i]->Branch("shapecode" , shapecode , "shapecode [clusters]/i" , BUFSIZE); + Sensor[i]->Branch("dx" , dx , "dx [clusters]/i" , BUFSIZE); + Sensor[i]->Branch("dy" , dy , "dy [clusters]/i" , BUFSIZE); + } + +// Loop + for(Int_t sensor=0;sensor<1;sensor++) +// for(Int_t sensor=0;sensorGetEntry(i); + + for(UInt_t j=0; jGetEntry(i); + + event = fEvent; + framenr = fFramenr; + sensorid = fSensorid; + status = fStatus; + timestamp = fTimestamp; + clusters = 0; + + for(UInt_t j=0; jFill(); +//------- + progress = (Int_t)((i*100)/(fNentries[sensor]-1)*10); + if(progress!=progress_tmp) { print_progress( ((i*100.)/(fNentries[sensor]-1)) ); progress_tmp=progress;} +//------- + } +//---------------------- + count =0; + countF=0; + for(UInt_t k=0; kWrite("",TObject::kOverwrite); + printf(" ->%3i\n", i); + } + + OutputFile->Save(); + OutputFile->Close(); + +//---------------------------------------- + char Commando[512]; + strcpy (Commando, "mv " ); + strcat (Commando, Filename ); + strcat (Commando, " " ); + strcat (Commando, fInputRootFile ); + system (Commando); +//---------------------------------------- + + delete[] hitmulti; + +} + +//#################################################################### + +void Mi26Ana::MostNoisy() { + + cout<<"Note: Only one hard-coded Sensor processed!"<Branch("event" , &event , "event/i" , BUFSIZE); + Sensor[i]->Branch("framenr" , &framenr , "framenr/i" , BUFSIZE); + Sensor[i]->Branch("sensorid" , &sensorid , "sensorid/s" , BUFSIZE); + Sensor[i]->Branch("status" , &status , "status/i" , BUFSIZE); + Sensor[i]->Branch("datalength" , &datalength , "datalength/s" , BUFSIZE); + Sensor[i]->Branch("datalengthcount" , &datalengthcount , "datalengthcount/s" , BUFSIZE); + Sensor[i]->Branch("states" , &states , "states/i" , BUFSIZE); + Sensor[i]->Branch("clusters" , &clusters , "clusters/i" , BUFSIZE); + Sensor[i]->Branch("timestamp" , ×tamp , "timestamp/l" , BUFSIZE); + Sensor[i]->Branch("debug" , &debug , "debug/l" , BUFSIZE); + Sensor[i]->Branch("row" , row , "row [states]/i" , BUFSIZE); + Sensor[i]->Branch("column" , column , "column [states]/i" , BUFSIZE); + Sensor[i]->Branch("nextn" , nextn , "nextn [states]/i" , BUFSIZE); + Sensor[i]->Branch("overflow" , overflow , "overflow [states]/i" , BUFSIZE); + Sensor[i]->Branch("pixelsPerCluster" , pixelsPerCluster , "pixelsPerCluster [clusters]/i" , BUFSIZE); + Sensor[i]->Branch("statesPerCluster" , statesPerCluster , "statesPerCluster [clusters]/i" , BUFSIZE); + Sensor[i]->Branch("row_cg" , row_cg , "row_cg [clusters]/F" , BUFSIZE); + Sensor[i]->Branch("column_cg" , column_cg , "column_cg [clusters]/F" , BUFSIZE); + Sensor[i]->Branch("shapecode" , shapecode , "shapecode [clusters]/i" , BUFSIZE); + Sensor[i]->Branch("dx" , dx , "dx [clusters]/i" , BUFSIZE); + Sensor[i]->Branch("dy" , dy , "dy [clusters]/i" , BUFSIZE); + } + +// Loop + for(Int_t sensor=0;sensor<1;sensor++) +// for(Int_t sensor=0;sensorGetEntry(i); + + for(UInt_t j=0; jGetEntry(i); + + event = fEvent; + framenr = fFramenr; + sensorid = fSensorid; + status = fStatus; + timestamp = fTimestamp; + clusters = 0; + + for(UInt_t j=0; jFill(); +//------- + progress = (Int_t)((i*100)/(fNentries[sensor]-1)*10); + if(progress!=progress_tmp) { print_progress( ((i*100.)/(fNentries[sensor]-1)) ); progress_tmp=progress;} +//------- + } +//---------------------- + count =0; + countF=0; + for(UInt_t k=0; kWrite("",TObject::kOverwrite); + printf(" ->%3i\n", i); + } + + OutputFile->Save(); + OutputFile->Close(); + +//---------------------------------------- + char Commando[512]; + strcpy (Commando, "mv " ); + strcat (Commando, Filename ); + strcat (Commando, " " ); + strcat (Commando, fInputRootFile ); + system (Commando); +//---------------------------------------- + delete[] hitmulti; + delete[] noisyPixels; + +} + +//#################################################################### + +int Mi26Ana::readPxFile() { + + ifstream myfile( fInputPxFile, std::ifstream::in ); + + if(!myfile.good()) + { + fNPxFound_arr = new int[1]; + return 0; + } + + myfile >> fNPxFound; + + fNPxFound_arr = new int[fNPxFound]; + + int count=0; + int pix; + + while( myfile.good() ) + { + myfile >> pix; + if( count +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "TCanvas.h" +#include "TRootCanvas.h" +#include +#include +#include +#include "TH1.h" +#include "TF1.h" +#include "TSystem.h" +#include +#include "TROOT.h" +#include "TMath.h" +// #include "TSystem.h" + +using namespace std; + +class Mi26Ana { + +private: +// TTrees + TFile* fFile; + TTree* fSensor [MAXSENSORS]; + UInt_t fNentries [MAXSENSORS]; + UInt_t fSensorspresent; + + UInt_t fEvent; + UInt_t fFramenr; + UShort_t fSensorid; + UInt_t fStatus; + UShort_t fDatalengthcount; + UShort_t fDatalength; + ULong64_t fTimestamp; + ULong64_t fDebug; + UInt_t fStates; + UInt_t fRow [MAXSTATES]; + UInt_t fColumn [MAXSTATES]; + UInt_t fNextn [MAXSTATES]; + UInt_t fOverflow [MAXSTATES]; + UInt_t fClusters; + UInt_t fPixelsPerCluster [MAXSTATES]; + UInt_t fStatesPerCluster [MAXSTATES]; + Float_t fRow_cg [MAXSTATES]; + Float_t fColumn_cg [MAXSTATES]; + UInt_t fShapeCode [MAXSTATES]; + UInt_t fDx [MAXSTATES]; + UInt_t fDy [MAXSTATES]; + +private: + void remove (); + void pixelocc2 (); + void pixelocc3 (); + void pixeloccHT (); + void pixeloccH3 (); + void empty1 (); + void empty2 (); + + void Map (); + void MostNoisy (); + int readPxFile (); + + TString fInputRootFile; + TString fInputPxFile; + int fMap; + int fNPx; + int fNPxFound; + int* fNPxFound_arr; + +public: + Mi26Ana(); + Mi26Ana( TString, TString, int, int ); + ~Mi26Ana(); + + void Exec (int); + + void setInFile (TString name) { fInputRootFile= name; } + void setPxFile (TString name) { fInputPxFile = name; } + void setNPx (int val) { fNPx = val; } + void setMap (int val) { fMap = val; } +}; + +#endif // Mi26Ana_H + \ No newline at end of file diff --git a/normalmode/analysis_gui/ANA/help.h b/normalmode/analysis_gui/ANA/help.h new file mode 100644 index 0000000..5ee6558 --- /dev/null +++ b/normalmode/analysis_gui/ANA/help.h @@ -0,0 +1,92 @@ +#ifndef HELP_H +#define HELP_H + +#include +#include +#include +#include +#include +#include +#include +#include "TStopwatch.h" + +//#################################################################### + +Int_t print_progress(Float_t ProgressInPercent) { + + Int_t nCharacter = printf("\r ["); + Int_t iBlock; + + for( iBlock=0; iBlockReset(); + + const char* InFile; + const char* PxFile; + int Mode; + int NPx; // Pixelnummer + int Map; + + stringstream strValue; + + if (argc>1) InFile = argv[1]; + if (argc>2) PxFile = argv[2]; + if (argc>3) strValue<> Mode; strValue.clear(); + if (argc>4) strValue<> NPx; strValue.clear(); + if (argc>5) strValue<> Map; strValue.clear(); + + TApplication theApp("Analysis", &argc, argv); + + Mi26Ana* ana = new Mi26Ana(); + ana->setInFile (InFile); + ana->setPxFile (PxFile); + ana->setNPx (NPx); + ana->setMap (Map); + ana->Exec (Mode); + delete ana; + theApp.Run(); +} \ No newline at end of file diff --git a/normalmode/analysis_gui/GUI/Makefile b/normalmode/analysis_gui/GUI/Makefile new file mode 100644 index 0000000..ec9a2dd --- /dev/null +++ b/normalmode/analysis_gui/GUI/Makefile @@ -0,0 +1,240 @@ +############################################################################# +# Makefile for building: nmode +# Generated by qmake (2.01a) (Qt 4.8.5) on: Wed Mar 25 16:26:40 2015 +# Project: nmode.pro +# Template: app +# Command: /usr/bin/qmake -o Makefile nmode.pro +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED +CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) +CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) +INCPATH = -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I$(ROOTSYS)/include -I. -I. +LINK = g++ +LFLAGS = -Wl,-O1 +LIBS = $(SUBLIBS) -L/usr/lib64 -L$(ROOTSYS)/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lGui -lRGL -lQtGui -L/usr/lib64 -L/usr/X11R6/lib -lQtCore -lpthread +AR = ar cqs +RANLIB = +QMAKE = /usr/bin/qmake +TAR = tar -cf +COMPRESS = gzip -9f +COPY = cp -f +SED = sed +COPY_FILE = $(COPY) +COPY_DIR = $(COPY) -r +STRIP = strip +INSTALL_FILE = install -m 644 -p +INSTALL_DIR = $(COPY_DIR) +INSTALL_PROGRAM = install -m 755 -p +DEL_FILE = rm -f +SYMLINK = ln -f -s +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = ./ + +####### Files + +SOURCES = main.cpp \ + nmode.cpp moc_nmode.cpp +OBJECTS = main.o \ + nmode.o \ + moc_nmode.o +DIST = /usr/share/qt4/mkspecs/common/unix.conf \ + /usr/share/qt4/mkspecs/common/linux.conf \ + /usr/share/qt4/mkspecs/common/gcc-base.conf \ + /usr/share/qt4/mkspecs/common/gcc-base-unix.conf \ + /usr/share/qt4/mkspecs/common/g++-base.conf \ + /usr/share/qt4/mkspecs/common/g++-unix.conf \ + /usr/share/qt4/mkspecs/qconfig.pri \ + /usr/share/qt4/mkspecs/modules/qt_phonon.pri \ + /usr/share/qt4/mkspecs/modules/qt_webkit.pri \ + /usr/share/qt4/mkspecs/features/qt_functions.prf \ + /usr/share/qt4/mkspecs/features/qt_config.prf \ + /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /usr/share/qt4/mkspecs/features/default_pre.prf \ + /usr/share/qt4/mkspecs/features/release.prf \ + /usr/share/qt4/mkspecs/features/default_post.prf \ + /usr/share/qt4/mkspecs/features/shared.prf \ + /usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ + /usr/share/qt4/mkspecs/features/warn_on.prf \ + /usr/share/qt4/mkspecs/features/qt.prf \ + /usr/share/qt4/mkspecs/features/unix/thread.prf \ + /usr/share/qt4/mkspecs/features/moc.prf \ + /usr/share/qt4/mkspecs/features/resources.prf \ + /usr/share/qt4/mkspecs/features/uic.prf \ + /usr/share/qt4/mkspecs/features/yacc.prf \ + /usr/share/qt4/mkspecs/features/lex.prf \ + /usr/share/qt4/mkspecs/features/include_source_dir.prf \ + nmode.pro +QMAKE_TARGET = nmode +DESTDIR = +TARGET = nmode + +first: all +####### Implicit rules + +.SUFFIXES: .o .c .cpp .cc .cxx .C + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" + +####### Build rules + +all: Makefile $(TARGET) + +$(TARGET): ui_nmode.h $(OBJECTS) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) + +Makefile: nmode.pro /usr/share/qt4/mkspecs/default/qmake.conf /usr/share/qt4/mkspecs/common/unix.conf \ + /usr/share/qt4/mkspecs/common/linux.conf \ + /usr/share/qt4/mkspecs/common/gcc-base.conf \ + /usr/share/qt4/mkspecs/common/gcc-base-unix.conf \ + /usr/share/qt4/mkspecs/common/g++-base.conf \ + /usr/share/qt4/mkspecs/common/g++-unix.conf \ + /usr/share/qt4/mkspecs/qconfig.pri \ + /usr/share/qt4/mkspecs/modules/qt_phonon.pri \ + /usr/share/qt4/mkspecs/modules/qt_webkit.pri \ + /usr/share/qt4/mkspecs/features/qt_functions.prf \ + /usr/share/qt4/mkspecs/features/qt_config.prf \ + /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /usr/share/qt4/mkspecs/features/default_pre.prf \ + /usr/share/qt4/mkspecs/features/release.prf \ + /usr/share/qt4/mkspecs/features/default_post.prf \ + /usr/share/qt4/mkspecs/features/shared.prf \ + /usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ + /usr/share/qt4/mkspecs/features/warn_on.prf \ + /usr/share/qt4/mkspecs/features/qt.prf \ + /usr/share/qt4/mkspecs/features/unix/thread.prf \ + /usr/share/qt4/mkspecs/features/moc.prf \ + /usr/share/qt4/mkspecs/features/resources.prf \ + /usr/share/qt4/mkspecs/features/uic.prf \ + /usr/share/qt4/mkspecs/features/yacc.prf \ + /usr/share/qt4/mkspecs/features/lex.prf \ + /usr/share/qt4/mkspecs/features/include_source_dir.prf \ + /usr/lib64/libQtGui.prl \ + /usr/lib64/libQtCore.prl + $(QMAKE) -o Makefile nmode.pro +/usr/share/qt4/mkspecs/common/unix.conf: +/usr/share/qt4/mkspecs/common/linux.conf: +/usr/share/qt4/mkspecs/common/gcc-base.conf: +/usr/share/qt4/mkspecs/common/gcc-base-unix.conf: +/usr/share/qt4/mkspecs/common/g++-base.conf: +/usr/share/qt4/mkspecs/common/g++-unix.conf: +/usr/share/qt4/mkspecs/qconfig.pri: +/usr/share/qt4/mkspecs/modules/qt_phonon.pri: +/usr/share/qt4/mkspecs/modules/qt_webkit.pri: +/usr/share/qt4/mkspecs/features/qt_functions.prf: +/usr/share/qt4/mkspecs/features/qt_config.prf: +/usr/share/qt4/mkspecs/features/exclusive_builds.prf: +/usr/share/qt4/mkspecs/features/default_pre.prf: +/usr/share/qt4/mkspecs/features/release.prf: +/usr/share/qt4/mkspecs/features/default_post.prf: +/usr/share/qt4/mkspecs/features/shared.prf: +/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf: +/usr/share/qt4/mkspecs/features/warn_on.prf: +/usr/share/qt4/mkspecs/features/qt.prf: +/usr/share/qt4/mkspecs/features/unix/thread.prf: +/usr/share/qt4/mkspecs/features/moc.prf: +/usr/share/qt4/mkspecs/features/resources.prf: +/usr/share/qt4/mkspecs/features/uic.prf: +/usr/share/qt4/mkspecs/features/yacc.prf: +/usr/share/qt4/mkspecs/features/lex.prf: +/usr/share/qt4/mkspecs/features/include_source_dir.prf: +/usr/lib64/libQtGui.prl: +/usr/lib64/libQtCore.prl: +qmake: FORCE + @$(QMAKE) -o Makefile nmode.pro + +dist: + @$(CHK_DIR_EXISTS) .tmp/nmode1.0.0 || $(MKDIR) .tmp/nmode1.0.0 + $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/nmode1.0.0/ && $(COPY_FILE) --parents nmode.h .tmp/nmode1.0.0/ && $(COPY_FILE) --parents main.cpp nmode.cpp .tmp/nmode1.0.0/ && $(COPY_FILE) --parents nmode.ui .tmp/nmode1.0.0/ && (cd `dirname .tmp/nmode1.0.0` && $(TAR) nmode1.0.0.tar nmode1.0.0 && $(COMPRESS) nmode1.0.0.tar) && $(MOVE) `dirname .tmp/nmode1.0.0`/nmode1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/nmode1.0.0 + + +clean:compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +####### Sub-libraries + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) Makefile + + +check: first + +mocclean: compiler_moc_header_clean compiler_moc_source_clean + +mocables: compiler_moc_header_make_all compiler_moc_source_make_all + +compiler_moc_header_make_all: moc_nmode.cpp +compiler_moc_header_clean: + -$(DEL_FILE) moc_nmode.cpp +moc_nmode.cpp: ui_nmode.h \ + nmode.h + /usr/bin/moc $(DEFINES) $(INCPATH) nmode.h -o moc_nmode.cpp + +compiler_rcc_make_all: +compiler_rcc_clean: +compiler_image_collection_make_all: qmake_image_collection.cpp +compiler_image_collection_clean: + -$(DEL_FILE) qmake_image_collection.cpp +compiler_moc_source_make_all: +compiler_moc_source_clean: +compiler_uic_make_all: ui_nmode.h +compiler_uic_clean: + -$(DEL_FILE) ui_nmode.h +ui_nmode.h: nmode.ui + /usr/bin/uic nmode.ui -o ui_nmode.h + +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: compiler_moc_header_clean compiler_uic_clean + +####### Compile + +main.o: main.cpp nmode.h \ + ui_nmode.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp + +nmode.o: nmode.cpp nmode.h \ + ui_nmode.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o nmode.o nmode.cpp + +moc_nmode.o: moc_nmode.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_nmode.o moc_nmode.cpp + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff --git a/normalmode/analysis_gui/GUI/main.cpp b/normalmode/analysis_gui/GUI/main.cpp new file mode 100644 index 0000000..98b00f9 --- /dev/null +++ b/normalmode/analysis_gui/GUI/main.cpp @@ -0,0 +1,22 @@ +// --- main.cpp - start --- + +#include "nmode.h" +#include +#include + +int main( int argc, char* argv[] ) +{ + TApplication* gMyRootApp = new TApplication("My ROOT Application", &argc, argv); + gMyRootApp->SetReturnFromRun(true); +// gMyRootApp->Run(kTRUE); + + QApplication a(argc, argv); + nmode w; + w.show(); + + w.setWindowTitle(QString::fromUtf8("ANA GUI")); +// QObject::connect( qApp, SIGNAL(lastWindowClosed()), qApp, SLOT(quit()) ); + return a.exec(); +} + +// --- main.cpp - end --- diff --git a/normalmode/analysis_gui/GUI/nmode.cpp b/normalmode/analysis_gui/GUI/nmode.cpp new file mode 100644 index 0000000..2624993 --- /dev/null +++ b/normalmode/analysis_gui/GUI/nmode.cpp @@ -0,0 +1,541 @@ +// --- nmode.cpp - start --- +#include "nmode.h" +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "TCanvas.h" +#include "TRootCanvas.h" +#include +#include +#include +#include "TH1.h" +#include "TF1.h" +#include "TSystem.h" +#include +#include "TROOT.h" +// #include "TSystem.h" + + + +using namespace std; + +//#################################################################### + +nmode::nmode(QMainWindow *parent) : QMainWindow(parent) { + + setupUi(this); +// Init inputs + initGUI(); + childcount=0; +// TApplication* gMyRootApp = new TApplication("My ROOT Application", &argc, argv); +// gMyRootApp->SetReturnFromRun(true); + + connect(lineDir ,SIGNAL( textChanged(QString) ) ,this ,SLOT( clickDir() ) ); + connect(lineFile ,SIGNAL( textChanged(QString) ) ,this ,SLOT( clickFile() ) ); + connect(pushSave ,SIGNAL( clicked() ) ,this ,SLOT( Save() ) ); + connect(pushClose ,SIGNAL( clicked() ) ,this ,SLOT( Close() ) ); + connect(pushFindNew ,SIGNAL( clicked() ) ,this ,SLOT( Newest() ) ); + connect(pushUnpack ,SIGNAL( clicked() ) ,this ,SLOT( Unpack() ) ); + connect(pushOpenBrowser ,SIGNAL( clicked() ) ,this ,SLOT( OpenBrowser() ) ); + + QSignalMapper *signalMapper = new QSignalMapper(this); + QSignalMapper *signalMapper2 = new QSignalMapper(this); + + signalMapper ->setMapping( pushRemove , 0); + signalMapper ->setMapping( pushOcc2 , 1); + signalMapper ->setMapping( pushOcc3 , 2); + signalMapper ->setMapping( pushOccHT , 3); + signalMapper ->setMapping( pushOccH3 , 4); + signalMapper ->setMapping( pushEmpty1 , 5); + signalMapper2 ->setMapping( pushFindBack , -1); + signalMapper2 ->setMapping( pushFindForth , 1); + + connect(pushRemove ,SIGNAL( clicked(bool) ) ,signalMapper, SLOT( map() ) ); + connect(pushOcc2 ,SIGNAL( clicked(bool) ) ,signalMapper, SLOT( map() ) ); + connect(pushOcc3 ,SIGNAL( clicked(bool) ) ,signalMapper, SLOT( map() ) ); + connect(pushOccHT ,SIGNAL( clicked(bool) ) ,signalMapper, SLOT( map() ) ); + connect(pushOccH3 ,SIGNAL( clicked(bool) ) ,signalMapper, SLOT( map() ) ); + connect(pushEmpty1 ,SIGNAL( clicked(bool) ) ,signalMapper, SLOT( map() ) ); + connect(pushFindBack ,SIGNAL( clicked(bool) ) ,signalMapper2, SLOT( map() ) ); + connect(pushFindForth ,SIGNAL( clicked(bool) ) ,signalMapper2, SLOT( map() ) ); + + connect(signalMapper ,SIGNAL( mapped(int) ) ,this ,SLOT( RunAna (int) ) ); + connect(signalMapper2 ,SIGNAL( mapped(int) ) ,this ,SLOT( NextFile (int) ) ); + +// checkRandPix +// checkBank1 +// checkBank2 +// checkBank3 +// checkBank4 +// spinRandPix + +} + +//#################################################################### + +nmode::~nmode() { + + Save(); + Close(); +} + +//#################################################################### + +void nmode::initGUI() { + + ifstream myfile ( "nmode.ini"); + string line; + int para; + + if (myfile.is_open()) + { + getline( myfile, line ); + lineDir -> insert( QString::fromStdString(line) ); + getline( myfile, line ); + lineFile -> insert( QString::fromStdString(line) ); + + myfile >> para; + radioHld -> setChecked(true); + if( para ) { radioRoot -> setChecked(true); } + myfile >> para; + radioMost -> setChecked(true); + if( para ) { radioExist -> setChecked(true); } + myfile >> para; + spinPix -> setValue( para ); + } + +} + +//#################################################################### + +void nmode::clickDir() { + lineDir->setStyleSheet("QLineEdit { color:black; }"); +} + +//#################################################################### + +void nmode::clickFile() { + lineFile->setStyleSheet("QLineEdit { color:black; }"); +} + +//#################################################################### + +void nmode::Save() { + + checkDir(); +// checkFile(); + + fstream myfile; + myfile.open( "nmode.ini" , ios::out ); + myfile << ( lineDir -> text()).toStdString() < text()).toStdString() < isChecked() <<" "; + myfile << radioExist -> isChecked() <<" "; + myfile << spinPix -> value() <<" "; + myfile <close(); + } + + childcount=0; + +} + +//#################################################################### + +void nmode::Newest() { + + if(checkDir()) + { + QString text = lineDir-> text(); + QByteArray bytes = text.toAscii(); + char *Dir = bytes.data(); + + time_t timecurr = 0; + time_t timenew = 0; + char Filecurr [256]; + char Filenew [256] = ""; + + char Ending [4]; + if( radioRoot -> isChecked() ) { strcpy (Ending, "root"); } + else { strcpy (Ending, "hld"); } + + uint Endinglength = strlen(Ending); + + DIR* dpdf; + struct dirent* epdf; + struct stat s; + uint namelength; + bool Endingcorr; + + dpdf = opendir(Dir); +// init File_new +// strcpy (File_new, ""); + + if (dpdf != NULL) + { + while ( (epdf = readdir(dpdf)) != NULL ) + { + if( (string) epdf->d_name != "." && (string) epdf->d_name != ".." ) + { + strcpy (Filecurr, Dir); + strcat (Filecurr, epdf->d_name); + + stat (Filecurr, &s); + timecurr = s.st_mtime; + namelength = strlen(Filecurr); + + Endingcorr = true; + + if(namelength>Endinglength) + { + for(uint i=0; id_name); + timenew = timecurr; + } + } + } + } + } + + if( strlen(Filenew)!=0 ) + { + lineFile -> clear(); + lineFile -> insert( QString(Filenew) ); + } + else + { + lineFile->setStyleSheet("QLineEdit { color:red; }"); + } + + } +} + +//#################################################################### + +void nmode::Unpack() { + + checkDir(); + + QString text; + QByteArray bytes; + char *Dir; + char *File; + + text = lineDir ->text(); + bytes = text.toAscii(); + Dir = bytes.data(); + + text = lineFile ->text(); + bytes = text.toAscii(); + File = bytes.data(); + + string command = ""; + command += "xterm -hold -geometry 105x15+10+10 -e ./rununpack.sh "; + command += Dir; + command += " "; + command += File; + + const char *ptr = command.c_str() ; + + child[childcount] = new QProcess(); +// connect(child[childcount], SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(isFinished( int, QProcess::ExitStatus ))); + child[childcount]->start(ptr); + childcount++; + +} + +//#################################################################### + +void nmode::OpenBrowser() { + + QString text; + QByteArray bytes; + char *Dir; + char *File; + char Filein [256] = ""; + + text = lineDir ->text(); + bytes = text.toAscii(); + Dir = bytes.data(); + + text = lineFile ->text(); + bytes = text.toAscii(); + File = bytes.data(); + + strcpy (Filein, Dir); + strcat (Filein, File); + + string command = ""; + command += "xterm -geometry 130x10+10+10 -e root -l "; + command += Filein; + + const char *ptr = command.c_str() ; + + child[childcount] = new QProcess(); +// connect(child[childcount], SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(isFinished( int, QProcess::ExitStatus ))); + child[childcount]->start(ptr); + childcount++; + +} + +//#################################################################### + +void nmode::NextFile(int sign) { + + if(checkDir()) + { + QString text; + QByteArray bytes; + char *Dir; + char *File; + + text = lineDir ->text(); + bytes = text.toAscii(); + Dir = bytes.data(); + + text = lineFile ->text(); + bytes = text.toAscii(); + File = bytes.data(); + + time_t timeref = 0; + time_t timecurr = 0; + time_t timenew = 2000000000; + if(sign==-1) {timenew = -2000000000;} + + char Fileref [256]; + char Filecurr [256]; + char Filenew [256] = ""; + + strcpy (Fileref, Dir); + strcat (Fileref, File); + + struct stat buff; + if( stat (Fileref, &buff) == 0 ) { lineFile->setStyleSheet("QLineEdit { color:black; }"); timeref = buff.st_mtime; } + else { lineFile->setStyleSheet("QLineEdit { color:red; }"); timeref = timenew; sign=-1*sign; timenew= -1*timenew; } + + text = lineDir ->text(); + bytes = text.toAscii(); + Dir = bytes.data(); + + text = lineFile ->text(); + bytes = text.toAscii(); + File = bytes.data(); + + char Ending [4]; + if( radioRoot -> isChecked() ) { strcpy (Ending, "root"); } + else { strcpy (Ending, "hld"); } + + uint Endinglength = strlen(Ending); + + DIR* dpdf; + struct dirent* epdf; + struct stat s; + uint namelength; + bool Endingcorr; + + dpdf = opendir(Dir); +// init File_new +// strcpy (File_new, ""); + + if (dpdf != NULL) + { + while ( (epdf = readdir(dpdf)) != NULL ) + { + if( (string) epdf->d_name != "." && (string) epdf->d_name != ".." ) + { + strcpy (Filecurr, Dir); + strcat (Filecurr, epdf->d_name); + + stat (Filecurr, &s); + timecurr = s.st_mtime; + namelength = strlen(Filecurr); + Endingcorr = true; + + if(namelength>Endinglength) + { + for(uint i=0; isign*timeref ) + { +// cout<sign*timecurr) + { + strcpy (Filenew, epdf->d_name); + timenew = timecurr; + } + } + } + } + } + } + + if ( strlen(Filenew)!=0 ) + { + lineFile -> clear(); + lineFile -> insert( QString(Filenew) ); + } +// else +// { +// pushFindBack ->setStyleSheet("* { background-color: red }"); +// pushFindForth ->setStyleSheet("* { background-color: red }"); +// pushFindBack ->setStyleSheet("* { background-color: lightGray }"); +// pushFindForth ->setStyleSheet("* { background-color: lightGray }"); +// } + } +} + +//#################################################################### + +void nmode::RunAna(int method) { + + checkDir(); + + string dirPath = ( lineDir -> text() ).toStdString(); + string filePath = ( lineFile-> text() ).toStdString(); + +// xterm -geometry 65x10+10+10 -e root -l "runreadgui.C+(\""3"\",\"/local/samir/test.root\","0","what","what","0")" + + std::stringstream strstr1; + strstr1.str(""); + strstr1 << method; + + std::stringstream strstr2; + strstr2.str(""); + strstr2 << spinPix->value(); + + std::stringstream strstr3; + strstr3.str(""); + strstr3 << radioExist->isChecked(); + +// string command = "xterm -hold -geometry 75x10+10+10 -e ./runana.sh "; + string command = "xterm -geometry 75x10+10+10 -e ./runana.sh "; + command += " "; + command += dirPath + filePath; + command += " "; + command += strstr1.str(); // method nr + command += " "; + command += strstr2.str(); // nr pixels + command += " "; + command += strstr3.str(); // most noisy or exist. Map + + const char *ptr = command.c_str() ; +// cout<start(ptr); + childcount++; + +} + +//#################################################################### +//#################################################################### + +bool nmode:: checkDir() { + + QString text = lineDir ->text(); + QByteArray bytes = text.toAscii(); + char *Dir = bytes.data(); + +// Add '/' at the end of Dir + if( Dir[strlen(Dir)-1] != '/' ) + { + strcat(Dir, "/" ); + lineDir -> clear(); + lineDir -> insert( QString(Dir) ); + } + +// Check whether Dir exists + DIR* dpdf = opendir(Dir); + + if (dpdf != NULL) { lineDir->setStyleSheet("QLineEdit { color:black; }"); return true; } + else { lineDir->setStyleSheet("QLineEdit { color:red; }"); return false; } +} + +//#################################################################### + +bool nmode:: checkFile() { + + if(checkDir()) + { + QString text; + QByteArray bytes; + char *Dir; + char *File; + + text = lineDir ->text(); + bytes = text.toAscii(); + Dir = bytes.data(); + + text = lineFile ->text(); + bytes = text.toAscii(); + File = bytes.data(); + + char Filecurr [256]; + strcpy (Filecurr, Dir); + strcat (Filecurr, File); + + struct stat buffer; + + if( stat (Filecurr, &buffer) == 0) { lineFile->setStyleSheet("QLineEdit { color:black; }"); return true; } + else { lineFile->setStyleSheet("QLineEdit { color:red; }"); return false; } + } + + return 0; +} + +//#################################################################### + +void nmode::Error() { + + QMessageBox* box = new QMessageBox(); + box->setWindowTitle(QString("Error")); +// box->setText(QString("Current Text:\""+text+"\"")); + box->setText(QString("Directory not found!")); + box->show(); +} + +//#################################################################### +// --- nmode.cpp - end --- diff --git a/normalmode/analysis_gui/GUI/nmode.h b/normalmode/analysis_gui/GUI/nmode.h new file mode 100644 index 0000000..7aca500 --- /dev/null +++ b/normalmode/analysis_gui/GUI/nmode.h @@ -0,0 +1,42 @@ +// --- nmode.h - start --- + +#ifndef NMODE_H +#define NMODE_H + +#include "ui_nmode.h" +#include "TCanvas.h" +#include + +class nmode : public QMainWindow, public Ui::MainWindow { + + Q_OBJECT + +public: + nmode(QMainWindow *parent=0); + ~nmode(); + +public slots: + void Error (); + void Unpack (); + void OpenBrowser(); + void Save (); + void Newest (); + void Close (); + void clickDir (); + void clickFile (); + void RunAna (int); + void NextFile (int); + +private: + void initGUI(); + bool checkDir(); + bool checkFile(); + + QProcess* child[1000]; + int childcount; +}; + +#endif // NMODE_H + +// --- nmode.h - end --- + diff --git a/normalmode/analysis_gui/GUI/nmode.ui b/normalmode/analysis_gui/GUI/nmode.ui new file mode 100644 index 0000000..3c8009f --- /dev/null +++ b/normalmode/analysis_gui/GUI/nmode.ui @@ -0,0 +1,389 @@ + + + MainWindow + + + + 0 + 0 + 495 + 296 + + + + MainWindow + + + + + + 59 + 12 + 391 + 26 + + + + + + + 59 + 42 + 391 + 26 + + + + + + + 19 + 18 + 41 + 16 + + + + DIR + + + + + + 19 + 48 + 41 + 16 + + + + FILE + + + + + + 97 + 148 + 101 + 131 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 3 + 54 + 95 + 26 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 165888 + + + + + + 4 + 82 + 101 + 21 + + + + + 8 + + + + Most noisy + + + + + + 4 + 102 + 101 + 21 + + + + + 8 + + + + Exist. Map + + + + + + 3 + 2 + 95 + 51 + + + + remove/map + Noisy Pixels + + + + + + + 200 + 150 + 95 + 51 + + + + Pixel Occ. + 2D + + + + + + 200 + 210 + 95 + 51 + + + + Pixel Occ. + 3D + + + + + + 300 + 210 + 95 + 51 + + + + Hit Occ. + 3D + + + + + + 60 + 84 + 95 + 51 + + + + Save + + + + + + 400 + 150 + 95 + 51 + + + + Open + Browser + + + + + + 160 + 84 + 95 + 51 + + + + Close + windows + + + + + + 313 + 74 + 135 + 61 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 10 + 6 + 51 + 21 + + + + Qt::RightToLeft + + + hld + + + + + + 62 + 6 + 51 + 21 + + + + root + + + + + + 27 + 26 + 81 + 31 + + + + Find Newest + + + + + + 3 + 26 + 21 + 31 + + + + < + + + + + + 111 + 26 + 21 + 31 + + + + > + + + + + + + 0 + 150 + 95 + 51 + + + + Unpack + + + + + + 400 + 210 + 95 + 51 + + + + Empty 1 + + + + + + 300 + 150 + 95 + 51 + + + + Hit Occ. + vs. Time + + + + + + + 0 + 0 + 495 + 20 + + + + + + + lineDir + lineFile + pushSave + pushClose + radioHld + radioRoot + pushFindBack + pushFindNew + pushFindForth + pushUnpack + pushRemove + spinPix + radioMost + radioExist + pushOcc2 + pushOccHT + pushOpenBrowser + pushOcc3 + pushOccH3 + pushEmpty1 + + + + diff --git a/normalmode/analysis_gui/GUI/runana.sh b/normalmode/analysis_gui/GUI/runana.sh new file mode 100755 index 0000000..a15e415 --- /dev/null +++ b/normalmode/analysis_gui/GUI/runana.sh @@ -0,0 +1,10 @@ +pxlmap=`pwd`/map.ini + +# echo " $1" +# echo " $2" +# echo " $3" +# echo " $4" +# echo " $pxlmap" + +time ./../ANA/Mi26Ana $1 $pxlmap $2 $3 $4 +echo "Finished!" \ No newline at end of file diff --git a/normalmode/analysis_gui/GUI/rununpack.sh b/normalmode/analysis_gui/GUI/rununpack.sh new file mode 100755 index 0000000..7f7ced4 --- /dev/null +++ b/normalmode/analysis_gui/GUI/rununpack.sh @@ -0,0 +1,13 @@ +echo "Input-Dir : $1" +echo "Input-File: $2" +./../../../normalmode/unpacker/Mi26NM $1 $2 +echo "Finished!" + + + +# --> Unpacker from folder: cpp_standalone + +# echo "Input: $1" +# # echo "Output: $4" +# . ../../cpp_standalone/unpackerB $1 +# echo "Finished!" diff --git a/normalmode/analysis_gui/readme.txt b/normalmode/analysis_gui/readme.txt new file mode 100644 index 0000000..6c005ce --- /dev/null +++ b/normalmode/analysis_gui/readme.txt @@ -0,0 +1,9 @@ + +1. Compile the code + - ANA + - GUI + - Unpacker (note: there are 2 different unpacker available) + +2. Un-/comment the part in GUI/run.sh according to which unpacker you choose + +3. To run the analysis GUI, you have to make ROOT available in the console first \ No newline at end of file diff --git a/normalmode/unpacker/unpack.C b/normalmode/unpacker/unpack.C index 624c1f5..936c74d 100755 --- a/normalmode/unpacker/unpack.C +++ b/normalmode/unpacker/unpack.C @@ -34,7 +34,7 @@ unpacker::~unpacker() { delete[] fFileLength; delete[] fInn; delete[] fRawData; -#if SAVE > 0 + cout<<"-------------"<%3i\n", i); } } - fOutputFile->Write(); +// fOutputFile->Write(); fOutputFile->Save(); fOutputFile->Close(); @@ -56,7 +56,6 @@ unpacker::~unpacker() { TFile::Open(fOutFileName); // gROOT->ProcessLine("new TBrowser;"); // gSystem->Exec(". ./runread.sh&"); -#endif } // cout<<"--------------------------------"< Wrong number of sensors (%3u --> %3u )! Frame number %10u skipped! File Number: %10u\n", fNrSensors, nrSensors, eventnrcount, fCurrFile); + printf("\r Data inconsistent: Wrong number of sensors (%2u-->%2u)! Frame number %8u skipped! File Number: %3u\n", fNrSensors, nrSensors, eventnrcount, fCurrFile); } else { @@ -185,7 +184,6 @@ bool unpacker::checkFiles(TString Dir, TString File) { fEvents = 0; ULong_t End; - // Check naming of 'Dir' and 'File' if( dir[strlen(dir)-1] != '/' ) { @@ -195,13 +193,20 @@ bool unpacker::checkFiles(TString Dir, TString File) { len = strlen(file); - for(uint i=0;i<4;i++) + if(len>4) { - if( file [len-4+i] != ending[i] ) + for(uint i=0;i<4;i++) { - has_ending = false; + if( file [len-4+i] != ending[i] ) + { + has_ending = false; + } } } + else + { + has_ending = false; + } for(uint i=0;i 0 fOutputFile = new TFile (fOutFileName,"RECREATE"); -#endif + for(Int_t i=0; i