ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/auterman/SusyScan/PlotScript/scan.C
(Generate patch)

Comparing UserCode/auterman/SusyScan/PlotScript/scan.C (file contents):
Revision 1.2 by auterman, Tue Dec 4 12:57:34 2007 UTC vs.
Revision 1.3 by auterman, Wed Dec 5 13:27:47 2007 UTC

# Line 14 | Line 14
14   #include <TPad.h>
15   #include <TColor.h>
16   #include <TStyle.h>
17 + #include <TLatex.h>
18  
19  
20   #include "scan.h"
# Line 23 | Line 24 | TROOT root("GUI", "GUI test environement
24  
25   using namespace std;
26  
27 +
28 + double total_xsec(const SUSY_XSECS point)
29 + { return point.total(); }
30 +
31 +
32   bool charged_LSP(const SUSY_POINT point)
33   { return ( (fabs(point.MZ1) - point.MTAU1)>0.0 ); }
34  
35   bool gluino(const SUSY_POINT point, const double mass)
36 < { return ( fabs(point.MGL - mass)<1.0 ); }
36 > { return ( fabs(point.MGL - mass)<5.0 ); }
37  
38   bool ul(const SUSY_POINT point, const double mass)
39   { return ( fabs(point.MUL - mass)<5.0 ); }
# Line 35 | Line 41 | bool ul(const SUSY_POINT point, const do
41   bool neutralino_1(const SUSY_POINT point, const double mass)
42   { return ( fabs(fabs(point.MZ1) - mass)<1.0 ); }
43  
44 + bool sq_equal_gluino(const SUSY_POINT point, const double treshold)
45 + { return ( fabs(point.MUL - point.MGL)<treshold ); }
46  
47   TScan::TScan()
48   {
# Line 63 | Line 71 | MyTGraph * TScan::IsoMassLine(bool(*func
71    return result;
72   }
73  
74 < TH2F * TScan::Area(bool(*func)(SUSY_POINT))
74 > template <class T> TH2F * TScan::Area(std::vector<T> pnts, double(*func)(T))
75   {
76    char * name = new char[255];
77    sprintf(name,"Area_plot%d",++plot_id);
78    TH2F * result = new TH2F(name,"",bins_x,min_x,max_x,bins_y,min_x,max_y);
79 <  for (std::vector<SUSY_POINT>::const_iterator it=points.begin();
80 <       it!=points.end(); ++it) {
79 >  for (typename std::vector<T>::const_iterator it=pnts.begin();
80 >       it!=pnts.end(); ++it) {
81 >     result->Fill(it->MZERO, it->MHALF, func(*it) );
82 >  }
83 >  delete name;
84 >  return result;
85 > }
86 >
87 > template <class T> TH2F * TScan::Area(std::vector<T> pnts, bool(*func)(T))
88 > {
89 >  char * name = new char[255];
90 >  sprintf(name,"Area_plot%d",++plot_id);
91 >  TH2F * result = new TH2F(name,"",bins_x,min_x,max_x,bins_y,min_x,max_y);
92 >  for (typename std::vector<T>::const_iterator it=pnts.begin();
93 >       it!=pnts.end(); ++it) {
94       if ( func( *it ) )
95         result->Fill(it->MZERO, it->MHALF, 1.);
75 //if (it->MZERO==100. && it->MHALF==200.)  
76 //cout << it->MZERO <<", "<<it->MHALF
77 //     << ",  m(Z1)="<<it->MZ1<<", m(stau)="<<it->MTAU1<<endl;
96    }
97    delete name;
98    return result;
# Line 304 | Line 322 | int TScan::DoStuff()
322     contour_no_solution->SetLineWidth(4);
323  
324     ///Where is the LSP charged?
325 <   TH2F   * ch_LSP = Area( charged_LSP );
325 >   TH2F   * ch_LSP = Area<SUSY_POINT>( points, charged_LSP );
326     MyTGraph * contour_charged_LSP = GetContour( ch_LSP );
327     contour_charged_LSP->SetLineColor(6);
328     contour_charged_LSP->SetLineWidth(4);
# Line 313 | Line 331 | int TScan::DoStuff()
331     TCanvas * c1 = new TCanvas("c1","c1",600,600);
332     c1->SetFillStyle   ( 4000 );
333     c1->SetLeftMargin  ( 0.15 );
334 <   c1->SetRightMargin ( 0.05 );
334 >   c1->SetRightMargin ( 0.15 );
335     c1->SetBottomMargin( 0.10 );
336     c1->cd();
337     //c1->SetTopMargin   ( 0.05 );
338     //TPostScript ps("plots.ps",-112);
339  
340     ///The base hist of the mSUGRA-plane with axis labels
341 <   TH2F * plane = new TH2F("plane","The mSUGRA parameter space;m_{0} [GeV];m_{1/2} [GeV]", bins_x,min_x,max_x,bins_y,min_x,max_y);
341 >   //TH2F * plane = new TH2F("plane","The mSUGRA parameter space;m_{0} [GeV];m_{1/2} [GeV]", bins_x,min_x,max_x,bins_y,min_x,max_y);
342 >   SetBins(80,80);//xsec-binning is 25 GeV
343 >   TH2F * plane = Area<SUSY_XSECS>( xsects, total_xsec );
344 >   SetBins(400,400);//mass-binning is 5 GeV
345 >   plane->SetTitle("The mSUGRA parameter space;m_{0} [GeV];m_{1/2} [GeV];#sigma_{SUSY incl.} [pb]");
346     plane->GetYaxis()->SetTitleOffset(  1.8 );
347 <   plane->Draw();
347 >   plane->GetZaxis()->SetTitleOffset(  1.1 );
348 >   plane->GetZaxis()->SetRangeUser(0.00001, 1000.);
349 >   gPad->SetLogz(1);
350 >   plane->Draw("COLZ");
351  
352     ///Now, add what ever should be displayed else
353     //---------------------------------------------------------------------------//
354 +   TLatex t;
355 +   t.SetTextColor(14);
356 +   t.SetTextAlign(12);
357 +   t.SetTextSize(0.02);
358    
359     ///gluino
360 <   //MyTGraph * m_gluino = IsoMassLine( gluino, 1000. ); m_gluino->Draw();
360 >   gStyle->SetLineColor(15);//gray
361 >   MyTGraph * m_gluino5  = IsoMassLine( gluino,  500. ); m_gluino5->Draw();
362 >   MyTGraph * m_gluino10 = IsoMassLine( gluino, 1000. ); m_gluino10->Draw();
363 >   MyTGraph * m_gluino20 = IsoMassLine( gluino, 2000. ); m_gluino20->Draw();
364 >   MyTGraph * m_gluino30 = IsoMassLine( gluino, 3000. ); m_gluino30->Draw();
365 >   MyTGraph * m_gluino40 = IsoMassLine( gluino, 4000. ); m_gluino40->Draw();
366 >   t.DrawLatex(360.,450.,"#tilde{g}=1000 GeV");
367 >   t.DrawLatex(600.,930.,"#tilde{g}=2000 GeV");
368 >   t.DrawLatex(870.,1420.,"#tilde{g}=3000 GeV");
369 >   t.DrawLatex(1150.,1930.,"#tilde{g}=4000 GeV");
370    
371     ///neutralino
372     //MyTGraph * m_neutralino1 = IsoMassLine( neutralino_1, 500. ); m_neutralino1->Draw();
# Line 342 | Line 380 | int TScan::DoStuff()
380     MyTGraph * m_ul30 = IsoMassLine( ul, 3000. ); m_ul30->Draw();
381     MyTGraph * m_ul35 = IsoMassLine( ul, 3500. ); m_ul35->Draw();
382     MyTGraph * m_ul40 = IsoMassLine( ul, 4000. ); m_ul40->Draw();
383 +   t.DrawLatex(800.,250.,"#tilde{u}_{L}=1000 GeV");
384 +   t.DrawLatex(1670.,470.,"#tilde{u}_{L}=2000 GeV");
385 +   t.DrawLatex(1670.,1250.,"#tilde{u}_{L}=3000 GeV");
386 +   t.DrawLatex(1670.,1930.,"#tilde{u}_{L}=4000 GeV");
387  
388     ///Contours
389     contour_no_solution->Add(max_x+5,430);
# Line 360 | Line 402 | int TScan::DoStuff()
402     contour_charged_LSP->SetLineWidth( 4 );
403     contour_charged_LSP->Draw("lf");
404     contour_charged_LSP->Draw();
405 +   t.SetTextSize(0.03);t.SetTextColor( 6 );
406 +   t.DrawLatex(200.,1800.,"charged LSP (#tilde{#tau})");
407  
408 +   // m(gluino)==m(squark)
409 +   gStyle->SetLineColor(1);//black
410 +   MyTGraph * m_ulgl  = IsoMassLine( sq_equal_gluino,  0.2 );
411 +   m_ulgl->SetLineWidth(3); m_ulgl->Draw();
412 +   t.SetTextSize(0.03);t.SetTextColor( 1 );
413 +   t.DrawLatex( 750.,1200.,"m(#tilde{u}_{L}) < m(#tilde{g})");
414 +   t.DrawLatex(1400.,1150.,"m(#tilde{u}_{L}) > m(#tilde{g})");
415  
416  
417 +   //DONE
418     c1->SaveAs("dirt.eps");
419     gApplication->Run();    //interactive
420  
# Line 396 | Line 448 | int scan(void)
448     gStyle->SetStatY(0);
449     gStyle->SetStatW(0);
450     gStyle->SetStatH(0);
451 +
452 +   gStyle->SetTitleFont(22);
453 +   gStyle->SetLabelFont(22,"X");
454 +   gStyle->SetLabelFont(22,"Y");
455 +   gStyle->SetLabelFont(22,"Z");
456 +   gStyle->SetLabelSize(0.03,"X");
457 +   gStyle->SetLabelSize(0.03,"Y");
458 +   gStyle->SetLabelSize(0.03,"Z");
459 +
460 +   //gROOT->SetStyle("MyStyle");
461 +
462    
463     TScan * scan = new TScan();
464     scan->DoStuff();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines