{
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;
}
}
|