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.1.1.1 by auterman, Fri Nov 30 13:10:50 2007 UTC vs.
Revision 1.1.1.2 by auterman, Mon Feb 25 15:54:04 2008 UTC

# Line 14 | Line 14
14   #include <TPad.h>
15   #include <TColor.h>
16   #include <TStyle.h>
17 + #include <TLatex.h>
18 + #include <TMarker.h>
19  
20  
21   #include "scan.h"
# Line 23 | Line 25 | TROOT root("GUI", "GUI test environement
25  
26   using namespace std;
27  
28 +
29 + double total_xsec(const SUSY_XSECS point)
30 + { return point.total(); }
31 +
32 +
33   bool charged_LSP(const SUSY_POINT point)
34   { return ( (fabs(point.MZ1) - point.MTAU1)>0.0 ); }
35  
36   bool gluino(const SUSY_POINT point, const double mass)
37 < { return ( fabs(point.MGL - mass)<1.0 ); }
37 > { return ( fabs(point.MGL - mass)<5.0 ); }
38  
39   bool ul(const SUSY_POINT point, const double mass)
40   { return ( fabs(point.MUL - mass)<5.0 ); }
# Line 35 | Line 42 | bool ul(const SUSY_POINT point, const do
42   bool neutralino_1(const SUSY_POINT point, const double mass)
43   { return ( fabs(fabs(point.MZ1) - mass)<1.0 ); }
44  
45 + bool sq_equal_gluino(const SUSY_POINT point, const double treshold)
46 + { return ( fabs(point.MUL - point.MGL)<treshold ); }
47 +
48 +
49 + bool xs_sq_equal_gluino(const SUSY_XSECS point, const double treshold)
50 + { if (point.sgsg()<1E-5&&point.sqsq()<1E-5) return false; else return (fabs(point.sgsg() - point.sqsq())<treshold*point.sqsq()/100. ); }
51 +
52  
53   TScan::TScan()
54   {
# Line 51 | Line 65 | TScan::~TScan()
65   {
66   }
67  
68 < MyTGraph * TScan::IsoMassLine(bool(*func)(SUSY_POINT,double), double mass )
68 > template <class T> MyTGraph * TScan::IsoMassLine(std::vector<T> pnts, bool(*func)(T,double), double mass )
69   {
70    MyTGraph * result = new MyTGraph(1);
71    int i=0;
72 <  for (std::vector<SUSY_POINT>::const_iterator it=points.begin();
73 <       it!=points.end(); ++it) {
72 >  for (typename std::vector<T>::const_iterator it=pnts.begin();
73 >       it!=pnts.end(); ++it) {
74       if ( func( *it, mass) )
75         result->SetPoint(i++, it->MZERO, it->MHALF);
76    }
77    return result;
78   }
79  
80 < TH2F * TScan::Area(bool(*func)(SUSY_POINT))
80 > template <class T> TH2F * TScan::Area(std::vector<T> pnts, double(*func)(T))
81   {
82    char * name = new char[255];
83    sprintf(name,"Area_plot%d",++plot_id);
84    TH2F * result = new TH2F(name,"",bins_x,min_x,max_x,bins_y,min_x,max_y);
85 <  for (std::vector<SUSY_POINT>::const_iterator it=points.begin();
86 <       it!=points.end(); ++it) {
85 >  for (typename std::vector<T>::const_iterator it=pnts.begin();
86 >       it!=pnts.end(); ++it) {
87 >     result->Fill(it->MZERO, it->MHALF, func(*it) );
88 >  }
89 >  delete name;
90 >  return result;
91 > }
92 >
93 > template <class T> TH2F * TScan::Area(std::vector<T> pnts, bool(*func)(T))
94 > {
95 >  char * name = new char[255];
96 >  sprintf(name,"Area_plot%d",++plot_id);
97 >  TH2F * result = new TH2F(name,"",bins_x,min_x,max_x,bins_y,min_x,max_y);
98 >  for (typename std::vector<T>::const_iterator it=pnts.begin();
99 >       it!=pnts.end(); ++it) {
100       if ( func( *it ) )
101         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;
102    }
103    delete name;
104    return result;
# Line 176 | Line 200 | void TScan::ReadGeneratedMasses(std::str
200     }
201   }
202  
203 + void TScan::ReadGeneratedXsects(std::string file)
204 + {
205 +   ifstream xsects_file;
206 +   xsects_file.open(file.c_str());
207 +   SUSY_XSECS x;
208 +   while (1) {
209 +      xsects_file >> x.MZERO      
210 +                  >> x.MHALF      
211 +                  >> x.TANB      
212 +                  >> x.SGNMU      
213 +                  >> x.AZERO      
214 +                  >> x.MTOP      
215 +                  >> x.XS0
216 +                  >> x.XS201
217 +                  >> x.XS202
218 +                  >> x.XS204
219 +                  >> x.XS205
220 +                  >> x.XS207
221 +                  >> x.XS208
222 +                  >> x.XS209
223 +                  >> x.XS210
224 +                  >> x.XS211
225 +                  >> x.XS212
226 +                  >> x.XS213
227 +                  >> x.XS214
228 +                  >> x.XS216
229 +                  >> x.XS217
230 +                  >> x.XS218
231 +                  >> x.XS219
232 +                  >> x.XS220
233 +                  >> x.XS221
234 +                  >> x.XS222
235 +                  >> x.XS223
236 +                  >> x.XS224
237 +                  >> x.XS225
238 +                  >> x.XS226
239 +                  >> x.XS227
240 +                  >> x.XS228
241 +                  >> x.XS229
242 +                  >> x.XS230
243 +                  >> x.XS231
244 +                  >> x.XS232
245 +                  >> x.XS233
246 +                  >> x.XS234
247 +                  >> x.XS235
248 +                  >> x.XS236
249 +                  >> x.XS237
250 +                  >> x.XS238
251 +                  >> x.XS239
252 +                  >> x.XS240
253 +                  >> x.XS241
254 +                  >> x.XS242
255 +                  >> x.XS243
256 +                  >> x.XS244
257 +                  >> x.XS246
258 +                  >> x.XS247
259 +                  >> x.XS248
260 +                  >> x.XS249
261 +                  >> x.XS250
262 +                  >> x.XS251
263 +                  >> x.XS252
264 +                  >> x.XS253
265 +                  >> x.XS254
266 +                  >> x.XS256
267 +                  >> x.XS258
268 +                  >> x.XS259
269 +                  >> x.XS261
270 +                  >> x.XS262
271 +                  >> x.XS263
272 +                  >> x.XS264
273 +                  >> x.XS265
274 +                  >> x.XS271
275 +                  >> x.XS272
276 +                  >> x.XS273
277 +                  >> x.XS274
278 +                  >> x.XS275
279 +                  >> x.XS276
280 +                  >> x.XS277
281 +                  >> x.XS278
282 +                  >> x.XS279
283 +                  >> x.XS280
284 +                  >> x.XS281
285 +                  >> x.XS282
286 +                  >> x.XS283
287 +                  >> x.XS284
288 +                  >> x.XS285
289 +                  >> x.XS286
290 +                  >> x.XS287
291 +                  >> x.XS288
292 +                  >> x.XS289
293 +                  >> x.XS290
294 +                  >> x.XS291
295 +                  >> x.XS292
296 +                  >> x.XS293
297 +                  >> x.XS294
298 +                  >> x.XS295
299 +                  >> x.XS296
300 +                  >> x.XS297
301 +                  >> x.XS298
302 +                  >> x.XS299
303 +                  >> x.XS300
304 +                  >> x.XS301;
305 +      if (!xsects_file.good()) break;
306 +      if (fabs(x.SGNMU)!=1.) {
307 +         cerr << "check lines near m0=" << x.MZERO << ", m1/2=" << x.MHALF << endl;
308 +         break;
309 +      }
310 +      xsects.push_back(x);
311 +   }
312 + }
313  
314   int TScan::DoStuff()
315   {
# Line 183 | Line 317 | int TScan::DoStuff()
317     ReadGeneratedMasses( "mass_scan.dat" );
318     cout << "Read in " << points.size() << " mass points." <<endl;
319  
320 +   ///Read in the generated x-sections
321 +   ReadGeneratedXsects( "xsec_scan.dat" );
322 +   cout << "Read in " << xsects.size() << " x-section points." <<endl;
323 +
324     ///Where are no mass-points generated?
325     TH2F   * no_solution         = Area51(  );
326     MyTGraph * contour_no_solution = GetContour( no_solution );
# Line 190 | Line 328 | int TScan::DoStuff()
328     contour_no_solution->SetLineWidth(4);
329  
330     ///Where is the LSP charged?
331 <   TH2F   * ch_LSP = Area( charged_LSP );
331 >   TH2F   * ch_LSP = Area<SUSY_POINT>( points, charged_LSP );
332     MyTGraph * contour_charged_LSP = GetContour( ch_LSP );
333     contour_charged_LSP->SetLineColor(6);
334     contour_charged_LSP->SetLineWidth(4);
# Line 199 | Line 337 | int TScan::DoStuff()
337     TCanvas * c1 = new TCanvas("c1","c1",600,600);
338     c1->SetFillStyle   ( 4000 );
339     c1->SetLeftMargin  ( 0.15 );
340 <   c1->SetRightMargin ( 0.05 );
340 >   c1->SetRightMargin ( 0.15 );
341     c1->SetBottomMargin( 0.10 );
342     c1->cd();
343     //c1->SetTopMargin   ( 0.05 );
344     //TPostScript ps("plots.ps",-112);
345  
346     ///The base hist of the mSUGRA-plane with axis labels
347 <   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);
347 >   //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);
348 >   SetBins(80,80);//xsec-binning is 25 GeV
349 >   TH2F * plane = Area<SUSY_XSECS>( xsects, total_xsec );
350 >   SetBins(400,400);//mass-binning is 5 GeV
351 >   plane->SetTitle("The mSUGRA parameter space;m_{0} [GeV];m_{1/2} [GeV];#sigma_{SUSY incl.} [pb]");
352     plane->GetYaxis()->SetTitleOffset(  1.8 );
353 <   plane->Draw();
353 >   plane->GetZaxis()->SetTitleOffset(  1.1 );
354 >   plane->GetZaxis()->SetRangeUser(0.00001, 1000.);
355 >   gPad->SetLogz(1);
356 >   plane->Draw("COLZ");
357  
358     ///Now, add what ever should be displayed else
359     //---------------------------------------------------------------------------//
360 +   TLatex t;
361 +   t.SetTextColor(14);
362 +   t.SetTextAlign(12);
363 +   t.SetTextSize(0.02);
364    
365     ///gluino
366 <   //MyTGraph * m_gluino = IsoMassLine( gluino, 1000. ); m_gluino->Draw();
366 >   gStyle->SetLineColor(15);//gray
367 >   MyTGraph * m_gluino5  = IsoMassLine( points, gluino,  500. ); m_gluino5->Draw();
368 >   MyTGraph * m_gluino10 = IsoMassLine( points, gluino, 1000. ); m_gluino10->Draw();
369 >   MyTGraph * m_gluino20 = IsoMassLine( points, gluino, 2000. ); m_gluino20->Draw();
370 >   MyTGraph * m_gluino30 = IsoMassLine( points, gluino, 3000. ); m_gluino30->Draw();
371 >   MyTGraph * m_gluino40 = IsoMassLine( points, gluino, 4000. ); m_gluino40->Draw();
372 >   t.DrawLatex(360.,450.,"#tilde{g}=1000 GeV");
373 >   t.DrawLatex(600.,930.,"#tilde{g}=2000 GeV");
374 >   t.DrawLatex(870.,1420.,"#tilde{g}=3000 GeV");
375 >   t.DrawLatex(1150.,1930.,"#tilde{g}=4000 GeV");
376    
377     ///neutralino
378     //MyTGraph * m_neutralino1 = IsoMassLine( neutralino_1, 500. ); m_neutralino1->Draw();
379    
380     ///left-handed up-like squarks
381 <   MyTGraph * m_ul5  = IsoMassLine( ul,  500. ); m_ul5->Draw();
382 <   MyTGraph * m_ul10 = IsoMassLine( ul, 1000. ); m_ul10->Draw();
383 <   MyTGraph * m_ul15 = IsoMassLine( ul, 1500. ); m_ul15->Draw();
384 <   MyTGraph * m_ul20 = IsoMassLine( ul, 2000. ); m_ul20->Draw();
385 <   MyTGraph * m_ul25 = IsoMassLine( ul, 2500. ); m_ul25->Draw();
386 <   MyTGraph * m_ul30 = IsoMassLine( ul, 3000. ); m_ul30->Draw();
387 <   MyTGraph * m_ul35 = IsoMassLine( ul, 3500. ); m_ul35->Draw();
388 <   MyTGraph * m_ul40 = IsoMassLine( ul, 4000. ); m_ul40->Draw();
381 >   MyTGraph * m_ul5  = IsoMassLine( points, ul,  500. ); m_ul5->Draw();
382 >   MyTGraph * m_ul10 = IsoMassLine( points, ul, 1000. ); m_ul10->Draw();
383 >   MyTGraph * m_ul15 = IsoMassLine( points, ul, 1500. ); m_ul15->Draw();
384 >   MyTGraph * m_ul20 = IsoMassLine( points, ul, 2000. ); m_ul20->Draw();
385 >   MyTGraph * m_ul25 = IsoMassLine( points, ul, 2500. ); m_ul25->Draw();
386 >   MyTGraph * m_ul30 = IsoMassLine( points, ul, 3000. ); m_ul30->Draw();
387 >   MyTGraph * m_ul35 = IsoMassLine( points, ul, 3500. ); m_ul35->Draw();
388 >   MyTGraph * m_ul40 = IsoMassLine( points, ul, 4000. ); m_ul40->Draw();
389 >   t.DrawLatex(800.,250.,"#tilde{u}_{L}=1000 GeV");
390 >   t.DrawLatex(1670.,470.,"#tilde{u}_{L}=2000 GeV");
391 >   t.DrawLatex(1670.,1250.,"#tilde{u}_{L}=3000 GeV");
392 >   t.DrawLatex(1670.,1930.,"#tilde{u}_{L}=4000 GeV");
393  
394     ///Contours
395     contour_no_solution->Add(max_x+5,430);
# Line 246 | Line 408 | int TScan::DoStuff()
408     contour_charged_LSP->SetLineWidth( 4 );
409     contour_charged_LSP->Draw("lf");
410     contour_charged_LSP->Draw();
411 +   t.SetTextSize(0.03);t.SetTextColor( 6 );
412 +   t.DrawLatex(200.,1800.,"charged LSP (#tilde{#tau})");
413  
414 <
415 <
416 <   //c2->Draw();             //interactive
417 <   //gApplication->Run();    //interactive
418 <
414 >   // m(gluino)==m(squark)
415 >   gStyle->SetLineColor(1);//black
416 >   MyTGraph * m_ulgl  = IsoMassLine( points, sq_equal_gluino,  0.2 );
417 >   m_ulgl->SetLineWidth(3); m_ulgl->Draw();
418 >   t.SetTextSize(0.03);t.SetTextColor( 1 );
419 >   t.DrawLatex( 750.,1200.,"m(#tilde{u}_{L}) < m(#tilde{g})");
420 >   t.DrawLatex(1350.,1150.,"m(#tilde{u}_{L}) > m(#tilde{g})");
421 >
422 >
423 >   // xs(gluino)==xs(squark)
424 >   MyTGraph * xs_ulgl  = IsoMassLine( xsects, xs_sq_equal_gluino,  5.0 );
425 >   xs_ulgl->SetLineWidth(3); xs_ulgl->Draw();
426 >   t.SetTextSize(0.02);t.SetTextColor( 1 );
427 >   t.DrawLatex( 890.,510.,"#sigma(#tilde{q}#tilde{q}) > #sigmam(#tilde{g}#tilde{g})");
428 >   t.DrawLatex(1280.,450.,"#sigma(#tilde{q}#tilde{q}) < #sigmam(#tilde{g}#tilde{g})");
429 >
430 >   TMarker m;
431 >   m.SetMarkerStyle(29);
432 >   m.SetMarkerColor(2);
433 >   m.SetMarkerSize(1.5);
434 >   m.DrawMarker(1000,1000);  
435 >   m.DrawMarker(1000,200);  
436 >   m.DrawMarker(1000,400);  
437 >   m.DrawMarker(1000,600);  
438 >   m.DrawMarker(1000,800);  
439 >   m.DrawMarker(1200,1000);  
440 >   m.DrawMarker(1200,1400);  
441 >   m.DrawMarker(1200,1800);  
442 >   m.DrawMarker(1200,200);  
443 >   m.DrawMarker(1200,600);  
444 >   m.DrawMarker(1600,1000);  
445 >   m.DrawMarker(1600,1400);  
446 >   m.DrawMarker(1600,1800);  
447 >   m.DrawMarker(1600,200);  
448 >   m.DrawMarker(1600,600);  
449 >   m.DrawMarker(2000,1000);  
450 >   m.DrawMarker(2000,1400);  
451 >   m.DrawMarker(2000,1800);  
452 >   m.DrawMarker(2000,200);  
453 >   m.DrawMarker(2000,600);  
454 >   m.DrawMarker(200,200);    
455 >   m.DrawMarker(400,200);    
456 >   m.DrawMarker(400,400);    
457 >   m.DrawMarker(400,600);    
458 >   m.DrawMarker(600,1000);  
459 >   m.DrawMarker(600,200);    
460 >   m.DrawMarker(600,400);    
461 >   m.DrawMarker(600,600);    
462 >   m.DrawMarker(600,800);    
463 >   m.DrawMarker(800,1000);  
464 >   m.DrawMarker(800,1400);  
465 >   m.DrawMarker(800,200);    
466 >   m.DrawMarker(800,400);    
467 >   m.DrawMarker(800,600);    
468 >   m.DrawMarker(800,800);    
469 >   //DONE
470     c1->SaveAs("dirt.eps");
471 +   gApplication->Run();    //interactive
472 +
473     //ps.NewPage();
474  
475   }
# Line 283 | Line 500 | int scan(void)
500     gStyle->SetStatY(0);
501     gStyle->SetStatW(0);
502     gStyle->SetStatH(0);
503 +
504 +   gStyle->SetTitleFont(22);
505 +   gStyle->SetLabelFont(22,"X");
506 +   gStyle->SetLabelFont(22,"Y");
507 +   gStyle->SetLabelFont(22,"Z");
508 +   gStyle->SetLabelSize(0.03,"X");
509 +   gStyle->SetLabelSize(0.03,"Y");
510 +   gStyle->SetLabelSize(0.03,"Z");
511 +
512 +   //gROOT->SetStyle("MyStyle");
513 +
514    
515     TScan * scan = new TScan();
516     scan->DoStuff();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines