lape
  LAPE e-log  ELOG logo
Message ID: 101     Entry time: Mon Aug 12 04:24:32 2013
Author: Mateus Vicente 
Type: Other 
Category: Software 
Subject: Timepix Pixel Map 

Programa em LabVIEW e em ROOT para fazer um "mapa" do detector com seu arquivo de saída.

O programa no labview permite salvar a saída (no formato X, Y, Value) como uma matriz (necessário para usar o Intensity Graph e permite visualizar interativamente as coordenadas e contagens clicando no gráfico. 

Captura_de_Tela_2013-08-12_às_04.08.58.png

Captura_de_Tela_2013-08-12_às_04.10.02.png

101_(Cópia_em_conflito_de_Vinícius_Lima_2013-08-09).png

1.png

Attachment 1: Captura_de_Tela_2013-08-12_às_04.08.58.png  68 kB  | Hide | Hide all
Captura_de_Tela_2013-08-12_às_04.08.58.png
Attachment 2: Captura_de_Tela_2013-08-12_às_04.10.02.png  33 kB  | Hide | Hide all
Captura_de_Tela_2013-08-12_às_04.10.02.png
Attachment 3: 101_(Cópia_em_conflito_de_Vinícius_Lima_2013-08-09).png  62 kB  | Hide | Hide all
101_(Cópia_em_conflito_de_Vinícius_Lima_2013-08-09).png
Attachment 5: Pixel_map.c  2 kB  | Hide | Hide all
{
    int thl;
    Double_t x, y, toa, tot;
    char filenametoa[50], filenametot[50], histnametoa[50], histnametoazoom[50], histnametot[50], histnametotzoom[50];
    ifstream datatoa, datatot;
    
    printf("THL value: ");
    scanf("%d", &thl);
    if (thl<315 && thl>390)
        {
        printf("Arquivo Invalido");
            goto 7;
        }
    
    else
    {
    sprintf(filenametoa,"ToAxTHL_010813/Data_THL_%d",thl);
    sprintf(filenametot,"ToTxTHL_010813/Data_THL_%d",thl);
    sprintf(histnametoa,"ToA Pixel Map THL %d",thl);
    sprintf(histnametoazoom,"ToA Pixel Map THL %d Zoomed in",thl);
    sprintf(histnametot,"ToT Pixel Map THL %d",thl);
    sprintf(histnametotzoom,"ToT Pixel Map THL %d Zoomed in",thl);
    
    gStyle->SetOptStat(0);
    
    TCanvas *c1 = new TCanvas("c1","Pixel Map",1200,800);
    c1->Divide(2,2);
    TCanvas *c2 = new TCanvas("c2","Pixel Map 3D",1200,600);
    c2->Divide(2,1);
    
    //ToA
    TH2F *maptoa = new TH2F("maptoa",histnametoa,256,0,256,256,0,256);
    TH2F *maptoazoom = new TH2F("maptoazoom",histnametoazoom,10,100,110,10,127,137);
    
    //ToT
    TH2F *maptot = new TH2F("maptot",histnametot,256,0,256,256,0,256);
    TH2F *maptotzoom = new TH2F("maptotzoom",histnametotzoom,10,100,110,10,127,137);
    
    datatoa.open(filenametoa);
    datatot.open(filenametot);
    
    while(!datatoa.eof())
    {
        //if(data.eof()) break;
        datatoa >> x >> y >> toa;
        //cout << x << y << tot;
        maptoa->Fill(x,y,toa);
        maptoazoom->Fill(x,y,toa);
    }

    while(!datatot.eof())
    {
        //if(data.eof()) break;
        datatot >> x >> y >> tot;
        //cout << x << y << tot;
        maptot->Fill(x,y,tot);
        maptotzoom->Fill(x,y,tot);
    }
    
    maptoa->SetXTitle("Detector X axis");
    maptoa->SetYTitle("Detector Y axix");
    maptoazoom->SetXTitle("Detector X axis");
    maptoazoom->SetYTitle("Detector Y axix");
    
    maptot->SetXTitle("Detector X axis");
    maptot->SetYTitle("DetectorY axix");
    maptotzoom->SetXTitle("Detector X axis");
    maptotzoom->SetYTitle("Detector Y axix");
    
    c1->cd(1);
    maptoa->Draw("colz");
    c1->cd(2);
    maptoazoom->Draw("colz");
    
    c1->cd(3);
    maptot->Draw("colz");
    c1->cd(4);
    maptotzoom->Draw("colz");
    
    c2->cd(1);
    maptoazoom->Draw("LEGO2Z");
    c2->cd(2);
    maptotzoom->Draw("LEGO2Z");
    
    datatoa.close();
    datatot.close();
    
    //TGMainFrame *fMainFrame1995 = new TGMainFrame(gClient->GetRoot(),10,10,kMainFrame | kVerticalFrame);
    //TGHSlider *fHSlider1754 = new TGHSlider(fMainFrame1995,272,kSlider1 | kScaleBoth,-1,kHorizontalFrame);
    //fHSlider1754->SetRange(315,390);
    //fMainFrame1995->MapSubwindows();
    
    //fMainFrame1995->Resize(fMainFrame1995->GetDefaultSize());
    //fMainFrame1995->MapWindow();
    //fMainFrame1995->Resize(300,50);
    
    //cout << fHSlider1754->GetPosition() << endl;
}
}
Attachment 6: Matrix_Pixel_Map.vi  45 kB
ELOG V2.9.2-2455