/* ------------------------------------------------------------- * * file: R4sImg.cpp * * description: Converts rawdata from dtb into a "readable" Image * * author: Beat Meier * modified: 31.8.2007 * * rev: Tilman Rohe * dat: 28.08.2017 * * ------------------------------------------------------------- */ #include "cmd.h" #include "datalink.h" #include "R4sImg.h" //#include "pixelAlive.h" #include "TROOT.h" #include "TH1D.h" #include "TH2D.h" #include "TH2F.h" #include "TCanvas.h" #include "TFile.h" #include "TString.h" #include "TTree.h" #include "TBranch.h" #include "TLeaf.h" #include "TGraph.h" #include "TMultiGraph.h" #include "TLegend.h" #include "TCanvas.h" int R4sImg::Get(int x, int y) { if ( y>IMG_HEIGHT || x>IMG_WIDTH ) {printf("ERROR: Out of range");return -9999;} return data[y*IMG_WIDTH + x]; } bool R4sImg::CreateRaw(const vector &rawdata) { Clear(); if (rawdata.size() < IMG_WIDTH*IMG_HEIGHT) return false; data = new int[IMG_WIDTH*IMG_HEIGHT]; for (int pos=0; pos>\n"); return; } if (count > IMG_WIDTH*IMG_HEIGHT) count = IMG_WIDTH*IMG_HEIGHT; for (unsigned int i=0; i>\n"); return; } FILE *f = fopen(filename.c_str(), "wt"); if (!f) return; int i = 0, x, y; for (y=IMG_HEIGHT-1; y>=0; y--) { for (x=0; x