void CalculateWeightingPotential()
{
if (gSystem->Which(".","siegfried.root")) return;
TFile *output = new TFile("siegfried.root", "recreate");
detector.Write();
grid.Write();
output->Close();
}
void DrawWeightingPotential()
{
TFile *input = new TFile("siegfried.root");
const int n = t->GetEntries();
t->Draw("c1*cos(c2):c1*sin(c2):v","","goff");
TGraph2D *gv = new TGraph2D(n, t->GetV1(), t->GetV2(), t->GetV3());
gv->SetName("gv"); gv->SetNpx(500); gv->SetNpy(500);
gStyle->SetPadRightMargin(0.16); gStyle->SetTitleOffset(-0.6,"z");
TCanvas *c = new TCanvas("c", "c", 600, 520);
c->SetLogz();
TH2D *h = gv->GetHistogram();
h->SetTitle(";x [cm];y [cm];weighting potential [V]");
h->GetXaxis()->CenterTitle();
h->GetYaxis()->CenterTitle();
h->GetZaxis()->CenterTitle();
h->Draw("colz");
c->Update();
TPaletteAxis *palette =
(TPaletteAxis*) h->GetListOfFunctions()->FindObject("palette");
palette->SetX2NDC(0.92);
gPad->Print("sip.png");
}
void drawSliceInPhi()
{
CalculateWeightingPotential();
DrawWeightingPotential();
}