void figKinematics() { // gSystem->Load("/home/vratik/workspace/daf/trunk/libUtilities.so"); // gSystem->Load("/home/vratik/workspace/daf/trunk/libEvent.so"); TStopwatch sw; sw.Start(); // const Bool_t savePictures = 1; const Bool_t savePictures = 0; TString pictureName; TString picturePath = "figures/"; // TString pictFormat = ".jpg"; // TString pictFormat = ".eps"; TString pictFormat = ".gif"; const Bool_t kKinematics = 1; // if (kKinematics) { TCanvas *cKin = new TCanvas("kinematicsBe", "kinematics of (p,n) reaction"); cKin->ToggleEditor(); cKin->SetWindowSize(1500, 1000); // TFile fr("../simulace/kin.root"); TFile *fr = new TFile("./kin.root"); TTree *tr = (TTree*)fr->Get("kin"); tr->SetMarkerStyle(20); tr->SetMarkerSize(0.4); TH2F *hKin = new TH2F("hKin", "", 1000, 0., 30., 1000, 4., 56.); // TCut cP = "p.fImpulse.Theta()*TMath::RadToDeg()>100"; // TCut cP = "p.fImpulse.Theta()*TMath::RadToDeg()>0"; // tr->Draw("(p1.fImpulse.T()-p1.fMass)/p1.fA:p1.fImpulse.Theta()*TMath::RadToDeg()>>hKin", "", "col"); // hKin->Print(); // return; // tr->SetMarkerColor(kRed); // tr->Draw("(p1.fImpulse.T()-p1.fMass)/p1.fA:p1.fImpulse.Theta()*TMath::RadToDeg()>>hKin", "", "scat"); tr->Draw("(p1.fImpulse.T()-p1.fMass)/p1.fA:p1.fImpulse.Theta()*TMath::RadToDeg()>>hKin", "", ""); hKin->SetMarkerColor(kRed); hKin->SetMarkerStyle(20); hKin->SetMarkerSize(0.4); tr->SetMarkerColor(kRed); tr->Draw("(p2.fImpulse.T()-p2.fMass)/p2.fA:p2.fImpulse.Theta()*TMath::RadToDeg()", "", "same"); tr->SetMarkerColor(kGreen); tr->Draw("(4_He.fImpulse.T()-4_He.fMass)/4_He.fA:4_He.fImpulse.Theta()*TMath::RadToDeg()", "", "same"); tr->SetMarkerColor(kBlue); tr->Draw("(6_Be.fImpulse.T()-6_Be.fMass)/6_Be.fA:6_Be.fImpulse.Theta()*TMath::RadToDeg()", "", "same"); hKin->GetXaxis()->SetTitle("#it{#theta}_{lab} (deg)"); hKin->GetXaxis()->CenterTitle(); hKin->GetXaxis()->SetTitleSize(0.07); hKin->GetXaxis()->SetTitleOffset(0.79); hKin->GetXaxis()->SetLabelSize(0.05); hKin->GetYaxis()->SetTitle("#it{E}_{lab} (AMeV)"); hKin->GetYaxis()->CenterTitle(); hKin->GetYaxis()->SetTitleSize(0.07); hKin->GetYaxis()->SetTitleOffset(0.79); hKin->GetYaxis()->SetLabelSize(0.05); cKin->cd(); cKin->Update(); TCanvas *c1 = new TCanvas(); c1->Update(); delete c1; cKin->Update(); if (savePictures) { // gStyle->SetCanvasDefW(649); // gStyle->SetCanvasDefH(727); pictureName.Form("%s%s%s", picturePath.Data(), cKin->GetName(), pictFormat.Data()); // cKin->SaveAs(pictureName.Data()); cKin->SaveAs("figures/PresKinematics.png"); cKin->cd(); // cKin->Close(); } // } }