#include "TROOT.h" #include "TSystem.h" #include "TStyle.h" #include "TCanvas.h" #include "TPad.h" #include "TH1.h" #include "TH2.h" #include "TF1.h" #include "TFile.h" #include "TTree.h" #include "TClonesArray.h" #include "TVector3.h" #include "TMath.h" #include "TChain.h" #include "TColor.h" #include "TGaxis.h" #include "TProfile.h" #include "TVector3.h" #include #include #include "../src/PrtHit.h" #include "../src/PrtEvent.h" #include "prttools.C" #include "save.C" void drawMult(TString infile="../build/hits.root"){ infile="/SAT/hera/had1/dervish/data/prt/mult635/hits_*.root"; PrtInit(infile); TH2F *hYield = new TH2F("photon_yield"+randstr(),"photon_yield",118,22,140,150,0,250 ); TProfile *pYield = new TProfile("hprof"+randstr(),"Profile of pz versus px",118,22,140,0,1000); TH1F *hLambda = new TH1F("lambda"+randstr(),"lambda",400,0,800 ); TH1F *hMult = new TH1F("mult"+randstr(),"mult",118,22,140); TH1F *hTime = new TH1F("time"+randstr(),"time",500,0,30 ); Int_t nhits,angle,z; PrtHit fHit; TVector3 mom; for (Int_t ievent=0; ieventGetEntries(); ievent++){ PrtNextEvent(ievent,1000); if(fEvent->GetHitSize()>0){ nhits = fEvent->GetHitSize(); angle = fEvent->GetAngle() + 0.00001; for(Int_t h=0; hGetHit(h); z = fHit.GetGlobalPos().Z(); mom = fHit.GetMomentum(); mom.RotateY(-(angle-90)*TMath::Pi()/180.); if(mom.X()>0){ //hYield->Fill(angle,1); //pYield->Fill(angle,1); hMult->Fill(angle,1); } //hTime->Fill(fHit.GetLeadTime(0)/1000.); hLambda->Fill(197.0*2.0*TMath::Pi()/fHit.GetMomentum().Mag()/1000000.); } } } // TCanvas* c = new TCanvas("c","c",800,500); // axisAngle800x500(hYield); // hYield->Draw("colz"); // pYield->SetMarkerColor(4); // pYield->SetMarkerStyle(21); // pYield->SetMarkerSize(0.6); // pYield->Draw("same"); // TCanvas* cs = new TCanvas("cs","cs",800,500); // TH1D *hSum = hYield->ProjectionX("sum"); // axisAngle800x500(hSum); // hSum->Scale(0.001); // hSum->Draw(); // TCanvas* cp = new TCanvas("cp","cp",800,500); // TH1D *hPdf = hYield->ProjectionY("pdf"); // axisAngle800x500(hPdf); // hPdf->GetYaxis()->SetTitle("PDF"); // hPdf->Scale(1/(double)(119*1000)); // hPdf->Draw(); // TCanvas* ct = new TCanvas("ct","ct",800,500); // axisTime800x500(hTime); // hTime->Draw(); TString strid = "lpR"; TCanvas* c1 = new TCanvas("c1","c1",800,500); hLambda->GetXaxis()->SetTitle("#lambda, [nm]"); hLambda->GetYaxis()->SetTitle("entries, [#]"); hLambda->Draw(); c1->Print("mult_lambda_"+strid+".C"); TCanvas* c2 = new TCanvas("c2","c2",800,500); axisAngle800x500(hMult); hMult->Scale(0.001); hMult->SetMarkerStyle(7); hMult->Draw(); c2->Print("mult_mult_"+strid+".C"); }