// draw r distributiob void genPlots03(std::string fullPath, int nOverlay = 500) { const int fVerbose(0); setTDRStyle(); gStyle->SetOptStat(112211); gStyle->SetPalette(1); // Canvas c = new TCanvas("c3","c3",1000,600); const unsigned int nPadX = 1; const unsigned int nPadY = 1; c->Divide(nPadX,nPadY); const unsigned int nPads=nPadX*nPadY; for(unsigned int i=1; i<=nPads; i++) { TPad* pad= (TPad*)c->cd(i); pad->SetTopMargin(0.10); pad->SetRightMargin(0.20); pad->SetLeftMargin(0.15); pad->SetLogy(); } // Open file TFile *f = TFile::Open(fullPath.c_str()); if (f==0) { cout << "File " << fullPath << " not found -- exiting" << endl; return; } if(fVerbose>0) cout << "Succesfully opened file " << fullPath << endl; // Get TTree TTree* t = (TTree*) f->Get("events"); if(fVerbose>0) cout << "Got TTree with " << t->GetEntries() << " entries" << endl; // Do plots c->cd(1); //doPlot2d(t,"hrzL0vtx", "vrl0:TMath::Abs(vzl0)",30,0,300,30,0,120,"Tit","|z|","r","cm","cm"); std::string histoName = "hrL0vtxreco"; doPlot1d(t,histoName.c_str(), "vrl0",30,0,30,"#Lambda vertices","r","cm"); // draw radii { TH2F *h = (TH2F*)gDirectory->GetList()->FindObject(histoName.c_str()); double r; const double min = h->GetMinimum(); const double max = h->GetMaximum(); TLine *l; r = 4.4; l = new TLine(r,min,r,max); l->Draw(); r = 7.3; l = new TLine(r,min,r,max); l->Draw(); r = 10.2; l = new TLine(r,min,r,max); l->Draw(); r = 25.5; l = new TLine(r,min,r,max); l->Draw(); } }
//------------------------------------------------------------------------------ // DrawIt //------------------------------------------------------------------------------ void DrawIt(TString filename, TString hname, TString cname, TString title) { TFile* inputfile = TFile::Open("../AuxiliaryFilesWZXS8TeV/" + filename + ".root"); TH2F* h = (TH2F*)inputfile->Get(hname)->Clone(cname); h->SetDirectory(0); inputfile->Close(); TString name = h->GetName(); TCanvas* canvas = new TCanvas(name, name, 600, 600); if (name.Contains("PR")) canvas->SetLogx(); if (name.Contains("SF")) canvas->SetLogx(); canvas->SetLeftMargin (0.9 * canvas->GetLeftMargin()); canvas->SetRightMargin(3.5 * canvas->GetRightMargin()); canvas->SetTopMargin (1.2 * canvas->GetTopMargin()); TH2FAxisFonts(h, "x", "p_{T} [GeV]"); TH2FAxisFonts(h, "y", "#eta"); h->Draw("colz"); h->SetTitle(""); DrawTLatex(42, 0.940, 0.976, _bigLabelSize, 33, title); if (!title.Contains("trigger")) { Double_t hmin = h->GetMinimum(); Double_t hmax = h->GetMaximum(); for (Int_t i=1; i<=h->GetNbinsX(); i++) { for (Int_t j=1; j<=h->GetNbinsY(); j++) { Double_t value = h->GetBinContent(i,j); Double_t ypos = h->GetYaxis()->GetBinCenter(j); Double_t xpos = h->GetXaxis()->GetBinCenter(i); if (gPad->GetLogx()) xpos = h->GetXaxis()->GetBinCenterLog(i); TLatex* latex = new TLatex(xpos, ypos, Form("%.2f", value)); latex->SetTextAlign( 22); latex->SetTextFont ( 42); latex->SetTextSize (0.027); if (value < hmin + 0.3*(hmax - hmin)) latex->SetTextColor(kWhite); latex->Draw(); } } } // Set the palette font //---------------------------------------------------------------------------- canvas->Update(); TPaletteAxis* palette = (TPaletteAxis*)h->GetListOfFunctions()->FindObject("palette"); palette->SetLabelFont(42); // Save the plot //---------------------------------------------------------------------------- canvas->Update(); canvas->Modified(); canvas->GetFrame()->DrawClone(); canvas->SaveAs("pdf/scale_factors/" + name + ".pdf"); canvas->SaveAs("png/scale_factors/" + name + ".png"); }
void rulevisHists( TDirectory *rfdir, TDirectory *vardir, TDirectory *corrdir, TMVAGlob::TypeOfPlot type) { // if (rfdir==0) return; if (vardir==0) return; if (corrdir==0) return; // const TString rfName = rfdir->GetName(); const TString maintitle = rfName + " : Rule Importance"; const TString rfNameOpt = "_RF2D_"; const TString outfname[TMVAGlob::kNumOfMethods] = { "rulevisHists", "rulevisHists_decorr", "rulevisCorr_pca", "rulevisCorr_gaussdecorr" }; const TString outputName = outfname[type]+"_"+rfdir->GetName(); // TIter rfnext(rfdir->GetListOfKeys()); TKey *rfkey; Double_t rfmax; Double_t rfmin; Bool_t allEmpty=kTRUE; Bool_t first=kTRUE; while ((rfkey = (TKey*)rfnext())) { // make sure, that we only look at histograms TClass *cl = gROOT->GetClass(rfkey->GetClassName()); if (!cl->InheritsFrom("TH2F")) continue; TH2F *hrf = (TH2F*)rfkey->ReadObj(); TString hname= hrf->GetName(); if (hname.Contains("__RF_")){ // found a new RF plot Double_t valmin = hrf->GetMinimum(); Double_t valmax = hrf->GetMaximum(); if (first) { rfmin=valmin; rfmax=valmax; first = kFALSE; } else { if (valmax>rfmax) rfmax=valmax; if (valmin<rfmin) rfmin=valmin; } if (hrf->GetEntries()>0) allEmpty=kFALSE; } } if (first) { cout << "ERROR: no RF plots found..." << endl; return; } const Int_t nContours = 100; Double_t contourLevels[nContours]; Double_t dcl = (rfmax-rfmin)/Double_t(nContours-1); // for (Int_t i=0; i<nContours; i++) { contourLevels[i] = rfmin+dcl*Double_t(i); } /////////////////////////// vardir->cd(); // how many plots are in the directory? Int_t noPlots = ((vardir->GetListOfKeys())->GetEntries()) / 2; // define Canvas layout here! // default setting Int_t xPad; // no of plots in x Int_t yPad; // no of plots in y Int_t width; // size of canvas Int_t height; switch (noPlots) { case 1: xPad = 1; yPad = 1; width = 500; height = 0.7*width; break; case 2: xPad = 2; yPad = 1; width = 600; height = 0.7*width; break; case 3: xPad = 3; yPad = 1; width = 900; height = 0.4*width; break; case 4: xPad = 2; yPad = 2; width = 600; height = width; break; default: xPad = 3; yPad = 2; width = 800; height = 0.7*width; break; } Int_t noPad = xPad * yPad ; // this defines how many canvases we need const Int_t noCanvas = 1 + (Int_t)((noPlots - 0.001)/noPad); TCanvas **c = new TCanvas*[noCanvas]; for (Int_t ic=0; ic<noCanvas; ic++) c[ic] = 0; // counter variables Int_t countCanvas = 0; Int_t countPad = 1; // loop over all objects in directory TIter next(vardir->GetListOfKeys()); TKey *key; TH1F *sigCpy=0; TH1F *bgdCpy=0; // Bool_t first = kTRUE; while ((key = (TKey*)next())) { // make sure, that we only look at histograms TClass *cl = gROOT->GetClass(key->GetClassName()); if (!cl->InheritsFrom("TH1")) continue; sig = (TH1F*)key->ReadObj(); TString hname= sig->GetName(); // check for all signal histograms if (hname.Contains("__S")){ // found a new signal plot // sigCpy = new TH1F(*sig); // create new canvas if ((c[countCanvas]==NULL) || (countPad>noPad)) { char cn[20]; sprintf( cn, "rulehist%d_", countCanvas+1 ); TString cname(cn); cname += rfdir->GetName(); c[countCanvas] = new TCanvas( cname, maintitle, countCanvas*50+200, countCanvas*20, width, height ); // style c[countCanvas]->Divide(xPad,yPad); countPad = 1; } // save canvas to file TPad *cPad = (TPad *)(c[countCanvas]->GetPad(countPad)); c[countCanvas]->cd(countPad); countPad++; // find the corredponding background histo TString bgname = hname; bgname.ReplaceAll("__S","__B"); hkey = vardir->GetKey(bgname); bgd = (TH1F*)hkey->ReadObj(); if (bgd == NULL) { cout << "ERROR!!! couldn't find backgroung histo for" << hname << endl; exit; } TString rfname = hname; rfname.ReplaceAll("__S","__RF"); TKey *hrfkey = rfdir->GetKey(rfname); TH2F *hrf = (TH2F*)hrfkey->ReadObj(); Double_t wv = hrf->GetMaximum(); // if (rfmax>0.0) // hrf->Scale(1.0/rfmax); hrf->SetMinimum(rfmin); // make sure it's zero -> for palette axis hrf->SetMaximum(rfmax); // make sure max is 1.0 -> idem hrf->SetContour(nContours,&contourLevels[0]); // this is set but not stored during plot creation in MVA_Factory // TMVAGlob::SetSignalAndBackgroundStyle( sigK, bgd ); sig->SetFillStyle(3002); sig->SetFillColor(1); sig->SetLineColor(1); sig->SetLineWidth(2); bgd->SetFillStyle(3554); bgd->SetFillColor(1); bgd->SetLineColor(1); bgd->SetLineWidth(2); // chop off "signal" TString title(hrf->GetTitle()); title.ReplaceAll("signal",""); // finally plot and overlay Float_t sc = 1.1; if (countPad==2) sc = 1.3; sig->SetMaximum( TMath::Max( sig->GetMaximum(), bgd->GetMaximum() )*sc ); Double_t smax = sig->GetMaximum(); if (first) { hrf->SetTitle( maintitle ); first = kFALSE; } else { hrf->SetTitle( "" ); } hrf->Draw("colz ah"); TMVAGlob::SetFrameStyle( hrf, 1.2 ); sig->Draw("same ah"); bgd->Draw("same ah"); // draw axis using range [0,smax] hrf->GetXaxis()->SetTitle( title ); hrf->GetYaxis()->SetTitleOffset( 1.30 ); hrf->GetYaxis()->SetTitle("Events"); hrf->GetYaxis()->SetLimits(0,smax); hrf->Draw("same axis"); cPad->SetRightMargin(0.13); cPad->Update(); // Draw legend if (countPad==2){ TLegend *legend= new TLegend( cPad->GetLeftMargin(), 1-cPad->GetTopMargin()-.18, cPad->GetLeftMargin()+.4, 1-cPad->GetTopMargin() ); legend->AddEntry(sig,"Signal","F"); legend->AddEntry(bgd,"Background","F"); legend->Draw("same"); legend->SetBorderSize(1); legend->SetMargin( 0.3 ); legend->SetFillColor(19); legend->SetFillStyle(1); } // save canvas to file if (countPad > noPad) { c[countCanvas]->Update(); TString fname = Form( "plots/%s_c%i", outputName.Data(), countCanvas+1 ); TMVAGlob::imgconv( c[countCanvas], fname ); // TMVAGlob::plot_logo(); // don't understand why this doesn't work ... :-( countCanvas++; } } } if (countPad <= noPad) { c[countCanvas]->Update(); TString fname = Form( "plots/%s_c%i", outputName.Data(), countCanvas+1 ); TMVAGlob::imgconv( c[countCanvas], fname ); } }
void DoEvolutions( const TString &sim, Int_t time, Int_t Nbins=1, const TString &options="") { #ifdef __CINT__ gSystem->Load("libptools.so"); #endif PGlobals::Initialize(); // Palettes! gROOT->Macro("PPalettes.C"); TString opt = options; // cout << "options = " << opt << endl; // Load PData PData *pData = PData::Get(sim.Data()); pData->LoadFileNames(time); if(!pData->IsInit()) return; Bool_t CYL = kFALSE; if(sim.Contains("cyl")) { CYL = kTRUE; opt += "cyl"; } Bool_t ThreeD = kFALSE; if(sim.Contains("3D")) ThreeD = kTRUE; // Some plasma constants Double_t n0 = pData->GetPlasmaDensity(); Double_t kp = pData->GetPlasmaK(); Double_t skindepth = 1.0; if(kp!=0.0) skindepth = 1/kp; Double_t E0 = pData->GetPlasmaE0(); // Some initial beam properties: Float_t Ebeam = pData->GetBeamEnergy() * PUnits::MeV; Float_t gamma = pData->GetBeamGamma(); Float_t vbeam = pData->GetBeamVelocity(); Double_t rms0 = pData->GetBeamRmsY() * kp; if(CYL) rms0 = pData->GetBeamRmsR() * kp; // Time in OU Float_t Time = pData->GetRealTime(); // z start of the plasma in normalized units. Float_t zStartPlasma = pData->GetPlasmaStart() * kp; // z start of the beam in normalized units. Float_t zStartBeam = pData->GetBeamStart() * kp; if(opt.Contains("center")) { Time -= zStartPlasma; if(opt.Contains("comov")) // Centers on the head of the beam. Time += zStartBeam; } // Beam charge 2D and 1D histogram (on-axis) // ------------------------------------------------------------------ TH2F *hDen2D = NULL; if(pData->GetChargeFileName(1)) { char hName[24]; sprintf(hName,"hDen2D"); hDen2D = (TH2F*) gROOT->FindObject(hName); if(hDen2D) { delete hDen2D; hDen2D = NULL; } if(!ThreeD) hDen2D = pData->GetCharge(1,opt); else hDen2D = pData->GetCharge2DSliceZY(1,-1,1,opt+"avg"); hDen2D->SetName(hName); hDen2D->GetXaxis()->CenterTitle(); hDen2D->GetYaxis()->CenterTitle(); hDen2D->GetZaxis()->CenterTitle(); if(opt.Contains("comov")) hDen2D->GetXaxis()->SetTitle("k_{p}#zeta"); else hDen2D->GetXaxis()->SetTitle("k_{p}z"); if(CYL) hDen2D->GetYaxis()->SetTitle("k_{p}r"); else hDen2D->GetYaxis()->SetTitle("k_{p}y"); hDen2D->GetZaxis()->SetTitle("n_{b}/n_{0}"); } // Define ranges from the charge 2D histogram: // Binning for 2D histograms: // We get this values from the 2D density histogram. Int_t x1Nbin = hDen2D->GetNbinsX(); Float_t x1Range = (hDen2D->GetXaxis()->GetXmax() - hDen2D->GetXaxis()->GetXmin()); Float_t x1Mid = (hDen2D->GetXaxis()->GetXmax() + hDen2D->GetXaxis()->GetXmin())/2.; Float_t x1Min = hDen2D->GetXaxis()->GetXmin(); Float_t x1Max = hDen2D->GetXaxis()->GetXmax(); Int_t x2Nbin = hDen2D->GetNbinsY(); Float_t x2Range = (hDen2D->GetYaxis()->GetXmax() - hDen2D->GetYaxis()->GetXmin()); Float_t x2Mid = (hDen2D->GetYaxis()->GetXmax() + hDen2D->GetYaxis()->GetXmin())/2.; Float_t x2Min = x2Mid - x2Range/2; Float_t x2Max = x2Mid + x2Range/2; if(Nbins==0) { Nbins = TMath::Nint(rms0 / hDen2D->GetYaxis()->GetBinWidth(1)) ; // cout << Form(" Rms0 = %6.2f Dx = %6.2f Nbins = %4i .", // rms0, hDen2D->GetYaxis()->GetBinWidth(1), Nbins) << endl; } // Slice width limits. Int_t FirstyBin = 0; Int_t LastyBin = 0; if(!CYL) { FirstyBin = hDen2D->GetNbinsY()/2 + 1 - Nbins; LastyBin = hDen2D->GetNbinsY()/2 + Nbins; } else { FirstyBin = 1; LastyBin = Nbins; } // OUTPUT ROOT FILE WITH THE PLOTS: TString filename = Form("./%s/Plots/Evolutions/Evolutions-%s.root",sim.Data(),sim.Data()); TFile * ifile = (TFile*) gROOT->GetListOfFiles()->FindObject(filename); // if doesn't exist the directory should be created if (!ifile) { TString f = filename; TString dir2 = f.Remove( f.Last( '/' ), f.Length() - f.Last( '/' ) ); TString dir1 = f.Remove( f.Last( '/' ), f.Length() - f.Last( '/' ) ); gSystem->mkdir( dir1 ); gSystem->mkdir( dir2 ); ifile = new TFile(filename,"UPDATE"); } // Charge 1D histogram on axis TH1F *hDen1D = NULL; if(pData->GetChargeFileName(1)) { TString opth1 = opt; opth1 += "avg"; char hName[24]; sprintf(hName,"hDen1D"); hDen1D = (TH1F*) gROOT->FindObject(hName); if(hDen1D) delete hDen1D; if(ThreeD) { hDen1D = pData->GetH1SliceZ3D(pData->GetChargeFileName(1)->c_str(),"charge",-1,Nbins,-1,Nbins,opth1.Data()); } else if(CYL) { // Cylindrical: The first bin with r>0 is actually the number 1 (not the 0). hDen1D = pData->GetH1SliceZ(pData->GetChargeFileName(1)->c_str(),"charge",1,Nbins,opth1.Data()); } else { // 2D cartesian hDen1D = pData->GetH1SliceZ(pData->GetChargeFileName(1)->c_str(),"charge",-1,Nbins,opth1.Data()); } hDen1D->SetName(hName); if(opt.Contains("comov")) hDen1D->GetXaxis()->SetTitle("k_{p}#zeta"); else hDen1D->GetXaxis()->SetTitle("k_{p}z"); hDen1D->GetYaxis()->SetTitle("n_{b}/n_{0}"); } // On-axis beam density vs \zeta vs time! _________________________________ TH2F *hDen1DvsTime = NULL; if(hDen1D) { char hName[24]; sprintf(hName,"hDen1DvsTime"); TH2F *hDen1DvsTimeOld = (TH2F*) ifile->Get(hName); Int_t nBins = 1; Float_t edge0 = Time-0.5; Float_t edge1 = Time+0.5; if(hDen1DvsTimeOld!=NULL) { nBins = hDen1DvsTimeOld->GetNbinsX()+1; Float_t binwidth = (Time - hDen1DvsTimeOld->GetXaxis()->GetBinCenter(1))/(nBins-1); edge0 = hDen1DvsTimeOld->GetXaxis()->GetBinCenter(1) - binwidth/2.; edge1 = Time + binwidth/2.; } hDen1DvsTime = new TH2F("temp","",nBins,edge0,edge1, hDen1D->GetNbinsX(), hDen1D->GetBinLowEdge(1), hDen1D->GetBinLowEdge(hDen1D->GetNbinsX()+1)); for(Int_t ix=1;ix<hDen1DvsTime->GetNbinsX();ix++) { for(Int_t iy=1;iy<hDen1DvsTime->GetNbinsY();iy++) { hDen1DvsTime->SetBinContent(ix,iy,hDen1DvsTimeOld->GetBinContent(ix,iy)); } } delete hDen1DvsTimeOld; // Fill last bin with the newest values. for(Int_t iy=1;iy<=hDen1D->GetNbinsX();iy++) { hDen1DvsTime->SetBinContent(nBins,iy,hDen1D->GetBinContent(iy)); } hDen1DvsTime->GetZaxis()->SetTitle("n_{b}/n_{0}"); hDen1DvsTime->GetYaxis()->SetTitle("k_{p}#zeta"); hDen1DvsTime->GetXaxis()->SetTitle("k_{p}z"); hDen1DvsTime->GetZaxis()->CenterTitle(); hDen1DvsTime->GetYaxis()->CenterTitle(); hDen1DvsTime->GetXaxis()->CenterTitle(); hDen1DvsTime->SetName(hName); // Change the range of z axis Float_t Denmax = hDen1DvsTime->GetMaximum(); hDen1DvsTime->GetZaxis()->SetRangeUser(0,Denmax); hDen1DvsTime->Write(hName,TObject::kOverwrite); } // RMS (vs z) of the beam's charge distribution: TProfile *hDen2Dprof = NULL; TH1F *hRms = NULL; Double_t axisPos = x2Mid; if(hDen2D) { TString pname = hDen2D->GetName(); pname += "_pfx"; hDen2Dprof = (TProfile*) gROOT->FindObject(pname.Data()); if(hDen2Dprof) { delete hDen2Dprof; hDen2Dprof = NULL; } hDen2Dprof = hDen2D->ProfileX("_pfx",1,-1,"s"); hRms = (TH1F*) gROOT->FindObject("hRms"); if(hRms) delete hRms; hRms = new TH1F("hRms","",x1Nbin,x1Min,x1Max); if(CYL) axisPos = 0.0; for(Int_t j=0;j<hRms->GetNbinsX();j++) { Double_t rms = 0; Double_t total = 0; for(Int_t k=1;k<=x2Nbin;k++) { Double_t value = hDen2D->GetBinContent(j,k); Double_t radius = hDen2D->GetYaxis()->GetBinCenter(k) - axisPos; if(CYL) { rms += radius*radius*radius*value; total += radius*value; } else { rms += radius*radius*value; total += value; } // cout << Form(" (%i,%i) -> radius = %7.4f , density = %7.4f",j,k,radius,value) << endl; } rms /= total; rms = sqrt(rms); hRms->SetBinContent(j,rms); } hRms->GetXaxis()->SetTitle("k_{p}z"); if(opt.Contains("comov")) hRms->GetXaxis()->SetTitle("k_{p}#zeta"); hRms->GetYaxis()->SetTitle("k_{p}#LTr#GT_{rms}"); } // Transverse charge RMS vs \zeta vs time! _________________________________ TH2F *hRmsvsTime = NULL; if(hRms) { char hName[24]; sprintf(hName,"hRmsvsTime"); TH2F *hRmsvsTimeOld = (TH2F*) ifile->Get(hName); Int_t nBins = 1; Float_t edge0 = Time-0.5; Float_t edge1 = Time+0.5; if(hRmsvsTimeOld!=NULL) { nBins = hRmsvsTimeOld->GetNbinsX()+1; Float_t binwidth = (Time - hRmsvsTimeOld->GetXaxis()->GetBinCenter(1))/(nBins-1); edge0 = hRmsvsTimeOld->GetXaxis()->GetBinCenter(1) - binwidth/2.; edge1 = Time + binwidth/2.; } hRmsvsTime = new TH2F("temp","",nBins,edge0,edge1, hRms->GetNbinsX(), hRms->GetBinLowEdge(1), hRms->GetBinLowEdge(hRms->GetNbinsX()+1)); for(Int_t ix=1;ix<hRmsvsTime->GetNbinsX();ix++) { for(Int_t iy=1;iy<hRmsvsTime->GetNbinsY();iy++) { hRmsvsTime->SetBinContent(ix,iy,hRmsvsTimeOld->GetBinContent(ix,iy)); } } delete hRmsvsTimeOld; // Fill last bin with the newest values. for(Int_t iy=1;iy<=hRms->GetNbinsX();iy++) { hRmsvsTime->SetBinContent(nBins,iy,hRms->GetBinContent(iy)); } hRmsvsTime->GetZaxis()->SetTitle("#LTr#GT_{rms}"); hRmsvsTime->GetYaxis()->SetTitle("k_{p}#zeta"); hRmsvsTime->GetXaxis()->SetTitle("k_{p}z"); hRmsvsTime->GetZaxis()->CenterTitle(); hRmsvsTime->GetYaxis()->CenterTitle(); hRmsvsTime->GetXaxis()->CenterTitle(); hRmsvsTime->SetName(hName); // Change the range of z axis Float_t Rmsmax = hRmsvsTime->GetMaximum(); hRmsvsTime->GetZaxis()->SetRangeUser(0,Rmsmax); hRmsvsTime->Write(hName,TObject::kOverwrite); } // INTEGRATED Beam's Charge: // Total charge vs time : TGraph *gQvsTime = NULL; if(hDen2D) { Double_t Q = 0; for(Int_t i=1;i<=x1Nbin;i++) { for(Int_t j=1;j<=x2Nbin;j++) { Double_t value = hDen2D->GetBinContent(i,j); if(CYL) { Double_t radius = hDen2D->GetYaxis()->GetBinCenter(j); Q += radius * value; // cout << Form(" (%i,%i) -> radius = %7.4f , value = %7.4f",i,j,radius,value) << endl; } else { Q += value; } } } Double_t xbinsize = hDen2D->GetXaxis()->GetBinWidth(1); Double_t ybinsize = hDen2D->GetYaxis()->GetBinWidth(1); Q *= xbinsize * ybinsize; if(!CYL && !ThreeD) { Q *= TMath::Sqrt(2*TMath::Pi()) * rms0; } else if(CYL) { Q *= 2*TMath::Pi(); } if(opt.Contains("units")) { Double_t dV = skindepth * skindepth * skindepth; Q *= n0 * dV; Q *= (PConst::ElectronCharge/PUnits::picocoulomb); cout << Form(" Integrated charge = %8i pC", TMath::Nint(Q)) << endl; } else { cout << Form(" Integrated charge = %8.4f n0 * kp^-3",Q) << endl; } Int_t nPoints = 0; char gName[32]; sprintf(gName,"gQvsTime"); gQvsTime = (TGraph*) ifile->Get(gName); if(gQvsTime==NULL) { gQvsTime = new TGraph(); gQvsTime->SetName(gName); nPoints = 0; // Some cosmetics at creation time: gQvsTime->SetLineWidth(3); gQvsTime->SetLineColor(PGlobals::fieldLine); gQvsTime->SetMarkerStyle(20); gQvsTime->SetMarkerSize(0.4); gQvsTime->SetMarkerColor(PGlobals::fieldLine); gQvsTime->GetYaxis()->SetTitle("charge [n_{0}/k_{p}^{3}]"); gQvsTime->GetXaxis()->SetTitle("k_{p}z"); } else { nPoints = gQvsTime->GetN(); } gQvsTime->Set(nPoints+1); gQvsTime->SetPoint(nPoints,Time,Q); gQvsTime->Write(gName,TObject::kOverwrite); } // ------------------------------------------------------------------------------------ // Longitudinal phasespace Int_t gNbin = 100; // Float_t gMin = 80; // Float_t gMax = 120; Float_t gMin = 43.07 - 1.2; Float_t gMax = 43.07 + 1.2; TH2F *hGvsZ = NULL; if(pData->GetRawFileName(1)) { char hName[24]; sprintf(hName,"hGvsZ"); hGvsZ = (TH2F*) gROOT->FindObject(hName); if(hGvsZ) { delete hGvsZ; hGvsZ = NULL; } hGvsZ = new TH2F(hName,"",x1Nbin,x1Min,x1Max,gNbin,gMin,gMax); pData->GetH2Raw(pData->GetRawFileName(1)->c_str(),"x1","gamma",hGvsZ,opt); hGvsZ->GetXaxis()->CenterTitle(); hGvsZ->GetYaxis()->CenterTitle(); hGvsZ->GetZaxis()->CenterTitle(); hGvsZ->GetYaxis()->SetTitle("#gamma"); if(opt.Contains("comov")) { hGvsZ->GetXaxis()->SetTitle("k_{p}#zeta"); hGvsZ->GetZaxis()->SetTitle("dN/d#zetad#gamma [a.u.]"); } else { hGvsZ->GetXaxis()->SetTitle("k_{p}z"); hGvsZ->GetZaxis()->SetTitle("dN/dzd#gamma [a.u.]"); } } else { cout << Form("--> No RAW data file is present for species 1") << endl; } TH2F *hGvsTime = NULL; TProfile *hGvsZprof = NULL; TGraphErrors *gGvsZ = NULL; if(hGvsZ) { TString pname = hGvsZ->GetName(); pname += "_pfx"; hGvsZprof = (TProfile*) gROOT->FindObject(pname.Data()); if(hGvsZprof) delete hGvsZprof; hGvsZprof = hGvsZ->ProfileX("_pfx",1,-1,"s"); gGvsZ = (TGraphErrors*) gROOT->FindObject("gGvsZ"); if(gGvsZ) delete gGvsZ; Int_t Npoints = hGvsZprof->GetNbinsX(); Double_t *x = new Double_t[Npoints]; Double_t *y = new Double_t[Npoints]; Double_t *ex = new Double_t[Npoints]; Double_t *ey = new Double_t[Npoints]; for(Int_t j=0;j<Npoints;j++) { x[j] = hGvsZprof->GetBinCenter(j); y[j] = hGvsZprof->GetBinContent(j); ex[j] = 0; ey[j] = hGvsZprof->GetBinError(j); } gGvsZ = new TGraphErrors(Npoints,x,y,ex,ey); gGvsZ->SetName("gGvsZ"); // PGlobals::SetH1Style((TH1*)gGvsZ,1); PGlobals::SetGraphStyle(gGvsZ,1); if(opt.Contains("comov")) gGvsZ->GetXaxis()->SetTitle("k_{p}#zeta"); else gGvsZ->GetXaxis()->SetTitle("k_{p}z"); gGvsZ->GetYaxis()->SetTitle("#LT#gamma#GT [MeV]"); char hName[24]; sprintf(hName,"hGvsTime"); TH2F *hGvsTimeOld = (TH2F*) ifile->Get(hName); Int_t nBins = 1; Float_t edge0 = Time-0.5; Float_t edge1 = Time+0.5; if(hGvsTimeOld!=NULL) { nBins = hGvsTimeOld->GetNbinsX()+1; Float_t binwidth = (Time - hGvsTimeOld->GetXaxis()->GetBinCenter(1))/(nBins-1); edge0 = hGvsTimeOld->GetXaxis()->GetBinCenter(1) - binwidth/2.; edge1 = Time + binwidth/2.; } hGvsTime = new TH2F("temp","",nBins,edge0,edge1, hGvsZprof->GetNbinsX(), hGvsZprof->GetBinLowEdge(1), hGvsZprof->GetBinLowEdge(hGvsZprof->GetNbinsX()+1)); for(Int_t ix=1;ix<hGvsTime->GetNbinsX();ix++) { for(Int_t iy=1;iy<hGvsTime->GetNbinsY();iy++) { hGvsTime->SetBinContent(ix,iy,hGvsTimeOld->GetBinContent(ix,iy)); } } delete hGvsTimeOld; // Fill last bin with the newest values. for(Int_t iy=1;iy<=hGvsZprof->GetNbinsX();iy++) { hGvsTime->SetBinContent(nBins,iy,hGvsZprof->GetBinContent(iy)); } hGvsTime->GetZaxis()->SetTitle("#LT#gamma#GT"); hGvsTime->GetYaxis()->SetTitle("k_{p}#zeta"); hGvsTime->GetXaxis()->SetTitle("k_{p}z"); hGvsTime->GetZaxis()->CenterTitle(); hGvsTime->GetYaxis()->CenterTitle(); hGvsTime->GetXaxis()->CenterTitle(); hGvsTime->SetName(hName); // Change the range of z axis Float_t Gmax = hGvsTime->GetMaximum(); Float_t Gmin = hGvsTime->GetMinimum(); hGvsTime->GetZaxis()->SetRangeUser(Gmin,Gmax); hGvsTime->Write(hName,TObject::kOverwrite); } // --------------------------------------------------------------------------------- // EM fields on - axis : TString opth1 = opt; opth1 += "avg"; // Get electric fields const Int_t Nfields = 2; TH1F **hE1D = new TH1F*[Nfields]; for(Int_t i=0;i<Nfields;i++) { hE1D[i] = NULL; if(!pData->GetEfieldFileName(i)) continue; char nam[3]; sprintf(nam,"e%i",i+1); if(ThreeD) { if(i==0) hE1D[i] = pData->GetH1SliceZ3D(pData->GetEfieldFileName(i)->c_str(),nam,-1,Nbins,-1,Nbins,opth1.Data()); else hE1D[i] = pData->GetH1SliceZ3D(pData->GetEfieldFileName(i)->c_str(),nam,-Nbins,Nbins,-Nbins,Nbins,opth1.Data()); } else if(CYL) { // Cylindrical: The first bin with r>0 is actually the number 1 (not the 0). if(i==0) hE1D[i] = pData->GetH1SliceZ(pData->GetEfieldFileName(i)->c_str(),nam,1,Nbins,opth1.Data()); else hE1D[i] = pData->GetH1SliceZ(pData->GetEfieldFileName(i)->c_str(),nam,1,Nbins,opth1.Data()); } else { // 2D cartesian if(i==0) hE1D[i] = pData->GetH1SliceZ(pData->GetEfieldFileName(i)->c_str(),nam,-1,Nbins,opth1.Data()); else hE1D[i] = pData->GetH1SliceZ(pData->GetEfieldFileName(i)->c_str(),nam,-Nbins,Nbins,opth1.Data()); } char hName[24]; sprintf(hName,"hE_%i_%i",i,time); hE1D[i]->SetName(hName); if(opt.Contains("comov")) hE1D[i]->GetXaxis()->SetTitle("k_{p}#zeta"); else hE1D[i]->GetXaxis()->SetTitle("k_{p}z"); if(i==0) hE1D[i]->GetYaxis()->SetTitle("E_{z}/E_{0}"); else if(i==1) hE1D[i]->GetYaxis()->SetTitle("E_{y}/E_{0}"); else if(i==2) hE1D[i]->GetYaxis()->SetTitle("E_{x}/E_{0}"); hE1D[i]->GetYaxis()->CenterTitle(); hE1D[i]->GetXaxis()->CenterTitle(); } // Calculate wave positions: // ---------------------------------------------------------------- // Calculate the crossings and the extremes of the Electric fields Float_t Ecross[Nfields][100] = {{0.0}}; Float_t Eextr[Nfields][100] = {{0.0}}; Int_t Ncross[Nfields] = {0}; for(Int_t i=0;i<Nfields;i++) { Ncross[i] = 0; if(!hE1D[i]) continue; // Only smooths the focusing if flag activated.. if(i>0 && opt.Contains("smooth")) { // cout << " Smoothing fields on axis..." << endl; hE1D[i]->Smooth(10); } Float_t maxZeta = zStartBeam; if(opt.Contains("center")) maxZeta -= zStartBeam; for(Int_t ip=hE1D[i]->GetNbinsX();ip>1;ip--) { Float_t Z2 = hE1D[i]->GetBinCenter(ip-1); if(Z2 > maxZeta) continue; Float_t E1 = hE1D[i]->GetBinContent(ip); Float_t E2 = hE1D[i]->GetBinContent(ip-1); Float_t Z1 = hE1D[i]->GetBinCenter(ip); // cout << Form("Z1 = %6.4f Z2 = %6.4f E1 = %6.4f E2 = %6.4f", Z1, Z2, E1, E2) << endl; if(E1*E2 >= 0) { // No change of sign means we are in a side of the zero axis. if(fabs(E2)>fabs(Eextr[i][Ncross[i]])) { Eextr[i][Ncross[i]] = E2; } } if(E1*E2 < 0) { // change of sign means a crossing! // The next crossing has to be far enough from the previous one: Float_t zcross = -E1 * ( (Z2-Z1)/(E2-E1) ) + Z1; if(Ncross[i]>0 && fabs(Ecross[i][Ncross[i]-1]-zcross)<TMath::PiOver2() ) continue; // cout << " CROSS! " << endl; // add the point Ecross[i][Ncross[i]] = zcross; Ncross[i]++; } } cout << " -> Number of crossings for field " << i << " : " << Ncross[i] << endl; for(Int_t ic=0;ic<Ncross[i];ic++) { // cout << Form(" %2i: zeta = %6.4f E = %6.4f", ic, Ecross[i][ic], Eextr[i][ic]) << endl; } hE1D[i]->SetLineColor(kRed); hE1D[i]->Write(hE1D[i]->GetName(),TObject::kOverwrite); } // Get the Graphs and histos from file Int_t nPoints = 0; TGraph ***gEcross = new TGraph**[Nfields]; TGraph ***gEextr = new TGraph**[Nfields]; TH2F **hEvsTime = new TH2F*[Nfields]; for(Int_t i=0;i<Nfields;i++) { char hName[24]; sprintf(hName,"hEvsTime_%i",i); TH2F *hEvsTimeOld = (TH2F*) ifile->Get(hName); Int_t nBins = 1; Float_t edge0 = Time-0.5; Float_t edge1 = Time+0.5; if(hEvsTimeOld!=NULL) { nBins = hEvsTimeOld->GetNbinsX()+1; Float_t binwidth = (Time - hEvsTimeOld->GetXaxis()->GetBinCenter(1))/(nBins-1); edge0 = hEvsTimeOld->GetXaxis()->GetBinCenter(1) - binwidth/2.; edge1 = Time + binwidth/2.; } hEvsTime[i] = new TH2F("temp","",nBins,edge0,edge1, hE1D[i]->GetNbinsX(), hE1D[i]->GetBinLowEdge(1), hE1D[i]->GetBinLowEdge(hE1D[i]->GetNbinsX()+1)); for(Int_t ix=1;ix<hEvsTime[i]->GetNbinsX();ix++) { for(Int_t iy=1;iy<hEvsTime[i]->GetNbinsY();iy++) { hEvsTime[i]->SetBinContent(ix,iy,hEvsTimeOld->GetBinContent(ix,iy)); } } delete hEvsTimeOld; // Fill last bin with the newest values. for(Int_t iy=1;iy<=hE1D[i]->GetNbinsX();iy++) { hEvsTime[i]->SetBinContent(nBins,iy,hE1D[i]->GetBinContent(iy)); } if(i==0) hEvsTime[i]->GetZaxis()->SetTitle("E_{z}/E_{0}"); else if(i==1) hEvsTime[i]->GetZaxis()->SetTitle("E_{y}/E_{0}"); else if(i==2) hEvsTime[i]->GetZaxis()->SetTitle("E_{x}/E_{0}"); hEvsTime[i]->GetYaxis()->SetTitle("k_{p}#zeta"); hEvsTime[i]->GetXaxis()->SetTitle("k_{p}z"); hEvsTime[i]->GetZaxis()->CenterTitle(); hEvsTime[i]->GetYaxis()->CenterTitle(); hEvsTime[i]->GetXaxis()->CenterTitle(); hEvsTime[i]->SetName(hName); // Change the range of z axis for the fields to be symmetric. Float_t Emax = hEvsTime[i]->GetMaximum(); Float_t Emin = hEvsTime[i]->GetMinimum(); if(Emax > TMath::Abs(Emin)) Emin = -Emax; else Emax = -Emin; hEvsTime[i]->GetZaxis()->SetRangeUser(Emin,Emax); hEvsTime[i]->Write(hName,TObject::kOverwrite); // --- gEcross[i] = new TGraph*[Ncross[i]]; gEextr[i] = new TGraph*[Ncross[i]]; char gName[24]; Int_t ifail = 0; for(Int_t ic=0;ic<Ncross[i];ic++) { sprintf(gName,"gEcross_%i_%i",i,ic); gEcross[i][ic] = (TGraph*) ifile->Get(gName); if(gEcross[i][ic]==NULL) { gEcross[i][ic] = new TGraph(); gEcross[i][ic]->SetName(gName); nPoints = 0; // Some cosmetics at creation time: if(i==1) gEcross[i][ic]->SetLineStyle(2); else gEcross[i][ic]->SetLineStyle(1); gEcross[i][ic]->SetLineWidth(1); gEcross[i][ic]->SetLineColor(kGray+1); gEcross[i][ic]->SetMarkerStyle(20); gEcross[i][ic]->SetMarkerSize(0.4); gEcross[i][ic]->SetMarkerColor(kGray+1); gEcross[i][ic]->GetYaxis()->SetTitle("k_{p}#zeta]"); gEcross[i][ic]->GetXaxis()->SetTitle("k_{p}z"); } else { nPoints = gEcross[i][ic]->GetN(); } // Check the new crossings respect the previous ones: // Double_t t,zeta; // if(nPoints>0) { // gEcross[i][ic]->GetPoint(nPoints-1,t,zeta); // if(fabs(zeta-Ecross[i][ic+ifail])>TMath::Pi()) { // ic--; // ifail++; // continue; // } // } gEcross[i][ic]->Set(nPoints+1); gEcross[i][ic]->SetPoint(nPoints,Time,Ecross[i][ic+ifail]); gEcross[i][ic]->Write(gName,TObject::kOverwrite); // if(ic==Ncross[i]-1) continue; sprintf(gName,"gEextr_%i_%i",i,ic); gEextr[i][ic] = (TGraph*) ifile->Get(gName); if(gEextr[i][ic]==NULL) { gEextr[i][ic] = new TGraph(); gEextr[i][ic]->SetName(gName); nPoints = 0; // Some cosmetics at creation time: if(i==0) { gEextr[i][ic]->SetLineWidth(3); gEextr[i][ic]->SetLineColor(PGlobals::fieldLine); gEextr[i][ic]->SetMarkerStyle(20); gEextr[i][ic]->SetMarkerSize(0.4); gEextr[i][ic]->SetMarkerColor(PGlobals::fieldLine); gEextr[i][ic]->GetYaxis()->SetTitle("E_{z}/E_{0}"); gEextr[i][ic]->GetXaxis()->SetTitle("k_{p}z"); } else if(i==1) { gEextr[i][ic]->SetLineWidth(1); gEextr[i][ic]->SetLineColor(kGray+2); gEextr[i][ic]->SetMarkerStyle(20); gEextr[i][ic]->SetMarkerSize(0.4); gEextr[i][ic]->SetMarkerColor(kGray+2); gEextr[i][ic]->GetYaxis()->SetTitle("E_{y}/E_{0}"); gEextr[i][ic]->GetXaxis()->SetTitle("k_{p}z"); } } else { nPoints = gEextr[i][ic]->GetN(); } gEextr[i][ic]->Set(nPoints+1); gEextr[i][ic]->SetPoint(nPoints,Time,Eextr[i][ic]); gEextr[i][ic]->Write(gName,TObject::kOverwrite); } } ifile->Close(); }
void SignfificanceT2tt(bool pval, int exp=0){ TFile *f = TFile::Open("Significances2DHistograms_T2tt.root"); TH2F *h; if(pval){ if(exp==0) h = (TH2F*)f->Get("hpObs"); else if(exp==1) h = (TH2F*)f->Get("hpExpPosteriori"); else if(exp==2) h = (TH2F*)f->Get("hpExpPriori"); } else { if(exp==0) h = (TH2F*)f->Get("hObs"); else if(exp==1) h = (TH2F*)f->Get("hExpPosteriori"); else if(exp==2) h = (TH2F*)f->Get("hExpPriori"); } h->GetXaxis()->SetTitle("m_{#tilde{t}} [GeV]"); h->GetXaxis()->SetLabelFont(42); h->GetXaxis()->SetLabelSize(0.035); h->GetXaxis()->SetTitleSize(0.05); h->GetXaxis()->SetTitleOffset(1.2); h->GetXaxis()->SetTitleFont(42); h->GetYaxis()->SetTitle("m_{#tilde{#chi}_{1}^{0}} [GeV]"); h->GetYaxis()->SetLabelFont(42); h->GetYaxis()->SetLabelSize(0.035); h->GetYaxis()->SetTitleSize(0.05); h->GetYaxis()->SetTitleOffset(1.35); h->GetYaxis()->SetTitleFont(42); double maximum = h->GetMaximum(); double minimum = h->GetMinimum(); double sigmin = 99; int sigminx=-1; int sigminy=-1; if(pval) sigmin = -99; h->GetZaxis()->SetRangeUser(minimum,maximum); for(int x = 1; x<=h->GetNbinsX();++x){ for(int y = 1; y<=h->GetNbinsX();++y){ if(!pval&&h->GetBinContent(x,y)<sigmin){ sigmin =h->GetBinContent(x,y); sigminx = x; sigminy = y; } if( pval&&h->GetBinContent(x,y)>sigmin){ sigmin =h->GetBinContent(x,y); sigminx = x; sigminy = y; } if(!pval&&h->GetXaxis()->GetBinLowEdge(x)<h->GetYaxis()->GetBinLowEdge(y)+75) h->SetBinContent(x,y,-999); if(h->GetXaxis()->GetBinLowEdge(x)<374) continue; if(h->GetXaxis()->GetBinLowEdge(x)>424) continue; if(h->GetYaxis()->GetBinLowEdge(y)<199) continue; if(h->GetYaxis()->GetBinLowEdge(y)>249) continue; if(!pval&&h->GetBinContent(x,y)>0.3) h->SetBinContent(x,y,0.05); } } h->GetZaxis()->SetRangeUser(minimum,maximum); if(!pval) cout << "minimal significance " << sigmin << " at " << h->GetXaxis()->GetBinLowEdge(sigminx) << "-" << h->GetYaxis()->GetBinLowEdge(sigminy) << endl; else cout << "maximal p- value " << sigmin << " at " << h->GetXaxis()->GetBinLowEdge(sigminx) << "-" << h->GetYaxis()->GetBinLowEdge(sigminy) << endl; TCanvas *c1 = new TCanvas("c1", "c1",50,50,600,600); gStyle->SetOptFit(1); gStyle->SetOptStat(0); gStyle->SetOptTitle(0); gStyle->SetErrorX(0.5); //c1->Range(-6.311689,-1.891383,28.75325,4.56342); c1->SetFillColor(0); c1->SetBorderMode(0); c1->SetBorderSize(2); //c1->SetLogy(); c1->SetTickx(1); c1->SetTicky(1); c1->SetLeftMargin(0.15); // c1->SetRightMargin(0.05); c1->SetRightMargin(0.15); c1->SetTopMargin(0.07); c1->SetBottomMargin(0.15); c1->SetFrameFillStyle(0); c1->SetFrameBorderMode(0); c1->SetFrameFillStyle(0); c1->SetFrameBorderMode(0); gStyle->SetHatchesLineWidth(0); TH1F *hSum = new TH1F("hSum","",10,100,900); hSum->SetMinimum(0.); hSum->SetMaximum(550); hSum->SetDirectory(0); hSum->SetStats(0); hSum->Draw(); hSum->GetYaxis()->SetRangeUser(0,500); hSum->GetXaxis()->SetRangeUser(100,900); Int_t ci; // for color index setting ci = TColor::GetColor("#000099"); hSum->SetLineColor(ci); hSum->SetLineStyle(0); hSum->SetMarkerStyle(20); hSum->GetXaxis()->SetTitle("m_{#tilde{t}} [GeV]"); //hSum->GetXaxis()->SetBit(TAxis::kLabelsVert); hSum->GetXaxis()->SetLabelFont(42); //hSum->GetXaxis()->SetLabelOffset(0.005); hSum->GetXaxis()->SetLabelSize(0.035); hSum->GetXaxis()->SetTitleSize(0.06); hSum->GetXaxis()->SetTitleOffset(1.2); hSum->GetXaxis()->SetTitleFont(42); hSum->GetYaxis()->SetTitle("m_{#tilde{#chi}}_{1}^{0} [GeV]"); hSum->GetYaxis()->SetLabelFont(42); //hSum->GetYaxis()->SetLabelOffset(0.007); hSum->GetYaxis()->SetLabelSize(0.035); hSum->GetYaxis()->SetTitleSize(0.05); hSum->GetYaxis()->SetTitleOffset(1.3); hSum->GetYaxis()->SetTitleFont(42); /* TLegend *legO = new TLegend(0.175,0.675,0.50,0.855,NULL,"brNDC"); //legO-> SetNColumns(2); legO->SetBorderSize(0); legO->SetTextSize(0.04); legO->SetTextFont(42); legO->SetLineColor(1); legO->SetLineStyle(1); legO->SetLineWidth(2); legO->SetFillColor(0); legO->SetFillStyle(1001); legO->SetHeader("Observed"); legO->AddEntry(gObs, "unpolarized","l"); legO->AddEntry(gObsR, "right-handed","l"); legO->AddEntry(gObsL, "left-handed","l"); */ TGraph* graphWhite = new TGraph(5); graphWhite->SetName("white"); graphWhite->SetTitle("white"); graphWhite->SetFillColor(kWhite); graphWhite->SetFillStyle(1001); graphWhite->SetLineColor(kBlack); graphWhite->SetLineStyle(1); graphWhite->SetLineWidth(3); graphWhite->SetPoint(0,100, 500); graphWhite->SetPoint(1,900, 500); graphWhite->SetPoint(2,900, 500*0.75); graphWhite->SetPoint(3,100, 500*0.75); graphWhite->SetPoint(4,100, 500); Float_t diagX[4] = {175.+25.,175.+25.+5000,175.-25.+5000,175.-25.}; Float_t diagY[4] = {0,5000,5000,0}; TGraph *gdiagonal = new TGraph(4, diagX, diagY); gdiagonal->SetName("MtopDiagonal"); gdiagonal->SetFillColor(kWhite); //#gdiagonal->SetFillColor(18); TLine* ldiagonal = new TLine(175,0.,650-25.,450); //TLine* ldiagonal = new TLine(175.,25,175+500,500); ldiagonal->SetLineColor(kGray); ldiagonal->SetLineStyle(2); TLatex* tdiagonal = new TLatex(400-2.5, 400-172.5,"m_{#tilde{t}} = m_{t} + m_{#tilde{#chi}_{1}^{0}}"); //tdiagonal->SetTextAngle(TMath::RadToDeg()*TMath::ATan(float(800)/float(500))); tdiagonal->SetTextAngle(56.31); tdiagonal->SetTextColor(kGray+2); tdiagonal->SetTextAlign(11); tdiagonal->SetTextSize(0.025); TLine* l2 = new TLine(150,75,585,500); l2->SetLineColor(kGray); l2->SetLineStyle(2); // if(killlowdiag){ // l2->SetX1(200); l2->SetY1(0); l2->SetX2(600); l2->SetY2(400); // } TLatex *t2 = new TLatex(300, 300-72.5,"m_{#tilde{t}} = m_{W} + m_{#tilde{#chi}_{1}^{0}}"); //t2->SetTextAngle(TMath::RadToDeg()*TMath::ATan(float(800)/float(500))); t2->SetTextAngle(56.31); t2->SetTextColor(kGray+2); t2->SetTextAlign(11); t2->SetTextSize(0.025); hSum->Draw("axis"); h->Draw("COLZsame"); gdiagonal->Draw("FSAME"); ldiagonal->Draw("LSAME"); l2->Draw(); // if(!killlowdiag) t2->Draw(); tdiagonal->Draw("SAME"); graphWhite->Draw("FSAME"); graphWhite->Draw("LSAME"); string textstring = "observed"; if(exp!=0) textstring = "expected"; TLatex* textOE= new TLatex(0.175,0.715,textstring.c_str() ); textOE->SetNDC(); textOE->SetTextAlign(13); textOE->SetTextFont(42); textOE->SetTextSize(0.042); textOE->Draw(); TLatex* textModelLabel= new TLatex(0.175,0.92,"pp #rightarrow #tilde{t} #tilde{t}*, #tilde{t} #rightarrow t #tilde{#chi}^{0}_{1}"); //TLatex* textModelLabel= new TLatex(0.175,0.92,"pp #rightarrow #tilde{t} #tilde{t}*, #tilde{t} #rightarrow t #tilde{#chi}^{0}_{1}"); //TLatex* textModelLabel= new TLatex(0.175,0.92,"#tilde{#chi} "); textModelLabel->SetNDC(); textModelLabel->SetTextAlign(13); textModelLabel->SetTextFont(42); textModelLabel->SetTextSize(0.042); textModelLabel->Draw(); TLatex* textlLabel= new TLatex(0.175,0.85,"NLO+NLL significance"); textlLabel->SetNDC(); textlLabel->SetTextAlign(13); textlLabel->SetTextFont(42); textlLabel->SetTextSize(0.042); textlLabel->Draw(); string psig = "significance [#sigma]"; if(pval) psig = "p-value"; TLatex * ztex = new TLatex(0.985,0.92,psig.c_str() ); ztex->SetNDC(); ztex->SetTextAlign(31); ztex->SetTextFont(42); ztex->SetTextSize(0.045); ztex->SetTextAngle(90); ztex->SetLineWidth(2); ztex->Draw(); //final CMS style TLatex *tLumi = new TLatex(0.81,0.944,"2.3 fb^{-1} (13 TeV)"); tLumi->SetNDC(); tLumi->SetTextAlign(31); tLumi->SetTextFont(42); tLumi->SetTextSize(0.042); tLumi->SetLineWidth(2); tLumi->Draw(); TLatex *tCMS = new TLatex(0.152,0.944,"CMS"); tCMS->SetNDC(); tCMS->SetTextAlign(11); tCMS->SetTextFont(61); tCMS->SetTextSize(0.0525); tCMS->SetLineWidth(2); tCMS->Draw(); TLatex *tPrel = new TLatex(0.265,0.944,"Preliminary"); tPrel->SetNDC(); tPrel->SetTextAlign(11); tPrel->SetTextFont(52); tPrel->SetTextSize(0.042); tPrel->SetLineWidth(2); tPrel->Draw(); c1->Modified(); c1->cd(); c1->Update(); c1->SetSelected(c1); }